nrfx 3.3
Data Structures | Macros | Typedefs | Functions
RRAMC driver

Resistive Random Access Memory Controller (RRAMC) peripheral driver. More...

Data Structures

struct  nrfx_rramc_config_t
 Configuration structure of the RRAMC driver instance. More...
 

Macros

#define NRFX_RRAMC_DEFAULT_CONFIG(_write_buff_size)
 RRAMC driver default configuration.
 

Typedefs

typedef void(* nrfx_rramc_evt_handler_t) (nrf_rramc_event_t const event_type)
 RRAMC driver event handler type.
 

Functions

void nrfx_rramc_all_erase (void)
 Function for erasing the whole RRAM memory.
 
void nrfx_rramc_byte_write (uint32_t address, uint8_t value)
 Function for writing a single byte to RRAM.
 
void nrfx_rramc_bytes_write (uint32_t address, void const *src, uint32_t num_bytes)
 Function for writing consecutive bytes to RRAM.
 
void nrfx_rramc_word_write (uint32_t address, uint32_t value)
 Function for writing a 32-bit word to RRAM.
 
void nrfx_rramc_words_write (uint32_t address, void const *src, uint32_t num_words)
 Function for writing consecutive 32-bit words to RRAM.
 
void nrfx_rramc_write_enable_set (bool enable, uint32_t write_buff_size)
 Function for enabling write mode and setting size of write buffer.
 
bool nrfx_rramc_write_enable_check (void)
 Function for checking if write mode is enabled.
 
nrfx_err_t nrfx_rramc_init (nrfx_rramc_config_t const *p_config, nrfx_rramc_evt_handler_t handler)
 Function for initializing the RRAMC driver instance.
 
nrfx_err_t nrfx_rramc_reconfigure (nrfx_rramc_config_t const *p_config)
 Function for reconfiguring the RRAMC driver instance.
 
void nrfx_rramc_uninit (void)
 Function for uninitializing the RRAMC driver instance.
 
uint32_t nrfx_rramc_memory_size_get (void)
 Function for getting the total RRAM size in bytes.
 
NRFX_STATIC_INLINE uint32_t nrfx_rramc_otp_word_read (uint32_t index)
 Function for reading a word from the OTP in UICR.
 
NRFX_STATIC_INLINE bool nrfx_rramc_otp_word_write (uint32_t index, uint32_t value)
 Function for writing a 32-bit word at index position to OTP region in UICR.
 
NRFX_STATIC_INLINE uint8_t nrfx_rramc_byte_read (uint32_t address)
 Function for reading a byte from the RRAM.
 
NRFX_STATIC_INLINE uint32_t nrfx_rramc_word_read (uint32_t address)
 Function for reading a 32-bit word from the RRAM.
 
NRFX_STATIC_INLINE void nrfx_rramc_buffer_read (void *dst, uint32_t address, uint32_t num_bytes)
 Function for reading a given number of bytes from the RRAM into the specified buffer.
 
NRFX_STATIC_INLINE bool nrfx_rramc_ready_check (void)
 Function for checking current RRAMC operation status.
 

Detailed Description

Resistive Random Access Memory Controller (RRAMC) peripheral driver.

Macro Definition Documentation

◆ NRFX_RRAMC_DEFAULT_CONFIG

#define NRFX_RRAMC_DEFAULT_CONFIG (   _write_buff_size)
Value:
{ \
.mode_write = false, \
.write_buff_size = _write_buff_size, \
.preload_timeout = 0x80, \
.preload_timeout_enable = true, \
.access_timeout = 0x100, \
.abort_on_pof = true, \
.irq_priority = NRFX_RRAMC_DEFAULT_CONFIG_IRQ_PRIORITY, \
}

RRAMC driver default configuration.

This configuration sets up RRAMC with the following options:

  • Write mode disabled
  • Preload timeout value: 0x80
  • Write to the RRAM on the next timeout enabled
  • Access timeout: 0x100
  • Write operation is to be aborted on the power failure
Parameters
[in]_write_buff_sizeSize of write buffer.

Typedef Documentation

◆ nrfx_rramc_evt_handler_t

typedef void(* nrfx_rramc_evt_handler_t) (nrf_rramc_event_t const event_type)

RRAMC driver event handler type.

Parameters
[in]event_typeRRAMC event.

Function Documentation

◆ nrfx_rramc_all_erase()

void nrfx_rramc_all_erase ( void  )

Function for erasing the whole RRAM memory.

Note
All user code and UICR will be erased.

◆ nrfx_rramc_buffer_read()

NRFX_STATIC_INLINE void nrfx_rramc_buffer_read ( void *  dst,
uint32_t  address,
uint32_t  num_bytes 
)

Function for reading a given number of bytes from the RRAM into the specified buffer.

Parameters
[out]dstPointer to the buffer to store the data.
[in]addressAddress of the first byte to be read.
[in]num_bytesNumber of bytes to be read.

◆ nrfx_rramc_byte_read()

NRFX_STATIC_INLINE uint8_t nrfx_rramc_byte_read ( uint32_t  address)

Function for reading a byte from the RRAM.

Use this function in case accessing the RRAM gives the possibility to run the code in an environment where the flash is simulated.

Parameters
[in]addressAddress of the byte to be read.
Returns
Value read from RRAM.

◆ nrfx_rramc_byte_write()

void nrfx_rramc_byte_write ( uint32_t  address,
uint8_t  value 
)

