nrfx 3.3
Data Structures | Macros | Functions
RRAMC HALY

Hardware access layer with cache and barrier support for managing the RRAMC peripheral. More...

Data Structures

struct  nrfy_rramc_config_t
 RRAMC configuration structure. More...
 

Macros

#define NRFY_RRAMC_BYTES_IN_WORD   4
 Value representing the number of bytes in a word.
 
#define NRFY_RRAMC_WORDS_IN_BUFER_LINE   4
 Value representing the number of words in a buffer line.
 
#define NRFY_RRAMC_RRAM_BASE_ADDRESS   NRF_MEMORY_FLASH_BASE
 Value representing resistive random access memory (RRAM) base address.
 
#define NRFY_RRAMC_READY_NEXT_TIMEOUT_DEFAULT   RRAMC_READYNEXTTIMEOUT_ResetValue
 Default value for waiting for a next write.
 

Functions

NRFY_STATIC_INLINE void nrfy_rramc_configure (NRF_RRAMC_Type *p_reg, nrfy_rramc_config_t const *p_config)
 Function for configuring the RRAMC.
 
NRFY_STATIC_INLINE void nrfy_rramc_int_init (NRF_RRAMC_Type *p_reg, uint32_t mask, uint8_t irq_priority, bool enable)
 Function for initializing the specified RRAMC interrupts.
 
NRFY_STATIC_INLINE void nrfy_rramc_int_uninit (NRF_RRAMC_Type *p_reg)
 Function for uninitializing the RRAMC interrupts.
 
NRFY_STATIC_INLINE uint32_t nrfy_rramc_events_process (NRF_RRAMC_Type *p_reg, uint32_t mask)
 Function for processing the specified RRAMC events.
 
NRFY_STATIC_INLINE void nrfy_rramc_byte_write (NRF_RRAMC_Type *p_reg, uint32_t address, uint8_t value)
 Function for writing a single byte to RRAM.
 
NRFY_STATIC_INLINE void nrfy_rramc_bytes_write (NRF_RRAMC_Type *p_reg, uint32_t address, void const *src, uint32_t num_bytes)
 Function for writing consecutive bytes to RRAM.
 
NRFY_STATIC_INLINE uint8_t nrfy_rramc_byte_read (uint32_t address)
 Function for reading a byte from the RRAM.
 
NRFY_STATIC_INLINE void nrfy_rramc_word_write (NRF_RRAMC_Type *p_reg, uint32_t address, uint32_t value)
 Function for writing a 32-bit word to RRAM.
 
NRFY_STATIC_INLINE void nrfy_rramc_words_write (NRF_RRAMC_Type *p_reg, uint32_t address, void const *src, uint32_t num_words)
 Function for writing consecutive 32-bit words to RRAM.
 
NRFY_STATIC_INLINE uint32_t nrfy_rramc_word_read (uint32_t address)
 Function for reading a 32-bit word from the RRAM.
 
NRFY_STATIC_INLINE void nrfy_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.
 
NRFY_STATIC_INLINE uint32_t nrfy_rramc_otp_word_read (uint32_t index)
 Function for reading a word from the OTP in UICR.
 
NRFY_STATIC_INLINE bool nrfy_rramc_otp_word_write (NRF_RRAMC_Type *p_reg, uint32_t index, uint32_t value)
 Function for writing a 32-bit word at index position to OTP region in UICR.
 
NRFY_STATIC_INLINE void nrfy_rramc_task_trigger (NRF_RRAMC_Type *p_reg, nrf_rramc_task_t task)
 
NRFY_STATIC_INLINE uint32_t nrfy_rramc_task_address_get (NRF_RRAMC_Type const *p_reg, nrf_rramc_task_t task)
 
NRFY_STATIC_INLINE void nrfy_rramc_event_clear (NRF_RRAMC_Type *p_reg, nrf_rramc_event_t event)
 
NRFY_STATIC_INLINE bool nrfy_rramc_event_check (NRF_RRAMC_Type const *p_reg, nrf_rramc_event_t event)
 
NRFY_STATIC_INLINE uint32_t nrfy_rramc_event_address_get (NRF_RRAMC_Type const *p_reg, nrf_rramc_event_t event)
 
