![]() |
nrfx 4.5.0
|
Magnetoresistive Random Access Memory Controller (MRAMC) peripheral driver. More...
Data Structures | |
| struct | nrfx_mramc_config_t |
| Configuration structure of the MRAMC driver instance. More... | |
Macros | |
| #define | NRFX_MRAMC_MAP_TO_ADDR(offset) |
| Macro for mapping relative MRAMC offset to absolute address. | |
| #define | NRFX_MRAMC_DEFAULT_CONFIG() |
| MRAMC driver default configuration. | |
Typedefs | |
| typedef void(* | nrfx_mramc_evt_handler_t) (nrf_mramc_event_t const event_type) |
| MRAMC driver event handler type. | |
Functions | |
| bool | nrfx_mramc_valid_address_check (uint32_t addr, bool uicr_allowed) |
| Function for checking if the address is valid. | |
| bool | nrfx_mramc_fits_memory_check (uint32_t addr, bool uicr_allowed, uint32_t bytes) |
| Function for checking if the address and size fit in MRAM memory. | |
| void | nrfx_mramc_all_erase (void) |
| Function for erasing the whole MRAM memory. | |
| void | nrfx_mramc_word_write (uint32_t address, uint32_t value) |
| Function for writing a 32-bit word to MRAM. | |
| void | nrfx_mramc_words_write (uint32_t address, void const *src, uint32_t num_words) |
| Function for writing consecutive 32-bit words to MRAM. | |
| void | nrfx_mramc_buffer_read (void *dst, uint32_t address, uint32_t num_bytes) |
| Function for reading consecutive bytes from MRAM. | |
| void | nrfx_mramc_config_write_mode_set (nrf_mramc_mode_write_t write_mode) |
| Function for setting the MRAMC write mode. | |
| void | nrfx_mramc_config_erase_mode_set (nrf_mramc_mode_erase_t erase_mode) |
| Function for setting the MRAMC erase mode. | |
| void | nrfx_mramc_confignvr_perm_set (bool enable, uint8_t page) |
| Function for setting the MRAMC NVR page write and erase permission,. | |
| int | nrfx_mramc_init (nrfx_mramc_config_t const *p_config, nrfx_mramc_evt_handler_t handler) |
| Function for initializing the MRAMC driver instance. | |
| int | nrfx_mramc_reconfigure (nrfx_mramc_config_t const *p_config) |
| Function for reconfiguring the MRAMC driver instance. | |
| void | nrfx_mramc_uninit (void) |
| Function for uninitializing the MRAMC driver instance. | |
| uint32_t | nrfx_mramc_memory_size_get (void) |
| Function for getting the total MRAM size in bytes. | |
| void | nrfx_mramc_area_erase (uint32_t address, uint32_t size) |
| Function for erasing MRAM area in given MRAM words size. | |
| void | nrfx_mramc_erase (uint32_t address, uint32_t num_words) |
| Function for erasing MRAM area in given 32-bit words size. | |
| NRFX_STATIC_INLINE uint32_t | nrfx_mramc_word_read (uint32_t address) |
| Function for reading a 32-bit word from the MRAM. | |
| NRFX_STATIC_INLINE bool | nrfx_mramc_ready_check (void) |
| Function for checking current MRAMC operation status. | |
| NRFX_STATIC_INLINE uint32_t | nrfx_mramc_otp_word_read (uint32_t index) |
| Function for reading a word from the OTP in UICR. | |
| NRFX_STATIC_INLINE bool | nrfx_mramc_otp_word_write (uint32_t index, uint32_t value) |
| Function for writing a 32-bit word at index position to OTP region in UICR. | |
Magnetoresistive Random Access Memory Controller (MRAMC) peripheral driver.
| #define NRFX_MRAMC_DEFAULT_CONFIG | ( | ) |
MRAMC driver default configuration.
This configuration sets up MRAMC with the following options:
| #define NRFX_MRAMC_MAP_TO_ADDR | ( | offset | ) |
Macro for mapping relative MRAMC offset to absolute address.
| [in] | offset | Offset to map. |
| typedef void(* nrfx_mramc_evt_handler_t) (nrf_mramc_event_t const event_type) |
MRAMC driver event handler type.
| [in] | event_type | MRAMC event. |
| void nrfx_mramc_all_erase | ( | void | ) |
Function for erasing the whole MRAM memory.
| void nrfx_mramc_area_erase | ( | uint32_t | address, |
| uint32_t | size ) |
Function for erasing MRAM area in given MRAM words size.
| [in] | address | Address to be erased. |
| [in] | size | Size to erase per number of NRF_MRAMC_BUS_SIZE in bytes. |
| void nrfx_mramc_buffer_read | ( | void * | dst, |
| uint32_t | address, | ||
| uint32_t | num_bytes ) |
Function for reading consecutive bytes from MRAM.
| [out] | dst | Pointer to the buffer to store the data. |
| [in] | address | Address of the first byte to be read. Must be word-aligned. |
| [in] | num_bytes | Number of bytes to be read. |
| void nrfx_mramc_config_erase_mode_set | ( | nrf_mramc_mode_erase_t | erase_mode | ) |
Function for setting the MRAMC erase mode.
| [in] | erase_mode | One of the enum in nrf_mramc_mode_erase_t. |
| void nrfx_mramc_config_write_mode_set | ( | nrf_mramc_mode_write_t | write_mode | ) |
Function for setting the MRAMC write mode.
| [in] | write_mode | One of the enum in nrf_mramc_mode_write_t. |
| void nrfx_mramc_confignvr_perm_set | ( | bool | enable, |
| uint8_t | page ) |
Function for setting the MRAMC NVR page write and erase permission,.
| [in] | enable | True to enable write and erase permission of CONFIGNVR.PAGE[n], false to disable. |
| [in] | page | Page number of CONFIGNVR.PAGE[0...n]. |
| void nrfx_mramc_erase | ( | uint32_t | address, |
| uint32_t | num_words ) |
Function for erasing MRAM area in given 32-bit words size.
| [in] | address | Address to be erased. |
| [in] | num_words | Number of 32-bit words to be erased. |
| bool nrfx_mramc_fits_memory_check | ( | uint32_t | addr, |
| bool | uicr_allowed, | ||
| uint32_t | bytes ) |
Function for checking if the address and size fit in MRAM memory.
| [in] | addr | Address to be checked. |
| [in] | uicr_allowed | If true, the UICR area is considered valid. |
| [in] | bytes | Number of bytes to be checked. |
| true | Address and size fit in memory. |
| false | Address and size not fitting in memory. |
| int nrfx_mramc_init | ( | nrfx_mramc_config_t const * | p_config, |
| nrfx_mramc_evt_handler_t | handler ) |
Function for initializing the MRAMC driver instance.
| [in] | p_config | Pointer to the structure containing configuration. |
| [in] | handler | Event handler provided by the user. |
| 0 | Initialization was successful. |
| -EALREADY | The driver has already been initialized. |
| uint32_t nrfx_mramc_memory_size_get | ( | void | ) |
Function for getting the total MRAM size in bytes.
FICR_INFO_MRAM_MRAM_Unspecified value if the total MRAM size cannot be determined based on the FICR data.| NRFX_STATIC_INLINE uint32_t nrfx_mramc_otp_word_read | ( | uint32_t | index | ) |
Function for reading a word from the OTP in UICR.
OTP is a region of the UICR present in some chips. This function must be used to read word data from this region since unaligned accesses are not available on the OTP RRAM area.
| [in] | index | Address (index) in OTP table from which a word is to be read. |
| The | contents at index. |
| NRFX_STATIC_INLINE bool nrfx_mramc_otp_word_write | ( | uint32_t | index, |
| uint32_t | value ) |
Function for writing a 32-bit word at index position to OTP region in UICR.
The OTP can only be written once after each Erase All is performed. This function checks if the value currently residing at the specified index can be transformed to the desired value. If yes, then performs the write operation.
| [in] | index | Address (index) in OTP table to which a word it to be written. |
| [in] | value | Value to be written. |
| true | Word can be written into the specified OTP index address. |
| false | Word cannot be written into the specified OTP index address. Erase UICR or change index address. |
| NRFX_STATIC_INLINE bool nrfx_mramc_ready_check | ( | void | ) |
Function for checking current MRAMC operation status.
The status is updated for all MRAMC operations.
| true | Current operation is completed, and MRAMC is ready. |
| false | MRAMC is busy. |
| int nrfx_mramc_reconfigure | ( | nrfx_mramc_config_t const * | p_config | ) |
Function for reconfiguring the MRAMC driver instance.
| [in] | p_config | Pointer to the structure containing configuration. |
| 0 | Reconfiguration was successful. |
| -EINPROGRESS | The driver is uninitialized. |
| bool nrfx_mramc_valid_address_check | ( | uint32_t | addr, |
| bool | uicr_allowed ) |
Function for checking if the address is valid.
| [in] | addr | Address to be checked. |
| [in] | uicr_allowed | If true, the UICR area is considered valid. |
| true | Address is valid. |
| false | Address is invalid. |
| NRFX_STATIC_INLINE uint32_t nrfx_mramc_word_read | ( | uint32_t | address | ) |
Function for reading a 32-bit word from the MRAM.
Use this function in case accessing the MRAM gives the possibility to run the code in an environment where the MRAM is simulated.
| [in] | address | Address of the word to be read. |
| void nrfx_mramc_word_write | ( | uint32_t | address, |
| uint32_t | value ) |
Function for writing a 32-bit word to MRAM.
| [in] | address | Address to where data is to be written. Must be word-aligned. |
| [in] | value | Value to be written. |
| void nrfx_mramc_words_write | ( | uint32_t | address, |
| void const * | src, | ||
| uint32_t | num_words ) |
Function for writing consecutive 32-bit words to MRAM.
Function uses direct write mode to write to MRAM directly.
| [in] | address | Address to where data is to be written. Must be word-aligned. |
| [in] | src | Pointer to data to be copied. Must be word-aligned. |
| [in] | num_words | Number of words to be written. |