Functions

uint8_t nvds_init (uint32_t start_addr, uint8_t sectors)
 Initialize the sectors for NVDS. More...
 
uint8_t nvds_get (NvdsTag_t tag, uint16_t *p_len, uint8_t *p_buf)
 Read data from NVDS. More...
 
uint8_t nvds_put (NvdsTag_t tag, uint16_t len, const uint8_t *p_buf)
 Write data to NVDS. If the tag does not exist, create one. More...
 
uint8_t nvds_del (NvdsTag_t tag)
 Delete a tag in NVDS. More...
 
uint16_t nvds_tag_length (NvdsTag_t tag)
 Get the length of a tag in NVDS. More...
 
uint8_t nvds_drv_func_replace (nvds_drv_func_t *p_nvds_drv_func)
 Replace the drive function. More...
 
uint8_t nvds_func_replace (nvds_func_t *p_nvds_func)
 Replace the function in NVDS. More...
 
void nvds_retention_size (uint8_t bond_dev_num, mesh_config_dev_num_t mesh_config_dev_num)
 Calculate the space reserved for system. More...
 

Detailed Description

Function Documentation

◆ nvds_del()

uint8_t nvds_del ( NvdsTag_t  tag)

Delete a tag in NVDS.

Parameters
[in]tagThe tag to be deleted.
Returns
Result of nvds delete.

◆ nvds_drv_func_replace()

uint8_t nvds_drv_func_replace ( nvds_drv_func_t p_nvds_drv_func)

Replace the drive function.

Parameters
[in]p_nvds_drv_funcPointer to drive functions.
Returns
Result of drive function replace.

◆ nvds_func_replace()

uint8_t nvds_func_replace ( nvds_func_t p_nvds_func)

Replace the function in NVDS.

Parameters
[in]p_nvds_funcPointer to nvds functions.
Returns
Result nvds function replace.

◆ nvds_get()

uint8_t nvds_get ( NvdsTag_t  tag,
uint16_t *  p_len,
uint8_t *  p_buf 
)

Read data from NVDS.

Parameters
[in]tagValid NVDS item tag.
[in,out]p_lenPointer to the length of data.
[out]p_bufData is read into the buffer.
Returns
Result of nvds get.

◆ nvds_init()

uint8_t nvds_init ( uint32_t  start_addr,
uint8_t  sectors 
)

Initialize the sectors for NVDS.

Note
NVDS module will use one more sector flash for garbage collection.
Parameters
[in]start_addrStart address of NVDS area. If the value does not equal zero, it must be sector-aligned. If the value equals zero, NVDS area will locate in the last two sector(s) in flash memory.
[in]sectorsThe number of sectors.
Returns
Result of nvds init.

◆ nvds_put()

uint8_t nvds_put ( NvdsTag_t  tag,
uint16_t  len,
const uint8_t *  p_buf 
)

Write data to NVDS. If the tag does not exist, create one.

Parameters
[in]tagValid NVDS item tag.
[in]lenLength of data to be written.
[in]p_bufData to be written.
Returns
Result of nvds put.

◆ nvds_retention_size()

void nvds_retention_size ( uint8_t  bond_dev_num,
mesh_config_dev_num_t  mesh_config_dev_num 
)

Calculate the space reserved for system.

Parameters
[in]bond_dev_numThe number of bond device.
[in]mesh_config_dev_numThe number of mesh config device.
Returns
System retention size.

◆ nvds_tag_length()

uint16_t nvds_tag_length ( NvdsTag_t  tag)

Get the length of a tag in NVDS.

Parameters
[in]tagThe tag to get the length.
Returns
Length of tag data.