Non-volatile Memory. More...
Enumerations | |
enum | nvm_result_t { NVM_RESULT_OK , NVM_RESULT_INVALID , NVM_RESULT_UNSUPPORTED , NVM_RESULT_BUSY , NVM_RESULT_ERR , TOTAL_NVM_RESULT } |
enum | nvm_status_t { NVM_STATUS_UNKNOWN , NVM_STATUS_OK , NVM_STATUS_BUSY , NVM_STATUS_STOP , NVM_STATUS_WRITING , NVM_STATUS_READING , NVM_STATUS_ERR , TOTAL_NVM_STATUS } |
enum | nvm_mode_t { NVM_MODE_PAGE_ERASE , NVM_MODE_ROW_PROGRAM , NVM_MODE_QUAD_WORD_PROGRAM , NVM_MODE_WORD_PROGRAM , TOTAL_NVM_MODE } |
Functions | |
nvm_result_t | hal_nvm_init (void) |
Initialize NVM. | |
nvm_result_t | hal_nvm_read (const uint32_t address, uint32_t *rx_buffer, const size_t len) |
Read memory from address to specified length. | |
nvm_result_t | hal_nvm_write (const uint32_t address, const uint32_t *tx_buffer, const size_t len, const nvm_mode_t mode) |
Write to memory on specified address. | |
nvm_result_t | hal_nvm_erase (const uint32_t address, const nvm_mode_t mode) |
Erase memory on specified address. | |
nvm_status_t | hal_nvm_get_status (void) |
Get NVM operation status. | |
nvm_result_t | hal_nvm_mutex_take (const uint8_t channel, const uint32_t timeout_ms) |
Try acquire RTOS mutex for specified channel. | |
nvm_result_t | hal_nvm_mutex_give (const uint8_t channel) |
Release RTOS mutex for specified channel. | |
Non-volatile Memory.
enum nvm_mode_t |
#include <nvm/public_inc/hal_nvm.h>
Enumerator | |
---|---|
NVM_MODE_PAGE_ERASE | |
NVM_MODE_ROW_PROGRAM | |
NVM_MODE_QUAD_WORD_PROGRAM | |
NVM_MODE_WORD_PROGRAM | |
TOTAL_NVM_MODE |
enum nvm_result_t |
#include <nvm/public_inc/hal_nvm.h>
Enumerator | |
---|---|
NVM_RESULT_OK | No error. |
NVM_RESULT_INVALID | Operation invalid. |
NVM_RESULT_UNSUPPORTED | Operation not supported. |
NVM_RESULT_BUSY | Bus busy. |
NVM_RESULT_ERR | Error occurred. |
TOTAL_NVM_RESULT |
enum nvm_status_t |
#include <nvm/public_inc/hal_nvm.h>
nvm_result_t hal_nvm_erase | ( | const uint32_t | address, |
const nvm_mode_t | mode ) |
#include <nvm/public_inc/hal_nvm.h>
Erase memory on specified address.
[in] | address | Start address to be erased |
[in] | mode | Erase mode |
NVM_RESULT_OK | Success erase from specified address |
NVM_RESULT_INVALID | Invalid address or invalid erase mode |
NVM_RESULT_ERR | Erase operation failed |
nvm_status_t hal_nvm_get_status | ( | void | ) |
#include <nvm/public_inc/hal_nvm.h>
Get NVM operation status.
Example usage:
nvm_status_t status = hal_nvm_get_status();
nvm_result_t hal_nvm_init | ( | void | ) |
#include <nvm/public_inc/hal_nvm.h>
Initialize NVM.
NVM_RESULT_OK | Success initialize NVM |
NVM_RESULT_UNSUPPORTED | Operation not supported |
NVM_RESULT_ERR | Failed initialize NVM |
nvm_result_t hal_nvm_mutex_give | ( | const uint8_t | channel | ) |
#include <nvm/public_inc/hal_nvm.h>
Release RTOS mutex for specified channel.
[in] | channel | NVM channel's mutex to be released |
NVM_RESULT_OK | Success release mutex |
NVM_RESULT_INVALID | Invalid channel |
NVM_RESULT_UNSUPPORTED | Operation not supported |
NVM_RESULT_ERR | Failed release mutex |
nvm_result_t hal_nvm_mutex_take | ( | const uint8_t | channel, |
const uint32_t | timeout_ms ) |
#include <nvm/public_inc/hal_nvm.h>
Try acquire RTOS mutex for specified channel.
[in] | channel | NVM channel's mutex to be locked |
[in] | timeout_ms | Mutex acquiring timeout in milliseconds |
NVM_RESULT_OK | Success acquire mutex |
NVM_RESULT_INVALID | Invalid channel |
NVM_RESULT_UNSUPPORTED | Operation not supported |
NVM_RESULT_ERR | Failed acquire mutex |
nvm_result_t hal_nvm_read | ( | const uint32_t | address, |
uint32_t * | rx_buffer, | ||
const size_t | len ) |
#include <nvm/public_inc/hal_nvm.h>
Read memory from address to specified length.
[in] | address | Start address to be read |
[out] | rx_buffer | Receiving buffer |
[in] | len | Range to read from start address |
NVM_RESULT_OK | Success read memory |
NVM_RESULT_INVALID | Operation invalid |
NVM_RESULT_ERR | Read operation failed |
nvm_result_t hal_nvm_write | ( | const uint32_t | address, |
const uint32_t * | tx_buffer, | ||
const size_t | len, | ||
const nvm_mode_t | mode ) |
#include <nvm/public_inc/hal_nvm.h>
Write to memory on specified address.
[in] | address | Start address to be written |
[in] | tx_buffer | Buffer to be written to memory |
[in] | len | Buffer size |
[in] | mode | Write mode |
NVM_RESULT_OK | Success write to specified address |
NVM_RESULT_INVALID | Operation invalid |
NVM_RESULT_ERR | Write operation failed |