MVDMA HAL

group nrf_mvdma_hal

Hardware access layer for managing the Memory-to-Memory Vector DMA (MVDMA) peripheral.

Defines

NRF_MVDMA_HAS_NEW_VER

Symbol indicating whether MVDMA uses new or old version.

NRF_MVDMA_HAS_AXIMODE

Symbol indicating whether AXIMODE configuration is present.

NRF_MVDMA_HAS_MULTIMODE

Macro for checking if multi-mode operation is available.

Enums

enum nrf_mvdma_task_t

MVDMA tasks.

Values:

enumerator NRF_MVDMA_TASK_PAUSE

Pause DMA transaction at next idle stage on memory bus.

enumerator NRF_MVDMA_TASK_RESET

Return all registers to default state and FSMs to IDLE.

enumerator NRF_MVDMA_TASK_START0

Start or continue processing of descriptor list 0.

enumerator NRF_MVDMA_TASK_START1

Start or continue processing of descriptor list 1.

enumerator NRF_MVDMA_TASK_START2

Start or continue processing of descriptor list 2.

enumerator NRF_MVDMA_TASK_START3

Start or continue processing of descriptor list 3.

enumerator NRF_MVDMA_TASK_START4

Start or continue processing of descriptor list 4.

enumerator NRF_MVDMA_TASK_START5

Start or continue processing of descriptor list 5.

enumerator NRF_MVDMA_TASK_START6

Start or continue processing of descriptor list 6.

enumerator NRF_MVDMA_TASK_START7

Start or continue processing of descriptor list 7.

enum nrf_mvdma_event_t

MVDMA events.

Values:

enumerator NRF_MVDMA_EVENT_END

Sink data descriptor list has been completed.

enumerator NRF_MVDMA_EVENT_STARTED

Data descriptor list processing has been started.

enumerator NRF_MVDMA_EVENT_PAUSED

Data transfer has been paused.

enumerator NRF_MVDMA_EVENT_RESET

MVDMA has been reset.

enumerator NRF_MVDMA_EVENT_SOURCEBUSERROR

Bus error has been received on the source channel.

enumerator NRF_MVDMA_EVENT_SOURCESELECTJOBDONE

Job on the source channel with event enable attribute bit active has been processed.

enumerator NRF_MVDMA_EVENT_SINKBUSERROR

Bus error has been received on the sink channel.

enumerator NRF_MVDMA_EVENT_SINKSELECTJOBDONE

Job on the sink channel with event enable attribute bit active has been processed.

enum nrf_mvdma_int_mask_t

MVDMA interrupts.

Values:

enumerator NRF_MVDMA_INT_END_MASK

Interrupt on END event.

enumerator NRF_MVDMA_INT_STARTED_MASK

Interrupt on STARTED event.

enumerator NRF_MVDMA_INT_PAUSED_MASK

Interrupt on PAUSED event.

enumerator NRF_MVDMA_INT_RESET_MASK

Interrupt on RESET event.

enumerator NRF_MVDMA_INT_SOURCEBUSERROR_MASK

Interrupt on SOURCEBUSERROR event.

enumerator NRF_MVDMA_INT_SINKBUSERROR_MASK

Interrupt on SINKBUSERROR event.

enumerator NRF_MVDMA_INT_SOURCESELECTJOBDONE_MASK

Interrupt on SOURCESELECTJOBDONE event.

enumerator NRF_MVDMA_INT_SINKSELECTJOBDONE_MASK

Interrupt on SINKSELECTJOBDONE event.

enum nrf_mvdma_mode_t

MVDMA modes of operation.

Values:

enumerator NRF_MVDMA_MODE_SINGLE

Descriptor list pointers are stored in SOURCELISTPTR and SINKLISTPTR registers.

enumerator NRF_MVDMA_MODE_MULTI

Descriptor list pointers are stored in a list in the memory.

enum nrf_mvdma_aximode_t

MVDMA AXI modes.

Values:

enumerator NRF_MVDMA_AXIMODE_AXI

AXI burst transactions may be longer than one beat.

enumerator NRF_MVDMA_AXIMODE_AXILITE

All AXI transactions are one-beat accesses.

enum nrf_mvdma_fifo_status_t

MVDMA FIFO status.

Values:

enumerator NRF_MVDMA_FIFO_STATUS_EMPTY

No data in intermediate FIFO.

enumerator NRF_MVDMA_FIFO_STATUS_NOT_EMPTY

Intermediate FIFO contains data.

enumerator NRF_MVDMA_FIFO_STATUS_FULL

Intermediate FIFO is full.

