Utility macros and functions for saving and restoring peripherals. More...
Macros | |
#define | NRFX_SR_VDMA_REG_ADDR(_inst, _reg, _array) NRFX_COND_CODE_1(_array, (), (&))NRFX_CONCAT(NRF_, _inst)->_reg |
Macro for returning an address of a register in the instance. | |
#define | NRFX_SR_VDMA_INST_REG_JOB(_inst, _regs, _len, _array) NRFX_VDMA_PERIPH_JOB(NRFX_SR_VDMA_REG_ADDR(_inst, _regs, _array), _len), |
Macro for creating a VDMA job for transfering data from a register set. | |
#define | NRFX_SR_VDMA_INST_SET_JOB(_inst, _regs, _array) NRFX_SR_VDMA_INST_REG_JOB(_inst, _regs, sizeof(NRFX_CONCAT(NRF_, _inst)->_regs), _array) |
Macro for creating a VDMA job for transfering data from a register structure. | |
#define | NRFX_SR_VDMA_INST_COND_REG_JOB(_inst, _feature, _regs, _len, _array) |
Macro for conditionally creating a VDMA job for transfering data from a register set. | |
#define | NRFX_SR_VDMA_INST_COND_SET_JOB(_inst, _feature, _regs, _array) |
Macro for conditionally creating a VDMA job for transfering data from a register structure. | |
#define | NRFX_SR_VDMA_INST_COND_LEN(_inst, _feature, _len) NRFX_COND_CODE_1(NRFX_CONCAT(_inst, _, _feature), (_len), (0)) |
Macro for conditionally returning a length. | |
#define | NRFX_SR_VDMA_INST_COND_SET_LEN(_inst, _feature, _regs) NRFX_SR_VDMA_INST_COND_LEN(_inst, _feature, sizeof(NRFX_CONCAT(NRF_, _inst)->_regs)) |
Macro for conditionally calculating length of a structure in a register set. | |
#define | NRFX_SR_VDMA_INST_SET_LEN(_inst, _regs) sizeof(NRFX_CONCAT(NRF_, _inst)->_regs) |
Macro for calculating length of a structure in a register set. | |
#define | NRFX_SR_VDMA_JOB(periph) NRFX_CONCAT(NRFX_SR_VDMA_, periph, _JOB)() |
Macro for generating a VDMA job descriptor for storing or restoring state of all instances of a given peripheral. | |
#define | NRFX_SR_VDMA_LEN(periph) NRFX_CONCAT(NRFX_SR_VDMA_, periph, _LEN)() |
Macro for calculating size of the buffer needed to store state of all instances of a given peripheral. | |
Utility macros and functions for saving and restoring peripherals.
#define NRFX_SR_VDMA_INST_COND_LEN | ( | _inst, | |
_feature, | |||
_len | |||
) | NRFX_COND_CODE_1(NRFX_CONCAT(_inst, _, _feature), (_len), (0)) |
Macro for conditionally returning a length.
Macro returns input _len
if there is a define formed of concatenation of an instance name and a feature name (e.g. SPU010_BELLS where SPU010 is _inst
and BELLS is a _feature
) set to 1.
[in] | _inst | Instance name, e.g. SPU100. |
[in] | _feature | Feature name as used in peripherals.h file. |
[in] | _len | Name of a register set associated with the given feature. |
_len
or 0 is feature define is not set or does not exist. #define NRFX_SR_VDMA_INST_COND_REG_JOB | ( | _inst, | |
_feature, | |||
_regs, | |||
_len, | |||
_array | |||
) |
Macro for conditionally creating a VDMA job for transfering data from a register set.
Job is created only if there is a define formed of concatenation of an instance name and a feature name (e.g. SPU010_BELLS where SPU010 is _inst
and BELLS is a _feature
) set to 1.
[in] | _inst | Instance, e.g. SPU010. |
[in] | _feature | Feature name as used in _peripherals.h. |
[in] | _regs | Name of a starting register. |
[in] | _len | Length of the transfer. |
[in] | _array | Indication whether provided structure is an array or not. Set to 1 to indicate that it is an array. |
#define NRFX_SR_VDMA_INST_COND_SET_JOB | ( | _inst, | |
_feature, | |||
_regs, | |||
_array | |||
) |
Macro for conditionally creating a VDMA job for transfering data from a register structure.
Job is created only if there is a define formed of concatenation of an instance name and a feature name (e.g. SPU010_BELLS where SPU010 is _inst
and BELLS is a _feature
) set to 1.
[in] | _inst | Instance, e.g. SPU010. |
[in] | _feature | Feature name as used in _peripherals.h. |
[in] | _regs | Name of a feature register set name. |
[in] | _array | Indication whether provided structure is an array or not. Set to 1 to indicate that it is an array. |
#define NRFX_SR_VDMA_INST_COND_SET_LEN | ( | _inst, | |
_feature, | |||
_regs | |||
) | NRFX_SR_VDMA_INST_COND_LEN(_inst, _feature, sizeof(NRFX_CONCAT(NRF_, _inst)->_regs)) |
Macro for conditionally calculating length of a structure in a register set.
Macro returns size of a struct if there is a define formed of concatenation of an instance name and a feature name (e.g. SPU010_BELLS where SPU010 is _inst
and BELLS is a _feature
) set to 1.
[in] | _inst | Instance name, e.g. SPU100. |
[in] | _feature | Feature name as used in peripherals.h file. |
[in] | _regs | Name of a register set associated with the given feature. |
#define NRFX_SR_VDMA_INST_REG_JOB | ( | _inst, | |
_regs, | |||
_len, | |||
_array | |||
) | NRFX_VDMA_PERIPH_JOB(NRFX_SR_VDMA_REG_ADDR(_inst, _regs, _array), _len), |
Macro for creating a VDMA job for transfering data from a register set.
[in] | _inst | Instance, e.g. SPU010. |
[in] | _regs | Name of a starting register. |
[in] | _len | Length of the transfer. |
[in] | _array | Indication whether provided structure is an array or not. Set to 1 to indicate that it is an array. |
#define NRFX_SR_VDMA_INST_SET_JOB | ( | _inst, | |
_regs, | |||
_array | |||
) | NRFX_SR_VDMA_INST_REG_JOB(_inst, _regs, sizeof(NRFX_CONCAT(NRF_, _inst)->_regs), _array) |
Macro for creating a VDMA job for transfering data from a register structure.
[in] | _inst | Instance, e.g. SPU010. |
[in] | _regs | Name of a feature register set name. |
[in] | _array | Indication whether provided structure is an array or not. Set to 1 to indicate that it is an array. |
#define NRFX_SR_VDMA_INST_SET_LEN | ( | _inst, | |
_regs | |||
) | sizeof(NRFX_CONCAT(NRF_, _inst)->_regs) |
Macro for calculating length of a structure in a register set.
[in] | _inst | Instance name, e.g. SPU100. |
[in] | _regs | Name of a register set associated with the given feature. |
#define NRFX_SR_VDMA_JOB | ( | periph | ) | NRFX_CONCAT(NRFX_SR_VDMA_, periph, _JOB)() |
Macro for generating a VDMA job descriptor for storing or restoring state of all instances of a given peripheral.
Sum of length of all transfers must equal length calculated by NRFX_SR_VDMA_LEN.
Macro attempts to call NRFX_SR_VDMA_<periph_name>_JOB macro with empty list of arguments. Such macro must exist or compilation will fail.
Return value can be used to initialize an array of jobs.
[in] | periph | Peripheral name, e.g. SPU. |
#define NRFX_SR_VDMA_LEN | ( | periph | ) | NRFX_CONCAT(NRFX_SR_VDMA_, periph, _LEN)() |
Macro for calculating size of the buffer needed to store state of all instances of a given peripheral.
Macro attempts to call NRFX_SR_VDMA_<periph_name>_LEN macro with empty list of arguments. Such macro must exist or compilation will fail.
[in] | periph | Peripheral name, e.g. SPU. |
#define NRFX_SR_VDMA_REG_ADDR | ( | _inst, | |
_reg, | |||
_array | |||
) | NRFX_COND_CODE_1(_array, (), (&))NRFX_CONCAT(NRF_, _inst)->_reg |
Macro for returning an address of a register in the instance.
[in] | _inst | Instance, e.g. SPU010. |
[in] | _reg | Register name. |
[in] | _array | Indication whether provided structure is an array or not. Set to 1 to indicate that it is an array. It is needed to determine if an ampersand must be added. |