Helper that allows preserving important data from peripheral's registers. More...
Data Structures | |
struct | nrfx_rtn_ctrl_list_t |
Type that handles information about registers to be preserved. More... | |
Functions | |
void | nrfx_rtn_backup (void const *p_reg, nrfx_rtn_ctrl_list_t const *p_ctrl_list, void *p_dest) |
Function for creating backup of the registers of a given peripheral. | |
void | nrfx_rtn_restore (void *p_reg, nrfx_rtn_ctrl_list_t const *p_ctrl_list, void const *p_src) |
Function for restoring values of the registers of a given peripheral. | |
Helper that allows preserving important data from peripheral's registers.
Register retention solution consists of:
Register description list consist of two symbols:
Main descriptions are stored in the soc/retention
directory.
In order to use the register retention list, the developer must first create types and structures in the header file, using the following scheme:
After creating of the structures and types developer can easily use them to reserve place to register backup statically:
or dynamically using some allocator:
Registers can be preserved using nrfx_rtn_backup()
function:
To restore registers use nrfx_rtn_restore()
function:
void nrfx_rtn_backup | ( | void const * | p_reg, |
nrfx_rtn_ctrl_list_t const * | p_ctrl_list, | ||
void * | p_dest | ||
) |
Function for creating backup of the registers of a given peripheral.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | p_ctrl_list | Pointer to the control list structure. |
[out] | p_dest | Pointer to the destination memory. |
void nrfx_rtn_restore | ( | void * | p_reg, |
nrfx_rtn_ctrl_list_t const * | p_ctrl_list, | ||
void const * | p_src | ||
) |
Function for restoring values of the registers of a given peripheral.
[out] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | p_ctrl_list | Pointer to the control list structure. |
[in] | p_src | Pointer to the source memory. |