Driver API for NVMCTRL (plib_nvmctrl.h)
More...
Driver API for NVMCTRL (plib_nvmctrl.h)
◆ NVMCTRL_BOOTCFG_SIZE
| #define NVMCTRL_BOOTCFG_SIZE (0x512U) |
◆ NVMCTRL_BOOTCFG_START_ADDRESS
| #define NVMCTRL_BOOTCFG_START_ADDRESS (0x0D000400U) |
◆ NVMCTRL_ERROR_LOCK
| #define NVMCTRL_ERROR_LOCK ( 0x8U ) |
◆ NVMCTRL_ERROR_NONE
| #define NVMCTRL_ERROR_NONE ( 0x0U ) |
◆ NVMCTRL_ERROR_NVM
| #define NVMCTRL_ERROR_NVM (<TBA>) |
◆ NVMCTRL_ERROR_PROG
| #define NVMCTRL_ERROR_PROG ( 0x4U ) |
◆ NVMCTRL_FLASH_PAGESIZE
| #define NVMCTRL_FLASH_PAGESIZE (512U) |
◆ NVMCTRL_FLASH_ROWSIZE
| #define NVMCTRL_FLASH_ROWSIZE (2048U) |
◆ NVMCTRL_FLASH_START_ADDRESS
| #define NVMCTRL_FLASH_START_ADDRESS (0x0c000000U) |
◆ NVMCTRL_CALLBACK
| typedef void(* NVMCTRL_CALLBACK) (void) |
◆ NVMCTRL_ERROR
◆ NVMCTRL_BOOTCFG_PageErase()
| bool NVMCTRL_BOOTCFG_PageErase |
( |
uint32_t | address | ) |
|
Erases a Boot Configuration page.
- Parameters
-
| address | Address within the BootCFG page to erase. |
- Returns
- true if erase is successful, false otherwise.
◆ NVMCTRL_BOOTCFG_WordWrite()
| bool NVMCTRL_BOOTCFG_WordWrite |
( |
const uint32_t * | data, |
|
|
uint32_t | address ) |
Writes a word to Boot Configuration memory.
- Parameters
-
| data | Pointer to word data. |
| address | Boot configuration address to write to. |
- Returns
- true if write is successful, false otherwise.
◆ NVMCTRL_CallbackRegister()
Registers a callback function with NVMCTRL.
- Parameters
-
| callback | Callback function pointer. |
- Returns
- void
◆ NVMCTRL_ClearCMD()
| void NVMCTRL_ClearCMD |
( |
void | | ) |
|
clears previous command in NVMCTRL.
◆ NVMCTRL_DisableWriteProtection()
| void NVMCTRL_DisableWriteProtection |
( |
void | | ) |
|
Disable write protection in NVMCTRL.
◆ NVMCTRL_EnableWriteProtection()
| void NVMCTRL_EnableWriteProtection |
( |
void | | ) |
|
Enable write protection in NVMCTRL.
◆ NVMCTRL_ErrorGet()
Gets the current NVM error status.
- Returns
- NVMCTRL_ERROR Error code.
◆ NVMCTRL_Initialize()
| void NVMCTRL_Initialize |
( |
void | | ) |
|
Initializes the NVMCTRL module.
Sets up the NVM controller for read/write/erase operations.
- Returns
- void
◆ NVMCTRL_IsBusy()
| bool NVMCTRL_IsBusy |
( |
void | | ) |
|
Checks if the NVM controller is busy.
- Returns
- true if busy, false otherwise.
◆ NVMCTRL_MultiPageErase()
| bool NVMCTRL_MultiPageErase |
( |
uint32_t | address, |
|
|
uint8_t | num_pages ) |
Erases multiple flash pages.
- Parameters
-
| address | Start address of erase operation. |
| num_pages | Number of pages to erase. |
- Returns
- true if erase is successful, false otherwise.
◆ NVMCTRL_PageErase()
| bool NVMCTRL_PageErase |
( |
uint32_t | address | ) |
|
Erases a single flash page.
- Parameters
-
| address | Address within the page to erase. |
- Returns
- true if erase is successful, false otherwise.
◆ NVMCTRL_Read()
| bool NVMCTRL_Read |
( |
const uint32_t | address, |
|
|
uint32_t * | data, |
|
|
uint32_t | length ) |
Reads data from flash memory.
- Parameters
-
| address | Flash memory address to read from. |
| data | Pointer to buffer to store read data. |
| length | Length of data to read (in bytes). |
- Returns
- true if read is successful, false otherwise.
◆ NVMCTRL_RegionLock()
| void NVMCTRL_RegionLock |
( |
uint32_t | address | ) |
|
Locks the specified memory region.
- Parameters
-
| address | Address of the memory region to lock. |
- Returns
- void
◆ NVMCTRL_RegionUnlock()
| void NVMCTRL_RegionUnlock |
( |
uint32_t | address | ) |
|
Unlocks the specified memory region.
- Parameters
-
| address | Address of the memory region to unlock. |
- Returns
- void
◆ NVMCTRL_WordsWrite()
| bool NVMCTRL_WordsWrite |
( |
const uint32_t * | data, |
|
|
uint32_t | address, |
|
|
uint32_t | word_count ) |
Writes multiple 32-bit words to flash memory.
- Parameters
-
| [in] | data | Pointer to the source data array to be written to flash. |
| [in] | address | 32-bit aligned flash start address where writing will begin. |
| [in] | word_count | Number of 32-bit words to write. |
- Returns
- true if write operation is successful, false on parameter errors, locked region, or hardware fault.
◆ NVMCTRL_WordWrite()
| bool NVMCTRL_WordWrite |
( |
const uint32_t * | data, |
|
|
uint32_t | address ) |
Writes a 32-bit word to flash.
- Parameters
-
| data | Pointer to word data. |
| address | Flash memory address to write to. |
- Returns
- true if write is successful, false otherwise.
◆ NVMCTRL_WriteProtectionLock()
| void NVMCTRL_WriteProtectionLock |
( |
void | | ) |
|
Lock write protection in NVMCTRL until next reset.