NRFY_STATIC_INLINE void nrfy_rramc_int_enable (NRF_RRAMC_Type *p_reg, uint32_t mask)
 
NRFY_STATIC_INLINE void nrfy_rramc_int_disable (NRF_RRAMC_Type *p_reg, uint32_t mask)
 
NRFY_STATIC_INLINE uint32_t nrfy_rramc_int_enable_check (NRF_RRAMC_Type const *p_reg, uint32_t mask)
 
NRFY_STATIC_INLINE void nrfy_rramc_subscribe_set (NRF_RRAMC_Type *p_reg, nrf_rramc_task_t task, uint8_t channel)
 
NRFY_STATIC_INLINE void nrfy_rramc_subscribe_clear (NRF_RRAMC_Type *p_reg, nrf_rramc_task_t task)
 
NRFY_STATIC_INLINE void nrfy_rramc_publish_set (NRF_RRAMC_Type *p_reg, nrf_rramc_event_t event, uint8_t channel)
 
NRFY_STATIC_INLINE void nrfy_rramc_publish_clear (NRF_RRAMC_Type *p_reg, nrf_rramc_event_t event)
 
NRFY_STATIC_INLINE bool nrfy_rramc_ready_check (NRF_RRAMC_Type *p_reg)
 
NRFY_STATIC_INLINE bool nrfy_rramc_write_ready_check (NRF_RRAMC_Type *p_reg)
 
NRFY_STATIC_INLINE uint32_t nrfy_rramc_error_access_addr_get (NRF_RRAMC_Type const *p_reg)
 
NRFY_STATIC_INLINE bool nrfy_rramc_empty_buffer_check (NRF_RRAMC_Type const *p_reg)
 
NRFY_STATIC_INLINE void nrfy_rramc_config_get (NRF_RRAMC_Type const *p_reg, nrf_rramc_config_t *p_config)
 
NRFY_STATIC_INLINE void nrfy_rramc_config_set (NRF_RRAMC_Type *p_reg, nrf_rramc_config_t const *p_config)
 
NRFY_STATIC_INLINE void nrfy_rramc_ready_next_timeout_get (NRF_RRAMC_Type const *p_reg, nrf_rramc_ready_next_timeout_t *p_config)
 
NRFY_STATIC_INLINE void nrfy_rramc_ready_next_timeout_set (NRF_RRAMC_Type *p_reg, nrf_rramc_ready_next_timeout_t const *p_config)
 
NRFY_STATIC_INLINE void nrfy_rramc_power_config_get (NRF_RRAMC_Type const *p_reg, nrf_rramc_power_t *p_config)
 
NRFY_STATIC_INLINE void nrfy_rramc_power_config_set (NRF_RRAMC_Type *p_reg, nrf_rramc_power_t const *p_config)
 
NRFY_STATIC_INLINE bool nrfy_rramc_erase_all_check (NRF_RRAMC_Type const *p_reg)
 
NRFY_STATIC_INLINE void nrfy_rramc_erase_all_set (NRF_RRAMC_Type *p_reg)
 

Detailed Description

Hardware access layer with cache and barrier support for managing the RRAMC peripheral.

Macro Definition Documentation

◆ NRFY_RRAMC_BYTES_IN_WORD

#define NRFY_RRAMC_BYTES_IN_WORD   4

Value representing the number of bytes in a word.

It is used in loops iterating over bytes contained in a word or in word-alignment checks.

◆ NRFY_RRAMC_WORDS_IN_BUFER_LINE

#define NRFY_RRAMC_WORDS_IN_BUFER_LINE   4

Value representing the number of words in a buffer line.

It is used in loops iterating over words contained in buffer lines.

Function Documentation

◆ nrfy_rramc_buffer_read()

NRFY_STATIC_INLINE void nrfy_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.

◆ nrfy_rramc_byte_read()

NRFY_STATIC_INLINE uint8_t nrfy_rramc_byte_read ( uint32_t  address)

Function for reading a byte from the RRAM.

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

◆ nrfy_rramc_byte_write()

NRFY_STATIC_INLINE void nrfy_rramc_byte_write ( NRF_RRAMC_Type *  p_reg,
uint32_t  address,
uint8_t  value 
)

Function for writing a single byte to RRAM.

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]p_regPointer to the structure of registers of the peripheral.
[in]addressAddress to where data is to be written.
[in]valueValue to be written.

