Configures the DMA Controller block, channels and descriptors. More...
Modules | |
Macros | |
Interrupt Masks | |
Functions | |
Data Structures | |
Enumerated Types | |
Configures the DMA Controller block, channels and descriptors.
The functions and other declarations used in this driver are in cy_dmac.h. You can include cy_pdl.h to get access to all functions and declarations in the PDL.
The DMA Controller channel is used in any project to transfer data without CPU intervention basing on a hardware trigger signal from another component.
The DMA Controller block has a set of registers, a base hardware address, and supports multiple channels with ping and pong descriptors. Many API functions for the DMAC driver require a base hardware address, channel number and descriptor. Ensure that you use the correct hardware address for the DMA Controller block in use.
Features:
To set up a DMAC driver, initialize and validate a descriptor and channel, then enable the DMAC block.
To set up a descriptor, provide the configuration parameters for the descriptor in the cy_stc_dmac_descriptor_config_t structure. Then call the Cy_DMAC_Descriptor_Init function to initialize the descriptor. You can modify the source and destination addresses dynamically by calling Cy_DMAC_Descriptor_SetSrcAddress and Cy_DMAC_Descriptor_SetDstAddress.
To set up a DMAC channel, provide a filled cy_stc_dmac_channel_config_t structure. Call the Cy_DMAC_Channel_Init function, specifying the channel number. Use Cy_DMAC_Channel_Enable to enable the configured DMAC channel.
Call Cy_DMAC_Channel_Enable for each DMAC channel in use.
When configured, another peripheral typically triggers the DMAC channel. The trigger is connected to the DMAC channel using the trigger multiplexer. The trigger multiplexer driver has a software trigger you can use in firmware to trigger the DMAC channel. See the Trigger Multiplexer documentation.
The following is a simplified structure of the DMAC driver API interdependencies in a typical user application:
NOTE: Even if a DMAC channel is enabled and the descriptor is validated, the channel is not operational until the DMAC block is enabled using function Cy_DMAC_Enable.
NOTE: If the DMAC descriptor is configured to generate an interrupt, the interrupt must be enabled using the Cy_DMAC_SetInterruptMask function for each DMAC channel.
For example:
The DMA controller provides the Active/Sleep functionality and is not available in Deep-Sleep power mode. Before transition to Deep-Sleep, handle pending interrupts and triggers for channels because they will be cleared on transition or wait for completion using the Cy_DMAC_GetActiveChannel function.
Refer to the SysPm (System Power Management) driver for more information about low-power mode transitions.
See the DMAC chapter of the device technical reference manual (TRM).
Version | Changes | Reason for Change |
---|---|---|
1.20 | Interface update for Cy_DMAC_Descriptor_SetSrcAddress() and Cy_DMAC_Descriptor_SetDstAddress(), parameter update for cy_stc_dmac_descriptor_config_t. | MISRA violation fix. |
1.10.1 | Update the paths to the code snippets. | PDL structure update. |
1.10 | Fixed the Cy_DMAC_Descriptor_SetState() function to properly clear status register. | Defect fix. |
1.0.1 | Corrected source code comments text. | |
1.0 | The initial version. |