Data Structures

group group_dmac_data_structures
struct cy_stc_dmac_descriptor_t
#include <cy_dmac.h>

DMAC descriptor structure type.

It is a user-declared structure allocated in RAM. The DMAC HW requires a pointer to this structure to work with it.

For advanced users: the descriptor can be allocated even in flash, however the user have to predefine all the structure items with constants manually, because the descriptor “Set” API functions (including Cy_DMAC_Descriptor_Init()) don’t work with read-only descriptors.

Public Members

uint32_t ctl

0x00000000 Descriptor control

uint32_t src

0x00000004 Descriptor source

uint32_t dst

0x00000008 Descriptor destination

uint32_t xSize

0x0000000C Descriptor X loop size

uint32_t xIncr

0x00000010 Descriptor X loop increment

uint32_t ySize

0x00000014 Descriptor Y loop size

uint32_t yIncr

0x00000010 Descriptor Y loop increment

uint32_t nextPtr

0x00000014 Descriptor next pointer

struct cy_stc_dmac_descriptor_config_t
#include <cy_dmac.h>

This structure is a configuration structure pre-initialized by user and passed as a parameter to the Cy_DMAC_Descriptor_Init().

It can be allocated in RAM/flash (on user’s choice). In case of flash allocation there is a possibility to reinitialize the descriptor in runtime. This structure has all the parameters of the descriptor as separate parameters. Most of these parameters are represented in the cy_stc_dmac_descriptor_t structure as bit fields.

Public Members

cy_en_dmac_retrigger_t retrigger

Specifies whether the DMA controller should wait for the input trigger to be deactivated.

cy_en_dmac_trigger_type_t interruptType

Sets the event that triggers an interrupt.

See cy_en_dmac_trigger_type_t.

cy_en_dmac_trigger_type_t triggerOutType

Sets the event that triggers an output.

See cy_en_dmac_trigger_type_t.

cy_en_dmac_channel_state_t channelState

Specifies whether the channel is enabled or disabled on completion of descriptor see cy_en_dmac_channel_state_t.

cy_en_dmac_trigger_type_t triggerInType

Sets what type of transfer is triggered.

See cy_en_dmac_trigger_type_t.

bool dataPrefetch

Source data transfers are initiated as soon as the channel is enabled, the current descriptor pointer is NOT “0” and there is space available in the channel’s data FIFO.

cy_en_dmac_data_size_t dataSize

The size of the data bus for transfer.

See cy_en_dmac_data_size_t. For memory copy and scatter descriptors this setting will be ignored.

cy_en_dmac_transfer_size_t srcTransferSize

The source transfer size.

For memory copy and scatter descriptors this setting will be ignored.

cy_en_dmac_transfer_size_t dstTransferSize

The destination transfer size.

For memory copy and scatter descriptors this setting will be ignored.

cy_en_dmac_descriptor_type_t descriptorType

The type of the descriptor.

See cy_en_dmac_descriptor_type_t.

void *srcAddress

The source address of the transfer.

void *dstAddress

The destination address of the transfer.

int32_t srcXincrement

The address increment of the source after each X-loop transfer.

Valid range is -32768…32767.

int32_t dstXincrement

The address increment of the destination after each X-loop transfer.

Valid range is -32768…32767.

uint32_t xCount

The number of transfers in an X-loop.

Valid range (for all descriptors except scatter transfer) is 1…65536. For memory copy descriptors, the X count is a nubmer of bytes (not a data transfer size). For scatter descriptors, the X count is a nubmer of [address, data] pairs (two words each). Valid range is 1…32768.

int32_t srcYincrement

The address increment of the source after each Y-loop transfer.

Valid range is -32768…32767.

int32_t dstYincrement

The address increment of the destination after each Y-loop transfer.

Valid range is -32768…32767.

uint32_t yCount

The number of X-loops in the Y-loop.

Valid range is 1…65536.

cy_stc_dmac_descriptor_t *nextDescriptor

The next descriptor to chain after completion.

A NULL value will signify no chaining.

struct cy_stc_dmac_channel_config_t
#include <cy_dmac.h>

This structure holds the initialization values for the DMAC channel.

Public Members

cy_stc_dmac_descriptor_t *descriptor

The DMAC descriptor associated with the channel being initialized.

uint32_t priority

This parameter specifies the channel’s priority.

bool enable

This parameter specifies if the channel is enabled after initializing.

bool bufferable

This parameter specifies whether a write transaction can complete.

without waiting for the destination to accept the write transaction data.