◆ nrfy_rramc_bytes_write()

NRFY_STATIC_INLINE void nrfy_rramc_bytes_write ( NRF_RRAMC_Type *  p_reg,
uint32_t  address,
void const *  src,
uint32_t  num_bytes 
)

Function for writing consecutive bytes to RRAM.

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]p_regPointer to the structure of registers of the peripheral.
[in]addressAddress to where data is to be written.
[in]srcPointer to data to be copied.
[in]num_bytesNumber of bytes to be written.

◆ nrfy_rramc_config_get()

NRFY_STATIC_INLINE void nrfy_rramc_config_get ( NRF_RRAMC_Type const *  p_reg,
nrf_rramc_config_t p_config 
)
See also
nrf_rramc_config_get Function for getting the RRAMC peripheral configuration.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[out]p_configPointer to the structure to be filled with RRAMC configuration data.

◆ nrfy_rramc_config_set()

NRFY_STATIC_INLINE void nrfy_rramc_config_set ( NRF_RRAMC_Type *  p_reg,
nrf_rramc_config_t const *  p_config 
)
See also
nrf_rramc_config_set Function for setting the RRAMC peripheral configuration.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_configPointer to the structure with configuration to be set.

◆ nrfy_rramc_configure()

NRFY_STATIC_INLINE void nrfy_rramc_configure ( NRF_RRAMC_Type *  p_reg,
nrfy_rramc_config_t const *  p_config 
)

Function for configuring the RRAMC.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_configPointer to the structure of configuration of the peripheral.

◆ nrfy_rramc_empty_buffer_check()

NRFY_STATIC_INLINE bool nrfy_rramc_empty_buffer_check ( NRF_RRAMC_Type const *  p_reg)
See also
nrf_rramc_empty_buffer_check Function for checking whether the internal write-buffer has been committed to RRAM and is now empty.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueThe internal write-buffer is empty and has no content that needs to be commited.
falseThe internal write-buffer has data that needs to be committed.

◆ nrfy_rramc_erase_all_check()

NRFY_STATIC_INLINE bool nrfy_rramc_erase_all_check ( NRF_RRAMC_Type const *  p_reg)
See also
nrf_rramc_erase_all_check Function for checking if the erasing operation of the whole RRAM main block has been started.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueErase of chip started.
falseNo operation.

◆ nrfy_rramc_erase_all_set()

NRFY_STATIC_INLINE void nrfy_rramc_erase_all_set ( NRF_RRAMC_Type *  p_reg)
See also
nrf_rramc_erase_all_set Function for erasing whole RRAM main block, that includes the SICR and the UICR.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrfy_rramc_error_access_addr_get()

NRFY_STATIC_INLINE uint32_t nrfy_rramc_error_access_addr_get ( NRF_RRAMC_Type const *  p_reg)
See also
nrf_rramc_error_access_addr_get Fuction for checking the address of the first access error.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Access error address.

◆ nrfy_rramc_event_address_get()

NRFY_STATIC_INLINE uint32_t nrfy_rramc_event_address_get ( NRF_RRAMC_Type const *  p_reg,
nrf_rramc_event_t  event 
)
See also
nrf_rramc_event_address_get Function for getting the address of the specified RRAMC event register.
Parameters
[in]p_regPointer to the peripheral register structure.
[in]eventRequested event.
Returns
Address of the specified event register.

◆ nrfy_rramc_event_check()

NRFY_STATIC_INLINE bool nrfy_rramc_event_check ( NRF_RRAMC_Type const *  p_reg,
nrf_rramc_event_t  event 
)
See also
nrf_rramc_event_check Function for retrieving the state of the RRAMC event.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent to be checked.
Return values
trueThe event has been generated.
falseThe event has not been generated.

◆ nrfy_rramc_event_clear()

NRFY_STATIC_INLINE void nrfy_rramc_event_clear ( NRF_RRAMC_Type *  p_reg,
nrf_rramc_event_t  event 
)
See also
nrf_rramc_event_clear Function for clearing the specified RRAMC event.
Parameters
[in]p_regPointer to the peripheral register structure.
[in]eventEvent to clear.

◆ nrfy_rramc_events_process()

