nrfx 3.3
Data Structures | Macros | Typedefs | Enumerations | Functions
Generic Vector DMA layer.

Helper layer that provides the common functionality for Vector DMA (VDMA). More...

Data Structures

struct  nrf_vdma_job_t
 Structure describing VDMA job. More...
 

Macros

#define NRF_VDMA_BUFFER_SIZE_MASK   VDMADESCRIPTOR_CONFIG_CNT_Msk
 Maximum size of VDMA buffer.
 
#define NRF_VDMA_REDUCED_JOB_SIZE(count)   (count + 2)
 Macro for computing size of the array of reduced job structures.
 
#define NRF_VDMA_JOB_ELEMENT(p_buffer, size, attribute)
 Macro for defining an element of a job list.
 
#define NRF_VDMA_REDUCED_JOB_INIT_ELEMENT(p_buffer, size, attribute)    NRF_VDMA_JOB_ELEMENT(p_buffer, size, NRF_VDMA_ATTRIBUTE_FIXED_ATTR | (attribute))
 Macro for defining initial element of reduced job list.
 
#define NRFX_VDMA_PERIPH_JOB(addr, size)    NRF_VDMA_JOB_ELEMENT(addr, size, NRF_VDMA_EXT_ATTRIBUTE_PERIPHERAL_MODE)
 Macro for defining a job for transfer engaging peripheral.
 

Typedefs

typedef uint32_t nrf_vdma_job_reduced_t
 Type describing VDMA job with fixed attributes and length.
 

Enumerations

enum  nrf_vdma_attributes_t {
  NRF_VDMA_ATTRIBUTE_PLAIN_DATA = 0x00 ,
  NRF_VDMA_ATTRIBUTE_BYTE_SWAP = 0x07 ,
  NRF_VDMA_ATTRIBUTE_JOB_LIST = 0x08 ,
  NRF_VDMA_ATTRIBUTE_BUFFER_FILL = 0x09 ,
  NRF_VDMA_ATTRIBUTE_FIXED_ATTR = 0x0A ,
  NRF_VDMA_ATTRIBUTE_CRC = 0x0B ,
  NRF_VDMA_ATTRIBUTE_STATIC_ADDR = 0x0C ,
  NRF_VDMA_ATTRIBUTE_PLAIN_DATA_BUF_WRITE = 0x0D
}
 VDMA attributes. More...
 
enum  nrf_vdma_ext_attribute_t {
  NRF_VDMA_EXT_ATTRIBUTE_PERIPHERAL_MODE = 0x40 ,
  NRF_VDMA_EXT_ATTRIBUTE_EVENT_ENABLE = 0x80
}
 VDMA extended attributes. More...
 

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.
 
__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.
 
__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.
 
__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.
 
__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.
 
__STATIC_INLINE void nrf_vdma_job_terminate (nrf_vdma_job_t *p_job)
 Function for terminating the specified job.
 
__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.
 

Detailed Description

Helper layer that provides the common functionality for Vector DMA (VDMA).

Macro Definition Documentation

◆ NRF_VDMA_JOB_ELEMENT

#define NRF_VDMA_JOB_ELEMENT (   p_buffer,
  size,
  attribute 
)
Value:
(uint32_t)p_buffer, \
(uint32_t)(((attribute) << VDMADESCRIPTOR_CONFIG_ATTRIBUTE_Pos) | \
#define NRF_VDMA_BUFFER_SIZE_MASK
Maximum size of VDMA buffer.
Definition: nrf_vdma.h:20

Macro for defining an element of a job list.

Parameters
[in]p_bufferPointer to the buffer.
[in]sizeSize of the transfer.
[in]attributeAttribute mask.
Returns
Two words of the job descriptor.

◆ NRF_VDMA_REDUCED_JOB_INIT_ELEMENT

#define NRF_VDMA_REDUCED_JOB_INIT_ELEMENT (   p_buffer,
  size,
  attribute 
)     NRF_VDMA_JOB_ELEMENT(p_buffer, size, NRF_VDMA_ATTRIBUTE_FIXED_ATTR | (attribute))

Macro for defining initial element of reduced job list.

Parameters
[in]p_bufferJob buffer.
[in]sizeSize of the job buffer.
[in]attributeAttributes of the job.
Returns
Two words of the job descriptor.

◆ NRF_VDMA_REDUCED_JOB_SIZE

#define NRF_VDMA_REDUCED_JOB_SIZE (   count)    (count + 2)

Macro for computing size of the array of reduced job structures.

Parameters
[in]countNumber of jobs to be stored in reduced job list.

◆ NRFX_VDMA_PERIPH_JOB

#define NRFX_VDMA_PERIPH_JOB (   addr,
  size 
)     NRF_VDMA_JOB_ELEMENT(addr, size, NRF_VDMA_EXT_ATTRIBUTE_PERIPHERAL_MODE)

Macro for defining a job for transfer engaging peripheral.

Parameters
[in]addrStarting address.
[in]sizeSize of a DMA job.
Returns
Two words which contains address, size and the descriptor byte.

Enumeration Type Documentation

◆ nrf_vdma_attributes_t

VDMA attributes.

Note
Only one attribute can be set for the job.
Enumerator
NRF_VDMA_ATTRIBUTE_PLAIN_DATA 

Data is not modified.

NRF_VDMA_ATTRIBUTE_BYTE_SWAP 

Data bytes are swapped.

NRF_VDMA_ATTRIBUTE_JOB_LIST 

Allows chaining of joblists.

NRF_VDMA_ATTRIBUTE_BUFFER_FILL 

Insters zeros into sink data buffers. Sink job attribute only.

NRF_VDMA_ATTRIBUTE_FIXED_ATTR 

Identical job attributes and sizes for all jobs in the list.

NRF_VDMA_ATTRIBUTE_CRC 

CRC checksum is calculated on all data in the source list.

NRF_VDMA_ATTRIBUTE_STATIC_ADDR 

Memory address is fixed for the entirety of the job.

NRF_VDMA_ATTRIBUTE_PLAIN_DATA_BUF_WRITE 

Used to get better write performance when many short bursts are beiing sent.

◆ nrf_vdma_ext_attribute_t

VDMA extended attributes.

Note
This attributes can be combined with each other and with standard attribute

Function Documentation

◆ nrf_vdma_job_buffer_get()

__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
[in]p_jobPointer to the structure of the specified job.
Returns
Pointer to the job buffer.

◆ nrf_vdma_job_fill()

__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
[out]p_jobPointer to the structure of the job to be filled.
[in]p_bufferJob buffer.
[in]sizeSize of the job buffer.
[in]attributesAttributes of the job.

◆ nrf_vdma_job_link()

__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
[out]p_jobPointer to the structure of the job to become link.
[in]p_job_linkedPointer to the structure of the job to be linked.

◆ nrf_vdma_job_reduced_fill()

__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
[out]p_jobPointer to the reduced structure of the job to be filled.
[in]p_bufferJob buffer.

◆ nrf_vdma_job_reduced_init()

__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
[out]p_jobPointer to the reduced structure of the job to be filled.
[in]p_bufferJob buffer.
[in]sizeSize of the job buffer.
[in]attributesAdditional attribute of the job.

◆ nrf_vdma_job_size_get()

__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
[in]p_jobPointer to the structure of the specified job.
Returns
Size of the job buffer.

◆ nrf_vdma_job_terminate()

__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
[out]p_jobPointer to the structure of the job to be terminated.

Documentation feedback | Developer Zone | Subscribe | Updated