nrfx 3.3
Macros
Utility macros and functions for saving and restoring SPU peripheral

Utility macros and functions for saving and restoring SPU peripheral. More...

Macros

#define _NRFX_SPU_VDMA_LEN(_inst, _with_periph)
 Macro for calculating length of a save & restore transfer for the given SPU instance.
 
#define _NRFX_SPU_VDMA_JOB(_inst, _with_periph)
 Macro for generating a set of jobs for a SPU peripheral.
 
#define NRFX_SR_VDMA_SPU_JOB()    NRFX_FOREACH_PRESENT(SPU, NRFX_INSTANCE_CONCAT, (), (), _NRFX_SPU_VDMA_JOB, 1)
 Macro for generating a set of VDMA jobs for transfer engaging all SPU instances.
 
#define NRFX_SR_VDMA_SPU_LEN()    (NRFX_FOREACH_PRESENT(SPU, NRFX_INSTANCE_CONCAT, (+), (0), _NRFX_SPU_VDMA_LEN, 1))
 Macro for calculating length of a save & restore transfer for all SPU instances.
 

Detailed Description

Utility macros and functions for saving and restoring SPU peripheral.

Macro Definition Documentation

◆ _NRFX_SPU_VDMA_JOB

#define _NRFX_SPU_VDMA_JOB (   _inst,
  _with_periph 
)
Value:
NRFX_COND_CODE_1(NRFX_CONCAT(_inst, _SR_VDMA_SKIP), \
(), \
( \
NRFX_SR_VDMA_INST_SET_JOB(_inst, INTEN, 0) \
NRFX_COND_CODE_1(_with_periph, \
(NRFX_SR_VDMA_INST_REG_JOB(_inst, PERIPH, \
NRFX_CONCAT(_inst, _PERIPH_COUNT) * \
sizeof(NRF_SPU_PERIPH_Type), \
1) \
), \
()) \
NRFX_SR_VDMA_INST_COND_SET_JOB(_inst, IPCT, FEATURE.IPCT, 0) \
NRFX_SR_VDMA_INST_COND_SET_JOB(_inst, DPPIC, FEATURE.DPPI, 0) \
NRFX_SR_VDMA_INST_COND_SET_JOB(_inst, GPIOTE, FEATURE.GPIOTE, 1) \
NRFX_SR_VDMA_INST_COND_SET_JOB(_inst, GPIO, FEATURE.GPIO, 1) \
NRFX_SR_VDMA_INST_COND_SET_JOB(_inst, GRTC, FEATURE.GRTC, 0) \
NRFX_SR_VDMA_INST_COND_SET_JOB(_inst, BELLS, FEATURE.BELLS, 0) \
) \
)
#define NRFX_SR_VDMA_INST_REG_JOB(_inst, _regs, _len, _array)
Macro for creating a VDMA job for transfering data from a register set.
Definition: nrfx_sr_vdma.h:46
#define NRFX_SR_VDMA_INST_SET_JOB(_inst, _regs, _array)
Macro for creating a VDMA job for transfering data from a register structure.
Definition: nrfx_sr_vdma.h:59
#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.
Definition: nrfx_sr_vdma.h:97
#define NRFX_COND_CODE_1(_flag, _if_1_code, _else_code)
Macro for inserting code depending on whether _flag exists and expands to 1 or not.
Definition: nrfx_utils.h:58
#define NRFX_CONCAT(...)
Macro for concatenating multiple arguments.
Definition: nrfx_utils.h:168

Macro for generating a set of jobs for a SPU peripheral.

It skips an instance if there is a define forcing skipping set to 1 (e.g. SPU010_SR_VDMA_SKIP to skip VDMA jobs for SPU010 instance).

Macro attempts to generate jobs for features which are supported by the given instance.

Parameters
[in]_instInstance, e.g. SPU010.
[in]_with_periphSet to 1 if PERIPH section shall also be included.
Returns
Job descriptors.

◆ _NRFX_SPU_VDMA_LEN

#define _NRFX_SPU_VDMA_LEN (   _inst,
  _with_periph 
)
Value:
NRFX_COND_CODE_1(NRFX_CONCAT(_inst, _SR_VDMA_SKIP), \
(0), \
((NRFX_SR_VDMA_INST_SET_LEN(_inst, INTEN) + \
NRFX_COND_CODE_1(_with_periph, \
((NRFX_CONCAT(_inst, _PERIPH_COUNT) * \
sizeof(NRF_SPU_PERIPH_Type))), \
(0)) + \
NRFX_SR_VDMA_INST_COND_SET_LEN(_inst, IPCT, FEATURE.IPCT) + \
NRFX_SR_VDMA_INST_COND_SET_LEN(_inst, DPPIC, FEATURE.DPPIC) + \
NRFX_SR_VDMA_INST_COND_SET_LEN(_inst, GPIOTE, FEATURE.GPIOTE) + \
NRFX_SR_VDMA_INST_COND_SET_LEN(_inst, GPIO, FEATURE.GPIO) + \
NRFX_SR_VDMA_INST_COND_SET_LEN(_inst, GRTC, FEATURE.GRTC) + \
NRFX_SR_VDMA_INST_COND_SET_LEN(_inst, BELLS, FEATURE.BELLS))))
#define NRFX_SR_VDMA_INST_SET_LEN(_inst, _regs)
Macro for calculating length of a structure in a register set.
Definition: nrfx_sr_vdma.h:141
#define NRFX_SR_VDMA_INST_COND_SET_LEN(_inst, _feature, _regs)
Macro for conditionally calculating length of a structure in a register set.
Definition: nrfx_sr_vdma.h:130

Macro for calculating length of a save & restore transfer for the given SPU instance.

Macro generates a sum of bytes transfered by jobs for a SPU instance. It skips an instance if there is a define forcing skipping set to 1 (e.g. SPU010_SR_VDMA_SKIP to skip VDMA jobs for SPU010 instance).

Macro attempts to sum transfer lengths for jobs for features which are supported by the given instance.

Parameters
[in]_instInstance, e.g. SPU010.
[in]_with_periphSet to 1 if PERIPH section should be included.

◆ NRFX_SR_VDMA_SPU_JOB

#define NRFX_SR_VDMA_SPU_JOB ( )     NRFX_FOREACH_PRESENT(SPU, NRFX_INSTANCE_CONCAT, (), (), _NRFX_SPU_VDMA_JOB, 1)

Macro for generating a set of VDMA jobs for transfer engaging all SPU instances.

Instances may be ommited by defining <instance>_SR_VDMA_SKIP to 1.

Returns
Job descriptors.

◆ NRFX_SR_VDMA_SPU_LEN

#define NRFX_SR_VDMA_SPU_LEN ( )     (NRFX_FOREACH_PRESENT(SPU, NRFX_INSTANCE_CONCAT, (+), (0), _NRFX_SPU_VDMA_LEN, 1))

Macro for calculating length of a save & restore transfer for all SPU instances.

Instances may be ommited by defining <instance>_SR_VDMA_SKIP to 1.

Returns
Number of bytes to transfer for perform save and restore.

Documentation feedback | Developer Zone | Subscribe | Updated