DW (Datawire)

group group_hal_impl_dma_dw

Implementation specific interface for using the Datawire DMA peripheral.

Functions

cy_rslt_t _cyhal_dma_dw_init(cyhal_dma_t *obj, cyhal_source_t *src, cyhal_dest_t *dest, uint8_t priority)

Initialize the Datawire peripheral.

Return

The status of the init request

Parameters
  • [out] obj: The DMA object to initialize

  • [in] src: An optional, input signal to connect to.

  • [in] dest: An optional, output target to drive.

  • [in] priority: The priority of this DMA operation relative to others. Values must be between 0-3 with 0 being the highest priority.

void _cyhal_dma_dw_free(cyhal_dma_t *obj)

Frees the Datawire specific DMA object.

This expects that common resources will be freed by caller.

Parameters
  • [inout] obj: The DMA object

cy_rslt_t _cyhal_dma_dw_configure(cyhal_dma_t *obj, const cyhal_dma_cfg_t *cfg)

Setup a Datawire descriptor for the dma resource.

Return

The status of the configure request

Parameters
  • [in] obj: The DMA object

  • [in] cfg: Configuration prameters for the transfer

cy_rslt_t _cyhal_dma_dw_start_transfer(cyhal_dma_t *obj)

Start a Datawire transfer.

Initiates DMA channel transfer for specified DMA object

Return

The status of the start_transfer request

Parameters
  • [in] obj: The DMA object

void _cyhal_dma_dw_enable_event(cyhal_dma_t *obj, cyhal_dma_event_t event, uint8_t intr_priority, bool enable)

Configure Datawire event enablement.

Parameters
  • [in] obj: The DMA object

  • [in] event: The DMA event type

  • [in] intr_priority: The priority for NVIC interrupt events. The priority from the most recent call will take precedence, i.e all events will have the same priority.

  • [in] enable: True to turn on interrupts, False to turn off

bool _cyhal_dma_dw_is_busy(cyhal_dma_t *obj)

Checks whether a transfer is pending or running on the DMA channel.

Return

True if DMA channel is busy

Parameters
  • [in] obj: The DMA object

cy_rslt_t _cyhal_dma_dw_connect_digital(cyhal_dma_t *obj, cyhal_source_t source, cyhal_dma_input_t input)

Connects a source signal and enables the specified input to the DMA channel.

Return

The status of the connection

Parameters
  • [in] obj: The DMA object

  • [in] source: Source signal obtained from another driver’s cyhal_<PERIPH>_enable_output

  • [in] input: Which input to enable

cy_rslt_t _cyhal_dma_dw_enable_output(cyhal_dma_t *obj, cyhal_dma_output_t output, cyhal_source_t *source)

Enables the specified output signal from a DMA channel that is triggered when a transfer is completed.

Return

The status of the output enable

Parameters
  • [in] obj: The DMA object

  • [in] output: Which event triggers the output

  • [out] source: Pointer to user-allocated source signal object which will be initialized by enable_output. source should be passed to (dis)connect_digital functions to (dis)connect the associated endpoints.

cy_rslt_t _cyhal_dma_dw_disconnect_digital(cyhal_dma_t *obj, cyhal_source_t source, cyhal_dma_input_t input)

Disconnects a source signal and disables the specified input to the DMA channel.

Return

The status of the disconnect

Parameters
  • [in] obj: The DMA object

  • [in] source: Source signal from cyhal_<PERIPH>_enable_output to disable

  • [in] input: Which input to disable

cy_rslt_t _cyhal_dma_dw_disable_output(cyhal_dma_t *obj, cyhal_dma_output_t output)

Disables the specified output signal from a DMA channel.

Return

The status of the disablement

Parameters
  • [in] obj: The DMA object

  • [in] output: Which output to disable