enum nrf_mvdma_source_error_t

MVDMA data source errors.

Values:

enumerator NRF_MVDMA_SOURCE_ERROR_NONE

No error.

enumerator NRF_MVDMA_SOURCE_ERROR_READ

Error related to memory when reading joblist or memory/register when reading data.

enumerator NRF_MVDMA_SOURCE_ERROR_READ_DECODE

Error related to the joblist address or address when reading memory/register.

enum nrf_mvdma_sink_error_t

MVDMA data sink errors.

Values:

enumerator NRF_MVDMA_SINK_ERROR_NONE

No error.

enumerator NRF_MVDMA_SINK_ERROR_READ

Error related to memory when reading joblist.

enumerator NRF_MVDMA_SINK_ERROR_WRITE

Error related to memory/register when writing data.

enumerator NRF_MVDMA_SINK_ERROR_DECODE_READ

Error related to the joblist address when reading joblist.

enumerator NRF_MVDMA_SINK_ERROR_DECODE_WRITE

Error related to the memory/register address when writing data.

Functions

NRF_STATIC_INLINE void nrf_mvdma_task_trigger(NRF_MVDMA_Type *p_reg, nrf_mvdma_task_t task)

Function for activating the specified MVDMA task.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • task[in] Task to be activated.

NRF_STATIC_INLINE uint32_t nrf_mvdma_task_address_get(NRF_MVDMA_Type const *p_reg, nrf_mvdma_task_t task)

Function for getting the address of the specified MVDMA task register.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • task[in] Specified task.

Returns:

Address of the specified task register.

NRF_STATIC_INLINE nrf_mvdma_task_t nrf_mvdma_start_task_get(NRF_MVDMA_Type const *p_reg, uint8_t index)

Function for getting START task by its index.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • index[in] Index of the START task.

Returns:

START task.

NRF_STATIC_INLINE void nrf_mvdma_event_clear(NRF_MVDMA_Type *p_reg, nrf_mvdma_event_t event)

Function for clearing the specified MVDMA event.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] Event to clear.

NRF_STATIC_INLINE bool nrf_mvdma_event_check(NRF_MVDMA_Type const *p_reg, nrf_mvdma_event_t event)

Function for retrieving the state of the MVDMA event.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] Event to be checked.

Return values:
  • true – The event has been generated.

  • false – The event has not been generated.

NRF_STATIC_INLINE uint32_t nrf_mvdma_event_address_get(NRF_MVDMA_Type const *p_reg, nrf_mvdma_event_t event)

Function for getting the address of the specified MVDMA event register.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] Specified event.

Returns:

Address of the specified event register.

NRF_STATIC_INLINE void nrf_mvdma_int_enable(NRF_MVDMA_Type *p_reg, uint32_t mask)

Function for enabling specified interrupts.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] Mask of interrupts to be enabled. Use nrf_mvdma_int_mask_t values for bit masking.

NRF_STATIC_INLINE void nrf_mvdma_int_disable(NRF_MVDMA_Type *p_reg, uint32_t mask)

Function for disabling specified interrupts.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] Mask of interrupts to be disabled. Use nrf_mvdma_int_mask_t values for bit masking.

NRF_STATIC_INLINE uint32_t nrf_mvdma_int_enable_check(NRF_MVDMA_Type const *p_reg, uint32_t mask)

Function for checking if the specified interrupts are enabled.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] Mask of interrupts to be checked. Use nrf_mvdma_int_mask_t values for bit masking.

Returns:

Mask of enabled interrupts.

NRF_STATIC_INLINE uint32_t nrf_mvdma_int_pending_get(NRF_MVDMA_Type const *p_reg)

Function for retrieving the state of pending interrupts.

Note

States of pending interrupt are saved as a bitmask. One set at particular position means that interrupt for event is pending.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

Bitmask with information about pending interrupts. Use nrf_mvdma_int_mask_t values for bit masking.

NRF_STATIC_INLINE void nrf_mvdma_subscribe_set(NRF_MVDMA_Type *p_reg, nrf_mvdma_task_t task, uint8_t channel)

Function for setting the subscribe configuration for a given MVDMA task.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • task[in] Task for which to set the configuration.

  • channel[in] Channel through which to subscribe events.

NRF_STATIC_INLINE void nrf_mvdma_subscribe_clear(NRF_MVDMA_Type *p_reg, nrf_mvdma_task_t task)

Function for clearing the subscribe configuration for a given MVDMA task.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • task[in] Task for which to clear the configuration.

