11bd4fe43Sopenharmony_ci/**
21bd4fe43Sopenharmony_ci * @file hi_nv.h
31bd4fe43Sopenharmony_ci *
41bd4fe43Sopenharmony_ci * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
51bd4fe43Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
61bd4fe43Sopenharmony_ci * you may not use this file except in compliance with the License.
71bd4fe43Sopenharmony_ci * You may obtain a copy of the License at
81bd4fe43Sopenharmony_ci *
91bd4fe43Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
101bd4fe43Sopenharmony_ci *
111bd4fe43Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
121bd4fe43Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
131bd4fe43Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
141bd4fe43Sopenharmony_ci * See the License for the specific language governing permissions and
151bd4fe43Sopenharmony_ci * limitations under the License.
161bd4fe43Sopenharmony_ci *
171bd4fe43Sopenharmony_ci * Description: NV items consist of the NV items in the factory partition and NV items in the normal partition.
181bd4fe43Sopenharmony_ci *              The NV items in the normal partition are classified into NV items in the reserved partition and
191bd4fe43Sopenharmony_ci *              NV items in the common partition. The values of NV items in the reserved partition won't change
201bd4fe43Sopenharmony_ci *              after OTA upgrade. \n
211bd4fe43Sopenharmony_ci * CNcomment:NV分为工厂区NV和非工厂区NV,非工厂区NV又分为保留区和普通区,保留区升级后保留NV值。CNend
221bd4fe43Sopenharmony_ci */
231bd4fe43Sopenharmony_ci
241bd4fe43Sopenharmony_ci/** @defgroup iot_nv NV Management
251bd4fe43Sopenharmony_ci * @ingroup  system
261bd4fe43Sopenharmony_ci */
271bd4fe43Sopenharmony_ci#ifndef __HI_NV_H__
281bd4fe43Sopenharmony_ci#define __HI_NV_H__
291bd4fe43Sopenharmony_ci#include <hi_types.h>
301bd4fe43Sopenharmony_ci
311bd4fe43Sopenharmony_ci/**
321bd4fe43Sopenharmony_ci* @ingroup  iot_nv
331bd4fe43Sopenharmony_ci*
341bd4fe43Sopenharmony_ci* Maximum length of an NV item (unit: byte). CNcomment:NV项最大长度(单位:byte)。CNend
351bd4fe43Sopenharmony_ci*/
361bd4fe43Sopenharmony_ci#define HNV_ITEM_MAXLEN (256 - 4)
371bd4fe43Sopenharmony_ci#define PRODUCT_CFG_NV_REG_NUM_MAX               4
381bd4fe43Sopenharmony_ci
391bd4fe43Sopenharmony_ci#define HI_FNV_DEFAULT_ADDR         0x8000
401bd4fe43Sopenharmony_ci#define HI_NV_DEFAULT_TOTAL_SIZE    0x2000
411bd4fe43Sopenharmony_ci#define HI_NV_DEFAULT_BLOCK_SIZE    0x1000
421bd4fe43Sopenharmony_ci
431bd4fe43Sopenharmony_ci/**
441bd4fe43Sopenharmony_ci* @ingroup  iot_nv
451bd4fe43Sopenharmony_ci*
461bd4fe43Sopenharmony_ci* Maximum number of registered hi_nv_register_change_nofity_proc functions.
471bd4fe43Sopenharmony_ciCNcomment:hi_nv_register_change_nofity_proc注册函数个数最大值。CNend
481bd4fe43Sopenharmony_ci*/
491bd4fe43Sopenharmony_ci#define HI_NV_CHANGED_PROC_NUM  PRODUCT_CFG_NV_REG_NUM_MAX
501bd4fe43Sopenharmony_ci
511bd4fe43Sopenharmony_ci/**
521bd4fe43Sopenharmony_ci* @ingroup  iot_nv
531bd4fe43Sopenharmony_ci* @brief Initialize Normal NV.CNcomment:非工厂区NV初始化。CNend
541bd4fe43Sopenharmony_ci*
551bd4fe43Sopenharmony_ci* @par 描述:
561bd4fe43Sopenharmony_ci*           Initialize Normal NV.CNcomment:非工厂区NV初始化。CNend
571bd4fe43Sopenharmony_ci*
581bd4fe43Sopenharmony_ci* @attention Parameters are obtained from the partition table and cannot be set randomly.
591bd4fe43Sopenharmony_ciCNcomment:参数从分区表中获取,禁止随意设置。CNend
601bd4fe43Sopenharmony_ci* @param  addr          [IN] type #hi_u32,Flash address of the normal NV partition, corresponding to the flash
611bd4fe43Sopenharmony_ci*                            address of the member #HI_FLASH_PARTITON_NORMAL_NV in the partition table.
621bd4fe43Sopenharmony_ciCNcomment:非工厂区NV的FLASH地址,对应分区表成员#HI_FLASH_PARTITON_NORMAL_NV的FLASH地址。CNend
631bd4fe43Sopenharmony_ci* @param  total_size    [IN] type #hi_u32,total size of normal NV.
641bd4fe43Sopenharmony_ciCNcomment:非工厂区NV的总大小。CNend
651bd4fe43Sopenharmony_ci* @param  block_size    [IN] type #hi_u32,block size of normal NV.
661bd4fe43Sopenharmony_ciCNcomment:非工厂区NV的块大小。CNend
671bd4fe43Sopenharmony_ci*
681bd4fe43Sopenharmony_ci* @retval #0            Success.
691bd4fe43Sopenharmony_ci* @retval #Other        Failure. For details, see hi_errno.h.
701bd4fe43Sopenharmony_ci* @par 依赖:
711bd4fe43Sopenharmony_ci*           @li hi_nv.h:Describes NV APIs.CNcomment:文件用于描述NV相关接口。CNend
721bd4fe43Sopenharmony_ci* @see hi_get_partition_table | hi_nv_read | hi_nv_write。
731bd4fe43Sopenharmony_ci*/
741bd4fe43Sopenharmony_ciHI_EAPI hi_u32 hi_nv_init(hi_u32 addr, hi_u32 total_size, hi_u32 block_size);
751bd4fe43Sopenharmony_ci
761bd4fe43Sopenharmony_ci/**
771bd4fe43Sopenharmony_ci* @ingroup  iot_nv
781bd4fe43Sopenharmony_ci* @brief Set the normal NV value.CNcomment:设置非工厂区NV值。CNend
791bd4fe43Sopenharmony_ci*
801bd4fe43Sopenharmony_ci* @par 描述:
811bd4fe43Sopenharmony_ci*           Set the normal NV value.CNcomment:设置非工厂区NV值。CNend
821bd4fe43Sopenharmony_ci*
831bd4fe43Sopenharmony_ci* @attention
841bd4fe43Sopenharmony_ci*            @li Only a normal NV item can be operated.CNcomment:仅能操作非工厂区NV。CNend
851bd4fe43Sopenharmony_ci*            @li This API is called only in a task and cannot be called in an interrupt.
861bd4fe43Sopenharmony_ciCNcomment:仅支持任务中调用,不支持中断中调用。CNend
871bd4fe43Sopenharmony_ci* @param  id      [IN] type #hi_u8,NV item ID, ranging from #HI_NV_NORMAL_ID_START to #HI_NV_NORMAL_USR_ID_END.
881bd4fe43Sopenharmony_ciCNcomment:NV项ID,范围从#HI_NV_NORMAL_ID_START到#HI_NV_NORMAL_USR_ID_END。CNend
891bd4fe43Sopenharmony_ci* @param  pdata   [IN] type #const hi_pvoid,NV item data.CNcomment:NV项数据。CNend
901bd4fe43Sopenharmony_ci* @param  len     [IN] type #hi_u8,Length of an NV item (unit: byte). The len must be equal to the Length of
911bd4fe43Sopenharmony_cithe real NV item data.CNcomment:NV项长度(单位:byte)。len必须和NV项的实际长度相等。CNend
921bd4fe43Sopenharmony_ci* @param  flag   [IN] type #hi_u32,Reserve.CNcomment:保留参数。CNend
931bd4fe43Sopenharmony_ci* @retval #0            Success.
941bd4fe43Sopenharmony_ci* @retval #Other        Failure. For details, see hi_errno.h.
951bd4fe43Sopenharmony_ci* @par 依赖:
961bd4fe43Sopenharmony_ci*           @li hi_nv.h:Describes NV APIs.CNcomment:文件用于描述NV相关接口。CNend
971bd4fe43Sopenharmony_ci* @see hi_nv_read。
981bd4fe43Sopenharmony_ci*/
991bd4fe43Sopenharmony_ciHI_EAPI hi_u32 hi_nv_write(hi_u8 id, const hi_pvoid pdata, hi_u8 len, hi_u32 flag);
1001bd4fe43Sopenharmony_ci
1011bd4fe43Sopenharmony_ci/**
1021bd4fe43Sopenharmony_ci* @ingroup  iot_nv
1031bd4fe43Sopenharmony_ci* @brief Read the normal NV value.CNcomment:读取非工厂区NV值。CNend
1041bd4fe43Sopenharmony_ci*
1051bd4fe43Sopenharmony_ci* @par 描述:
1061bd4fe43Sopenharmony_ci*           Read the normal NV value.CNcomment:读取非工厂区NV值。CNend
1071bd4fe43Sopenharmony_ci*
1081bd4fe43Sopenharmony_ci* @attention
1091bd4fe43Sopenharmony_ci*            @li Only a normal NV item can be operated.CNcomment:仅能操作非工厂区NV。CNend
1101bd4fe43Sopenharmony_ci*            @li This API is called only in a task and cannot be called in an interrupt.
1111bd4fe43Sopenharmony_ciCNcomment:仅支持任务中调用,不支持中断中调用。CNend
1121bd4fe43Sopenharmony_ci*
1131bd4fe43Sopenharmony_ci* @param  id      [IN] type #hi_u8,NV item ID, ranging from #HI_NV_NORMAL_ID_START to #HI_NV_NORMAL_USR_ID_END.
1141bd4fe43Sopenharmony_ciCNcomment:NV项ID,范围从#HI_NV_NORMAL_ID_START到#HI_NV_NORMAL_USR_ID_END。CNend
1151bd4fe43Sopenharmony_ci* @param  pdata   [OUT] type #const hi_pvoid,NV item data.CNcomment:NV项数据。CNend
1161bd4fe43Sopenharmony_ci* @param  len     [IN] type #hi_u8,Length of an NV item (unit: byte).  The len must be equal to the Length of
1171bd4fe43Sopenharmony_cithe real NV item data.CNcomment:NV项长度(单位:byte)。len必须和NV项的实际长度相等。CNend
1181bd4fe43Sopenharmony_ci* @param  flag   [IN] type #hi_u32,Reserve.CNcomment:保留参数。CNend
1191bd4fe43Sopenharmony_ci*
1201bd4fe43Sopenharmony_ci* @retval #0            Success.
1211bd4fe43Sopenharmony_ci* @retval #Other        Failure. For details, see hi_errno.h.
1221bd4fe43Sopenharmony_ci* @par 依赖:
1231bd4fe43Sopenharmony_ci*           @li hi_nv.h:Describes NV APIs.CNcomment:文件用于描述NV相关接口。CNend
1241bd4fe43Sopenharmony_ci* @see hi_nv_write。
1251bd4fe43Sopenharmony_ci*/
1261bd4fe43Sopenharmony_ciHI_EAPI hi_u32 hi_nv_read(hi_u8 id, const hi_pvoid pdata, hi_u8 len, hi_u32 flag);
1271bd4fe43Sopenharmony_ci
1281bd4fe43Sopenharmony_ci/**
1291bd4fe43Sopenharmony_ci* @ingroup  iot_nv
1301bd4fe43Sopenharmony_ci* @brief NV item change callback function.CNcomment:NV项变更回调函数。CNend
1311bd4fe43Sopenharmony_ci*
1321bd4fe43Sopenharmony_ci* @par 描述:
1331bd4fe43Sopenharmony_ci*           NV item change callback function.CNcomment:NV项变更回调函数。CNend
1341bd4fe43Sopenharmony_ci*
1351bd4fe43Sopenharmony_ci* @attention This API can be called only after the SAL is initialized.
1361bd4fe43Sopenharmony_ciCNcomment:在SAL初始化结束后才可以调用该接口。CNend
1371bd4fe43Sopenharmony_ci*
1381bd4fe43Sopenharmony_ci* @param  id      [IN] type #hi_u8,NV item ID, ranging from #HI_NV_NORMAL_ID_START to #HI_NV_NORMAL_USR_ID_END.
1391bd4fe43Sopenharmony_ciCNcomment:NV项ID,范围从#HI_NV_NORMAL_ID_START到#HI_NV_NORMAL_USR_ID_END。CNend
1401bd4fe43Sopenharmony_ci*
1411bd4fe43Sopenharmony_ci* @retval #0            Success.
1421bd4fe43Sopenharmony_ci* @retval #Other        Failure. For details, see hi_errno.h.
1431bd4fe43Sopenharmony_ci* @par 依赖:
1441bd4fe43Sopenharmony_ci*           @li hi_nv.h:Describes NV APIs.CNcomment:文件用于描述NV相关接口。CNend
1451bd4fe43Sopenharmony_ci* @see None
1461bd4fe43Sopenharmony_ci*/
1471bd4fe43Sopenharmony_citypedef hi_u32(*hi_nvm_changed_notify_f) (hi_u8 id);
1481bd4fe43Sopenharmony_ci
1491bd4fe43Sopenharmony_ci/**
1501bd4fe43Sopenharmony_ci* @ingroup  iot_nv
1511bd4fe43Sopenharmony_ci* @brief Register the normal NV item change notification function.CNcomment:非工厂区NV项变更通知函数注册。CNend
1521bd4fe43Sopenharmony_ci*
1531bd4fe43Sopenharmony_ci* @par 描述:
1541bd4fe43Sopenharmony_ci*           Register the normal NV item change notification function.CNcomment:非工厂区NV项变更通知函数注册。CNend
1551bd4fe43Sopenharmony_ci*
1561bd4fe43Sopenharmony_ci* @attention
1571bd4fe43Sopenharmony_ci*           Only the change notification function for normal NV items can be registered.
1581bd4fe43Sopenharmony_ci*           The maximum number of registered functions is #HI_NV_CHANGED_PROC_NUM. If the number of registered functions
1591bd4fe43Sopenharmony_ci*           exceeds the maximum, an error code is returned.
1601bd4fe43Sopenharmony_ciCNcomment:仅支持非工厂NV项注册变更通知函数处理。注册个数上限为#HI_NV_CHANGED_PROC_NUM,如超过会返回错误码。CNend
1611bd4fe43Sopenharmony_ci*
1621bd4fe43Sopenharmony_ci* @param  min_id [IN] type #hi_u8,Minimum value of an NV item ID.CNcomment:NV项ID最小值。CNend
1631bd4fe43Sopenharmony_ci* @param  max_id [IN] type #hi_u8,Maximum value of an NV item ID.CNcomment:NV项ID最大值。CNend
1641bd4fe43Sopenharmony_ci* @param  func   [IN] type #hi_nvm_changed_notify_f,Handling function for NV item changes. That is, after an NV item
1651bd4fe43Sopenharmony_ci*                     is changed, the NV module automatically calls the registered API.
1661bd4fe43Sopenharmony_ciCNcomment:NV项改变的处理函数, 即NV项变更后,NV模块会自动调用该注册的接口。CNend
1671bd4fe43Sopenharmony_ci*
1681bd4fe43Sopenharmony_ci* @retval #0            Success.
1691bd4fe43Sopenharmony_ci* @retval #Other        Failure. For details, see hi_errno.h.
1701bd4fe43Sopenharmony_ci* @par 依赖:
1711bd4fe43Sopenharmony_ci*           @li hi_nv.h:Describes NV APIs.CNcomment:文件用于描述NV相关接口。CNend
1721bd4fe43Sopenharmony_ci* @see None
1731bd4fe43Sopenharmony_ci*/
1741bd4fe43Sopenharmony_ciHI_EAPI hi_u32 hi_nv_register_change_notify_proc(hi_u8 min_id, hi_u8 max_id, hi_nvm_changed_notify_f func);
1751bd4fe43Sopenharmony_ci
1761bd4fe43Sopenharmony_ci/**
1771bd4fe43Sopenharmony_ci* @ingroup  iot_nv
1781bd4fe43Sopenharmony_ci* @brief Initialize factory NV.CNcomment:工厂区NV初始化。CNend
1791bd4fe43Sopenharmony_ci*
1801bd4fe43Sopenharmony_ci* @par 描述:
1811bd4fe43Sopenharmony_ci*          Initialize factory NV.CNcomment: 工厂区NV初始化。CNend
1821bd4fe43Sopenharmony_ci*
1831bd4fe43Sopenharmony_ci* @attention The parameters cannot be set randomly and must match the product delivery plan.
1841bd4fe43Sopenharmony_ciCNcomment:参数不能随意配置,需要与产品出厂规划匹配。CNend
1851bd4fe43Sopenharmony_ci* @param  addr [IN] type #hi_u32,Start address of the NV factory partition in the flash. The address is planned by
1861bd4fe43Sopenharmony_ci*                   the factory and set by the macro #HI_FNV_DEFAULT_ADDR.
1871bd4fe43Sopenharmony_ciCNcomment:设置工厂区NV FLASH首地址,由出厂规划,宏定义HI_FNV_DEFAULT_ADDR 统一设置。CNend
1881bd4fe43Sopenharmony_ci* @param  total_size    [IN] type #hi_u32,total size of factory NV.
1891bd4fe43Sopenharmony_ciCNcomment:工厂区NV的总大小。CNend
1901bd4fe43Sopenharmony_ci* @param  block_size    [IN] type #hi_u32,block size of factory NV.
1911bd4fe43Sopenharmony_ciCNcomment:工厂区NV的块大小。CNend
1921bd4fe43Sopenharmony_ci* @retval #0            Success.
1931bd4fe43Sopenharmony_ci* @retval #Other        Failure. For details, see hi_errno.h.
1941bd4fe43Sopenharmony_ci* @par 依赖:
1951bd4fe43Sopenharmony_ci*           @li hi_nv.h:Describes NV APIs.CNcomment:文件用于描述NV相关接口。CNend
1961bd4fe43Sopenharmony_ci* @see hi_factory_nv_write | hi_factory_nv_read。
1971bd4fe43Sopenharmony_ci*/
1981bd4fe43Sopenharmony_ciHI_EAPI hi_u32 hi_factory_nv_init(hi_u32 addr, hi_u32 total_size, hi_u32 block_size);
1991bd4fe43Sopenharmony_ci
2001bd4fe43Sopenharmony_ci/**
2011bd4fe43Sopenharmony_ci* @ingroup  iot_nv
2021bd4fe43Sopenharmony_ci* @brief Set the NV value in the factory partition. CNcomment:设置工厂区NV值。CNend
2031bd4fe43Sopenharmony_ci*
2041bd4fe43Sopenharmony_ci* @par 描述:
2051bd4fe43Sopenharmony_ci*           Set the NV value in the factory partition.CNcomment:设置工厂区NV值。CNend
2061bd4fe43Sopenharmony_ci*
2071bd4fe43Sopenharmony_ci* @attention None
2081bd4fe43Sopenharmony_ci* @param  id    [IN] type #hi_u8,NV item ID, ranging from #HI_NV_FACTORY_ID_START to #HI_NV_FACTORY_USR_ID_END.
2091bd4fe43Sopenharmony_ciCNcomment:NV项ID,范围从#HI_NV_FACTORY_ID_START到#HI_NV_FACTORY_USR_ID_END。CNend
2101bd4fe43Sopenharmony_ci* @param  pdata [IN] type #hi_pvoid,NV item data.CNcomment:NV项数据。CNend
2111bd4fe43Sopenharmony_ci* @param  len   [IN] type #hi_u8,Length of an NV item (unit: byte). The len must be equal to the Length of
2121bd4fe43Sopenharmony_cithe real NV item data.CNcomment:NV项长度(单位:byte)。len必须和NV项的实际长度相等。CNend
2131bd4fe43Sopenharmony_ci* @param  flag   [IN] type #hi_u32,Reserve.CNcomment:保留参数。CNend
2141bd4fe43Sopenharmony_ci*
2151bd4fe43Sopenharmony_ci* @retval #0            Success.
2161bd4fe43Sopenharmony_ci* @retval #Other        Failure. For details, see hi_errno.h.
2171bd4fe43Sopenharmony_ci* @par 依赖:
2181bd4fe43Sopenharmony_ci*           @li hi_nv.h:Describes NV APIs.CNcomment:文件用于描述NV相关接口。CNend
2191bd4fe43Sopenharmony_ci* @see hi_factory_nv_read。
2201bd4fe43Sopenharmony_ci*/
2211bd4fe43Sopenharmony_ciHI_EAPI hi_u32 hi_factory_nv_write(hi_u8 id, hi_pvoid pdata, hi_u8 len, hi_u32 flag);
2221bd4fe43Sopenharmony_ci
2231bd4fe43Sopenharmony_ci/**
2241bd4fe43Sopenharmony_ci* @ingroup  iot_nv
2251bd4fe43Sopenharmony_ci* @brief Read the NV value in the factory partition.CNcomment:读取工厂区NV值。CNend
2261bd4fe43Sopenharmony_ci*
2271bd4fe43Sopenharmony_ci* @par 描述:
2281bd4fe43Sopenharmony_ci*           Read the NV value in the factory partition.CNcomment:读取工厂区NV值。CNend
2291bd4fe43Sopenharmony_ci*
2301bd4fe43Sopenharmony_ci* @attention None
2311bd4fe43Sopenharmony_ci*
2321bd4fe43Sopenharmony_ci* @param  id      [IN] type #hi_u8,NV item ID, ranging from #HI_NV_NORMAL_ID_START to #HI_NV_NORMAL_USR_ID_END.
2331bd4fe43Sopenharmony_ciCNcomment:NV项ID,范围从#HI_NV_NORMAL_ID_START到#HI_NV_NORMAL_USR_ID_END。CNend
2341bd4fe43Sopenharmony_ci* @param  pdata   [OUT] type #hi_pvoid,NV item data.CNcomment:NV项数据。CNend
2351bd4fe43Sopenharmony_ci* @param  len     [IN] type #hi_u8,Length of an NV item (unit: byte). The len must be equal to the Length of
2361bd4fe43Sopenharmony_cithe real NV item data.CNcomment:NV项长度(单位:byte)。len必须和NV项的实际长度相等。CNend
2371bd4fe43Sopenharmony_ci* @param  flag    [IN] type #hi_u32,Reserve.CNcomment:保留参数。CNend
2381bd4fe43Sopenharmony_ci*
2391bd4fe43Sopenharmony_ci* @retval #0            Success.
2401bd4fe43Sopenharmony_ci* @retval #Other        Failure. For details, see hi_errno.h.
2411bd4fe43Sopenharmony_ci* @par 依赖:
2421bd4fe43Sopenharmony_ci*           @li hi_nv.h:Describes NV APIs.CNcomment:文件用于描述NV相关接口。CNend
2431bd4fe43Sopenharmony_ci* @see hi_factory_nv_write。
2441bd4fe43Sopenharmony_ci*/
2451bd4fe43Sopenharmony_ciHI_EAPI hi_u32 hi_factory_nv_read(hi_u8 id, hi_pvoid pdata, hi_u8 len, hi_u32 flag);
2461bd4fe43Sopenharmony_ci
2471bd4fe43Sopenharmony_ci/**
2481bd4fe43Sopenharmony_ci* @ingroup  iot_nv
2491bd4fe43Sopenharmony_ci* @brief refresh backup nv, always used after finish factory test.
2501bd4fe43Sopenharmony_ciCNcomment:更新原始备份区NV,常用于产测完成后。CNend
2511bd4fe43Sopenharmony_ci*
2521bd4fe43Sopenharmony_ci* @par 描述:
2531bd4fe43Sopenharmony_ci*           refresh backup nv, always used after finish factory test.
2541bd4fe43Sopenharmony_ciCNcomment:更新原始备份区NV,常用于产测完成后。CNend
2551bd4fe43Sopenharmony_ci*
2561bd4fe43Sopenharmony_ci* @attention should refresh backup nv if factory test modified nv.
2571bd4fe43Sopenharmony_ciCNcomment: 如果产测有修改NV参数,应该在产测完成后同步刷新备份区NV。CNend
2581bd4fe43Sopenharmony_ci*
2591bd4fe43Sopenharmony_ci* @param  None
2601bd4fe43Sopenharmony_ci*
2611bd4fe43Sopenharmony_ci* @retval #0            Success.
2621bd4fe43Sopenharmony_ci* @retval #Other        Failure. For details, see hi_errno.h.
2631bd4fe43Sopenharmony_ci* @par 依赖:
2641bd4fe43Sopenharmony_ci*           @li hi_nv.h:Describes NV APIs.CNcomment:文件用于描述NV相关接口。CNend
2651bd4fe43Sopenharmony_ci*/
2661bd4fe43Sopenharmony_ciHI_EAPI hi_u32 hi_nv_refresh_backup(hi_void);
2671bd4fe43Sopenharmony_ci
2681bd4fe43Sopenharmony_ci/**
2691bd4fe43Sopenharmony_ci* @ingroup  iot_nv
2701bd4fe43Sopenharmony_ci* @brief restore nv by oringinal backup nv.
2711bd4fe43Sopenharmony_ciCNcomment: 使用原始备份NV 覆盖当前NV,常用于恢复出厂设置。CNend
2721bd4fe43Sopenharmony_ci*
2731bd4fe43Sopenharmony_ci* @par 描述:
2741bd4fe43Sopenharmony_ci*           restore nv by oringinal backup nv.
2751bd4fe43Sopenharmony_ciCNcomment:使用原始备份NV 覆盖当前NV,常用于恢复出厂设置。CNend
2761bd4fe43Sopenharmony_ci*
2771bd4fe43Sopenharmony_ci* @attention should reset system after restore nv. only restore normal nv, not include factory nv.
2781bd4fe43Sopenharmony_ciCNcomment: 使用备份NV 覆盖原始NV后,须重启系统。
2791bd4fe43Sopenharmony_ci仅覆盖工作区NV,不包括工厂区NV。CNend
2801bd4fe43Sopenharmony_ci*
2811bd4fe43Sopenharmony_ci* @param  None
2821bd4fe43Sopenharmony_ci*
2831bd4fe43Sopenharmony_ci* @retval #0            Success.
2841bd4fe43Sopenharmony_ci* @retval #Other        Failure. For details, see hi_errno.h.
2851bd4fe43Sopenharmony_ci* @par 依赖:
2861bd4fe43Sopenharmony_ci*           @li hi_nv.h:Describes NV APIs.CNcomment:文件用于描述NV相关接口。CNend
2871bd4fe43Sopenharmony_ci*/
2881bd4fe43Sopenharmony_ciHI_EAPI hi_u32 hi_nv_restore_by_backup(hi_void);
2891bd4fe43Sopenharmony_ci
2901bd4fe43Sopenharmony_ci#endif
291