Generic Vector DMA layer
- group nrf_vdma
Helper layer that provides the common functionality for Vector DMA (VDMA).
Defines
-
NRF_VDMA_BUFFER_SIZE_MASK
Maximum size of VDMA buffer.
-
NRF_VDMA_REDUCED_JOB_SIZE(count)
Macro for computing size of the array of reduced job structures.
- Parameters:
count – [in] Number of jobs to be stored in reduced job list.
-
NRF_VDMA_JOB_ELEMENT(p_buffer, size, attribute)
Macro for defining an element of a job list.
- Parameters:
p_buffer – [in] Pointer to the buffer.
size – [in] Size of the transfer.
attribute – [in] Attribute mask.
- Returns:
Two words of the job descriptor.
-
NRF_VDMA_REDUCED_JOB_INIT_ELEMENT(p_buffer, size, attribute)
Macro for defining initial element of reduced job list.
- Parameters:
p_buffer – [in] Job buffer.
size – [in] Size of the job buffer.
attribute – [in] Attributes of the job.
- Returns:
Two words of the job descriptor.
-
NRFX_VDMA_PERIPH_JOB(addr, size)
Macro for defining a job for transfer engaging peripheral.
- Parameters:
addr – [in] Starting address.
size – [in] Size of a DMA job.
- Returns:
Two words which contains address, size and the descriptor byte.
Typedefs
-
typedef uint32_t nrf_vdma_job_reduced_t
Type describing VDMA job with fixed attributes and length.
Enums
-
enum nrf_vdma_attributes_t
VDMA attributes.
Note
Only one attribute can be set for the job.
Values:
-
enumerator NRF_VDMA_ATTRIBUTE_PLAIN_DATA
Data is not modified.
-
enumerator NRF_VDMA_ATTRIBUTE_BYTE_SWAP
Data bytes are swapped.
-
enumerator NRF_VDMA_ATTRIBUTE_JOB_LIST
Allows chaining of joblists.
-
enumerator NRF_VDMA_ATTRIBUTE_BUFFER_FILL
Insters zeros into sink data buffers. Sink job attribute only.
-
enumerator NRF_VDMA_ATTRIBUTE_FIXED_ATTR
Identical job attributes and sizes for all jobs in the list.
-
enumerator NRF_VDMA_ATTRIBUTE_CRC
CRC checksum is calculated on all data in the source list.
-
enumerator NRF_VDMA_ATTRIBUTE_STATIC_ADDR
Memory address is fixed for the entirety of the job.
-
enumerator NRF_VDMA_ATTRIBUTE_PLAIN_DATA_BUF_WRITE
Used to get better write performance when many short bursts are beiing sent.
-
enumerator NRF_VDMA_ATTRIBUTE_PLAIN_DATA
Functions
-
__STATIC_INLINE void nrf_vdma_job_fill(nrf_vdma_job_t *p_job, void *p_buffer, size_t size, uint8_t attributes)
Function for filling the specified structure of the job with given job parameters.
- Parameters:
p_job – [out] Pointer to the structure of the job to be filled.
p_buffer – [in] Job buffer.
size – [in] Size of the job buffer.
attributes – [in] Attributes of the job.
-
__STATIC_INLINE void nrf_vdma_job_reduced_init(nrf_vdma_job_reduced_t *p_job, void *p_buffer, size_t size, uint8_t attributes)
Function for initializing the specified structure of the job with fixed attributes.
First element of reduced job list occupies space for two elements.
Note
Use nrf_vdma_job_terminate() to terminate reduced job list.
- Parameters:
p_job – [out] Pointer to the reduced structure of the job to be filled.
p_buffer – [in] Job buffer.
size – [in] Size of the job buffer.
attributes – [in] Additional attribute of the job.
-
__STATIC_INLINE void nrf_vdma_job_reduced_fill(nrf_vdma_job_reduced_t *p_job, void *p_buffer)
Function for filling the specified reduced structure of the job with given buffer pointer.
- Parameters:
p_job – [out] Pointer to the reduced structure of the job to be filled.
p_buffer – [in] Job buffer.
-
__STATIC_INLINE void *nrf_vdma_job_buffer_get(nrf_vdma_job_t const *p_job)
Function for getting the pointer to the buffer associated with specified job.
- Parameters:
p_job – [in] Pointer to the structure of the specified job.
- Returns:
Pointer to the job buffer.
-
__STATIC_INLINE size_t nrf_vdma_job_size_get(nrf_vdma_job_t const *p_job)
Function for getting the size of the buffer associated with specified job.
- Parameters:
p_job – [in] Pointer to the structure of the specified job.
- Returns:
Size of the job buffer.
-
__STATIC_INLINE void nrf_vdma_job_terminate(nrf_vdma_job_t *p_job)
Function for terminating the specified job.
When VectorDMA encounters job that is terminated, processing of the job list stops.
- Parameters:
p_job – [out] Pointer to the structure of the job to be terminated.
-
__STATIC_INLINE void nrf_vdma_job_link(nrf_vdma_job_t *p_job, nrf_vdma_job_t *p_job_linked)
Function for linking the job with another job.
When VectorDMA encounters job that is linked to another job, execution of the linked job starts.
- Parameters:
p_job – [out] Pointer to the structure of the job to become link.
p_job_linked – [in] Pointer to the structure of the job to be linked.
-
struct nrf_vdma_job_t
- #include <nrf_vdma.h>
Structure describing VDMA job.
-
NRF_VDMA_BUFFER_SIZE_MASK