NRFY_STATIC_INLINE uint32_t nrfy_rramc_events_process ( NRF_RRAMC_Type *  p_reg,
uint32_t  mask 
)

Function for processing the specified RRAMC events.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of events to be processed, created by NRFY_EVENT_TO_INT_BITMASK().
Returns
Mask of events that were generated and processed. To be checked against the result of NRFY_EVENT_TO_INT_BITMASK().

◆ nrfy_rramc_int_disable()

NRFY_STATIC_INLINE void nrfy_rramc_int_disable ( NRF_RRAMC_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_rramc_int_disable Function for disabling the specified interrupts.
Parameters
[in]p_regPointer to the peripheral register structure.
[in]maskMask of interrupts to be disabled. Use nrf_rramc_int_mask_t values for bit masking.

◆ nrfy_rramc_int_enable()

NRFY_STATIC_INLINE void nrfy_rramc_int_enable ( NRF_RRAMC_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_rramc_int_enable Function for enabling the specified interrupts.
Parameters
[in]p_regPointer to the peripheral register structure.
[in]maskMask of interrupts to be enabled. Use nrf_rramc_int_mask_t values for bit masking.

◆ nrfy_rramc_int_enable_check()

NRFY_STATIC_INLINE uint32_t nrfy_rramc_int_enable_check ( NRF_RRAMC_Type const *  p_reg,
uint32_t  mask 
)
See also
nrf_rramc_int_enable_check Function for checking if the specified interrupts are enabled.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be checked. Use nrf_rramc_int_mask_t values for bit masking.
Returns
Mask of enabled interrupts.

◆ nrfy_rramc_int_init()

NRFY_STATIC_INLINE void nrfy_rramc_int_init ( NRF_RRAMC_Type *  p_reg,
uint32_t  mask,
uint8_t  irq_priority,
bool  enable 
)

Function for initializing the specified RRAMC interrupts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be initialized.
[in]irq_priorityInterrupt priority.
[in]enableTrue if interrupts associated with the event mask are to be enabled, false otherwise.

◆ nrfy_rramc_int_uninit()

NRFY_STATIC_INLINE void nrfy_rramc_int_uninit ( NRF_RRAMC_Type *  p_reg)

Function for uninitializing the RRAMC interrupts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrfy_rramc_otp_word_read()

NRFY_STATIC_INLINE uint32_t nrfy_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.

◆ nrfy_rramc_otp_word_write()

NRFY_STATIC_INLINE bool nrfy_rramc_otp_word_write ( NRF_RRAMC_Type *  p_reg,
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]p_regPointer to the structure of registers of the peripheral.
[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.

◆ nrfy_rramc_power_config_get()

NRFY_STATIC_INLINE void nrfy_rramc_power_config_get ( NRF_RRAMC_Type const *  p_reg,
nrf_rramc_power_t p_config 
)
See also
nrf_rramc_power_config_get Function for getting the RRAMC power configuration.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[out]p_configPointer to the structure to be filled with information about power configuration.

◆ nrfy_rramc_power_config_set()

NRFY_STATIC_INLINE void nrfy_rramc_power_config_set ( NRF_RRAMC_Type *  p_reg,
nrf_rramc_power_t const *  p_config 
)
See also
nrf_rramc_power_config_set Function for setting the RRAMC power configuration.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_configPointer to the structure filled with information about power configuration.

◆ nrfy_rramc_publish_clear()

NRFY_STATIC_INLINE void nrfy_rramc_publish_clear ( NRF_RRAMC_Type *  p_reg,
nrf_rramc_event_t  event 
)
See also
nrf_rramc_publish_clear Function for clearing the publish configuration for a wokenup RRAMC event.
Note
Not every event has its corresponding publish register. Refer to the Product Specification for more information.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent for which to clear the configuration.

◆ nrfy_rramc_publish_set()

NRFY_STATIC_INLINE void nrfy_rramc_publish_set ( NRF_RRAMC_Type *  p_reg,
nrf_rramc_event_t  event,
uint8_t  channel 
)
See also
nrf_rramc_publish_set Function for setting the publish configuration for a wokenup RRAMC event.
Note
Not every event has its corresponding publish register. Refer to the Product Specification for more information.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent for which to set the configuration.
[in]channelChannel through which to publish the event.

◆ nrfy_rramc_ready_check()

NRFY_STATIC_INLINE bool nrfy_rramc_ready_check ( NRF_RRAMC_Type *  p_reg)
See also
nrf_rramc_ready_check Function for checking current RRAMC operation status.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueCurrent operation is completed, and RRAMC is ready.
falseRRAMC is busy.

◆ nrfy_rramc_ready_next_timeout_get()

NRFY_STATIC_INLINE void nrfy_rramc_ready_next_timeout_get ( NRF_RRAMC_Type const *  p_reg,
nrf_rramc_ready_next_timeout_t p_config 
)
See also
nrf_rramc_ready_next_timeout_get Function for getting preload timeout value for waiting for a next write.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[out]p_configPointer to the structure to be filled with information about preload timeout value.

◆ nrfy_rramc_ready_next_timeout_set()

NRFY_STATIC_INLINE void nrfy_rramc_ready_next_timeout_set ( NRF_RRAMC_Type *  p_reg,
nrf_rramc_ready_next_timeout_t const *  p_config 
)
See also
nrf_rramc_ready_next_timeout_set Function for setting preload timeout value for waiting for a next write.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_configPointer to the structure filled with information about$ preload timeout value.

◆ nrfy_rramc_subscribe_clear()

NRFY_STATIC_INLINE void nrfy_rramc_subscribe_clear ( NRF_RRAMC_Type *  p_reg,
nrf_rramc_task_t  task 
)
See also
nrf_rramc_subscribe_clear Function for clearing the subscribe configuration for a wakeup RRAMC task.
Note
Not every task has its corresponding subscribe register. Refer to the Product Specification for more information.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask for which to clear the configuration.

◆ nrfy_rramc_subscribe_set()

NRFY_STATIC_INLINE void nrfy_rramc_subscribe_set ( NRF_RRAMC_Type *  p_reg,
nrf_rramc_task_t  task,
uint8_t  channel 
)
See also
nrf_rramc_subscribe_set Function for setting the subscribe configuration for a wakeup RRAMC task.
Note
Not every task has its corresponding subscribe register. Refer to the Product Specification for more information.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask for which to set the configuration.
[in]channelChannel through which to subscribe events.

◆ nrfy_rramc_task_address_get()

NRFY_STATIC_INLINE uint32_t nrfy_rramc_task_address_get ( NRF_RRAMC_Type const *  p_reg,
nrf_rramc_task_t  task 
)
See also
nrf_rramc_task_address_get Function for getting the address of the specified RRAMC task register.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskRRAMC task.
Returns
Address of the specified task register.

◆ nrfy_rramc_task_trigger()

NRFY_STATIC_INLINE void nrfy_rramc_task_trigger ( NRF_RRAMC_Type *  p_reg,
nrf_rramc_task_t  task 
)
See also
nrf_rramc_task_trigger Function for activating the specified RRAMC task.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask to be activated.

◆ nrfy_rramc_word_read()

NRFY_STATIC_INLINE uint32_t nrfy_rramc_word_read ( uint32_t  address)

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

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

◆ nrfy_rramc_word_write()

NRFY_STATIC_INLINE void nrfy_rramc_word_write ( NRF_RRAMC_Type *  p_reg,
uint32_t  address,
uint32_t  value 
)

Function for writing a 32-bit word to RRAM.

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]p_regPointer to the structure of registers of the peripheral.
[in]addressAddress to where data is to be written. Must be word-aligned.
[in]valueValue to be written.

◆ nrfy_rramc_words_write()

NRFY_STATIC_INLINE void nrfy_rramc_words_write ( NRF_RRAMC_Type *  p_reg,
uint32_t  address,
void const *  src,
uint32_t  num_words 
)

Function for writing consecutive 32-bit words to RRAM.

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]p_regPointer to the structure of registers of the peripheral.
[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.

◆ nrfy_rramc_write_ready_check()

NRFY_STATIC_INLINE bool nrfy_rramc_write_ready_check ( NRF_RRAMC_Type *  p_reg)
See also
nrf_rramc_write_ready_check Function for checking whether RRAMC is ready to accept a new write operation.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueRRAMC is ready to accept a new write operation.
falseRRAMC cannot accept any write operation now.

Documentation feedback | Developer Zone | Subscribe | Updated