cy_dma_8h¶
The header file of the DMA driver.
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
- Version
2.40
- Copyright
Copyright 2016-2020 Cypress Semiconductor Corporation SPDX-License-Identifier: Apache-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Defines
-
CY_DMA_DRV_VERSION_MAJOR
¶ The driver major version.
-
CY_DMA_DRV_VERSION_MINOR
¶ The driver minor version.
-
CY_DMA_ID
¶ The DMA driver identifier.
-
CY_DMA_INTR_MASK
¶ The DMA channel interrupt mask.
-
CY_DMA_LOOP_COUNT_MIN
¶ The minimum X/Y Count API parameters.
-
CY_DMA_LOOP_COUNT_MAX
¶ The maximum X/Y Count API parameters.
-
CY_DMA_LOOP_INCREMENT_MIN
¶ The minimum X/Y Increment API parameters.
-
CY_DMA_LOOP_INCREMENT_MAX
¶ The maximum X/Y Increment API parameters.
-
CY_DMA_BWC
¶ The backward compatibility flag.
Enables a group of macros which provide the backward compatibility with most of the DMA driver version 1.0 interface.
Enums
-
enum
cy_en_dma_intr_cause_t
¶ cy_en_dma_intr_cause_t: Contains the possible interrupt cause values.
Values:
-
enumerator
CY_DMA_INTR_CAUSE_NO_INTR
¶ No interrupt.
-
enumerator
CY_DMA_INTR_CAUSE_COMPLETION
¶ Completion.
-
enumerator
CY_DMA_INTR_CAUSE_SRC_BUS_ERROR
¶ Source bus error.
-
enumerator
CY_DMA_INTR_CAUSE_DST_BUS_ERROR
¶ Destination bus error.
-
enumerator
CY_DMA_INTR_CAUSE_SRC_MISAL
¶ Source address is not aligned.
-
enumerator
CY_DMA_INTR_CAUSE_DST_MISAL
¶ Destination address is not aligned.
-
enumerator
CY_DMA_INTR_CAUSE_CURR_PTR_NULL
¶ Current descriptor pointer is NULL.
-
enumerator
CY_DMA_INTR_CAUSE_ACTIVE_CH_DISABLED
¶ Active channel is disabled.
-
enumerator
CY_DMA_INTR_CAUSE_DESCR_BUS_ERROR
¶ Descriptor bus error.
-
enumerator
-
enum
cy_en_dma_descriptor_type_t
¶ cy_en_dma_descriptor_type_t: Contains the options for the descriptor type.
Values:
-
enumerator
CY_DMA_SINGLE_TRANSFER
¶ Single transfer.
-
enumerator
CY_DMA_1D_TRANSFER
¶ 1D transfer.
-
enumerator
CY_DMA_2D_TRANSFER
¶ 2D transfer.
-
enumerator
CY_DMA_CRC_TRANSFER
¶ CRC transfer.
Supported by the CPUSS_ver2 only.
-
enumerator
-
enum
cy_en_dma_trigger_type_t
¶ cy_en_dma_trigger_type_t: Contains the options for the interrupt, trig-in and trig-out type parameters of the descriptor.
Values:
-
enumerator
CY_DMA_1ELEMENT
¶ One element transfer.
-
enumerator
CY_DMA_X_LOOP
¶ One X loop transfer.
-
enumerator
CY_DMA_DESCR
¶ One descriptor transfer.
-
enumerator
CY_DMA_DESCR_CHAIN
¶ Entire descriptor chain transfer.
-
enumerator
-
enum
cy_en_dma_data_size_t
¶ cy_en_dma_data_size_t: Contains the options for the data size.
Values:
-
enumerator
CY_DMA_BYTE
¶ One byte.
-
enumerator
CY_DMA_HALFWORD
¶ Half word (two bytes).
-
enumerator
CY_DMA_WORD
¶ Full word (four bytes).
-
enumerator
-
enum
cy_en_dma_retrigger_t
¶ cy_en_dma_retrigger_t: Contains the options for descriptor retriggering.
Values:
-
enumerator
CY_DMA_RETRIG_IM
¶ Retrigger immediately.
-
enumerator
CY_DMA_RETRIG_4CYC
¶ Retrigger after 4 Clk_Slow cycles.
-
enumerator
CY_DMA_RETRIG_16CYC
¶ Retrigger after 16 Clk_Slow cycles.
-
enumerator
CY_DMA_WAIT_FOR_REACT
¶ Wait for trigger reactivation.
-
enumerator
-
enum
cy_en_dma_transfer_size_t
¶ cy_en_dma_transfer_size_t: Contains the options for the transfer size.
Values:
-
enumerator
CY_DMA_TRANSFER_SIZE_DATA
¶ As specified by dataSize.
-
enumerator
CY_DMA_TRANSFER_SIZE_WORD
¶ A full word (four bytes).
-
enumerator
Functions
-
__STATIC_INLINE void Cy_DMA_Enable (DW_Type *base)
Enables the DMA block.
- Function Usage
/* Scenario: Initialize a 1D descriptor */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor; cy_stc_dma_descriptor_t nextDescriptor; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; cy_stc_dma_descriptor_config_t descriptor_cfg = { .retrigger = CY_DMA_RETRIG_IM, .interruptType = CY_DMA_DESCR, .triggerOutType = CY_DMA_DESCR, .channelState = CY_DMA_CHANNEL_ENABLED, .triggerInType = CY_DMA_DESCR, .dataSize = CY_DMA_WORD, .srcTransferSize = CY_DMA_TRANSFER_SIZE_WORD, .dstTransferSize = CY_DMA_TRANSFER_SIZE_WORD, .descriptorType = CY_DMA_1D_TRANSFER, .srcAddress = &src, .dstAddress = &dst, .srcXincrement = 1U, .dstXincrement = 1U, .xCount = DATACNT, .srcYincrement = 0U, .dstYincrement = 0U, .yCount = 1UL, .nextDescriptor = &nextDescriptor, }; if (CY_DMA_SUCCESS != Cy_DMA_Descriptor_Init(&descriptor, &descriptor_cfg)) { /* Insert error handling */ } /* Scenario: Setup and enable the DMA channel 0 of block DW0 */ cy_stc_dma_channel_config_t channelConfig; channelConfig.preemptable = false; channelConfig.enable = false; channelConfig.bufferable = false; if (CY_DMA_SUCCESS != Cy_DMA_Channel_Init(DW0, 0UL, &channelConfig)) { /* Insert error handling */ } Cy_DMA_Channel_SetDescriptor(DW0, 0UL, &descriptor); Cy_DMA_Channel_SetPriority(DW0, 0UL, 3UL); Cy_DMA_Channel_Enable(DW0, 0UL); Cy_DMA_Enable(DW0);
- Parameters
base – The pointer to the hardware DMA block.
-
__STATIC_INLINE void Cy_DMA_Disable (DW_Type *base)
Disables the DMA block.
- Function Usage
/* Scenario: Disable the DMA channel 0 of block DW0 if it's priority equals 3 */ if (3UL == Cy_DMA_Channel_GetPriority(DW0, 0UL)) { if (0UL != Cy_DMA_GetActiveChannel(DW0)) { Cy_DMA_Channel_Disable(DW0, 0UL); Cy_DMA_Channel_DeInit(DW0, 0UL); /* if needed (if there is only channel used) the whole block can be disabled */ Cy_DMA_Disable(DW0); } }
- Parameters
base – The pointer to the hardware DMA block.
-
__STATIC_INLINE uint32_t Cy_DMA_GetActiveChannel (DW_Type const *base)
Returns the status of the active/pending channels.
the DMA block.
- Function Usage
/* Scenario: Disable the DMA channel 0 of block DW0 if it's priority equals 3 */ if (3UL == Cy_DMA_Channel_GetPriority(DW0, 0UL)) { if (0UL != Cy_DMA_GetActiveChannel(DW0)) { Cy_DMA_Channel_Disable(DW0, 0UL); Cy_DMA_Channel_DeInit(DW0, 0UL); /* if needed (if there is only channel used) the whole block can be disabled */ Cy_DMA_Disable(DW0); } }
- Parameters
base – The pointer to the hardware DMA block.
- Returns
Returns a bit-field with all of the currently active/pending channels in the DMA block.
-
__STATIC_INLINE void * Cy_DMA_GetActiveSrcAddress (DW_Type const *base)
Returns the source address being used for the current transfer.
- Function Usage
/* Scenario: Make sure the array is not in use before modifying the array */ uint32_t array[16]; if (((void*) array != Cy_DMA_GetActiveSrcAddress(DW0)) && ((void*) array != Cy_DMA_GetActiveDstAddress(DW0))) { /* Modify the array content here */ }
- Parameters
base – The pointer to the hardware DMA block.
- Returns
Returns the pointer to the source of transfer.
-
__STATIC_INLINE void * Cy_DMA_GetActiveDstAddress (DW_Type const *base)
Returns the destination address being used for the current transfer.
- Function Usage
/* Scenario: Make sure the array is not in use before modifying the array */ uint32_t array[16]; if (((void*) array != Cy_DMA_GetActiveSrcAddress(DW0)) && ((void*) array != Cy_DMA_GetActiveDstAddress(DW0))) { /* Modify the array content here */ }
- Parameters
base – The pointer to the hardware DMA block.
- Returns
Returns the pointer to the destination of transfer.
-
cy_en_dma_status_t
Cy_DMA_Crc_Init
(DW_Type *base, cy_stc_dma_crc_config_t const *crcConfig) Initializes the DMA CRC functionality.
- Function Usage
/* Scenario: Setup the CRC for DMA block DW0 */ cy_stc_dma_crc_config_t crcConfig = { .dataReverse = false, .dataXor = 0x00000000UL, .polynomial = 0x04C11DB7UL, .reminderReverse = false, .reminderXor = 0x00000000UL, .lfsrInitVal = 0xFFFFFFFFUL }; if (CY_DMA_SUCCESS != Cy_DMA_Crc_Init(DW0, &crcConfig)) { /* Insert error handling */ }
- Parameters
base – The pointer to the hardware DMA block.
crcConfig – The pointer to the CRC configuration structure cy_stc_dma_crc_config_t.
- Returns
The status /ref cy_en_dma_status_t.
-
cy_en_dma_status_t
Cy_DMA_Channel_Init
(DW_Type *base, uint32_t channel, cy_stc_dma_channel_config_t const *channelConfig) Initializes the DMA channel with a descriptor and other parameters.
- Function Usage
/* Scenario: Initialize a 1D descriptor */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor; cy_stc_dma_descriptor_t nextDescriptor; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; cy_stc_dma_descriptor_config_t descriptor_cfg = { .retrigger = CY_DMA_RETRIG_IM, .interruptType = CY_DMA_DESCR, .triggerOutType = CY_DMA_DESCR, .channelState = CY_DMA_CHANNEL_ENABLED, .triggerInType = CY_DMA_DESCR, .dataSize = CY_DMA_WORD, .srcTransferSize = CY_DMA_TRANSFER_SIZE_WORD, .dstTransferSize = CY_DMA_TRANSFER_SIZE_WORD, .descriptorType = CY_DMA_1D_TRANSFER, .srcAddress = &src, .dstAddress = &dst, .srcXincrement = 1U, .dstXincrement = 1U, .xCount = DATACNT, .srcYincrement = 0U, .dstYincrement = 0U, .yCount = 1UL, .nextDescriptor = &nextDescriptor, }; if (CY_DMA_SUCCESS != Cy_DMA_Descriptor_Init(&descriptor, &descriptor_cfg)) { /* Insert error handling */ } /* Scenario: Setup and enable the DMA channel 0 of block DW0 */ cy_stc_dma_channel_config_t channelConfig; channelConfig.preemptable = false; channelConfig.enable = false; channelConfig.bufferable = false; if (CY_DMA_SUCCESS != Cy_DMA_Channel_Init(DW0, 0UL, &channelConfig)) { /* Insert error handling */ } Cy_DMA_Channel_SetDescriptor(DW0, 0UL, &descriptor); Cy_DMA_Channel_SetPriority(DW0, 0UL, 3UL); Cy_DMA_Channel_Enable(DW0, 0UL); Cy_DMA_Enable(DW0);
- Parameters
base – The pointer to the hardware DMA block.
channel – A channel number.
channelConfig – The structure that has the initialization information for the channel.
- Returns
The status /ref cy_en_dma_status_t.
-
void
Cy_DMA_Channel_DeInit
(DW_Type *base, uint32_t channel) Clears the content of registers corresponding to the channel.
- Function Usage
/* Scenario: Disable the DMA channel 0 of block DW0 if it's priority equals 3 */ if (3UL == Cy_DMA_Channel_GetPriority(DW0, 0UL)) { if (0UL != Cy_DMA_GetActiveChannel(DW0)) { Cy_DMA_Channel_Disable(DW0, 0UL); Cy_DMA_Channel_DeInit(DW0, 0UL); /* if needed (if there is only channel used) the whole block can be disabled */ Cy_DMA_Disable(DW0); } }
- Parameters
base – The pointer to the hardware DMA block.
channel – A channel number.
-
__STATIC_INLINE void Cy_DMA_Channel_SetDescriptor (DW_Type *base, uint32_t channel, cy_stc_dma_descriptor_t const *descriptor)
Sets a descriptor as current for the specified DMA channel.
- Function Usage
/* Scenario: Initialize a 1D descriptor */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor; cy_stc_dma_descriptor_t nextDescriptor; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; cy_stc_dma_descriptor_config_t descriptor_cfg = { .retrigger = CY_DMA_RETRIG_IM, .interruptType = CY_DMA_DESCR, .triggerOutType = CY_DMA_DESCR, .channelState = CY_DMA_CHANNEL_ENABLED, .triggerInType = CY_DMA_DESCR, .dataSize = CY_DMA_WORD, .srcTransferSize = CY_DMA_TRANSFER_SIZE_WORD, .dstTransferSize = CY_DMA_TRANSFER_SIZE_WORD, .descriptorType = CY_DMA_1D_TRANSFER, .srcAddress = &src, .dstAddress = &dst, .srcXincrement = 1U, .dstXincrement = 1U, .xCount = DATACNT, .srcYincrement = 0U, .dstYincrement = 0U, .yCount = 1UL, .nextDescriptor = &nextDescriptor, }; if (CY_DMA_SUCCESS != Cy_DMA_Descriptor_Init(&descriptor, &descriptor_cfg)) { /* Insert error handling */ } /* Scenario: Setup and enable the DMA channel 0 of block DW0 */ cy_stc_dma_channel_config_t channelConfig; channelConfig.preemptable = false; channelConfig.enable = false; channelConfig.bufferable = false; if (CY_DMA_SUCCESS != Cy_DMA_Channel_Init(DW0, 0UL, &channelConfig)) { /* Insert error handling */ } Cy_DMA_Channel_SetDescriptor(DW0, 0UL, &descriptor); Cy_DMA_Channel_SetPriority(DW0, 0UL, 3UL); Cy_DMA_Channel_Enable(DW0, 0UL); Cy_DMA_Enable(DW0);
- Parameters
base – The pointer to the hardware DMA block.
channel – The channel number.
descriptor – This is the descriptor to be associated with the channel.
-
__STATIC_INLINE void Cy_DMA_Channel_Enable (DW_Type *base, uint32_t channel)
The function is used to enable a DMA channel.
- Function Usage
/* Scenario: Initialize a 1D descriptor */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor; cy_stc_dma_descriptor_t nextDescriptor; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; cy_stc_dma_descriptor_config_t descriptor_cfg = { .retrigger = CY_DMA_RETRIG_IM, .interruptType = CY_DMA_DESCR, .triggerOutType = CY_DMA_DESCR, .channelState = CY_DMA_CHANNEL_ENABLED, .triggerInType = CY_DMA_DESCR, .dataSize = CY_DMA_WORD, .srcTransferSize = CY_DMA_TRANSFER_SIZE_WORD, .dstTransferSize = CY_DMA_TRANSFER_SIZE_WORD, .descriptorType = CY_DMA_1D_TRANSFER, .srcAddress = &src, .dstAddress = &dst, .srcXincrement = 1U, .dstXincrement = 1U, .xCount = DATACNT, .srcYincrement = 0U, .dstYincrement = 0U, .yCount = 1UL, .nextDescriptor = &nextDescriptor, }; if (CY_DMA_SUCCESS != Cy_DMA_Descriptor_Init(&descriptor, &descriptor_cfg)) { /* Insert error handling */ } /* Scenario: Setup and enable the DMA channel 0 of block DW0 */ cy_stc_dma_channel_config_t channelConfig; channelConfig.preemptable = false; channelConfig.enable = false; channelConfig.bufferable = false; if (CY_DMA_SUCCESS != Cy_DMA_Channel_Init(DW0, 0UL, &channelConfig)) { /* Insert error handling */ } Cy_DMA_Channel_SetDescriptor(DW0, 0UL, &descriptor); Cy_DMA_Channel_SetPriority(DW0, 0UL, 3UL); Cy_DMA_Channel_Enable(DW0, 0UL); Cy_DMA_Enable(DW0);
- Parameters
base – The pointer to the hardware DMA block.
channel – The channel number.
-
__STATIC_INLINE void Cy_DMA_Channel_Disable (DW_Type *base, uint32_t channel)
The function is used to disable a DMA channel.
- Function Usage
/* Scenario: Disable the DMA channel 0 of block DW0 if it's priority equals 3 */ if (3UL == Cy_DMA_Channel_GetPriority(DW0, 0UL)) { if (0UL != Cy_DMA_GetActiveChannel(DW0)) { Cy_DMA_Channel_Disable(DW0, 0UL); Cy_DMA_Channel_DeInit(DW0, 0UL); /* if needed (if there is only channel used) the whole block can be disabled */ Cy_DMA_Disable(DW0); } }
- Parameters
base – The pointer to the hardware DMA block.
channel – The channel number.
-
__STATIC_INLINE void Cy_DMA_Channel_SetPriority (DW_Type *base, uint32_t channel, uint32_t priority)
The function is used to set a priority for the DMA channel.
- Function Usage
/* Scenario: Initialize a 1D descriptor */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor; cy_stc_dma_descriptor_t nextDescriptor; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; cy_stc_dma_descriptor_config_t descriptor_cfg = { .retrigger = CY_DMA_RETRIG_IM, .interruptType = CY_DMA_DESCR, .triggerOutType = CY_DMA_DESCR, .channelState = CY_DMA_CHANNEL_ENABLED, .triggerInType = CY_DMA_DESCR, .dataSize = CY_DMA_WORD, .srcTransferSize = CY_DMA_TRANSFER_SIZE_WORD, .dstTransferSize = CY_DMA_TRANSFER_SIZE_WORD, .descriptorType = CY_DMA_1D_TRANSFER, .srcAddress = &src, .dstAddress = &dst, .srcXincrement = 1U, .dstXincrement = 1U, .xCount = DATACNT, .srcYincrement = 0U, .dstYincrement = 0U, .yCount = 1UL, .nextDescriptor = &nextDescriptor, }; if (CY_DMA_SUCCESS != Cy_DMA_Descriptor_Init(&descriptor, &descriptor_cfg)) { /* Insert error handling */ } /* Scenario: Setup and enable the DMA channel 0 of block DW0 */ cy_stc_dma_channel_config_t channelConfig; channelConfig.preemptable = false; channelConfig.enable = false; channelConfig.bufferable = false; if (CY_DMA_SUCCESS != Cy_DMA_Channel_Init(DW0, 0UL, &channelConfig)) { /* Insert error handling */ } Cy_DMA_Channel_SetDescriptor(DW0, 0UL, &descriptor); Cy_DMA_Channel_SetPriority(DW0, 0UL, 3UL); Cy_DMA_Channel_Enable(DW0, 0UL); Cy_DMA_Enable(DW0);
- Parameters
base – The pointer to the hardware DMA block.
channel – The channel number.
priority – The priority to be set for the DMA channel. The allowed values are 0,1,2,3.
-
__STATIC_INLINE uint32_t Cy_DMA_Channel_GetPriority (DW_Type const *base, uint32_t channel)
Returns the priority of the DMA channel.
- Function Usage
/* Scenario: Disable the DMA channel 0 of block DW0 if it's priority equals 3 */ if (3UL == Cy_DMA_Channel_GetPriority(DW0, 0UL)) { if (0UL != Cy_DMA_GetActiveChannel(DW0)) { Cy_DMA_Channel_Disable(DW0, 0UL); Cy_DMA_Channel_DeInit(DW0, 0UL); /* if needed (if there is only channel used) the whole block can be disabled */ Cy_DMA_Disable(DW0); } }
- Parameters
base – The pointer to the hardware DMA block.
channel – The channel number.
- Returns
The priority of the channel.
-
__STATIC_INLINE cy_en_dma_intr_cause_t Cy_DMA_Channel_GetStatus (DW_Type const *base, uint32_t channel)
Returns the interrupt reason of the specified channel.
- Function Usage
/* Scenario: Inside the interrupt service routine for block DW0 channel 0: */ if (CY_DMA_INTR_MASK == Cy_DMA_Channel_GetInterruptStatusMasked(DW0, 0UL)) { /* Get the interrupt cause */ cy_en_dma_intr_cause_t cause = Cy_DMA_Channel_GetStatus(DW0, 0UL); if (CY_DMA_INTR_CAUSE_COMPLETION != cause) { /* Insert error handling */ } /* Clear the interrupt */ Cy_DMA_Channel_ClearInterrupt(DW0, 0UL); }
- Parameters
base – The pointer to the hardware DMA block.
channel – The channel number.
- Returns
The cause cy_en_dma_intr_cause_t of the interrupt.
-
__STATIC_INLINE cy_stc_dma_descriptor_t * Cy_DMA_Channel_GetCurrentDescriptor (DW_Type const *base, uint32_t channel)
Returns the descriptor that is active in the channel.
- Function Usage
/* Scenario: Disable a descriptor */ if (&descriptor != Cy_DMA_Channel_GetCurrentDescriptor(DW0, 0UL)) /* Make sure it is not in use */ { Cy_DMA_Descriptor_DeInit(&descriptor); }
- Parameters
base – The pointer to the hardware DMA block.
channel – The channel number.
- Returns
The pointer to the descriptor associated with the channel.
-
__STATIC_INLINE uint32_t Cy_DMA_Channel_GetInterruptStatus (DW_Type const *base, uint32_t channel)
Returns the interrupt status of the specified channel.
- Function Usage
/* Scenario: Need to check the interrupt status regardless of whether it is enabled (masked) or not */ if (CY_DMA_INTR_MASK == Cy_DMA_Channel_GetInterruptStatus (DW0, 0UL)) { /* The DW0 channel 0 interrupt is pending */ }
- Parameters
base – The pointer to the hardware DMA block.
channel – The channel number.
- Returns
The status of an interrupt for the specified channel.
-
__STATIC_INLINE void Cy_DMA_Channel_ClearInterrupt (DW_Type *base, uint32_t channel)
Clears the interrupt status of the specified channel.
- Function Usage
/* Scenario: Inside the interrupt service routine for block DW0 channel 0: */ if (CY_DMA_INTR_MASK == Cy_DMA_Channel_GetInterruptStatusMasked(DW0, 0UL)) { /* Get the interrupt cause */ cy_en_dma_intr_cause_t cause = Cy_DMA_Channel_GetStatus(DW0, 0UL); if (CY_DMA_INTR_CAUSE_COMPLETION != cause) { /* Insert error handling */ } /* Clear the interrupt */ Cy_DMA_Channel_ClearInterrupt(DW0, 0UL); }
- Parameters
base – The pointer to the hardware DMA block.
channel – The channel number.
-
__STATIC_INLINE void Cy_DMA_Channel_SetInterrupt (DW_Type *base, uint32_t channel)
Sets the interrupt for the specified channel.
- Function Usage
/* Scenario: Enable interrupts for block DW0 channel 0 */ Cy_DMA_Channel_SetInterruptMask (DW0, 0UL, CY_DMA_INTR_MASK); /* Scenario: Test the interrupt for block DW0 channel 0 */ Cy_DMA_Channel_SetInterrupt(DW0, 0UL); /* Now the interrupt should occur (if it is enabled, of course) */ /* Scenario: Disable interrupts for block DW0 channel 0 if it is enabled */ if (CY_DMA_INTR_MASK == Cy_DMA_Channel_GetInterruptMask(DW0, 0UL)) { Cy_DMA_Channel_SetInterruptMask (DW0, 0UL, 0UL); }
- Parameters
base – The pointer to the hardware DMA block.
channel – The channel number.
-
__STATIC_INLINE uint32_t Cy_DMA_Channel_GetInterruptMask (DW_Type const *base, uint32_t channel)
Returns the interrupt mask value of the specified channel.
- Function Usage
/* Scenario: Enable interrupts for block DW0 channel 0 */ Cy_DMA_Channel_SetInterruptMask (DW0, 0UL, CY_DMA_INTR_MASK); /* Scenario: Test the interrupt for block DW0 channel 0 */ Cy_DMA_Channel_SetInterrupt(DW0, 0UL); /* Now the interrupt should occur (if it is enabled, of course) */ /* Scenario: Disable interrupts for block DW0 channel 0 if it is enabled */ if (CY_DMA_INTR_MASK == Cy_DMA_Channel_GetInterruptMask(DW0, 0UL)) { Cy_DMA_Channel_SetInterruptMask (DW0, 0UL, 0UL); }
- Parameters
base – The pointer to the hardware DMA block.
channel – The channel number.
- Returns
The interrupt mask value.
-
__STATIC_INLINE void Cy_DMA_Channel_SetInterruptMask (DW_Type *base, uint32_t channel, uint32_t interrupt)
Sets an interrupt mask value for the specified channel.
- Function Usage
/* Scenario: Enable interrupts for block DW0 channel 0 */ Cy_DMA_Channel_SetInterruptMask (DW0, 0UL, CY_DMA_INTR_MASK); /* Scenario: Test the interrupt for block DW0 channel 0 */ Cy_DMA_Channel_SetInterrupt(DW0, 0UL); /* Now the interrupt should occur (if it is enabled, of course) */ /* Scenario: Disable interrupts for block DW0 channel 0 if it is enabled */ if (CY_DMA_INTR_MASK == Cy_DMA_Channel_GetInterruptMask(DW0, 0UL)) { Cy_DMA_Channel_SetInterruptMask (DW0, 0UL, 0UL); }
- Parameters
base – The pointer to the hardware DMA block.
channel – The channel number.
interrupt – The interrupt mask: CY_DMA_INTR_MASK to enable the interrupt or 0UL to disable the interrupt.
-
__STATIC_INLINE uint32_t Cy_DMA_Channel_GetInterruptStatusMasked (DW_Type const *base, uint32_t channel)
Returns the logical AND of the corresponding INTR and INTR_MASK fields in a single-load operation.
- Function Usage
/* Scenario: Inside the interrupt service routine for block DW0 channel 0: */ if (CY_DMA_INTR_MASK == Cy_DMA_Channel_GetInterruptStatusMasked(DW0, 0UL)) { /* Get the interrupt cause */ cy_en_dma_intr_cause_t cause = Cy_DMA_Channel_GetStatus(DW0, 0UL); if (CY_DMA_INTR_CAUSE_COMPLETION != cause) { /* Insert error handling */ } /* Clear the interrupt */ Cy_DMA_Channel_ClearInterrupt(DW0, 0UL); }
- Parameters
base – The pointer to the hardware DMA block.
channel – The channel number.
-
cy_en_dma_status_t
Cy_DMA_Descriptor_Init
(cy_stc_dma_descriptor_t *descriptor, cy_stc_dma_descriptor_config_t const *config) Initializes the descriptor structure in SRAM from a pre-initialized configuration structure.
This function initializes only the descriptor and not the channel.
- Function Usage
/* Scenario: Initialize a 1D descriptor */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor; cy_stc_dma_descriptor_t nextDescriptor; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; cy_stc_dma_descriptor_config_t descriptor_cfg = { .retrigger = CY_DMA_RETRIG_IM, .interruptType = CY_DMA_DESCR, .triggerOutType = CY_DMA_DESCR, .channelState = CY_DMA_CHANNEL_ENABLED, .triggerInType = CY_DMA_DESCR, .dataSize = CY_DMA_WORD, .srcTransferSize = CY_DMA_TRANSFER_SIZE_WORD, .dstTransferSize = CY_DMA_TRANSFER_SIZE_WORD, .descriptorType = CY_DMA_1D_TRANSFER, .srcAddress = &src, .dstAddress = &dst, .srcXincrement = 1U, .dstXincrement = 1U, .xCount = DATACNT, .srcYincrement = 0U, .dstYincrement = 0U, .yCount = 1UL, .nextDescriptor = &nextDescriptor, }; if (CY_DMA_SUCCESS != Cy_DMA_Descriptor_Init(&descriptor, &descriptor_cfg)) { /* Insert error handling */ } /* Scenario: Setup and enable the DMA channel 0 of block DW0 */ cy_stc_dma_channel_config_t channelConfig; channelConfig.preemptable = false; channelConfig.enable = false; channelConfig.bufferable = false; if (CY_DMA_SUCCESS != Cy_DMA_Channel_Init(DW0, 0UL, &channelConfig)) { /* Insert error handling */ } Cy_DMA_Channel_SetDescriptor(DW0, 0UL, &descriptor); Cy_DMA_Channel_SetPriority(DW0, 0UL, 3UL); Cy_DMA_Channel_Enable(DW0, 0UL); Cy_DMA_Enable(DW0);
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
config – This is a configuration structure that has all initialization information for the descriptor.
- Returns
The status /ref cy_en_dma_status_t.
-
void
Cy_DMA_Descriptor_DeInit
(cy_stc_dma_descriptor_t *descriptor) Clears the content of the specified descriptor.
- Function Usage
/* Scenario: Disable a descriptor */ if (&descriptor != Cy_DMA_Channel_GetCurrentDescriptor(DW0, 0UL)) /* Make sure it is not in use */ { Cy_DMA_Descriptor_DeInit(&descriptor); }
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
-
void
Cy_DMA_Descriptor_SetNextDescriptor
(cy_stc_dma_descriptor_t *descriptor, cy_stc_dma_descriptor_t const *nextDescriptor) Sets a Next Descriptor for the specified descriptor.
Based on the descriptor type, the offset of the address for the next descriptor may vary. For the single-transfer descriptor type, this register is at offset 0x0c. For the 1D-transfer descriptor type, this register is at offset 0x10. For the 2D-transfer descriptor type, this register is at offset 0x14.
- Function Usage
/* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor = {0}; cy_stc_dma_descriptor_t nextDescriptor = {0}; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; if (&descriptor != Cy_DMA_Channel_GetCurrentDescriptor(DW0, 0UL)) /* Make sure it is not in use */ { Cy_DMA_Descriptor_SetRetrigger(&descriptor, CY_DMA_RETRIG_IM); Cy_DMA_Descriptor_SetInterruptType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetTriggerOutType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetChannelState(&descriptor, CY_DMA_CHANNEL_ENABLED); Cy_DMA_Descriptor_SetTriggerInType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetDataSize(&descriptor, CY_DMA_WORD); Cy_DMA_Descriptor_SetSrcTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDstTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDescriptorType(&descriptor, CY_DMA_1D_TRANSFER); Cy_DMA_Descriptor_SetSrcAddress(&descriptor, &src); Cy_DMA_Descriptor_SetDstAddress(&descriptor, &dst); Cy_DMA_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDstIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDataCount(&descriptor, DATACNT); Cy_DMA_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDstIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDataCount(&descriptor, 1UL); Cy_DMA_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor); }
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
nextDescriptor – The pointer to the next descriptor.
-
void
Cy_DMA_Descriptor_SetDescriptorType
(cy_stc_dma_descriptor_t *descriptor, cy_en_dma_descriptor_type_t descriptorType) Sets the descriptor’s type for the specified descriptor.
Moves the next descriptor register value into the proper place in accordance to the actual descriptor type. During the descriptor’s type changing, the Xloop and Yloop settings, such as data count and source/destination increment (i.e. the content of the xCtl and yCtl descriptor registers) might be lost (overridden by the next descriptor value) because of the different descriptor registers structures for different descriptor types. Carefully set up the Xloop (and Yloop, if used) data count and source/destination increment if the descriptor type is changed from a simpler to a more complicated type (“single transfer” -> “1D”, “1D” -> “2D”, etc.).
- Function Usage
/* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor = {0}; cy_stc_dma_descriptor_t nextDescriptor = {0}; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; if (&descriptor != Cy_DMA_Channel_GetCurrentDescriptor(DW0, 0UL)) /* Make sure it is not in use */ { Cy_DMA_Descriptor_SetRetrigger(&descriptor, CY_DMA_RETRIG_IM); Cy_DMA_Descriptor_SetInterruptType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetTriggerOutType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetChannelState(&descriptor, CY_DMA_CHANNEL_ENABLED); Cy_DMA_Descriptor_SetTriggerInType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetDataSize(&descriptor, CY_DMA_WORD); Cy_DMA_Descriptor_SetSrcTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDstTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDescriptorType(&descriptor, CY_DMA_1D_TRANSFER); Cy_DMA_Descriptor_SetSrcAddress(&descriptor, &src); Cy_DMA_Descriptor_SetDstAddress(&descriptor, &dst); Cy_DMA_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDstIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDataCount(&descriptor, DATACNT); Cy_DMA_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDstIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDataCount(&descriptor, 1UL); Cy_DMA_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor); }
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
descriptorType – The descriptor type cy_en_dma_descriptor_type_t.
-
__STATIC_INLINE void Cy_DMA_Descriptor_SetSrcAddress (cy_stc_dma_descriptor_t *descriptor, void const *srcAddress)
Sets the source address for the specified descriptor.
- Function Usage
/* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor = {0}; cy_stc_dma_descriptor_t nextDescriptor = {0}; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; if (&descriptor != Cy_DMA_Channel_GetCurrentDescriptor(DW0, 0UL)) /* Make sure it is not in use */ { Cy_DMA_Descriptor_SetRetrigger(&descriptor, CY_DMA_RETRIG_IM); Cy_DMA_Descriptor_SetInterruptType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetTriggerOutType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetChannelState(&descriptor, CY_DMA_CHANNEL_ENABLED); Cy_DMA_Descriptor_SetTriggerInType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetDataSize(&descriptor, CY_DMA_WORD); Cy_DMA_Descriptor_SetSrcTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDstTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDescriptorType(&descriptor, CY_DMA_1D_TRANSFER); Cy_DMA_Descriptor_SetSrcAddress(&descriptor, &src); Cy_DMA_Descriptor_SetDstAddress(&descriptor, &dst); Cy_DMA_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDstIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDataCount(&descriptor, DATACNT); Cy_DMA_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDstIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDataCount(&descriptor, 1UL); Cy_DMA_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor); }
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
srcAddress – The source address value for the descriptor.
-
__STATIC_INLINE void Cy_DMA_Descriptor_SetDstAddress (cy_stc_dma_descriptor_t *descriptor, void const *dstAddress)
Sets the destination address for the specified descriptor.
- Function Usage
/* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor = {0}; cy_stc_dma_descriptor_t nextDescriptor = {0}; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; if (&descriptor != Cy_DMA_Channel_GetCurrentDescriptor(DW0, 0UL)) /* Make sure it is not in use */ { Cy_DMA_Descriptor_SetRetrigger(&descriptor, CY_DMA_RETRIG_IM); Cy_DMA_Descriptor_SetInterruptType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetTriggerOutType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetChannelState(&descriptor, CY_DMA_CHANNEL_ENABLED); Cy_DMA_Descriptor_SetTriggerInType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetDataSize(&descriptor, CY_DMA_WORD); Cy_DMA_Descriptor_SetSrcTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDstTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDescriptorType(&descriptor, CY_DMA_1D_TRANSFER); Cy_DMA_Descriptor_SetSrcAddress(&descriptor, &src); Cy_DMA_Descriptor_SetDstAddress(&descriptor, &dst); Cy_DMA_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDstIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDataCount(&descriptor, DATACNT); Cy_DMA_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDstIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDataCount(&descriptor, 1UL); Cy_DMA_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor); }
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
dstAddress – The destination address value for the descriptor.
-
__STATIC_INLINE void Cy_DMA_Descriptor_SetXloopDataCount (cy_stc_dma_descriptor_t *descriptor, uint32_t xCount)
Sets the number of data elements to transfer in the X loop for the specified descriptor (for 1D or 2D descriptors only).
- Function Usage
/* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor = {0}; cy_stc_dma_descriptor_t nextDescriptor = {0}; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; if (&descriptor != Cy_DMA_Channel_GetCurrentDescriptor(DW0, 0UL)) /* Make sure it is not in use */ { Cy_DMA_Descriptor_SetRetrigger(&descriptor, CY_DMA_RETRIG_IM); Cy_DMA_Descriptor_SetInterruptType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetTriggerOutType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetChannelState(&descriptor, CY_DMA_CHANNEL_ENABLED); Cy_DMA_Descriptor_SetTriggerInType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetDataSize(&descriptor, CY_DMA_WORD); Cy_DMA_Descriptor_SetSrcTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDstTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDescriptorType(&descriptor, CY_DMA_1D_TRANSFER); Cy_DMA_Descriptor_SetSrcAddress(&descriptor, &src); Cy_DMA_Descriptor_SetDstAddress(&descriptor, &dst); Cy_DMA_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDstIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDataCount(&descriptor, DATACNT); Cy_DMA_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDstIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDataCount(&descriptor, 1UL); Cy_DMA_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor); }
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
xCount – The number of data elements to transfer in the X loop. Valid range is 1 … 256.
-
__STATIC_INLINE void Cy_DMA_Descriptor_SetYloopDataCount (cy_stc_dma_descriptor_t *descriptor, uint32_t yCount)
Sets the number of data elements for the Y loop of the specified descriptor (for 2D descriptors only).
- Function Usage
/* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor = {0}; cy_stc_dma_descriptor_t nextDescriptor = {0}; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; if (&descriptor != Cy_DMA_Channel_GetCurrentDescriptor(DW0, 0UL)) /* Make sure it is not in use */ { Cy_DMA_Descriptor_SetRetrigger(&descriptor, CY_DMA_RETRIG_IM); Cy_DMA_Descriptor_SetInterruptType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetTriggerOutType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetChannelState(&descriptor, CY_DMA_CHANNEL_ENABLED); Cy_DMA_Descriptor_SetTriggerInType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetDataSize(&descriptor, CY_DMA_WORD); Cy_DMA_Descriptor_SetSrcTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDstTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDescriptorType(&descriptor, CY_DMA_1D_TRANSFER); Cy_DMA_Descriptor_SetSrcAddress(&descriptor, &src); Cy_DMA_Descriptor_SetDstAddress(&descriptor, &dst); Cy_DMA_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDstIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDataCount(&descriptor, DATACNT); Cy_DMA_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDstIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDataCount(&descriptor, 1UL); Cy_DMA_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor); }
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
yCount – The number of X loops to execute in the Y loop. The valid range is 1 … 256.
-
__STATIC_INLINE void Cy_DMA_Descriptor_SetXloopSrcIncrement (cy_stc_dma_descriptor_t *descriptor, int32_t srcXincrement)
Sets the source increment parameter for the X loop of the specified descriptor (for 1D or 2D descriptors only).
- Function Usage
/* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor = {0}; cy_stc_dma_descriptor_t nextDescriptor = {0}; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; if (&descriptor != Cy_DMA_Channel_GetCurrentDescriptor(DW0, 0UL)) /* Make sure it is not in use */ { Cy_DMA_Descriptor_SetRetrigger(&descriptor, CY_DMA_RETRIG_IM); Cy_DMA_Descriptor_SetInterruptType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetTriggerOutType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetChannelState(&descriptor, CY_DMA_CHANNEL_ENABLED); Cy_DMA_Descriptor_SetTriggerInType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetDataSize(&descriptor, CY_DMA_WORD); Cy_DMA_Descriptor_SetSrcTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDstTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDescriptorType(&descriptor, CY_DMA_1D_TRANSFER); Cy_DMA_Descriptor_SetSrcAddress(&descriptor, &src); Cy_DMA_Descriptor_SetDstAddress(&descriptor, &dst); Cy_DMA_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDstIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDataCount(&descriptor, DATACNT); Cy_DMA_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDstIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDataCount(&descriptor, 1UL); Cy_DMA_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor); }
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
srcXincrement – The value of the source increment. The valid range is -2048 … 2047.
-
__STATIC_INLINE void Cy_DMA_Descriptor_SetXloopDstIncrement (cy_stc_dma_descriptor_t *descriptor, int32_t dstXincrement)
Sets the destination increment parameter for the X loop for the specified descriptor (for 1D or 2D descriptors only).
- Function Usage
/* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor = {0}; cy_stc_dma_descriptor_t nextDescriptor = {0}; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; if (&descriptor != Cy_DMA_Channel_GetCurrentDescriptor(DW0, 0UL)) /* Make sure it is not in use */ { Cy_DMA_Descriptor_SetRetrigger(&descriptor, CY_DMA_RETRIG_IM); Cy_DMA_Descriptor_SetInterruptType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetTriggerOutType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetChannelState(&descriptor, CY_DMA_CHANNEL_ENABLED); Cy_DMA_Descriptor_SetTriggerInType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetDataSize(&descriptor, CY_DMA_WORD); Cy_DMA_Descriptor_SetSrcTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDstTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDescriptorType(&descriptor, CY_DMA_1D_TRANSFER); Cy_DMA_Descriptor_SetSrcAddress(&descriptor, &src); Cy_DMA_Descriptor_SetDstAddress(&descriptor, &dst); Cy_DMA_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDstIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDataCount(&descriptor, DATACNT); Cy_DMA_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDstIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDataCount(&descriptor, 1UL); Cy_DMA_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor); }
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
dstXincrement – The value of the destination increment. The valid range is -2048 … 2047.
-
__STATIC_INLINE void Cy_DMA_Descriptor_SetYloopSrcIncrement (cy_stc_dma_descriptor_t *descriptor, int32_t srcYincrement)
Sets the source increment parameter for the Y loop for the specified descriptor (for 2D descriptors only).
- Function Usage
/* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor = {0}; cy_stc_dma_descriptor_t nextDescriptor = {0}; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; if (&descriptor != Cy_DMA_Channel_GetCurrentDescriptor(DW0, 0UL)) /* Make sure it is not in use */ { Cy_DMA_Descriptor_SetRetrigger(&descriptor, CY_DMA_RETRIG_IM); Cy_DMA_Descriptor_SetInterruptType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetTriggerOutType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetChannelState(&descriptor, CY_DMA_CHANNEL_ENABLED); Cy_DMA_Descriptor_SetTriggerInType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetDataSize(&descriptor, CY_DMA_WORD); Cy_DMA_Descriptor_SetSrcTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDstTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDescriptorType(&descriptor, CY_DMA_1D_TRANSFER); Cy_DMA_Descriptor_SetSrcAddress(&descriptor, &src); Cy_DMA_Descriptor_SetDstAddress(&descriptor, &dst); Cy_DMA_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDstIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDataCount(&descriptor, DATACNT); Cy_DMA_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDstIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDataCount(&descriptor, 1UL); Cy_DMA_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor); }
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
srcYincrement – The value of the source increment. The valid range is -2048 … 2047.
-
__STATIC_INLINE void Cy_DMA_Descriptor_SetYloopDstIncrement (cy_stc_dma_descriptor_t *descriptor, int32_t dstYincrement)
Sets the destination increment parameter for the Y loop of the specified descriptor (for 2D descriptors only).
- Function Usage
/* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor = {0}; cy_stc_dma_descriptor_t nextDescriptor = {0}; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; if (&descriptor != Cy_DMA_Channel_GetCurrentDescriptor(DW0, 0UL)) /* Make sure it is not in use */ { Cy_DMA_Descriptor_SetRetrigger(&descriptor, CY_DMA_RETRIG_IM); Cy_DMA_Descriptor_SetInterruptType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetTriggerOutType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetChannelState(&descriptor, CY_DMA_CHANNEL_ENABLED); Cy_DMA_Descriptor_SetTriggerInType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetDataSize(&descriptor, CY_DMA_WORD); Cy_DMA_Descriptor_SetSrcTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDstTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDescriptorType(&descriptor, CY_DMA_1D_TRANSFER); Cy_DMA_Descriptor_SetSrcAddress(&descriptor, &src); Cy_DMA_Descriptor_SetDstAddress(&descriptor, &dst); Cy_DMA_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDstIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDataCount(&descriptor, DATACNT); Cy_DMA_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDstIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDataCount(&descriptor, 1UL); Cy_DMA_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor); }
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
dstYincrement – The value of the destination increment. The valid range is -2048 … 2047.
-
__STATIC_INLINE void Cy_DMA_Descriptor_SetInterruptType (cy_stc_dma_descriptor_t *descriptor, cy_en_dma_trigger_type_t interruptType)
Sets the interrupt type for the specified descriptor.
- Function Usage
/* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor = {0}; cy_stc_dma_descriptor_t nextDescriptor = {0}; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; if (&descriptor != Cy_DMA_Channel_GetCurrentDescriptor(DW0, 0UL)) /* Make sure it is not in use */ { Cy_DMA_Descriptor_SetRetrigger(&descriptor, CY_DMA_RETRIG_IM); Cy_DMA_Descriptor_SetInterruptType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetTriggerOutType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetChannelState(&descriptor, CY_DMA_CHANNEL_ENABLED); Cy_DMA_Descriptor_SetTriggerInType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetDataSize(&descriptor, CY_DMA_WORD); Cy_DMA_Descriptor_SetSrcTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDstTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDescriptorType(&descriptor, CY_DMA_1D_TRANSFER); Cy_DMA_Descriptor_SetSrcAddress(&descriptor, &src); Cy_DMA_Descriptor_SetDstAddress(&descriptor, &dst); Cy_DMA_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDstIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDataCount(&descriptor, DATACNT); Cy_DMA_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDstIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDataCount(&descriptor, 1UL); Cy_DMA_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor); }
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
interruptType – The interrupt type set for the descriptor. cy_en_dma_trigger_type_t
-
__STATIC_INLINE void Cy_DMA_Descriptor_SetTriggerInType (cy_stc_dma_descriptor_t *descriptor, cy_en_dma_trigger_type_t triggerInType)
Sets the Trigger-In-Type for the specified descriptor.
- Function Usage
/* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor = {0}; cy_stc_dma_descriptor_t nextDescriptor = {0}; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; if (&descriptor != Cy_DMA_Channel_GetCurrentDescriptor(DW0, 0UL)) /* Make sure it is not in use */ { Cy_DMA_Descriptor_SetRetrigger(&descriptor, CY_DMA_RETRIG_IM); Cy_DMA_Descriptor_SetInterruptType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetTriggerOutType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetChannelState(&descriptor, CY_DMA_CHANNEL_ENABLED); Cy_DMA_Descriptor_SetTriggerInType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetDataSize(&descriptor, CY_DMA_WORD); Cy_DMA_Descriptor_SetSrcTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDstTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDescriptorType(&descriptor, CY_DMA_1D_TRANSFER); Cy_DMA_Descriptor_SetSrcAddress(&descriptor, &src); Cy_DMA_Descriptor_SetDstAddress(&descriptor, &dst); Cy_DMA_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDstIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDataCount(&descriptor, DATACNT); Cy_DMA_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDstIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDataCount(&descriptor, 1UL); Cy_DMA_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor); }
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
triggerInType – The Trigger In Type parameter cy_en_dma_trigger_type_t
-
__STATIC_INLINE void Cy_DMA_Descriptor_SetTriggerOutType (cy_stc_dma_descriptor_t *descriptor, cy_en_dma_trigger_type_t triggerOutType)
Sets the Trigger-Out-Type for the specified descriptor.
- Function Usage
/* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor = {0}; cy_stc_dma_descriptor_t nextDescriptor = {0}; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; if (&descriptor != Cy_DMA_Channel_GetCurrentDescriptor(DW0, 0UL)) /* Make sure it is not in use */ { Cy_DMA_Descriptor_SetRetrigger(&descriptor, CY_DMA_RETRIG_IM); Cy_DMA_Descriptor_SetInterruptType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetTriggerOutType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetChannelState(&descriptor, CY_DMA_CHANNEL_ENABLED); Cy_DMA_Descriptor_SetTriggerInType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetDataSize(&descriptor, CY_DMA_WORD); Cy_DMA_Descriptor_SetSrcTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDstTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDescriptorType(&descriptor, CY_DMA_1D_TRANSFER); Cy_DMA_Descriptor_SetSrcAddress(&descriptor, &src); Cy_DMA_Descriptor_SetDstAddress(&descriptor, &dst); Cy_DMA_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDstIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDataCount(&descriptor, DATACNT); Cy_DMA_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDstIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDataCount(&descriptor, 1UL); Cy_DMA_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor); }
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
triggerOutType – The Trigger-Out-Type set for the descriptor. cy_en_dma_trigger_type_t
-
__STATIC_INLINE void Cy_DMA_Descriptor_SetDataSize (cy_stc_dma_descriptor_t *descriptor, cy_en_dma_data_size_t dataSize)
Sets the Data Element Size for the specified descriptor.
- Function Usage
/* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor = {0}; cy_stc_dma_descriptor_t nextDescriptor = {0}; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; if (&descriptor != Cy_DMA_Channel_GetCurrentDescriptor(DW0, 0UL)) /* Make sure it is not in use */ { Cy_DMA_Descriptor_SetRetrigger(&descriptor, CY_DMA_RETRIG_IM); Cy_DMA_Descriptor_SetInterruptType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetTriggerOutType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetChannelState(&descriptor, CY_DMA_CHANNEL_ENABLED); Cy_DMA_Descriptor_SetTriggerInType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetDataSize(&descriptor, CY_DMA_WORD); Cy_DMA_Descriptor_SetSrcTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDstTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDescriptorType(&descriptor, CY_DMA_1D_TRANSFER); Cy_DMA_Descriptor_SetSrcAddress(&descriptor, &src); Cy_DMA_Descriptor_SetDstAddress(&descriptor, &dst); Cy_DMA_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDstIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDataCount(&descriptor, DATACNT); Cy_DMA_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDstIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDataCount(&descriptor, 1UL); Cy_DMA_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor); }
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
dataSize – The Data Element Size cy_en_dma_data_size_t
-
__STATIC_INLINE void Cy_DMA_Descriptor_SetSrcTransferSize (cy_stc_dma_descriptor_t *descriptor, cy_en_dma_transfer_size_t srcTransferSize)
Sets the Source Transfer Size for the specified descriptor.
- Function Usage
/* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor = {0}; cy_stc_dma_descriptor_t nextDescriptor = {0}; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; if (&descriptor != Cy_DMA_Channel_GetCurrentDescriptor(DW0, 0UL)) /* Make sure it is not in use */ { Cy_DMA_Descriptor_SetRetrigger(&descriptor, CY_DMA_RETRIG_IM); Cy_DMA_Descriptor_SetInterruptType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetTriggerOutType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetChannelState(&descriptor, CY_DMA_CHANNEL_ENABLED); Cy_DMA_Descriptor_SetTriggerInType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetDataSize(&descriptor, CY_DMA_WORD); Cy_DMA_Descriptor_SetSrcTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDstTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDescriptorType(&descriptor, CY_DMA_1D_TRANSFER); Cy_DMA_Descriptor_SetSrcAddress(&descriptor, &src); Cy_DMA_Descriptor_SetDstAddress(&descriptor, &dst); Cy_DMA_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDstIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDataCount(&descriptor, DATACNT); Cy_DMA_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDstIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDataCount(&descriptor, 1UL); Cy_DMA_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor); }
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
srcTransferSize – The Source Transfer Size cy_en_dma_transfer_size_t.
-
__STATIC_INLINE void Cy_DMA_Descriptor_SetDstTransferSize (cy_stc_dma_descriptor_t *descriptor, cy_en_dma_transfer_size_t dstTransferSize)
Sets the Destination Transfer Size for the specified descriptor.
- Function Usage
/* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor = {0}; cy_stc_dma_descriptor_t nextDescriptor = {0}; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; if (&descriptor != Cy_DMA_Channel_GetCurrentDescriptor(DW0, 0UL)) /* Make sure it is not in use */ { Cy_DMA_Descriptor_SetRetrigger(&descriptor, CY_DMA_RETRIG_IM); Cy_DMA_Descriptor_SetInterruptType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetTriggerOutType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetChannelState(&descriptor, CY_DMA_CHANNEL_ENABLED); Cy_DMA_Descriptor_SetTriggerInType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetDataSize(&descriptor, CY_DMA_WORD); Cy_DMA_Descriptor_SetSrcTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDstTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDescriptorType(&descriptor, CY_DMA_1D_TRANSFER); Cy_DMA_Descriptor_SetSrcAddress(&descriptor, &src); Cy_DMA_Descriptor_SetDstAddress(&descriptor, &dst); Cy_DMA_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDstIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDataCount(&descriptor, DATACNT); Cy_DMA_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDstIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDataCount(&descriptor, 1UL); Cy_DMA_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor); }
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
dstTransferSize – The Destination Transfer Size cy_en_dma_transfer_size_t.
-
__STATIC_INLINE void Cy_DMA_Descriptor_SetRetrigger (cy_stc_dma_descriptor_t *descriptor, cy_en_dma_retrigger_t retrigger)
Sets the retrigger value that specifies whether the controller should wait for the input trigger to be deactivated.
- Function Usage
/* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor = {0}; cy_stc_dma_descriptor_t nextDescriptor = {0}; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; if (&descriptor != Cy_DMA_Channel_GetCurrentDescriptor(DW0, 0UL)) /* Make sure it is not in use */ { Cy_DMA_Descriptor_SetRetrigger(&descriptor, CY_DMA_RETRIG_IM); Cy_DMA_Descriptor_SetInterruptType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetTriggerOutType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetChannelState(&descriptor, CY_DMA_CHANNEL_ENABLED); Cy_DMA_Descriptor_SetTriggerInType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetDataSize(&descriptor, CY_DMA_WORD); Cy_DMA_Descriptor_SetSrcTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDstTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDescriptorType(&descriptor, CY_DMA_1D_TRANSFER); Cy_DMA_Descriptor_SetSrcAddress(&descriptor, &src); Cy_DMA_Descriptor_SetDstAddress(&descriptor, &dst); Cy_DMA_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDstIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDataCount(&descriptor, DATACNT); Cy_DMA_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDstIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDataCount(&descriptor, 1UL); Cy_DMA_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor); }
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
retrigger – The cy_en_dma_retrigger_t parameter specifies whether the controller should wait for the input trigger to be deactivated.
-
__STATIC_INLINE void Cy_DMA_Descriptor_SetChannelState (cy_stc_dma_descriptor_t *descriptor, cy_en_dma_channel_state_t channelState)
Sets the channel state on completion of the specified descriptor.
- Function Usage
/* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */ #define DATACNT (8UL) cy_stc_dma_descriptor_t descriptor = {0}; cy_stc_dma_descriptor_t nextDescriptor = {0}; uint32_t src[DATACNT]; uint32_t dst[DATACNT]; if (&descriptor != Cy_DMA_Channel_GetCurrentDescriptor(DW0, 0UL)) /* Make sure it is not in use */ { Cy_DMA_Descriptor_SetRetrigger(&descriptor, CY_DMA_RETRIG_IM); Cy_DMA_Descriptor_SetInterruptType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetTriggerOutType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetChannelState(&descriptor, CY_DMA_CHANNEL_ENABLED); Cy_DMA_Descriptor_SetTriggerInType(&descriptor, CY_DMA_DESCR); Cy_DMA_Descriptor_SetDataSize(&descriptor, CY_DMA_WORD); Cy_DMA_Descriptor_SetSrcTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDstTransferSize(&descriptor, CY_DMA_TRANSFER_SIZE_WORD); Cy_DMA_Descriptor_SetDescriptorType(&descriptor, CY_DMA_1D_TRANSFER); Cy_DMA_Descriptor_SetSrcAddress(&descriptor, &src); Cy_DMA_Descriptor_SetDstAddress(&descriptor, &dst); Cy_DMA_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDstIncrement(&descriptor, 1UL); Cy_DMA_Descriptor_SetXloopDataCount(&descriptor, DATACNT); Cy_DMA_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDstIncrement(&descriptor, 0UL); Cy_DMA_Descriptor_SetYloopDataCount(&descriptor, 1UL); Cy_DMA_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor); }
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
channelState – The channel state cy_en_dma_channel_state_t.
-
cy_stc_dma_descriptor_t *
Cy_DMA_Descriptor_GetNextDescriptor
(cy_stc_dma_descriptor_t const *descriptor) Returns a next descriptor address of the specified descriptor.
Based on the descriptor type, the offset of the address for the next descriptor may vary. For a single-transfer descriptor type, this register is at offset 0x0c. For the 1D-transfer descriptor type, this register is at offset 0x10. For the 2D-transfer descriptor type, this register is at offset 0x14.
- Function Usage
/* Scenario: Get the value of individual descriptor parameters dynamically. The snippet shows them all. */ /* This function assumes the 'descriptor' is initialized, see \ref Cy_DMA_Enable description */ cy_en_dma_retrigger_t retrigger = Cy_DMA_Descriptor_GetRetrigger(&descriptor); cy_en_dma_trigger_type_t interruptType = Cy_DMA_Descriptor_GetInterruptType(&descriptor); cy_en_dma_trigger_type_t triggerOutType = Cy_DMA_Descriptor_GetTriggerOutType(&descriptor); cy_en_dma_channel_state_t channelState = Cy_DMA_Descriptor_GetChannelState(&descriptor); cy_en_dma_trigger_type_t triggerInType = Cy_DMA_Descriptor_GetTriggerInType(&descriptor); cy_en_dma_data_size_t dataSize = Cy_DMA_Descriptor_GetDataSize(&descriptor); cy_en_dma_transfer_size_t srcTransferSize = Cy_DMA_Descriptor_GetSrcTransferSize(&descriptor); cy_en_dma_transfer_size_t dstTransferSize = Cy_DMA_Descriptor_GetDstTransferSize(&descriptor); cy_en_dma_descriptor_type_t descriptorType = Cy_DMA_Descriptor_GetDescriptorType(&descriptor); void * srcAddress = Cy_DMA_Descriptor_GetSrcAddress(&descriptor); void * dstAddress = Cy_DMA_Descriptor_GetDstAddress(&descriptor); int32_t srcXincrement = Cy_DMA_Descriptor_GetXloopSrcIncrement(&descriptor); int32_t dstXincrement = Cy_DMA_Descriptor_GetXloopDstIncrement(&descriptor); uint32_t xCount = Cy_DMA_Descriptor_GetXloopDataCount(&descriptor); int32_t srcYincrement = Cy_DMA_Descriptor_GetYloopSrcIncrement(&descriptor); int32_t dstYincrement = Cy_DMA_Descriptor_GetYloopDstIncrement(&descriptor); uint32_t yCount = Cy_DMA_Descriptor_GetYloopDataCount(&descriptor); cy_stc_dma_descriptor_t * nextDescriptor = Cy_DMA_Descriptor_GetNextDescriptor(&descriptor);
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
- Returns
The pointer to the next descriptor.
-
__STATIC_INLINE cy_en_dma_descriptor_type_t Cy_DMA_Descriptor_GetDescriptorType (cy_stc_dma_descriptor_t const *descriptor)
Returns the descriptor’s type of the specified descriptor.
- Function Usage
/* Scenario: Get the value of individual descriptor parameters dynamically. The snippet shows them all. */ /* This function assumes the 'descriptor' is initialized, see \ref Cy_DMA_Enable description */ cy_en_dma_retrigger_t retrigger = Cy_DMA_Descriptor_GetRetrigger(&descriptor); cy_en_dma_trigger_type_t interruptType = Cy_DMA_Descriptor_GetInterruptType(&descriptor); cy_en_dma_trigger_type_t triggerOutType = Cy_DMA_Descriptor_GetTriggerOutType(&descriptor); cy_en_dma_channel_state_t channelState = Cy_DMA_Descriptor_GetChannelState(&descriptor); cy_en_dma_trigger_type_t triggerInType = Cy_DMA_Descriptor_GetTriggerInType(&descriptor); cy_en_dma_data_size_t dataSize = Cy_DMA_Descriptor_GetDataSize(&descriptor); cy_en_dma_transfer_size_t srcTransferSize = Cy_DMA_Descriptor_GetSrcTransferSize(&descriptor); cy_en_dma_transfer_size_t dstTransferSize = Cy_DMA_Descriptor_GetDstTransferSize(&descriptor); cy_en_dma_descriptor_type_t descriptorType = Cy_DMA_Descriptor_GetDescriptorType(&descriptor); void * srcAddress = Cy_DMA_Descriptor_GetSrcAddress(&descriptor); void * dstAddress = Cy_DMA_Descriptor_GetDstAddress(&descriptor); int32_t srcXincrement = Cy_DMA_Descriptor_GetXloopSrcIncrement(&descriptor); int32_t dstXincrement = Cy_DMA_Descriptor_GetXloopDstIncrement(&descriptor); uint32_t xCount = Cy_DMA_Descriptor_GetXloopDataCount(&descriptor); int32_t srcYincrement = Cy_DMA_Descriptor_GetYloopSrcIncrement(&descriptor); int32_t dstYincrement = Cy_DMA_Descriptor_GetYloopDstIncrement(&descriptor); uint32_t yCount = Cy_DMA_Descriptor_GetYloopDataCount(&descriptor); cy_stc_dma_descriptor_t * nextDescriptor = Cy_DMA_Descriptor_GetNextDescriptor(&descriptor);
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
- Returns
The descriptor type cy_en_dma_descriptor_type_t.
-
__STATIC_INLINE void * Cy_DMA_Descriptor_GetSrcAddress (cy_stc_dma_descriptor_t const *descriptor)
Returns the source address parameter of the specified descriptor.
- Function Usage
/* Scenario: Get the value of individual descriptor parameters dynamically. The snippet shows them all. */ /* This function assumes the 'descriptor' is initialized, see \ref Cy_DMA_Enable description */ cy_en_dma_retrigger_t retrigger = Cy_DMA_Descriptor_GetRetrigger(&descriptor); cy_en_dma_trigger_type_t interruptType = Cy_DMA_Descriptor_GetInterruptType(&descriptor); cy_en_dma_trigger_type_t triggerOutType = Cy_DMA_Descriptor_GetTriggerOutType(&descriptor); cy_en_dma_channel_state_t channelState = Cy_DMA_Descriptor_GetChannelState(&descriptor); cy_en_dma_trigger_type_t triggerInType = Cy_DMA_Descriptor_GetTriggerInType(&descriptor); cy_en_dma_data_size_t dataSize = Cy_DMA_Descriptor_GetDataSize(&descriptor); cy_en_dma_transfer_size_t srcTransferSize = Cy_DMA_Descriptor_GetSrcTransferSize(&descriptor); cy_en_dma_transfer_size_t dstTransferSize = Cy_DMA_Descriptor_GetDstTransferSize(&descriptor); cy_en_dma_descriptor_type_t descriptorType = Cy_DMA_Descriptor_GetDescriptorType(&descriptor); void * srcAddress = Cy_DMA_Descriptor_GetSrcAddress(&descriptor); void * dstAddress = Cy_DMA_Descriptor_GetDstAddress(&descriptor); int32_t srcXincrement = Cy_DMA_Descriptor_GetXloopSrcIncrement(&descriptor); int32_t dstXincrement = Cy_DMA_Descriptor_GetXloopDstIncrement(&descriptor); uint32_t xCount = Cy_DMA_Descriptor_GetXloopDataCount(&descriptor); int32_t srcYincrement = Cy_DMA_Descriptor_GetYloopSrcIncrement(&descriptor); int32_t dstYincrement = Cy_DMA_Descriptor_GetYloopDstIncrement(&descriptor); uint32_t yCount = Cy_DMA_Descriptor_GetYloopDataCount(&descriptor); cy_stc_dma_descriptor_t * nextDescriptor = Cy_DMA_Descriptor_GetNextDescriptor(&descriptor);
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
- Returns
The source address value of the descriptor.
-
__STATIC_INLINE void * Cy_DMA_Descriptor_GetDstAddress (cy_stc_dma_descriptor_t const *descriptor)
Returns the destination address parameter of the specified descriptor.
- Function Usage
/* Scenario: Get the value of individual descriptor parameters dynamically. The snippet shows them all. */ /* This function assumes the 'descriptor' is initialized, see \ref Cy_DMA_Enable description */ cy_en_dma_retrigger_t retrigger = Cy_DMA_Descriptor_GetRetrigger(&descriptor); cy_en_dma_trigger_type_t interruptType = Cy_DMA_Descriptor_GetInterruptType(&descriptor); cy_en_dma_trigger_type_t triggerOutType = Cy_DMA_Descriptor_GetTriggerOutType(&descriptor); cy_en_dma_channel_state_t channelState = Cy_DMA_Descriptor_GetChannelState(&descriptor); cy_en_dma_trigger_type_t triggerInType = Cy_DMA_Descriptor_GetTriggerInType(&descriptor); cy_en_dma_data_size_t dataSize = Cy_DMA_Descriptor_GetDataSize(&descriptor); cy_en_dma_transfer_size_t srcTransferSize = Cy_DMA_Descriptor_GetSrcTransferSize(&descriptor); cy_en_dma_transfer_size_t dstTransferSize = Cy_DMA_Descriptor_GetDstTransferSize(&descriptor); cy_en_dma_descriptor_type_t descriptorType = Cy_DMA_Descriptor_GetDescriptorType(&descriptor); void * srcAddress = Cy_DMA_Descriptor_GetSrcAddress(&descriptor); void * dstAddress = Cy_DMA_Descriptor_GetDstAddress(&descriptor); int32_t srcXincrement = Cy_DMA_Descriptor_GetXloopSrcIncrement(&descriptor); int32_t dstXincrement = Cy_DMA_Descriptor_GetXloopDstIncrement(&descriptor); uint32_t xCount = Cy_DMA_Descriptor_GetXloopDataCount(&descriptor); int32_t srcYincrement = Cy_DMA_Descriptor_GetYloopSrcIncrement(&descriptor); int32_t dstYincrement = Cy_DMA_Descriptor_GetYloopDstIncrement(&descriptor); uint32_t yCount = Cy_DMA_Descriptor_GetYloopDataCount(&descriptor); cy_stc_dma_descriptor_t * nextDescriptor = Cy_DMA_Descriptor_GetNextDescriptor(&descriptor);
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
- Returns
The destination address value of the descriptor.
-
__STATIC_INLINE uint32_t Cy_DMA_Descriptor_GetXloopDataCount (cy_stc_dma_descriptor_t const *descriptor)
Returns the number of data elements for the X loop of the specified descriptor (for 1D or 2D descriptors only).
- Function Usage
/* Scenario: Get the value of individual descriptor parameters dynamically. The snippet shows them all. */ /* This function assumes the 'descriptor' is initialized, see \ref Cy_DMA_Enable description */ cy_en_dma_retrigger_t retrigger = Cy_DMA_Descriptor_GetRetrigger(&descriptor); cy_en_dma_trigger_type_t interruptType = Cy_DMA_Descriptor_GetInterruptType(&descriptor); cy_en_dma_trigger_type_t triggerOutType = Cy_DMA_Descriptor_GetTriggerOutType(&descriptor); cy_en_dma_channel_state_t channelState = Cy_DMA_Descriptor_GetChannelState(&descriptor); cy_en_dma_trigger_type_t triggerInType = Cy_DMA_Descriptor_GetTriggerInType(&descriptor); cy_en_dma_data_size_t dataSize = Cy_DMA_Descriptor_GetDataSize(&descriptor); cy_en_dma_transfer_size_t srcTransferSize = Cy_DMA_Descriptor_GetSrcTransferSize(&descriptor); cy_en_dma_transfer_size_t dstTransferSize = Cy_DMA_Descriptor_GetDstTransferSize(&descriptor); cy_en_dma_descriptor_type_t descriptorType = Cy_DMA_Descriptor_GetDescriptorType(&descriptor); void * srcAddress = Cy_DMA_Descriptor_GetSrcAddress(&descriptor); void * dstAddress = Cy_DMA_Descriptor_GetDstAddress(&descriptor); int32_t srcXincrement = Cy_DMA_Descriptor_GetXloopSrcIncrement(&descriptor); int32_t dstXincrement = Cy_DMA_Descriptor_GetXloopDstIncrement(&descriptor); uint32_t xCount = Cy_DMA_Descriptor_GetXloopDataCount(&descriptor); int32_t srcYincrement = Cy_DMA_Descriptor_GetYloopSrcIncrement(&descriptor); int32_t dstYincrement = Cy_DMA_Descriptor_GetYloopDstIncrement(&descriptor); uint32_t yCount = Cy_DMA_Descriptor_GetYloopDataCount(&descriptor); cy_stc_dma_descriptor_t * nextDescriptor = Cy_DMA_Descriptor_GetNextDescriptor(&descriptor);
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
- Returns
The number of data elements to transfer in the X loop. The range is 1 … 256.
-
__STATIC_INLINE uint32_t Cy_DMA_Descriptor_GetYloopDataCount (cy_stc_dma_descriptor_t const *descriptor)
Returns the number of X loops to execute in the Y loop of the specified descriptor (for 2D descriptors only).
- Function Usage
/* Scenario: Get the value of individual descriptor parameters dynamically. The snippet shows them all. */ /* This function assumes the 'descriptor' is initialized, see \ref Cy_DMA_Enable description */ cy_en_dma_retrigger_t retrigger = Cy_DMA_Descriptor_GetRetrigger(&descriptor); cy_en_dma_trigger_type_t interruptType = Cy_DMA_Descriptor_GetInterruptType(&descriptor); cy_en_dma_trigger_type_t triggerOutType = Cy_DMA_Descriptor_GetTriggerOutType(&descriptor); cy_en_dma_channel_state_t channelState = Cy_DMA_Descriptor_GetChannelState(&descriptor); cy_en_dma_trigger_type_t triggerInType = Cy_DMA_Descriptor_GetTriggerInType(&descriptor); cy_en_dma_data_size_t dataSize = Cy_DMA_Descriptor_GetDataSize(&descriptor); cy_en_dma_transfer_size_t srcTransferSize = Cy_DMA_Descriptor_GetSrcTransferSize(&descriptor); cy_en_dma_transfer_size_t dstTransferSize = Cy_DMA_Descriptor_GetDstTransferSize(&descriptor); cy_en_dma_descriptor_type_t descriptorType = Cy_DMA_Descriptor_GetDescriptorType(&descriptor); void * srcAddress = Cy_DMA_Descriptor_GetSrcAddress(&descriptor); void * dstAddress = Cy_DMA_Descriptor_GetDstAddress(&descriptor); int32_t srcXincrement = Cy_DMA_Descriptor_GetXloopSrcIncrement(&descriptor); int32_t dstXincrement = Cy_DMA_Descriptor_GetXloopDstIncrement(&descriptor); uint32_t xCount = Cy_DMA_Descriptor_GetXloopDataCount(&descriptor); int32_t srcYincrement = Cy_DMA_Descriptor_GetYloopSrcIncrement(&descriptor); int32_t dstYincrement = Cy_DMA_Descriptor_GetYloopDstIncrement(&descriptor); uint32_t yCount = Cy_DMA_Descriptor_GetYloopDataCount(&descriptor); cy_stc_dma_descriptor_t * nextDescriptor = Cy_DMA_Descriptor_GetNextDescriptor(&descriptor);
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
- Returns
The number of X loops to execute in the Y loop. The range is 1 … 256.
-
__STATIC_INLINE int32_t Cy_DMA_Descriptor_GetXloopSrcIncrement (cy_stc_dma_descriptor_t const *descriptor)
Returns the source increment parameter for the X loop of the specified descriptor (for 1D or 2D descriptors only).
- Function Usage
/* Scenario: Get the value of individual descriptor parameters dynamically. The snippet shows them all. */ /* This function assumes the 'descriptor' is initialized, see \ref Cy_DMA_Enable description */ cy_en_dma_retrigger_t retrigger = Cy_DMA_Descriptor_GetRetrigger(&descriptor); cy_en_dma_trigger_type_t interruptType = Cy_DMA_Descriptor_GetInterruptType(&descriptor); cy_en_dma_trigger_type_t triggerOutType = Cy_DMA_Descriptor_GetTriggerOutType(&descriptor); cy_en_dma_channel_state_t channelState = Cy_DMA_Descriptor_GetChannelState(&descriptor); cy_en_dma_trigger_type_t triggerInType = Cy_DMA_Descriptor_GetTriggerInType(&descriptor); cy_en_dma_data_size_t dataSize = Cy_DMA_Descriptor_GetDataSize(&descriptor); cy_en_dma_transfer_size_t srcTransferSize = Cy_DMA_Descriptor_GetSrcTransferSize(&descriptor); cy_en_dma_transfer_size_t dstTransferSize = Cy_DMA_Descriptor_GetDstTransferSize(&descriptor); cy_en_dma_descriptor_type_t descriptorType = Cy_DMA_Descriptor_GetDescriptorType(&descriptor); void * srcAddress = Cy_DMA_Descriptor_GetSrcAddress(&descriptor); void * dstAddress = Cy_DMA_Descriptor_GetDstAddress(&descriptor); int32_t srcXincrement = Cy_DMA_Descriptor_GetXloopSrcIncrement(&descriptor); int32_t dstXincrement = Cy_DMA_Descriptor_GetXloopDstIncrement(&descriptor); uint32_t xCount = Cy_DMA_Descriptor_GetXloopDataCount(&descriptor); int32_t srcYincrement = Cy_DMA_Descriptor_GetYloopSrcIncrement(&descriptor); int32_t dstYincrement = Cy_DMA_Descriptor_GetYloopDstIncrement(&descriptor); uint32_t yCount = Cy_DMA_Descriptor_GetYloopDataCount(&descriptor); cy_stc_dma_descriptor_t * nextDescriptor = Cy_DMA_Descriptor_GetNextDescriptor(&descriptor);
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
- Returns
The value of the source increment. The range is -2048 … 2047.
-
__STATIC_INLINE int32_t Cy_DMA_Descriptor_GetXloopDstIncrement (cy_stc_dma_descriptor_t const *descriptor)
Returns the destination increment parameter for the X loop of the specified descriptor (for 1D or 2D descriptors only).
- Function Usage
/* Scenario: Get the value of individual descriptor parameters dynamically. The snippet shows them all. */ /* This function assumes the 'descriptor' is initialized, see \ref Cy_DMA_Enable description */ cy_en_dma_retrigger_t retrigger = Cy_DMA_Descriptor_GetRetrigger(&descriptor); cy_en_dma_trigger_type_t interruptType = Cy_DMA_Descriptor_GetInterruptType(&descriptor); cy_en_dma_trigger_type_t triggerOutType = Cy_DMA_Descriptor_GetTriggerOutType(&descriptor); cy_en_dma_channel_state_t channelState = Cy_DMA_Descriptor_GetChannelState(&descriptor); cy_en_dma_trigger_type_t triggerInType = Cy_DMA_Descriptor_GetTriggerInType(&descriptor); cy_en_dma_data_size_t dataSize = Cy_DMA_Descriptor_GetDataSize(&descriptor); cy_en_dma_transfer_size_t srcTransferSize = Cy_DMA_Descriptor_GetSrcTransferSize(&descriptor); cy_en_dma_transfer_size_t dstTransferSize = Cy_DMA_Descriptor_GetDstTransferSize(&descriptor); cy_en_dma_descriptor_type_t descriptorType = Cy_DMA_Descriptor_GetDescriptorType(&descriptor); void * srcAddress = Cy_DMA_Descriptor_GetSrcAddress(&descriptor); void * dstAddress = Cy_DMA_Descriptor_GetDstAddress(&descriptor); int32_t srcXincrement = Cy_DMA_Descriptor_GetXloopSrcIncrement(&descriptor); int32_t dstXincrement = Cy_DMA_Descriptor_GetXloopDstIncrement(&descriptor); uint32_t xCount = Cy_DMA_Descriptor_GetXloopDataCount(&descriptor); int32_t srcYincrement = Cy_DMA_Descriptor_GetYloopSrcIncrement(&descriptor); int32_t dstYincrement = Cy_DMA_Descriptor_GetYloopDstIncrement(&descriptor); uint32_t yCount = Cy_DMA_Descriptor_GetYloopDataCount(&descriptor); cy_stc_dma_descriptor_t * nextDescriptor = Cy_DMA_Descriptor_GetNextDescriptor(&descriptor);
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
- Returns
The value of the destination increment. The range is -2048 … 2047.
-
__STATIC_INLINE int32_t Cy_DMA_Descriptor_GetYloopSrcIncrement (cy_stc_dma_descriptor_t const *descriptor)
Returns the source increment parameter for the outer Y of the specified descriptor (for 2D descriptors only).
- Function Usage
/* Scenario: Get the value of individual descriptor parameters dynamically. The snippet shows them all. */ /* This function assumes the 'descriptor' is initialized, see \ref Cy_DMA_Enable description */ cy_en_dma_retrigger_t retrigger = Cy_DMA_Descriptor_GetRetrigger(&descriptor); cy_en_dma_trigger_type_t interruptType = Cy_DMA_Descriptor_GetInterruptType(&descriptor); cy_en_dma_trigger_type_t triggerOutType = Cy_DMA_Descriptor_GetTriggerOutType(&descriptor); cy_en_dma_channel_state_t channelState = Cy_DMA_Descriptor_GetChannelState(&descriptor); cy_en_dma_trigger_type_t triggerInType = Cy_DMA_Descriptor_GetTriggerInType(&descriptor); cy_en_dma_data_size_t dataSize = Cy_DMA_Descriptor_GetDataSize(&descriptor); cy_en_dma_transfer_size_t srcTransferSize = Cy_DMA_Descriptor_GetSrcTransferSize(&descriptor); cy_en_dma_transfer_size_t dstTransferSize = Cy_DMA_Descriptor_GetDstTransferSize(&descriptor); cy_en_dma_descriptor_type_t descriptorType = Cy_DMA_Descriptor_GetDescriptorType(&descriptor); void * srcAddress = Cy_DMA_Descriptor_GetSrcAddress(&descriptor); void * dstAddress = Cy_DMA_Descriptor_GetDstAddress(&descriptor); int32_t srcXincrement = Cy_DMA_Descriptor_GetXloopSrcIncrement(&descriptor); int32_t dstXincrement = Cy_DMA_Descriptor_GetXloopDstIncrement(&descriptor); uint32_t xCount = Cy_DMA_Descriptor_GetXloopDataCount(&descriptor); int32_t srcYincrement = Cy_DMA_Descriptor_GetYloopSrcIncrement(&descriptor); int32_t dstYincrement = Cy_DMA_Descriptor_GetYloopDstIncrement(&descriptor); uint32_t yCount = Cy_DMA_Descriptor_GetYloopDataCount(&descriptor); cy_stc_dma_descriptor_t * nextDescriptor = Cy_DMA_Descriptor_GetNextDescriptor(&descriptor);
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
- Returns
The value of the source increment. The range is -2048 … 2047.
-
__STATIC_INLINE int32_t Cy_DMA_Descriptor_GetYloopDstIncrement (cy_stc_dma_descriptor_t const *descriptor)
Returns the destination increment parameter for the Y loop of the specified descriptor (for 2D descriptors only).
- Function Usage
/* Scenario: Get the value of individual descriptor parameters dynamically. The snippet shows them all. */ /* This function assumes the 'descriptor' is initialized, see \ref Cy_DMA_Enable description */ cy_en_dma_retrigger_t retrigger = Cy_DMA_Descriptor_GetRetrigger(&descriptor); cy_en_dma_trigger_type_t interruptType = Cy_DMA_Descriptor_GetInterruptType(&descriptor); cy_en_dma_trigger_type_t triggerOutType = Cy_DMA_Descriptor_GetTriggerOutType(&descriptor); cy_en_dma_channel_state_t channelState = Cy_DMA_Descriptor_GetChannelState(&descriptor); cy_en_dma_trigger_type_t triggerInType = Cy_DMA_Descriptor_GetTriggerInType(&descriptor); cy_en_dma_data_size_t dataSize = Cy_DMA_Descriptor_GetDataSize(&descriptor); cy_en_dma_transfer_size_t srcTransferSize = Cy_DMA_Descriptor_GetSrcTransferSize(&descriptor); cy_en_dma_transfer_size_t dstTransferSize = Cy_DMA_Descriptor_GetDstTransferSize(&descriptor); cy_en_dma_descriptor_type_t descriptorType = Cy_DMA_Descriptor_GetDescriptorType(&descriptor); void * srcAddress = Cy_DMA_Descriptor_GetSrcAddress(&descriptor); void * dstAddress = Cy_DMA_Descriptor_GetDstAddress(&descriptor); int32_t srcXincrement = Cy_DMA_Descriptor_GetXloopSrcIncrement(&descriptor); int32_t dstXincrement = Cy_DMA_Descriptor_GetXloopDstIncrement(&descriptor); uint32_t xCount = Cy_DMA_Descriptor_GetXloopDataCount(&descriptor); int32_t srcYincrement = Cy_DMA_Descriptor_GetYloopSrcIncrement(&descriptor); int32_t dstYincrement = Cy_DMA_Descriptor_GetYloopDstIncrement(&descriptor); uint32_t yCount = Cy_DMA_Descriptor_GetYloopDataCount(&descriptor); cy_stc_dma_descriptor_t * nextDescriptor = Cy_DMA_Descriptor_GetNextDescriptor(&descriptor);
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
- Returns
The value of the destination increment. The range is -2048 … 2047.
-
__STATIC_INLINE cy_en_dma_trigger_type_t Cy_DMA_Descriptor_GetInterruptType (cy_stc_dma_descriptor_t const *descriptor)
Returns the Interrupt-Type of the specified descriptor.
- Function Usage
/* Scenario: Get the value of individual descriptor parameters dynamically. The snippet shows them all. */ /* This function assumes the 'descriptor' is initialized, see \ref Cy_DMA_Enable description */ cy_en_dma_retrigger_t retrigger = Cy_DMA_Descriptor_GetRetrigger(&descriptor); cy_en_dma_trigger_type_t interruptType = Cy_DMA_Descriptor_GetInterruptType(&descriptor); cy_en_dma_trigger_type_t triggerOutType = Cy_DMA_Descriptor_GetTriggerOutType(&descriptor); cy_en_dma_channel_state_t channelState = Cy_DMA_Descriptor_GetChannelState(&descriptor); cy_en_dma_trigger_type_t triggerInType = Cy_DMA_Descriptor_GetTriggerInType(&descriptor); cy_en_dma_data_size_t dataSize = Cy_DMA_Descriptor_GetDataSize(&descriptor); cy_en_dma_transfer_size_t srcTransferSize = Cy_DMA_Descriptor_GetSrcTransferSize(&descriptor); cy_en_dma_transfer_size_t dstTransferSize = Cy_DMA_Descriptor_GetDstTransferSize(&descriptor); cy_en_dma_descriptor_type_t descriptorType = Cy_DMA_Descriptor_GetDescriptorType(&descriptor); void * srcAddress = Cy_DMA_Descriptor_GetSrcAddress(&descriptor); void * dstAddress = Cy_DMA_Descriptor_GetDstAddress(&descriptor); int32_t srcXincrement = Cy_DMA_Descriptor_GetXloopSrcIncrement(&descriptor); int32_t dstXincrement = Cy_DMA_Descriptor_GetXloopDstIncrement(&descriptor); uint32_t xCount = Cy_DMA_Descriptor_GetXloopDataCount(&descriptor); int32_t srcYincrement = Cy_DMA_Descriptor_GetYloopSrcIncrement(&descriptor); int32_t dstYincrement = Cy_DMA_Descriptor_GetYloopDstIncrement(&descriptor); uint32_t yCount = Cy_DMA_Descriptor_GetYloopDataCount(&descriptor); cy_stc_dma_descriptor_t * nextDescriptor = Cy_DMA_Descriptor_GetNextDescriptor(&descriptor);
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
- Returns
The Interrupt-Type cy_en_dma_trigger_type_t.
-
__STATIC_INLINE cy_en_dma_trigger_type_t Cy_DMA_Descriptor_GetTriggerInType (cy_stc_dma_descriptor_t const *descriptor)
Returns the Trigger-In-Type parameter of the specified descriptor.
- Function Usage
/* Scenario: Get the value of individual descriptor parameters dynamically. The snippet shows them all. */ /* This function assumes the 'descriptor' is initialized, see \ref Cy_DMA_Enable description */ cy_en_dma_retrigger_t retrigger = Cy_DMA_Descriptor_GetRetrigger(&descriptor); cy_en_dma_trigger_type_t interruptType = Cy_DMA_Descriptor_GetInterruptType(&descriptor); cy_en_dma_trigger_type_t triggerOutType = Cy_DMA_Descriptor_GetTriggerOutType(&descriptor); cy_en_dma_channel_state_t channelState = Cy_DMA_Descriptor_GetChannelState(&descriptor); cy_en_dma_trigger_type_t triggerInType = Cy_DMA_Descriptor_GetTriggerInType(&descriptor); cy_en_dma_data_size_t dataSize = Cy_DMA_Descriptor_GetDataSize(&descriptor); cy_en_dma_transfer_size_t srcTransferSize = Cy_DMA_Descriptor_GetSrcTransferSize(&descriptor); cy_en_dma_transfer_size_t dstTransferSize = Cy_DMA_Descriptor_GetDstTransferSize(&descriptor); cy_en_dma_descriptor_type_t descriptorType = Cy_DMA_Descriptor_GetDescriptorType(&descriptor); void * srcAddress = Cy_DMA_Descriptor_GetSrcAddress(&descriptor); void * dstAddress = Cy_DMA_Descriptor_GetDstAddress(&descriptor); int32_t srcXincrement = Cy_DMA_Descriptor_GetXloopSrcIncrement(&descriptor); int32_t dstXincrement = Cy_DMA_Descriptor_GetXloopDstIncrement(&descriptor); uint32_t xCount = Cy_DMA_Descriptor_GetXloopDataCount(&descriptor); int32_t srcYincrement = Cy_DMA_Descriptor_GetYloopSrcIncrement(&descriptor); int32_t dstYincrement = Cy_DMA_Descriptor_GetYloopDstIncrement(&descriptor); uint32_t yCount = Cy_DMA_Descriptor_GetYloopDataCount(&descriptor); cy_stc_dma_descriptor_t * nextDescriptor = Cy_DMA_Descriptor_GetNextDescriptor(&descriptor);
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
- Returns
The Trigger-In-Type cy_en_dma_trigger_type_t
-
__STATIC_INLINE cy_en_dma_trigger_type_t Cy_DMA_Descriptor_GetTriggerOutType (cy_stc_dma_descriptor_t const *descriptor)
Returns the Trigger-Out-Type parameter of the specified descriptor.
- Function Usage
/* Scenario: Get the value of individual descriptor parameters dynamically. The snippet shows them all. */ /* This function assumes the 'descriptor' is initialized, see \ref Cy_DMA_Enable description */ cy_en_dma_retrigger_t retrigger = Cy_DMA_Descriptor_GetRetrigger(&descriptor); cy_en_dma_trigger_type_t interruptType = Cy_DMA_Descriptor_GetInterruptType(&descriptor); cy_en_dma_trigger_type_t triggerOutType = Cy_DMA_Descriptor_GetTriggerOutType(&descriptor); cy_en_dma_channel_state_t channelState = Cy_DMA_Descriptor_GetChannelState(&descriptor); cy_en_dma_trigger_type_t triggerInType = Cy_DMA_Descriptor_GetTriggerInType(&descriptor); cy_en_dma_data_size_t dataSize = Cy_DMA_Descriptor_GetDataSize(&descriptor); cy_en_dma_transfer_size_t srcTransferSize = Cy_DMA_Descriptor_GetSrcTransferSize(&descriptor); cy_en_dma_transfer_size_t dstTransferSize = Cy_DMA_Descriptor_GetDstTransferSize(&descriptor); cy_en_dma_descriptor_type_t descriptorType = Cy_DMA_Descriptor_GetDescriptorType(&descriptor); void * srcAddress = Cy_DMA_Descriptor_GetSrcAddress(&descriptor); void * dstAddress = Cy_DMA_Descriptor_GetDstAddress(&descriptor); int32_t srcXincrement = Cy_DMA_Descriptor_GetXloopSrcIncrement(&descriptor); int32_t dstXincrement = Cy_DMA_Descriptor_GetXloopDstIncrement(&descriptor); uint32_t xCount = Cy_DMA_Descriptor_GetXloopDataCount(&descriptor); int32_t srcYincrement = Cy_DMA_Descriptor_GetYloopSrcIncrement(&descriptor); int32_t dstYincrement = Cy_DMA_Descriptor_GetYloopDstIncrement(&descriptor); uint32_t yCount = Cy_DMA_Descriptor_GetYloopDataCount(&descriptor); cy_stc_dma_descriptor_t * nextDescriptor = Cy_DMA_Descriptor_GetNextDescriptor(&descriptor);
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
- Returns
The Trigger-Out-Type parameter cy_en_dma_trigger_type_t.
-
__STATIC_INLINE cy_en_dma_data_size_t Cy_DMA_Descriptor_GetDataSize (cy_stc_dma_descriptor_t const *descriptor)
Returns the Data Element Size parameter of the specified descriptor.
- Function Usage
/* Scenario: Get the value of individual descriptor parameters dynamically. The snippet shows them all. */ /* This function assumes the 'descriptor' is initialized, see \ref Cy_DMA_Enable description */ cy_en_dma_retrigger_t retrigger = Cy_DMA_Descriptor_GetRetrigger(&descriptor); cy_en_dma_trigger_type_t interruptType = Cy_DMA_Descriptor_GetInterruptType(&descriptor); cy_en_dma_trigger_type_t triggerOutType = Cy_DMA_Descriptor_GetTriggerOutType(&descriptor); cy_en_dma_channel_state_t channelState = Cy_DMA_Descriptor_GetChannelState(&descriptor); cy_en_dma_trigger_type_t triggerInType = Cy_DMA_Descriptor_GetTriggerInType(&descriptor); cy_en_dma_data_size_t dataSize = Cy_DMA_Descriptor_GetDataSize(&descriptor); cy_en_dma_transfer_size_t srcTransferSize = Cy_DMA_Descriptor_GetSrcTransferSize(&descriptor); cy_en_dma_transfer_size_t dstTransferSize = Cy_DMA_Descriptor_GetDstTransferSize(&descriptor); cy_en_dma_descriptor_type_t descriptorType = Cy_DMA_Descriptor_GetDescriptorType(&descriptor); void * srcAddress = Cy_DMA_Descriptor_GetSrcAddress(&descriptor); void * dstAddress = Cy_DMA_Descriptor_GetDstAddress(&descriptor); int32_t srcXincrement = Cy_DMA_Descriptor_GetXloopSrcIncrement(&descriptor); int32_t dstXincrement = Cy_DMA_Descriptor_GetXloopDstIncrement(&descriptor); uint32_t xCount = Cy_DMA_Descriptor_GetXloopDataCount(&descriptor); int32_t srcYincrement = Cy_DMA_Descriptor_GetYloopSrcIncrement(&descriptor); int32_t dstYincrement = Cy_DMA_Descriptor_GetYloopDstIncrement(&descriptor); uint32_t yCount = Cy_DMA_Descriptor_GetYloopDataCount(&descriptor); cy_stc_dma_descriptor_t * nextDescriptor = Cy_DMA_Descriptor_GetNextDescriptor(&descriptor);
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
- Returns
The Data Element Size cy_en_dma_data_size_t.
-
__STATIC_INLINE cy_en_dma_transfer_size_t Cy_DMA_Descriptor_GetSrcTransferSize (cy_stc_dma_descriptor_t const *descriptor)
Returns the Source Transfer Size parameter of the specified descriptor.
- Function Usage
/* Scenario: Get the value of individual descriptor parameters dynamically. The snippet shows them all. */ /* This function assumes the 'descriptor' is initialized, see \ref Cy_DMA_Enable description */ cy_en_dma_retrigger_t retrigger = Cy_DMA_Descriptor_GetRetrigger(&descriptor); cy_en_dma_trigger_type_t interruptType = Cy_DMA_Descriptor_GetInterruptType(&descriptor); cy_en_dma_trigger_type_t triggerOutType = Cy_DMA_Descriptor_GetTriggerOutType(&descriptor); cy_en_dma_channel_state_t channelState = Cy_DMA_Descriptor_GetChannelState(&descriptor); cy_en_dma_trigger_type_t triggerInType = Cy_DMA_Descriptor_GetTriggerInType(&descriptor); cy_en_dma_data_size_t dataSize = Cy_DMA_Descriptor_GetDataSize(&descriptor); cy_en_dma_transfer_size_t srcTransferSize = Cy_DMA_Descriptor_GetSrcTransferSize(&descriptor); cy_en_dma_transfer_size_t dstTransferSize = Cy_DMA_Descriptor_GetDstTransferSize(&descriptor); cy_en_dma_descriptor_type_t descriptorType = Cy_DMA_Descriptor_GetDescriptorType(&descriptor); void * srcAddress = Cy_DMA_Descriptor_GetSrcAddress(&descriptor); void * dstAddress = Cy_DMA_Descriptor_GetDstAddress(&descriptor); int32_t srcXincrement = Cy_DMA_Descriptor_GetXloopSrcIncrement(&descriptor); int32_t dstXincrement = Cy_DMA_Descriptor_GetXloopDstIncrement(&descriptor); uint32_t xCount = Cy_DMA_Descriptor_GetXloopDataCount(&descriptor); int32_t srcYincrement = Cy_DMA_Descriptor_GetYloopSrcIncrement(&descriptor); int32_t dstYincrement = Cy_DMA_Descriptor_GetYloopDstIncrement(&descriptor); uint32_t yCount = Cy_DMA_Descriptor_GetYloopDataCount(&descriptor); cy_stc_dma_descriptor_t * nextDescriptor = Cy_DMA_Descriptor_GetNextDescriptor(&descriptor);
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
- Returns
The Source Transfer Size cy_en_dma_transfer_size_t.
-
__STATIC_INLINE cy_en_dma_transfer_size_t Cy_DMA_Descriptor_GetDstTransferSize (cy_stc_dma_descriptor_t const *descriptor)
Returns the Destination Transfer Size parameter of the specified descriptor.
- Function Usage
/* Scenario: Get the value of individual descriptor parameters dynamically. The snippet shows them all. */ /* This function assumes the 'descriptor' is initialized, see \ref Cy_DMA_Enable description */ cy_en_dma_retrigger_t retrigger = Cy_DMA_Descriptor_GetRetrigger(&descriptor); cy_en_dma_trigger_type_t interruptType = Cy_DMA_Descriptor_GetInterruptType(&descriptor); cy_en_dma_trigger_type_t triggerOutType = Cy_DMA_Descriptor_GetTriggerOutType(&descriptor); cy_en_dma_channel_state_t channelState = Cy_DMA_Descriptor_GetChannelState(&descriptor); cy_en_dma_trigger_type_t triggerInType = Cy_DMA_Descriptor_GetTriggerInType(&descriptor); cy_en_dma_data_size_t dataSize = Cy_DMA_Descriptor_GetDataSize(&descriptor); cy_en_dma_transfer_size_t srcTransferSize = Cy_DMA_Descriptor_GetSrcTransferSize(&descriptor); cy_en_dma_transfer_size_t dstTransferSize = Cy_DMA_Descriptor_GetDstTransferSize(&descriptor); cy_en_dma_descriptor_type_t descriptorType = Cy_DMA_Descriptor_GetDescriptorType(&descriptor); void * srcAddress = Cy_DMA_Descriptor_GetSrcAddress(&descriptor); void * dstAddress = Cy_DMA_Descriptor_GetDstAddress(&descriptor); int32_t srcXincrement = Cy_DMA_Descriptor_GetXloopSrcIncrement(&descriptor); int32_t dstXincrement = Cy_DMA_Descriptor_GetXloopDstIncrement(&descriptor); uint32_t xCount = Cy_DMA_Descriptor_GetXloopDataCount(&descriptor); int32_t srcYincrement = Cy_DMA_Descriptor_GetYloopSrcIncrement(&descriptor); int32_t dstYincrement = Cy_DMA_Descriptor_GetYloopDstIncrement(&descriptor); uint32_t yCount = Cy_DMA_Descriptor_GetYloopDataCount(&descriptor); cy_stc_dma_descriptor_t * nextDescriptor = Cy_DMA_Descriptor_GetNextDescriptor(&descriptor);
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
- Returns
The Destination Transfer Size cy_en_dma_transfer_size_t.
-
__STATIC_INLINE cy_en_dma_retrigger_t Cy_DMA_Descriptor_GetRetrigger (cy_stc_dma_descriptor_t const *descriptor)
Returns a value that specifies whether the controller should wait for the input trigger to be deactivated.
- Function Usage
/* Scenario: Get the value of individual descriptor parameters dynamically. The snippet shows them all. */ /* This function assumes the 'descriptor' is initialized, see \ref Cy_DMA_Enable description */ cy_en_dma_retrigger_t retrigger = Cy_DMA_Descriptor_GetRetrigger(&descriptor); cy_en_dma_trigger_type_t interruptType = Cy_DMA_Descriptor_GetInterruptType(&descriptor); cy_en_dma_trigger_type_t triggerOutType = Cy_DMA_Descriptor_GetTriggerOutType(&descriptor); cy_en_dma_channel_state_t channelState = Cy_DMA_Descriptor_GetChannelState(&descriptor); cy_en_dma_trigger_type_t triggerInType = Cy_DMA_Descriptor_GetTriggerInType(&descriptor); cy_en_dma_data_size_t dataSize = Cy_DMA_Descriptor_GetDataSize(&descriptor); cy_en_dma_transfer_size_t srcTransferSize = Cy_DMA_Descriptor_GetSrcTransferSize(&descriptor); cy_en_dma_transfer_size_t dstTransferSize = Cy_DMA_Descriptor_GetDstTransferSize(&descriptor); cy_en_dma_descriptor_type_t descriptorType = Cy_DMA_Descriptor_GetDescriptorType(&descriptor); void * srcAddress = Cy_DMA_Descriptor_GetSrcAddress(&descriptor); void * dstAddress = Cy_DMA_Descriptor_GetDstAddress(&descriptor); int32_t srcXincrement = Cy_DMA_Descriptor_GetXloopSrcIncrement(&descriptor); int32_t dstXincrement = Cy_DMA_Descriptor_GetXloopDstIncrement(&descriptor); uint32_t xCount = Cy_DMA_Descriptor_GetXloopDataCount(&descriptor); int32_t srcYincrement = Cy_DMA_Descriptor_GetYloopSrcIncrement(&descriptor); int32_t dstYincrement = Cy_DMA_Descriptor_GetYloopDstIncrement(&descriptor); uint32_t yCount = Cy_DMA_Descriptor_GetYloopDataCount(&descriptor); cy_stc_dma_descriptor_t * nextDescriptor = Cy_DMA_Descriptor_GetNextDescriptor(&descriptor);
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
- Returns
The Retrigger setting cy_en_dma_retrigger_t.
-
__STATIC_INLINE cy_en_dma_channel_state_t Cy_DMA_Descriptor_GetChannelState (cy_stc_dma_descriptor_t const *descriptor)
Returns the channel state on completion of the specified descriptor.
- Function Usage
/* Scenario: Get the value of individual descriptor parameters dynamically. The snippet shows them all. */ /* This function assumes the 'descriptor' is initialized, see \ref Cy_DMA_Enable description */ cy_en_dma_retrigger_t retrigger = Cy_DMA_Descriptor_GetRetrigger(&descriptor); cy_en_dma_trigger_type_t interruptType = Cy_DMA_Descriptor_GetInterruptType(&descriptor); cy_en_dma_trigger_type_t triggerOutType = Cy_DMA_Descriptor_GetTriggerOutType(&descriptor); cy_en_dma_channel_state_t channelState = Cy_DMA_Descriptor_GetChannelState(&descriptor); cy_en_dma_trigger_type_t triggerInType = Cy_DMA_Descriptor_GetTriggerInType(&descriptor); cy_en_dma_data_size_t dataSize = Cy_DMA_Descriptor_GetDataSize(&descriptor); cy_en_dma_transfer_size_t srcTransferSize = Cy_DMA_Descriptor_GetSrcTransferSize(&descriptor); cy_en_dma_transfer_size_t dstTransferSize = Cy_DMA_Descriptor_GetDstTransferSize(&descriptor); cy_en_dma_descriptor_type_t descriptorType = Cy_DMA_Descriptor_GetDescriptorType(&descriptor); void * srcAddress = Cy_DMA_Descriptor_GetSrcAddress(&descriptor); void * dstAddress = Cy_DMA_Descriptor_GetDstAddress(&descriptor); int32_t srcXincrement = Cy_DMA_Descriptor_GetXloopSrcIncrement(&descriptor); int32_t dstXincrement = Cy_DMA_Descriptor_GetXloopDstIncrement(&descriptor); uint32_t xCount = Cy_DMA_Descriptor_GetXloopDataCount(&descriptor); int32_t srcYincrement = Cy_DMA_Descriptor_GetYloopSrcIncrement(&descriptor); int32_t dstYincrement = Cy_DMA_Descriptor_GetYloopDstIncrement(&descriptor); uint32_t yCount = Cy_DMA_Descriptor_GetYloopDataCount(&descriptor); cy_stc_dma_descriptor_t * nextDescriptor = Cy_DMA_Descriptor_GetNextDescriptor(&descriptor);
- Parameters
descriptor – The descriptor structure instance declared by the user/component.
- Returns
The Channel State setting cy_en_dma_channel_state_t.
-
struct
cy_stc_dma_descriptor_t
¶ - #include <>
DMA descriptor structure type.
It is a user/component-declared structure allocated in RAM. The DMA HW requires a pointer to this structure to work with it.
For advanced users: the descriptor can be allocated even in flash, then the user manually predefines all the structure items with constants. This is because most of the driver’s API (especially functions modifying descriptors, including Cy_DMA_Descriptor_Init()) can’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
xCtl
¶ 0x0000000C Descriptor X loop control
-
uint32_t
yCtl
¶ 0x00000010 Descriptor Y loop control
-
uint32_t
nextPtr
¶ 0x00000014 Descriptor next pointer
-
uint32_t
-
struct
cy_stc_dma_descriptor_config_t
¶ - #include <>
This structure is a configuration structure pre-initialized by the user and passed as a parameter to the Cy_DMA_Descriptor_Init().
It can be allocated in RAM/flash (the 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_dma_descriptor_t structure as bitfields.
Public Members
-
cy_en_dma_retrigger_t
retrigger
¶ Specifies whether the DW controller should wait for the input trigger to be deactivated.
-
cy_en_dma_trigger_type_t
interruptType
¶ Sets the event that triggers an interrupt.
-
cy_en_dma_trigger_type_t
triggerOutType
¶ Sets the event that triggers an output.
-
cy_en_dma_channel_state_t
channelState
¶ Specifies whether the channel is enabled or disabled on completion of descriptor.
-
cy_en_dma_trigger_type_t
triggerInType
¶ Sets what type of transfer is triggered.
-
cy_en_dma_data_size_t
dataSize
¶ The size of the data bus for transfer.
-
cy_en_dma_transfer_size_t
srcTransferSize
¶ The source transfer size.
-
cy_en_dma_transfer_size_t
dstTransferSize
¶ The destination transfer size.
-
cy_en_dma_descriptor_type_t
descriptorType
¶ The type of the descriptor.
-
void *
srcAddress
¶ The source address of the transfer.
-
void *
dstAddress
¶ The destination address of the transfer.
For CPUSS_ver2 only: for CRC transfer, the CRC result without post-processing (reversing and/or XORing, if used) is placed into the dstAddress.
-
int32_t
srcXincrement
¶ The address increment of the source after each X-loop transfer.
Valid range is -2048 … 2047.
-
int32_t
dstXincrement
¶ The address increment of the destination after each X-loop transfer.
Valid range is -2048 … 2047.
-
uint32_t
xCount
¶ The number of transfers in an X-loop.
Valid range is 1 … 256.
-
int32_t
srcYincrement
¶ The address increment of the source after each Y-loop transfer.
Valid range is -2048 … 2047.
-
int32_t
dstYincrement
¶ The address increment of the destination after each Y-loop transfer.
Valid range is -2048 … 2047.
-
uint32_t
yCount
¶ The number of X-loops in the Y-loop.
Valid range is 1 … 256.
-
cy_stc_dma_descriptor_t *
nextDescriptor
¶ The next descriptor to chain after completion.
A NULL value will signify no chaining.
-
cy_en_dma_retrigger_t
-
struct
cy_stc_dma_channel_config_t
¶ - #include <>
This structure holds the initialization values for the DMA channel.
Public Members
-
cy_stc_dma_descriptor_t *
descriptor
¶ The DMA descriptor associated with the channel being initialized.
-
bool
preemptable
¶ Specifies whether the channel is preemptable by another higher-priority channel.
-
uint32_t
priority
¶ This parameter specifies the channel’s priority.
-
bool
enable
¶ This parameter specifies whether 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.
-
cy_stc_dma_descriptor_t *
-
struct
cy_stc_dma_crc_config_t
¶ - #include <>
This structure holds the initialization values for the CRC feature, only for CPUSS_ver2.
Public Members
-
bool
dataReverse
¶ Specifies the bit order in which a data byte is processed (reversal is performed after XORing): ‘false’: Most significant bit (bit 1) first.
‘true’: Least significant bit (bit 0) first.
-
uint32_t
dataXor
¶ Specifies a byte mask with which each data byte is XORed.
The XOR is performed before data reversal.
-
bool
reminderReverse
¶ Specifies whether the remainder is bit reversed (reversal is performed after XORing).
Note: this parameter doesn’t affect the CRC value stored into the dstAddress. The reversed value remains in the CRC_REM_RESULT register.
-
uint32_t
reminderXor
¶ Specifies a mask with which the remainder is XORed.
The XOR is performed before remainder reversal. Note: this parameter doesn’t affect the CRC value stored into the dstAddress. The XORed value remains in the CRC_REM_RESULT register.
-
uint32_t
polynomial
¶ CRC polynomial.
The polynomial is represented WITHOUT the high order bit (this bit is always assumed ‘1’). The polynomial should be aligned/shifted such that the more significant bits (bit 31 and down) contain the polynomial and the less significant bits (bit 0 and up) contain padding ‘0’s. Some frequently used polynomials:
CRC32: POLYNOMIAL is 0x04c11db7 (x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x + 1).
CRC16: POLYNOMIAL is 0x80050000 (x^16 + x^15 + x^2 + 1, shifted by 16 bit positions).
CRC16 CCITT: POLYNOMIAL is 0x10210000 (x^16 + x^12 + x^5 + 1, shifted by 16 bit positions).
-
uint32_t
lfsrInitVal
¶ The initial value of the Linear Feedback Shift Register.
-
bool