 |
HT32SX Monarch Scan
Monarch Scan application for HT32SX
|
Go to the documentation of this file.
23 #ifdef ERASE_VALUE_IS_FF
24 #define NVM_BLOCK_INVALID 0xFFFFFFFCFFFFFF0E
25 #define NVM_BLOCK_VALID 0xFFFFFF0CFFFFFF0E
26 #define NVM_BLOCK_EMPTY 0xFFFFFFFFFFFFFFFF
28 #define NVM_BLOCK_INVALID_1 0xFFFFFFFF
29 #define NVM_BLOCK_INVALID_2 0xFFFFFF0E
31 #define NVM_BLOCK_VALID_1 0xFFFFFF0E
32 #define NVM_BLOCK_VALID_2 0xFFFFFF0C
34 #define NVM_BLOCK_INVALID 0x00000000000000FE
35 #define NVM_BLOCK_VALID 0x000000FC000000FE
36 #define NVM_BLOCK_EMPTY 0x00
38 #define NVM_BLOCK_INVALID_1 0x00000000
39 #define NVM_BLOCK_INVALID_2 0x000000FE
41 #define NVM_BLOCK_VALID_1 0x000000FE
42 #define NVM_BLOCK_VALID_2 0x000000FC
45 #define BLOCK_HEADER_SIZE 8
46 #define BLOCK_BODY_SIZE 8
48 #define EEPROM_NVDATA_ADDRESS 0x600
49 #define RCZ_MASK 0x000000FF
84 NVM_WRITE_RECORD_ERROR,
85 NVM_READ_RECORD_ERROR,
86 NVM_WRITE_HEADER_ERROR,
118 #define INIT_NVM_CONFIG(X) NVM_ConfigType X = { .nvmType = NVM_TYPE_EEPROM, \
119 .boardDataAddress = 0, .sfxDataAddress = EEPROM_NVDATA_ADDRESS, .messageSequenceNumber = 0x00 }
NVM_TYPE GetNVMType(void)
Returns the configured NVM Type.
Definition: nvm_api.c:94
NVM_RW_RESULTS NVM_Read(uint32_t nAddress, uint8_t cNbBytes, uint8_t *pcBuffer)
Reads data from NVM.
Definition: nvm_api.c:109
NVM_UPDATE_OFFSET
Board Data update modes.
Definition: nvm_api.h:95
NVM API configuration structure.
Definition: nvm_api.h:108
Record for Sigfox recurrent data, like messages counter.
Definition: nvm_api.h:127
uint32_t GetNVMBoardDataAddress(void)
Returns the Board Data Address.
Definition: nvm_api.c:99
NVM_TYPE
Describes NVM Type. Possible values reference FLASH or EEPROM memory.
Definition: nvm_api.h:56
NVM_RW_RESULTS NVM_Write(uint32_t nAddress, uint8_t cNbBytes, uint8_t *pcBuffer, NVM_WRITE_MODE writeMode)
Writes data to NVM.
Definition: nvm_api.c:122
uint32_t sfxDataAddress
Definition: nvm_api.h:112
NVM_RW_RESULTS NVM_UpdateOffset(NVM_UPDATE_OFFSET updateWhat, int32_t data)
Update Board Offsets (Frequency, RSSI and LBT offsets)
Definition: nvm_api.c:236
NVM_RW_RESULTS NVM_WriteRecord(uint8_t *nvmRecord, uint32_t recordSize)
Writes record in the last available slot in the userSpace page. If no space left, the page will be er...
Definition: nvm_api.c:189
uint8_t messageSequenceNumber
Definition: nvm_api.h:113
uint32_t boardDataAddress
Definition: nvm_api.h:111
NVM_RW_RESULTS NVM_ReadRecord(uint8_t *nvmRecord, uint32_t recordSize)
Reads last record stored at userSpaceAddress.
Definition: nvm_api.c:135
uint32_t GetNVMSigfoxDataAddress(void)
Returns the Sigfox Data Address.
Definition: nvm_api.c:104
NVM_RW_RESULTS
Return values for NVM Read/Write functions.
Definition: nvm_api.h:79
NVM_WRITE_MODE
Describes write mode operation.
Definition: nvm_api.h:68
void SetNVMInitial(NVM_ConfigType *config)
Initialize NVM API.
Definition: nvm_api.c:73
Record for board data.
Definition: nvm_api.h:140
NVM_TYPE nvmType
Definition: nvm_api.h:110