NRF_STATIC_INLINE void nrf_mvdma_publish_set(NRF_MVDMA_Type *p_reg, nrf_mvdma_event_t event, uint8_t channel)

Function for setting the publish configuration for a given MVDMA event.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] Event for which to set the configuration.

  • channel[in] Channel through which to publish the event.

NRF_STATIC_INLINE void nrf_mvdma_publish_clear(NRF_MVDMA_Type *p_reg, nrf_mvdma_event_t event)

Function for clearing the publish configuration for a given MVDMA event.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • event[in] Event for which to clear the configuration.

NRF_STATIC_INLINE void nrf_mvdma_mode_set(NRF_MVDMA_Type *p_reg, nrf_mvdma_mode_t mode)

Function for setting the MVDMA mode.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mode[in] Desired operating mode for MVDMA.

NRF_STATIC_INLINE void nrf_mvdma_aximode_set(NRF_MVDMA_Type *p_reg, nrf_mvdma_aximode_t aximode)

Function for setting the AXI mode.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • aximode[in] Desired AXI mode for MVDMA.

NRF_STATIC_INLINE void nrf_mvdma_source_list_ptr_set(NRF_MVDMA_Type *p_reg, nrf_vdma_job_t const *p_job)

Function for setting the pointer to the source descriptor list or pointer to the list of descriptor list pointers, depending on configured nrf_mvdma_mode_t mode.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • p_job[in] Pointer to a job list.

NRF_STATIC_INLINE nrf_vdma_job_t *nrf_mvdma_source_list_ptr_get(NRF_MVDMA_Type const *p_reg)

Function for getting the pointer to the source descriptor list or pointer to the list of descriptor list pointers, depending on configured nrf_mvdma_mode_t mode.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

Pointer to a job list.

NRF_STATIC_INLINE void nrf_mvdma_sink_list_ptr_set(NRF_MVDMA_Type *p_reg, nrf_vdma_job_t const *p_job)

Function for getting the pointer to the sink descriptor list or pointer to the list of descriptor list pointers, depending on configured nrf_mvdma_mode_t mode.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • p_job[in] Pointer to a job list.

NRF_STATIC_INLINE nrf_vdma_job_t *nrf_mvdma_sink_list_ptr_get(NRF_MVDMA_Type const *p_reg)

Function for getting the pointer to the sink descriptor list or pointer to the list of descriptor list pointers, depending on configured nrf_mvdma_mode_t mode.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

Pointer to a job list.

NRF_STATIC_INLINE uint32_t nrf_mvdma_crc_result_get(NRF_MVDMA_Type const *p_reg)

Function for getting the result of CRC checksum calculation.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

Result of CRC checksum calculation.

NRF_STATIC_INLINE nrf_mvdma_fifo_status_t nrf_mvdma_fifo_status_get(NRF_MVDMA_Type const *p_reg)

Function for getting the status of intermediate FIFO.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

Intermediate FIFO status.

NRF_STATIC_INLINE bool nrf_mvdma_activity_check(NRF_MVDMA_Type const *p_reg)

Function for checking the MVDMA activity.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Return values:
  • true – MVDMA is processing data.

  • false – MVDMA is idle.

NRF_STATIC_INLINE nrf_mvdma_source_error_t nrf_mvdma_source_error_get(NRF_MVDMA_Type const *p_reg)

Function for getting the bus error of MVDMA data source.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

Bus error of data source.

NRF_STATIC_INLINE nrf_mvdma_sink_error_t nrf_mvdma_sink_error_get(NRF_MVDMA_Type const *p_reg)

Function for getting the bus error of MVDMA data source.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

Bus error of data sink.

NRF_STATIC_INLINE uint32_t nrf_mvdma_last_source_address_get(NRF_MVDMA_Type const *p_reg)

Function for getting the latest address being accessed on the source AXI channel.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

Latest address being accessed on the source AXI channel.

NRF_STATIC_INLINE uint32_t nrf_mvdma_last_sink_address_get(NRF_MVDMA_Type const *p_reg)

Function for getting the latest address being accessed on the sink AXI channel.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

Latest address being accessed on the sink AXI channel.

NRF_STATIC_INLINE uint32_t nrf_mvdma_source_job_count_get(NRF_MVDMA_Type const *p_reg)

Function for getting the number of completed jobs in the current source descriptor list.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

Number of completed jobs in the current source descriptor list.

NRF_STATIC_INLINE uint32_t nrf_mvdma_sink_job_count_get(NRF_MVDMA_Type const *p_reg)

Function for getting the number of completed jobs in the current sink descriptor list.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Returns:

Number of completed jobs in the current sink descriptor list.