Non-Volatile Memory Controller (NVMC) peripheral driver. More...
Functions | |
nrfx_err_t | nrfx_nvmc_page_erase (uint32_t address) |
Function for erasing a page in flash. More... | |
nrfx_err_t | nrfx_nvmc_uicr_erase (void) |
Function for erasing the user information configuration register (UICR). More... | |
void | nrfx_nvmc_all_erase (void) |
Function for erasing the whole flash memory. More... | |
bool | nrfx_nvmc_byte_writable_check (uint32_t address, uint8_t value) |
Function for checking whether a byte is writable at the specified address. More... | |
void | nrfx_nvmc_byte_write (uint32_t address, uint8_t value) |
Function for writing a single byte to flash. More... | |
bool | nrfx_nvmc_halfword_writable_check (uint32_t address, uint16_t value) |
Function for checking whether a halfword is writable at the specified address. More... | |
void | nrfx_nvmc_halfword_write (uint32_t address, uint16_t value) |
Function for writing a 16-bit halfword to flash. More... | |
bool | nrfx_nvmc_word_writable_check (uint32_t address, uint32_t value) |
Function for checking whether a word is writable at the specified address. More... | |
void | nrfx_nvmc_word_write (uint32_t address, uint32_t value) |
Function for writing a 32-bit word to flash. More... | |
void | nrfx_nvmc_bytes_write (uint32_t address, void const *src, uint32_t num_bytes) |
Function for writing consecutive bytes to flash. More... | |
void | nrfx_nvmc_words_write (uint32_t address, void const *src, uint32_t num_words) |
Function for writing consecutive words to flash. More... | |
uint16_t | nrfx_nvmc_otp_halfword_read (uint32_t address) |
Function for reading a 16-bit aligned halfword from the OTP (UICR) More... | |
uint32_t | nrfx_nvmc_flash_size_get (void) |
Function for getting the total flash size in bytes. More... | |
uint32_t | nrfx_nvmc_flash_page_size_get (void) |
Function for getting the flash page size in bytes. More... | |
uint32_t | nrfx_nvmc_flash_page_count_get (void) |
Function for getting the flash page count. More... | |
NRFX_STATIC_INLINE bool | nrfx_nvmc_write_done_check (void) |
Function for checking if the last flash write has been completed. More... | |
Non-Volatile Memory Controller (NVMC) peripheral driver.
void nrfx_nvmc_all_erase | ( | void | ) |
Function for erasing the whole flash memory.
bool nrfx_nvmc_byte_writable_check | ( | uint32_t | address, |
uint8_t | value | ||
) |
Function for checking whether a byte is writable at the specified address.
The NVMC is only able to write '0' to bits in the flash that are erased (set to '1'). It cannot rewrite a bit back to '1'. This function checks if the value currently residing at the specified address can be transformed to the desired value without any '0' to '1' transitions.
address | Address to be checked. |
value | Value to be checked. |
true | Byte can be written at the specified address. |
false | Byte cannot be written at the specified address. Erase the page or change the address. |
void nrfx_nvmc_byte_write | ( | uint32_t | address, |
uint8_t | value | ||
) |
Function for writing a single byte to flash.
To determine if the flash write has been completed, use nrfx_nvmc_write_done_check().
address | Address to write to. |
value | Value to write. |
void nrfx_nvmc_bytes_write | ( | uint32_t | address, |
void const * | src, | ||
uint32_t | num_bytes | ||
) |
Function for writing consecutive bytes to flash.
To determine if the last flash write has been completed, use nrfx_nvmc_write_done_check().
address | Address to write to. |
src | Pointer to the data to copy from. |
num_bytes | Number of bytes to write. |
uint32_t nrfx_nvmc_flash_page_count_get | ( | void | ) |
Function for getting the flash page count.
uint32_t nrfx_nvmc_flash_page_size_get | ( | void | ) |
Function for getting the flash page size in bytes.
uint32_t nrfx_nvmc_flash_size_get | ( | void | ) |
Function for getting the total flash size in bytes.
bool nrfx_nvmc_halfword_writable_check | ( | uint32_t | address, |
uint16_t | value | ||
) |
Function for checking whether a halfword is writable at the specified address.
The NVMC is only able to write '0' to bits in the Flash that are erased (set to '1'). It cannot rewrite a bit back to '1'. This function checks if the value currently residing at the specified address can be transformed to the desired value without any '0' to '1' transitions.
address | Address to be checked. Must be halfword-aligned. |
value | Value to be checked. |
true | Halfword can be written at the specified address. |
false | Halfword cannot be written at the specified address. Erase page or change address. |
void nrfx_nvmc_halfword_write | ( | uint32_t | address, |
uint16_t | value | ||
) |
Function for writing a 16-bit halfword to flash.
To determine if the flash write has been completed, use nrfx_nvmc_write_done_check().
address | Address to write to. Must be halfword-aligned. |
value | Value to write. |
uint16_t nrfx_nvmc_otp_halfword_read | ( | uint32_t | address | ) |
Function for reading a 16-bit aligned halfword from the OTP (UICR)
OTP is a region of the UICR present in some chips. This function must be used to read halfword data from this region since unaligned accesses are not available on the OTP flash area.
address | Address to read from. Must be halfword-aligned. |
The | contents at address . |
nrfx_err_t nrfx_nvmc_page_erase | ( | uint32_t | address | ) |
Function for erasing a page in flash.
This function blocks until the erase operation finishes.
address | Address of the first word in the page to erase. |
NRFX_SUCCESS | Page erase complete. |
NRFX_ERROR_INVALID_ADDR | Address is not aligned to the size of the page. |
nrfx_err_t nrfx_nvmc_uicr_erase | ( | void | ) |
Function for erasing the user information configuration register (UICR).
NRFX_SUCCESS | UICR has been successfully erased. |
NRFX_ERROR_NOT_SUPPORTED | UICR erase is not supported. |
bool nrfx_nvmc_word_writable_check | ( | uint32_t | address, |
uint32_t | value | ||
) |
Function for checking whether a word is writable at the specified address.
The NVMC is only able to write '0' to bits in the Flash that are erased (set to '1'). It cannot rewrite a bit back to '1'. This function checks if the value currently residing at the specified address can be transformed to the desired value without any '0' to '1' transitions.
address | Address to be checked. Must be word-aligned. |
value | Value to be checked. |
true | Word can be written at the specified address. |
false | Word cannot be written at the specified address. Erase page or change address. |
void nrfx_nvmc_word_write | ( | uint32_t | address, |
uint32_t | value | ||
) |
Function for writing a 32-bit word to flash.
To determine if the flash write has been completed, use nrfx_nvmc_write_done_check().
address | Address to write to. Must be word-aligned. |
value | Value to write. |
void nrfx_nvmc_words_write | ( | uint32_t | address, |
void const * | src, | ||
uint32_t | num_words | ||
) |
Function for writing consecutive words to flash.
To determine if the last flash write has been completed, use nrfx_nvmc_write_done_check().
address | Address to write to. Must be word-aligned. |
src | Pointer to data to copy from. Must be word-aligned. |
num_words | Number of words to write. |
NRFX_STATIC_INLINE bool nrfx_nvmc_write_done_check | ( | void | ) |
Function for checking if the last flash write has been completed.
true | Last write completed successfully. |
false | Last write is still in progress. |