SmartSnippets DA1459x SDK
ad_nvparam.h
Go to the documentation of this file.
1 
46 #ifndef AD_NVPARAM_H_
47 #define AD_NVPARAM_H_
48 
49 #if dg_configNVPARAM_ADAPTER
50 
51 #include <stdlib.h>
52 #include <stdint.h>
53 #include <stdbool.h>
54 #include <ad_nvms.h>
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
60 /*
61  * DEFINES
62  ****************************************************************************************
63  */
64 
72 typedef void* nvparam_t;
73 
86 nvparam_t ad_nvparam_open(const char *area_name);
87 
94 void ad_nvparam_close(nvparam_t nvparam);
95 
105 void ad_nvparam_erase_all(nvparam_t nvparam);
106 
116 void ad_nvparam_erase(nvparam_t nvparam, uint8_t tag);
117 
136 uint16_t ad_nvparam_read_offset(nvparam_t nvparam, uint8_t tag, uint16_t offset,
137  uint16_t length, void *data);
138 
152 __STATIC_INLINE uint16_t ad_nvparam_read(nvparam_t nvparam, uint8_t tag, uint16_t length, void *data)
153 {
154  return ad_nvparam_read_offset(nvparam, tag, 0, length, data);
155 }
156 
173 uint16_t ad_nvparam_write(nvparam_t nvparam, uint8_t tag, uint16_t length, const void *data);
174 
193 uint16_t ad_nvparam_get_length(nvparam_t nvparam, uint8_t tag, uint16_t *max_length);
194 
195 #ifdef __cplusplus
196 }
197 #endif
198 
199 #endif /* dg_configNVPARAM_ADAPTER */
200 
201 #endif /* AD_NVMSPARAM_H_ */
202 
ad_nvparam_write
uint16_t ad_nvparam_write(nvparam_t nvparam, uint8_t tag, uint16_t length, const void *data)
Write parameter value.
ad_nvparam_open
nvparam_t ad_nvparam_open(const char *area_name)
Open NV-Parameters area.
ad_nvms.h
NVMS adapter API.
ad_nvparam_read
__STATIC_INLINE uint16_t ad_nvparam_read(nvparam_t nvparam, uint8_t tag, uint16_t length, void *data)
Read parameter value.
Definition: ad_nvparam.h:152
ad_nvparam_erase
void ad_nvparam_erase(nvparam_t nvparam, uint8_t tag)
Erase single NV-Parameter.
ad_nvparam_erase_all
void ad_nvparam_erase_all(nvparam_t nvparam)
Erase NV-Parameters area.
ad_nvparam_get_length
uint16_t ad_nvparam_get_length(nvparam_t nvparam, uint8_t tag, uint16_t *max_length)
Get current parameter length.
ad_nvparam_read_offset
uint16_t ad_nvparam_read_offset(nvparam_t nvparam, uint8_t tag, uint16_t offset, uint16_t length, void *data)
Read parameter value with offset.
partition_t::data
partition_entry_t data
Definition: ad_nvms.h:182
nvparam_t
void * nvparam_t
NV-Parameters area handle.
Definition: ad_nvparam.h:72
ad_nvparam_close
void ad_nvparam_close(nvparam_t nvparam)
Close NV-Parameters area.