Function for writing a single byte to RRAM.

To determine if the last RRAM write operation has been completed, use nrfx_rramc_ready_check(). The status is not updated during writes to write-buffer.

Note
Depending on the source of the code being executed, the CPU may be halted during the operation. Refer to the Product Specification for more information.
Parameters
[in]addressAddress to where data is to be written.
[in]valueValue to be written.

◆ nrfx_rramc_bytes_write()

void nrfx_rramc_bytes_write ( uint32_t  address,
void const *  src,
uint32_t  num_bytes 
)

Function for writing consecutive bytes to RRAM.

To determine if the last RRAM write operation has been completed, use nrfx_rramc_ready_check(). The status is not updated during writes to write-buffer.

Note
Depending on the source of the code being executed, the CPU may be halted during the operation. Refer to the Product Specification for more information.
Parameters
[in]addressAddress to where data is to be written.
[in]srcPointer to data to be copied.
[in]num_bytesNumber of bytes to be written.

◆ nrfx_rramc_init()

nrfx_err_t nrfx_rramc_init ( nrfx_rramc_config_t const *  p_config,
nrfx_rramc_evt_handler_t  handler 
)

Function for initializing the RRAMC driver instance.

Parameters
[in]p_configPointer to the structure containing configuration.
[in]handlerEvent handler provided by the user.
Return values
NRFX_SUCCESSInitialization was successful.
NRFX_ERROR_ALREADYThe driver has already been initialized.

◆ nrfx_rramc_memory_size_get()

uint32_t nrfx_rramc_memory_size_get ( void  )

Function for getting the total RRAM size in bytes.

Note
The function will return FICR_INFO_RRAM_RRAM_Unspecified value if the total RRAM size cannot be determined based on the FICR data.
Returns
RRAM total size in bytes.

◆ nrfx_rramc_otp_word_read()

NRFX_STATIC_INLINE uint32_t nrfx_rramc_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.

Parameters
[in]indexAddress (index) in OTP table from which a word is to be read.
Return values
Thecontents at index.

◆ nrfx_rramc_otp_word_write()

NRFX_STATIC_INLINE bool nrfx_rramc_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 is only able to write '0' to bits in the UICR 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 index can be transformed to the desired value without any '0' to '1' transitions. If yes, then perform the write operation.

Parameters
[in]indexAddress (index) in OTP table to which a word it to be written.
[in]valueValue to be written.
Return values
trueWord can be written into the specified OTP index address.
falseWord cannot be written into the specified OTP index address. Erase UICR or change index address.

◆ nrfx_rramc_ready_check()

NRFX_STATIC_INLINE bool nrfx_rramc_ready_check ( void  )

Function for checking current RRAMC operation status.

The status is updated for all RRAMC operations except during read and writes to write-buffer.

Return values
trueCurrent operation is completed, and RRAMC is ready.
falseRRAMC is busy.

◆ nrfx_rramc_reconfigure()

nrfx_err_t nrfx_rramc_reconfigure ( nrfx_rramc_config_t const *  p_config)

Function for reconfiguring the RRAMC driver instance.

Parameters
[in]p_configPointer to the structure containing configuration.
Return values
NRFX_SUCCESSReconfiguration was successful.
NRFX_ERROR_INVALID_STATEThe driver is uninitialized.

◆ nrfx_rramc_word_read()

NRFX_STATIC_INLINE uint32_t nrfx_rramc_word_read ( uint32_t  address)

Function for reading a 32-bit word from the RRAM.

Use this function in case accessing the RRAM gives the possibility to run the code in an environment where the flash is simulated.

Parameters
[in]addressAddress of the word to be read.
Returns
Value read from RRAM.

◆ nrfx_rramc_word_write()

void nrfx_rramc_word_write ( uint32_t  address,
uint32_t  value 
)

Function for writing a 32-bit word to RRAM.

To determine if the last RRAM write operation has been completed, use nrfx_rramc_ready_check(). The status is not updated during writes to write-buffer.

Note
Depending on the source of the code being executed, the CPU may be halted during the operation. Refer to the Product Specification for more information.
Parameters
[in]addressAddress to where data is to be written. Must be word-aligned.
[in]valueValue to be written.

◆ nrfx_rramc_words_write()

void nrfx_rramc_words_write ( uint32_t  address,
void const *  src,
uint32_t  num_words 
)

Function for writing consecutive 32-bit words to RRAM.

To determine if the last RRAM write operation has been completed, use nrfx_rramc_ready_check(). The status is not updated during writes to write-buffer.

Note
Depending on the source of the code being executed, the CPU may be halted during the operation. Refer to the Product Specification for more information.
Parameters
[in]addressAddress to where data is to be written. Must be word-aligned.
[in]srcPointer to data to be copied. Must be word-aligned.
[in]num_wordsNumber of words to be written.

◆ nrfx_rramc_write_enable_check()

bool nrfx_rramc_write_enable_check ( void  )

Function for checking if write mode is enabled.

Returns
True if write mode is enabled, false otherwise.

◆ nrfx_rramc_write_enable_set()

void nrfx_rramc_write_enable_set ( bool  enable,
uint32_t  write_buff_size 
)

Function for enabling write mode and setting size of write buffer.

Parameters
[in]enableTrue if write mode is to be enabled, false otherwise.
[in]write_buff_sizeSize of write buffer. If set to 0, buffering is disabled.

Documentation feedback | Developer Zone | Subscribe | Updated