cy_dmac_8h

The header file of the DMAC 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

1.20

Copyright

Copyright 2018-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_DMAC_DRV_VERSION_MAJOR

The driver major version.

CY_DMAC_DRV_VERSION_MINOR

The driver minor version.

CY_DMAC_ID

The DMAC driver identifier.

CY_DMAC_LOOP_COUNT_MIN

The minimum X/Y Count API parameters.

CY_DMAC_LOOP_COUNT_MAX

The maximum X/Y Count API parameters.

CY_DMAC_SCATTER_COUNT_MAX

The maximum X Count API parameter for scatter transfer.

CY_DMAC_LOOP_INCREMENT_MIN

The minimum X/Y Increment API parameters.

CY_DMAC_LOOP_INCREMENT_MAX

The maximum X/Y Increment API parameters.

CY_DMAC_INTR_COMPLETION

Bit 0: Completion of data transfer(s) as specified by the descriptor’s interruptType setting.

CY_DMAC_INTR_SRC_BUS_ERROR

Bit 1: Bus error for a load from the source.

CY_DMAC_INTR_DST_BUS_ERROR

Bit 2: Bus error for a store to the destination.

CY_DMAC_INTR_SRC_MISAL

Bit 3: Misalignment of the source address.

CY_DMAC_INTR_DST_MISAL

Bit 4: Misalignment of the destination address.

CY_DMAC_INTR_CURR_PTR_NULL

Bit 5: The channel is enabled and the current descriptor pointer is “0”.

CY_DMAC_INTR_ACTIVE_CH_DISABLED

Bit 6: The channel is disabled and the data transfer engine is busy.

CY_DMAC_INTR_DESCR_BUS_ERROR

Bit 7: Bus error for a load of the descriptor.

Enums

enum cy_en_dmac_descriptor_type_t

cy_en_dmac_descriptor_type_t: Contains the options for the descriptor type.

Values:

enumerator CY_DMAC_SINGLE_TRANSFER

Single transfer.

enumerator CY_DMAC_1D_TRANSFER

1D transfer.

enumerator CY_DMAC_2D_TRANSFER

2D transfer.

enumerator CY_DMAC_MEMORY_COPY

Memory copy.

enumerator CY_DMAC_SCATTER_TRANSFER

Scatter transfer.

enum cy_en_dmac_trigger_type_t

cy_en_dmac_trigger_type_t: Contains the options for the interrupt, trig-in and trig-out type parameters of the descriptor.

Values:

enumerator CY_DMAC_1ELEMENT

One element transfer.

enumerator CY_DMAC_X_LOOP

One X loop transfer.

enumerator CY_DMAC_DESCR

One descriptor transfer.

enumerator CY_DMAC_DESCR_CHAIN

Entire descriptor chain transfer.

enum cy_en_dmac_data_size_t

cy_en_dmac_data_size_t: Contains the options for the data size.

Values:

enumerator CY_DMAC_BYTE

One byte.

enumerator CY_DMAC_HALFWORD

Half word (two bytes).

enumerator CY_DMAC_WORD

Full word (four bytes).

enum cy_en_dmac_retrigger_t

cy_en_dmac_retrigger_t: Contains the options for descriptor retriggering.

Values:

enumerator CY_DMAC_RETRIG_IM

Retrigger immediately.

enumerator CY_DMAC_RETRIG_4CYC

Retrigger after 4 Clk_Slow cycles.

enumerator CY_DMAC_RETRIG_16CYC

Retrigger after 16 Clk_Slow cycles.

enumerator CY_DMAC_WAIT_FOR_REACT

Wait for trigger reactivation.

enum cy_en_dmac_transfer_size_t

cy_en_dmac_transfer_size_t: Contains the options for the transfer size.

Values:

enumerator CY_DMAC_TRANSFER_SIZE_DATA

As specified by dataSize.

enumerator CY_DMAC_TRANSFER_SIZE_WORD

A full word (four bytes).

enum cy_en_dmac_channel_state_t

cy_en_dmac_channel_state_t: Contains the options for the state of the channel when the descriptor is completed.

Values:

enumerator CY_DMAC_CHANNEL_ENABLED

Channel stays enabled.

enumerator CY_DMAC_CHANNEL_DISABLED

Channel is disabled.

enum cy_en_dmac_status_t

cy_en_dmac_status_t: Contains the return values of the DMAC driver.

Values:

enumerator CY_DMAC_SUCCESS

Success.

enumerator CY_DMAC_BAD_PARAM

The input parameters passed to the DMAC API are not valid.

Functions

__STATIC_INLINE void Cy_DMAC_Enable (DMAC_Type *base)

Enables the DMACblock.

Function Usage

    
    /* Scenario: Initialize a 1D descriptor */
    #define DATACNT (8UL)
    cy_stc_dmac_descriptor_t descriptor;
    cy_stc_dmac_descriptor_t nextDescriptor;
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    cy_stc_dmac_descriptor_config_t descriptor_cfg = 
    {
        .retrigger = CY_DMAC_RETRIG_IM,
        .interruptType = CY_DMAC_DESCR,
        .triggerOutType = CY_DMAC_DESCR,
        .channelState = CY_DMAC_CHANNEL_ENABLED,
        .triggerInType = CY_DMAC_DESCR,
        .dataSize = CY_DMAC_WORD,
        .srcTransferSize = CY_DMAC_TRANSFER_SIZE_WORD,
        .dstTransferSize = CY_DMAC_TRANSFER_SIZE_WORD,
        .descriptorType = CY_DMAC_1D_TRANSFER,
        .srcAddress = &src,
        .dstAddress = &dst,
        .srcXincrement = 1U,
        .dstXincrement = 1U,
        .xCount = DATACNT,
        .srcYincrement = 0U,
        .dstYincrement = 0U,
        .yCount = 1UL,
        .nextDescriptor = &nextDescriptor,
    };
    
    if (CY_DMAC_SUCCESS != Cy_DMAC_Descriptor_Init(&descriptor, &descriptor_cfg))
    {
        /* Insert error handling */
    }
    
    /* Scenario: Setup and enable the DMAC channel 0 */
    cy_stc_dmac_channel_config_t channelConfig;
    channelConfig.enable = false;
    channelConfig.bufferable = false;
    
    if (CY_DMAC_SUCCESS != Cy_DMAC_Channel_Init(DMAC, 0UL, &channelConfig))
    {
        /* Insert error handling */
    }
    
    Cy_DMAC_Channel_SetDescriptor(DMAC, 0UL, &descriptor);
    Cy_DMAC_Channel_SetPriority(DMAC, 0UL, 3UL);
    Cy_DMAC_Channel_Enable(DMAC, 0UL);
    
    Cy_DMAC_Enable(DMAC);
    

Parameters
  • base: The pointer to the hardware DMAC block.

__STATIC_INLINE void Cy_DMAC_Disable (DMAC_Type *base)

Disables the DMACblock.

Function Usage

    
    /* Scenario: Disable the DMAC channel 0 if it's priority equals 3 */
    
    if (3UL == Cy_DMAC_Channel_GetPriority(DMAC, 0UL))
    {    
        if (0UL != Cy_DMAC_GetActiveChannel(DMAC))
        {
            Cy_DMAC_Channel_Disable(DMAC, 0UL);
            Cy_DMAC_Channel_DeInit(DMAC, 0UL);

            /* if needed (if there is only channel used) the whole block can be disabled */
            Cy_DMAC_Disable(DMAC);
        }
    }
    

Parameters
  • base: The pointer to the hardware DMAC block.

__STATIC_INLINE uint32_t Cy_DMAC_GetActiveChannel (DMAC_Type const *base)

Returns the status of the active/pending channels of the DMACblock.

Return

Returns a bit-field with all of the currently active/pending channels in the DMAC block.

Function Usage

    
    /* Scenario: Disable the DMAC channel 0 if it's priority equals 3 */
    
    if (3UL == Cy_DMAC_Channel_GetPriority(DMAC, 0UL))
    {    
        if (0UL != Cy_DMAC_GetActiveChannel(DMAC))
        {
            Cy_DMAC_Channel_Disable(DMAC, 0UL);
            Cy_DMAC_Channel_DeInit(DMAC, 0UL);

            /* if needed (if there is only channel used) the whole block can be disabled */
            Cy_DMAC_Disable(DMAC);
        }
    }
    

Parameters
  • base: The pointer to the hardware DMAC block.

cy_en_dmac_status_t Cy_DMAC_Channel_Init(DMAC_Type *base, uint32_t channel, cy_stc_dmac_channel_config_t const *config)

Initializes the DMAC channel with a descriptor and other parameters.

Return

The status /ref cy_en_dmac_status_t.

Function Usage

    
    /* Scenario: Initialize a 1D descriptor */
    #define DATACNT (8UL)
    cy_stc_dmac_descriptor_t descriptor;
    cy_stc_dmac_descriptor_t nextDescriptor;
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    cy_stc_dmac_descriptor_config_t descriptor_cfg = 
    {
        .retrigger = CY_DMAC_RETRIG_IM,
        .interruptType = CY_DMAC_DESCR,
        .triggerOutType = CY_DMAC_DESCR,
        .channelState = CY_DMAC_CHANNEL_ENABLED,
        .triggerInType = CY_DMAC_DESCR,
        .dataSize = CY_DMAC_WORD,
        .srcTransferSize = CY_DMAC_TRANSFER_SIZE_WORD,
        .dstTransferSize = CY_DMAC_TRANSFER_SIZE_WORD,
        .descriptorType = CY_DMAC_1D_TRANSFER,
        .srcAddress = &src,
        .dstAddress = &dst,
        .srcXincrement = 1U,
        .dstXincrement = 1U,
        .xCount = DATACNT,
        .srcYincrement = 0U,
        .dstYincrement = 0U,
        .yCount = 1UL,
        .nextDescriptor = &nextDescriptor,
    };
    
    if (CY_DMAC_SUCCESS != Cy_DMAC_Descriptor_Init(&descriptor, &descriptor_cfg))
    {
        /* Insert error handling */
    }
    
    /* Scenario: Setup and enable the DMAC channel 0 */
    cy_stc_dmac_channel_config_t channelConfig;
    channelConfig.enable = false;
    channelConfig.bufferable = false;
    
    if (CY_DMAC_SUCCESS != Cy_DMAC_Channel_Init(DMAC, 0UL, &channelConfig))
    {
        /* Insert error handling */
    }
    
    Cy_DMAC_Channel_SetDescriptor(DMAC, 0UL, &descriptor);
    Cy_DMAC_Channel_SetPriority(DMAC, 0UL, 3UL);
    Cy_DMAC_Channel_Enable(DMAC, 0UL);
    
    Cy_DMAC_Enable(DMAC);
    

Parameters
  • base: The pointer to the hardware DMAC block.

  • channel: A channel number.

  • config: The structure that has the initialization information for the channel.

void Cy_DMAC_Channel_DeInit(DMAC_Type *base, uint32_t channel)

Clears the content of registers corresponding to the channel.

Function Usage

    
    /* Scenario: Disable the DMAC channel 0 if it's priority equals 3 */
    
    if (3UL == Cy_DMAC_Channel_GetPriority(DMAC, 0UL))
    {    
        if (0UL != Cy_DMAC_GetActiveChannel(DMAC))
        {
            Cy_DMAC_Channel_Disable(DMAC, 0UL);
            Cy_DMAC_Channel_DeInit(DMAC, 0UL);

            /* if needed (if there is only channel used) the whole block can be disabled */
            Cy_DMAC_Disable(DMAC);
        }
    }
    

Parameters
  • base: The pointer to the hardware DMAC block.

  • channel: A channel number.

__STATIC_INLINE void Cy_DMAC_Channel_SetDescriptor (DMAC_Type *base, uint32_t channel, cy_stc_dmac_descriptor_t const *descriptor)

Sets a descriptor as current for the specified DMACchannel.

Function Usage

    
    /* Scenario: Initialize a 1D descriptor */
    #define DATACNT (8UL)
    cy_stc_dmac_descriptor_t descriptor;
    cy_stc_dmac_descriptor_t nextDescriptor;
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    cy_stc_dmac_descriptor_config_t descriptor_cfg = 
    {
        .retrigger = CY_DMAC_RETRIG_IM,
        .interruptType = CY_DMAC_DESCR,
        .triggerOutType = CY_DMAC_DESCR,
        .channelState = CY_DMAC_CHANNEL_ENABLED,
        .triggerInType = CY_DMAC_DESCR,
        .dataSize = CY_DMAC_WORD,
        .srcTransferSize = CY_DMAC_TRANSFER_SIZE_WORD,
        .dstTransferSize = CY_DMAC_TRANSFER_SIZE_WORD,
        .descriptorType = CY_DMAC_1D_TRANSFER,
        .srcAddress = &src,
        .dstAddress = &dst,
        .srcXincrement = 1U,
        .dstXincrement = 1U,
        .xCount = DATACNT,
        .srcYincrement = 0U,
        .dstYincrement = 0U,
        .yCount = 1UL,
        .nextDescriptor = &nextDescriptor,
    };
    
    if (CY_DMAC_SUCCESS != Cy_DMAC_Descriptor_Init(&descriptor, &descriptor_cfg))
    {
        /* Insert error handling */
    }
    
    /* Scenario: Setup and enable the DMAC channel 0 */
    cy_stc_dmac_channel_config_t channelConfig;
    channelConfig.enable = false;
    channelConfig.bufferable = false;
    
    if (CY_DMAC_SUCCESS != Cy_DMAC_Channel_Init(DMAC, 0UL, &channelConfig))
    {
        /* Insert error handling */
    }
    
    Cy_DMAC_Channel_SetDescriptor(DMAC, 0UL, &descriptor);
    Cy_DMAC_Channel_SetPriority(DMAC, 0UL, 3UL);
    Cy_DMAC_Channel_Enable(DMAC, 0UL);
    
    Cy_DMAC_Enable(DMAC);
    

Parameters
  • base: The pointer to the hardware DMAC block.

  • channel: The channel number.

  • descriptor: This is the descriptor to be associated with the channel.

__STATIC_INLINE void Cy_DMAC_Channel_Enable (DMAC_Type *base, uint32_t channel)

Enables a DMAC channel.

Function Usage

    
    /* Scenario: Initialize a 1D descriptor */
    #define DATACNT (8UL)
    cy_stc_dmac_descriptor_t descriptor;
    cy_stc_dmac_descriptor_t nextDescriptor;
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    cy_stc_dmac_descriptor_config_t descriptor_cfg = 
    {
        .retrigger = CY_DMAC_RETRIG_IM,
        .interruptType = CY_DMAC_DESCR,
        .triggerOutType = CY_DMAC_DESCR,
        .channelState = CY_DMAC_CHANNEL_ENABLED,
        .triggerInType = CY_DMAC_DESCR,
        .dataSize = CY_DMAC_WORD,
        .srcTransferSize = CY_DMAC_TRANSFER_SIZE_WORD,
        .dstTransferSize = CY_DMAC_TRANSFER_SIZE_WORD,
        .descriptorType = CY_DMAC_1D_TRANSFER,
        .srcAddress = &src,
        .dstAddress = &dst,
        .srcXincrement = 1U,
        .dstXincrement = 1U,
        .xCount = DATACNT,
        .srcYincrement = 0U,
        .dstYincrement = 0U,
        .yCount = 1UL,
        .nextDescriptor = &nextDescriptor,
    };
    
    if (CY_DMAC_SUCCESS != Cy_DMAC_Descriptor_Init(&descriptor, &descriptor_cfg))
    {
        /* Insert error handling */
    }
    
    /* Scenario: Setup and enable the DMAC channel 0 */
    cy_stc_dmac_channel_config_t channelConfig;
    channelConfig.enable = false;
    channelConfig.bufferable = false;
    
    if (CY_DMAC_SUCCESS != Cy_DMAC_Channel_Init(DMAC, 0UL, &channelConfig))
    {
        /* Insert error handling */
    }
    
    Cy_DMAC_Channel_SetDescriptor(DMAC, 0UL, &descriptor);
    Cy_DMAC_Channel_SetPriority(DMAC, 0UL, 3UL);
    Cy_DMAC_Channel_Enable(DMAC, 0UL);
    
    Cy_DMAC_Enable(DMAC);
    

Parameters
  • base: The pointer to the hardware DMAC block.

  • channel: The channel number.

__STATIC_INLINE void Cy_DMAC_Channel_Disable (DMAC_Type *base, uint32_t channel)

Disables a DMACchannel.

Function Usage

    
    /* Scenario: Disable the DMAC channel 0 if it's priority equals 3 */
    
    if (3UL == Cy_DMAC_Channel_GetPriority(DMAC, 0UL))
    {    
        if (0UL != Cy_DMAC_GetActiveChannel(DMAC))
        {
            Cy_DMAC_Channel_Disable(DMAC, 0UL);
            Cy_DMAC_Channel_DeInit(DMAC, 0UL);

            /* if needed (if there is only channel used) the whole block can be disabled */
            Cy_DMAC_Disable(DMAC);
        }
    }
    

Parameters
  • base: The pointer to the hardware DMAC block.

  • channel: The channel number.

__STATIC_INLINE void Cy_DMAC_Channel_SetPriority (DMAC_Type *base, uint32_t channel, uint32_t priority)

The function is used to set a priority for the DMAC channel.

Function Usage

    
    /* Scenario: Initialize a 1D descriptor */
    #define DATACNT (8UL)
    cy_stc_dmac_descriptor_t descriptor;
    cy_stc_dmac_descriptor_t nextDescriptor;
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    cy_stc_dmac_descriptor_config_t descriptor_cfg = 
    {
        .retrigger = CY_DMAC_RETRIG_IM,
        .interruptType = CY_DMAC_DESCR,
        .triggerOutType = CY_DMAC_DESCR,
        .channelState = CY_DMAC_CHANNEL_ENABLED,
        .triggerInType = CY_DMAC_DESCR,
        .dataSize = CY_DMAC_WORD,
        .srcTransferSize = CY_DMAC_TRANSFER_SIZE_WORD,
        .dstTransferSize = CY_DMAC_TRANSFER_SIZE_WORD,
        .descriptorType = CY_DMAC_1D_TRANSFER,
        .srcAddress = &src,
        .dstAddress = &dst,
        .srcXincrement = 1U,
        .dstXincrement = 1U,
        .xCount = DATACNT,
        .srcYincrement = 0U,
        .dstYincrement = 0U,
        .yCount = 1UL,
        .nextDescriptor = &nextDescriptor,
    };
    
    if (CY_DMAC_SUCCESS != Cy_DMAC_Descriptor_Init(&descriptor, &descriptor_cfg))
    {
        /* Insert error handling */
    }
    
    /* Scenario: Setup and enable the DMAC channel 0 */
    cy_stc_dmac_channel_config_t channelConfig;
    channelConfig.enable = false;
    channelConfig.bufferable = false;
    
    if (CY_DMAC_SUCCESS != Cy_DMAC_Channel_Init(DMAC, 0UL, &channelConfig))
    {
        /* Insert error handling */
    }
    
    Cy_DMAC_Channel_SetDescriptor(DMAC, 0UL, &descriptor);
    Cy_DMAC_Channel_SetPriority(DMAC, 0UL, 3UL);
    Cy_DMAC_Channel_Enable(DMAC, 0UL);
    
    Cy_DMAC_Enable(DMAC);
    

Parameters
  • base: The pointer to the hardware DMAC block.

  • channel: The channel number.

  • priority: The priority to be set for the DMAC channel. The allowed values are 0,1,2,3.

__STATIC_INLINE uint32_t Cy_DMAC_Channel_GetPriority (DMAC_Type const *base, uint32_t channel)

Returns the priority of the DMAC channel.

Return

The priority of the channel.

Function Usage

    
    /* Scenario: Disable the DMAC channel 0 if it's priority equals 3 */
    
    if (3UL == Cy_DMAC_Channel_GetPriority(DMAC, 0UL))
    {    
        if (0UL != Cy_DMAC_GetActiveChannel(DMAC))
        {
            Cy_DMAC_Channel_Disable(DMAC, 0UL);
            Cy_DMAC_Channel_DeInit(DMAC, 0UL);

            /* if needed (if there is only channel used) the whole block can be disabled */
            Cy_DMAC_Disable(DMAC);
        }
    }
    

Parameters
  • base: The pointer to the hardware DMAC block.

  • channel: The channel number.

__STATIC_INLINE void * Cy_DMAC_Channel_GetCurrentSrcAddress (DMAC_Type const *base, uint32_t channel)

Returns the source address being used for the current transfer.

Return

Returns the pointer to the source of transfer.

Function Usage

    
    /* Scenario: Make sure the arrays are not in use before reading/modifying */
    
    uint32_t src[16];
    uint32_t dst[16];
    
    if (((void*) src != Cy_DMAC_Channel_GetCurrentSrcAddress(DMAC, 0UL)) &&
        ((void*) dst != Cy_DMAC_Channel_GetCurrentDstAddress(DMAC, 0UL)))
    {    
        /* Read the dst/modify the src arrays content here */
    }
    

Parameters
  • base: The pointer to the hardware DMAC block.

  • channel: The channel number.

__STATIC_INLINE void * Cy_DMAC_Channel_GetCurrentDstAddress (DMAC_Type const *base, uint32_t channel)

Returns the destination address being used for the current transfer.

Return

Returns the pointer to the destination of transfer.

Function Usage

    
    /* Scenario: Make sure the arrays are not in use before reading/modifying */
    
    uint32_t src[16];
    uint32_t dst[16];
    
    if (((void*) src != Cy_DMAC_Channel_GetCurrentSrcAddress(DMAC, 0UL)) &&
        ((void*) dst != Cy_DMAC_Channel_GetCurrentDstAddress(DMAC, 0UL)))
    {    
        /* Read the dst/modify the src arrays content here */
    }
    

Parameters
  • base: The pointer to the hardware DMAC block.

  • channel: The channel number.

__STATIC_INLINE uint32_t Cy_DMAC_Channel_GetCurrentXloopIndex (DMAC_Type const *base, uint32_t channel)

Returns the current transfer X-loop index.

Return

Returns the current transfer X-loop index.

Function Usage

    
    /* Scenario: Make sure the current indexes are greater than a desired 
     * data source item before modifying.
     */
    
    uint32_t src[16][16];
    uint32_t x = 7;
    uint32_t y = 8;
    
    if (((void*) src == Cy_DMAC_Channel_GetCurrentSrcAddress(DMAC, 0UL)) &&
                   (x < Cy_DMAC_Channel_GetCurrentXloopIndex(DMAC, 0UL)) &&
                   (y < Cy_DMAC_Channel_GetCurrentYloopIndex(DMAC, 0UL)))
    {    
        /* Modify the src arrays content here */
    }
    

Parameters
  • base: The pointer to the hardware DMAC block.

  • channel: The channel number.

__STATIC_INLINE uint32_t Cy_DMAC_Channel_GetCurrentYloopIndex (DMAC_Type const *base, uint32_t channel)

Returns the current transfer X-loop index.

Return

Returns the current transfer X-loop index.

Function Usage

    
    /* Scenario: Make sure the current indexes are greater than a desired 
     * data source item before modifying.
     */
    
    uint32_t src[16][16];
    uint32_t x = 7;
    uint32_t y = 8;
    
    if (((void*) src == Cy_DMAC_Channel_GetCurrentSrcAddress(DMAC, 0UL)) &&
                   (x < Cy_DMAC_Channel_GetCurrentXloopIndex(DMAC, 0UL)) &&
                   (y < Cy_DMAC_Channel_GetCurrentYloopIndex(DMAC, 0UL)))
    {    
        /* Modify the src arrays content here */
    }
    

Parameters
  • base: The pointer to the hardware DMAC block.

  • channel: The channel number.

__STATIC_INLINE cy_stc_dmac_descriptor_t * Cy_DMAC_Channel_GetCurrentDescriptor (DMAC_Type const *base, uint32_t channel)

Returns the descriptor that is active in the channel.

Return

The pointer to the descriptor associated with the channel.

Function Usage

    /* Scenario: Disable a descriptor */
    if (&descriptor != Cy_DMAC_Channel_GetCurrentDescriptor(DMAC, 0UL)) /* Make sure it is not in use */
    {
        Cy_DMAC_Descriptor_DeInit(&descriptor);
    }
    

Parameters
  • base: The pointer to the hardware DMAC block.

  • channel: The channel number.

__STATIC_INLINE uint32_t Cy_DMAC_Channel_GetInterruptStatus (DMAC_Type const *base, uint32_t channel)

Returns the interrupt status of the specified channel.

Return

The interrupt status, see Interrupt Masks.

Function Usage

    /* Scenario: Need to check the  interrupt status regardless of whether it is enabled (masked) or not */
    if (CY_DMAC_INTR_MASK == Cy_DMAC_Channel_GetInterruptStatus (DMAC, 0UL))
    {
        /* The DMAC channel 0 interrupt is pending */
    }

Parameters
  • base: The pointer to the hardware DMAC block.

  • channel: The channel number.

__STATIC_INLINE void Cy_DMAC_Channel_ClearInterrupt (DMAC_Type *base, uint32_t channel, uint32_t interrupt)

Clears the interrupt status of the specified channel.

Function Usage

    /* Scenario: Inside the interrupt service routine for DMAC channel 0: */    
    uint32_t interrupt = Cy_DMAC_Channel_GetInterruptStatusMasked(DMAC, 0UL);

    if (CY_DMAC_INTR_COMPLETION == interrupt)
    {
        /* Insert completion interrupt handling */
    }

    /* Check for other interrupts */

    /* Clear interrupts */
    Cy_DMAC_Channel_ClearInterrupt(DMAC, 0UL, interrupt);

Parameters
  • base: The pointer to the hardware DMAC block.

  • channel: The channel number.

  • interrupt: The interrupt mask, see Interrupt Masks.

__STATIC_INLINE void Cy_DMAC_Channel_SetInterrupt (DMAC_Type *base, uint32_t channel, uint32_t interrupt)

Sets the interrupt for the specified channel.

Function Usage

    /* Scenario: Enable interrupts for channel 0 */
    Cy_DMAC_Channel_SetInterruptMask (DMAC, 0UL, CY_DMAC_INTR_MASK);
    
    /* Scenario: Test the interrupt for channel 0 */
    Cy_DMAC_Channel_SetInterrupt(DMAC, 0UL, CY_DMAC_INTR_COMPLETION);
    /* Now the interrupt should occur (if it is enabled, of course) */

    /* Scenario: Disable interrupts for DMAC channel 0 if it is enabled */
    if (CY_DMAC_INTR_MASK == Cy_DMAC_Channel_GetInterruptMask(DMAC, 0UL))
    {
        Cy_DMAC_Channel_SetInterruptMask (DMAC, 0UL, 0UL);
    }

Parameters
  • base: The pointer to the hardware DMAC block.

  • channel: The channel number.

  • interrupt: The interrupt mask. See Interrupt Masks.

__STATIC_INLINE uint32_t Cy_DMAC_Channel_GetInterruptMask (DMAC_Type const *base, uint32_t channel)

Returns the interrupt mask value of the specified channel.

Return

The interrupt mask value. See Interrupt Masks.

Function Usage

    /* Scenario: Enable interrupts for channel 0 */
    Cy_DMAC_Channel_SetInterruptMask (DMAC, 0UL, CY_DMAC_INTR_MASK);
    
    /* Scenario: Test the interrupt for channel 0 */
    Cy_DMAC_Channel_SetInterrupt(DMAC, 0UL, CY_DMAC_INTR_COMPLETION);
    /* Now the interrupt should occur (if it is enabled, of course) */

    /* Scenario: Disable interrupts for DMAC channel 0 if it is enabled */
    if (CY_DMAC_INTR_MASK == Cy_DMAC_Channel_GetInterruptMask(DMAC, 0UL))
    {
        Cy_DMAC_Channel_SetInterruptMask (DMAC, 0UL, 0UL);
    }

Parameters
  • base: The pointer to the hardware DMAC block.

  • channel: The channel number.

__STATIC_INLINE void Cy_DMAC_Channel_SetInterruptMask (DMAC_Type *base, uint32_t channel, uint32_t interrupt)

Sets an interrupt mask value for the specified channel.

Function Usage

    /* Scenario: Enable interrupts for channel 0 */
    Cy_DMAC_Channel_SetInterruptMask (DMAC, 0UL, CY_DMAC_INTR_MASK);
    
    /* Scenario: Test the interrupt for channel 0 */
    Cy_DMAC_Channel_SetInterrupt(DMAC, 0UL, CY_DMAC_INTR_COMPLETION);
    /* Now the interrupt should occur (if it is enabled, of course) */

    /* Scenario: Disable interrupts for DMAC channel 0 if it is enabled */
    if (CY_DMAC_INTR_MASK == Cy_DMAC_Channel_GetInterruptMask(DMAC, 0UL))
    {
        Cy_DMAC_Channel_SetInterruptMask (DMAC, 0UL, 0UL);
    }

Parameters
  • base: The pointer to the hardware DMAC block.

  • channel: The channel number.

  • interrupt: The interrupt mask, see Interrupt Masks.

__STATIC_INLINE uint32_t Cy_DMAC_Channel_GetInterruptStatusMasked (DMAC_Type const *base, uint32_t channel)

Returns the logical AND of the corresponding INTR and INTR_MASK fields in a single-load operation.

Return

The masked interrupt status. See Interrupt Masks.

Function Usage

    /* Scenario: Inside the interrupt service routine for DMAC channel 0: */    
    uint32_t interrupt = Cy_DMAC_Channel_GetInterruptStatusMasked(DMAC, 0UL);

    if (CY_DMAC_INTR_COMPLETION == interrupt)
    {
        /* Insert completion interrupt handling */
    }

    /* Check for other interrupts */

    /* Clear interrupts */
    Cy_DMAC_Channel_ClearInterrupt(DMAC, 0UL, interrupt);

Parameters
  • base: The pointer to the hardware DMAC block.

  • channel: The channel number.

cy_en_dmac_status_t Cy_DMAC_Descriptor_Init(cy_stc_dmac_descriptor_t *descriptor, cy_stc_dmac_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.

Return

The status /ref cy_en_dmac_status_t.

Function Usage

    
    /* Scenario: Initialize a 1D descriptor */
    #define DATACNT (8UL)
    cy_stc_dmac_descriptor_t descriptor;
    cy_stc_dmac_descriptor_t nextDescriptor;
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    cy_stc_dmac_descriptor_config_t descriptor_cfg = 
    {
        .retrigger = CY_DMAC_RETRIG_IM,
        .interruptType = CY_DMAC_DESCR,
        .triggerOutType = CY_DMAC_DESCR,
        .channelState = CY_DMAC_CHANNEL_ENABLED,
        .triggerInType = CY_DMAC_DESCR,
        .dataSize = CY_DMAC_WORD,
        .srcTransferSize = CY_DMAC_TRANSFER_SIZE_WORD,
        .dstTransferSize = CY_DMAC_TRANSFER_SIZE_WORD,
        .descriptorType = CY_DMAC_1D_TRANSFER,
        .srcAddress = &src,
        .dstAddress = &dst,
        .srcXincrement = 1U,
        .dstXincrement = 1U,
        .xCount = DATACNT,
        .srcYincrement = 0U,
        .dstYincrement = 0U,
        .yCount = 1UL,
        .nextDescriptor = &nextDescriptor,
    };
    
    if (CY_DMAC_SUCCESS != Cy_DMAC_Descriptor_Init(&descriptor, &descriptor_cfg))
    {
        /* Insert error handling */
    }
    
    /* Scenario: Setup and enable the DMAC channel 0 */
    cy_stc_dmac_channel_config_t channelConfig;
    channelConfig.enable = false;
    channelConfig.bufferable = false;
    
    if (CY_DMAC_SUCCESS != Cy_DMAC_Channel_Init(DMAC, 0UL, &channelConfig))
    {
        /* Insert error handling */
    }
    
    Cy_DMAC_Channel_SetDescriptor(DMAC, 0UL, &descriptor);
    Cy_DMAC_Channel_SetPriority(DMAC, 0UL, 3UL);
    Cy_DMAC_Channel_Enable(DMAC, 0UL);
    
    Cy_DMAC_Enable(DMAC);
    

Parameters
  • descriptor: The descriptor structure instance.

  • config: This is a configuration structure that has all initialization information for the descriptor.

void Cy_DMAC_Descriptor_DeInit(cy_stc_dmac_descriptor_t *descriptor)

Clears the content of the specified descriptor.

Function Usage

    /* Scenario: Disable a descriptor */
    if (&descriptor != Cy_DMAC_Channel_GetCurrentDescriptor(DMAC, 0UL)) /* Make sure it is not in use */
    {
        Cy_DMAC_Descriptor_DeInit(&descriptor);
    }
    

Parameters
  • descriptor: The descriptor structure instance.

void Cy_DMAC_Descriptor_SetNextDescriptor(cy_stc_dmac_descriptor_t *descriptor, cy_stc_dmac_descriptor_t const *nextDescriptor)

Sets a Next Descriptor parameter for the specified descriptor.

Based on the descriptor type, the offset of the address for the next descriptor register may vary: For the single and scatter transfer descriptors, this register is at offset 0x0c. For the memory copy descriptor type, this register is at offset 0x10. For the 1D-transfer descriptor type, this register is at offset 0x14. For the 2D-transfer descriptor type, this register is at offset 0x1c.

Function Usage

    
    /* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */
    
    #define DATACNT (8UL)
    cy_stc_dmac_descriptor_t descriptor = {0};
    cy_stc_dmac_descriptor_t nextDescriptor = {0};
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    if (&descriptor != Cy_DMAC_Channel_GetCurrentDescriptor(DMAC, 0UL)) /* Make sure it is not in use */
    {
        Cy_DMAC_Descriptor_SetRetrigger(&descriptor, CY_DMAC_RETRIG_IM);
        Cy_DMAC_Descriptor_SetInterruptType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetTriggerOutType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetChannelState(&descriptor, CY_DMAC_CHANNEL_ENABLED);
        Cy_DMAC_Descriptor_SetTriggerInType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetDataSize(&descriptor, CY_DMAC_WORD);
        Cy_DMAC_Descriptor_SetSrcTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDstTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDescriptorType(&descriptor, CY_DMAC_1D_TRANSFER);
        Cy_DMAC_Descriptor_SetSrcAddress(&descriptor, &src);
        Cy_DMAC_Descriptor_SetDstAddress(&descriptor, &dst);
        Cy_DMAC_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDstIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDataCount(&descriptor, DATACNT);
        Cy_DMAC_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDstIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDataCount(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor);
    }
    

Parameters
  • descriptor: The descriptor structure instance.

  • nextDescriptor: The pointer to the next descriptor.

void Cy_DMAC_Descriptor_SetDescriptorType(cy_stc_dmac_descriptor_t *descriptor, cy_en_dmac_descriptor_type_t descriptorType)

Sets the descriptor’s type for the specified descriptor.

Moves the next descriptor pointer and X data count values into the proper offset in accordance to the actual descriptor type.

During the descriptor’s type change, carefully set up the settings starting from dstAddress and all the rest below in the cy_stc_dmac_descriptor_config_t structure. This is because the content of the descriptor registers might be lost/overridden by other descriptor settings due to the different registers structure for different descriptor types.

Function Usage

    
    /* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */
    
    #define DATACNT (8UL)
    cy_stc_dmac_descriptor_t descriptor = {0};
    cy_stc_dmac_descriptor_t nextDescriptor = {0};
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    if (&descriptor != Cy_DMAC_Channel_GetCurrentDescriptor(DMAC, 0UL)) /* Make sure it is not in use */
    {
        Cy_DMAC_Descriptor_SetRetrigger(&descriptor, CY_DMAC_RETRIG_IM);
        Cy_DMAC_Descriptor_SetInterruptType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetTriggerOutType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetChannelState(&descriptor, CY_DMAC_CHANNEL_ENABLED);
        Cy_DMAC_Descriptor_SetTriggerInType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetDataSize(&descriptor, CY_DMAC_WORD);
        Cy_DMAC_Descriptor_SetSrcTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDstTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDescriptorType(&descriptor, CY_DMAC_1D_TRANSFER);
        Cy_DMAC_Descriptor_SetSrcAddress(&descriptor, &src);
        Cy_DMAC_Descriptor_SetDstAddress(&descriptor, &dst);
        Cy_DMAC_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDstIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDataCount(&descriptor, DATACNT);
        Cy_DMAC_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDstIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDataCount(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor);
    }
    

Parameters

__STATIC_INLINE void Cy_DMAC_Descriptor_SetSrcAddress (cy_stc_dmac_descriptor_t *descriptor, void const *srcAddress)

Sets the source address parameter for the specified descriptor.

Function Usage

    
    /* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */
    
    #define DATACNT (8UL)
    cy_stc_dmac_descriptor_t descriptor = {0};
    cy_stc_dmac_descriptor_t nextDescriptor = {0};
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    if (&descriptor != Cy_DMAC_Channel_GetCurrentDescriptor(DMAC, 0UL)) /* Make sure it is not in use */
    {
        Cy_DMAC_Descriptor_SetRetrigger(&descriptor, CY_DMAC_RETRIG_IM);
        Cy_DMAC_Descriptor_SetInterruptType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetTriggerOutType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetChannelState(&descriptor, CY_DMAC_CHANNEL_ENABLED);
        Cy_DMAC_Descriptor_SetTriggerInType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetDataSize(&descriptor, CY_DMAC_WORD);
        Cy_DMAC_Descriptor_SetSrcTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDstTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDescriptorType(&descriptor, CY_DMAC_1D_TRANSFER);
        Cy_DMAC_Descriptor_SetSrcAddress(&descriptor, &src);
        Cy_DMAC_Descriptor_SetDstAddress(&descriptor, &dst);
        Cy_DMAC_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDstIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDataCount(&descriptor, DATACNT);
        Cy_DMAC_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDstIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDataCount(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor);
    }
    

Parameters
  • descriptor: The descriptor structure instance.

  • srcAddress: The source address value for the descriptor.

__STATIC_INLINE void Cy_DMAC_Descriptor_SetDstAddress (cy_stc_dmac_descriptor_t *descriptor, void const *dstAddress)

Sets the destination address parameter for the specified descriptor.

Function Usage

    
    /* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */
    
    #define DATACNT (8UL)
    cy_stc_dmac_descriptor_t descriptor = {0};
    cy_stc_dmac_descriptor_t nextDescriptor = {0};
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    if (&descriptor != Cy_DMAC_Channel_GetCurrentDescriptor(DMAC, 0UL)) /* Make sure it is not in use */
    {
        Cy_DMAC_Descriptor_SetRetrigger(&descriptor, CY_DMAC_RETRIG_IM);
        Cy_DMAC_Descriptor_SetInterruptType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetTriggerOutType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetChannelState(&descriptor, CY_DMAC_CHANNEL_ENABLED);
        Cy_DMAC_Descriptor_SetTriggerInType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetDataSize(&descriptor, CY_DMAC_WORD);
        Cy_DMAC_Descriptor_SetSrcTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDstTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDescriptorType(&descriptor, CY_DMAC_1D_TRANSFER);
        Cy_DMAC_Descriptor_SetSrcAddress(&descriptor, &src);
        Cy_DMAC_Descriptor_SetDstAddress(&descriptor, &dst);
        Cy_DMAC_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDstIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDataCount(&descriptor, DATACNT);
        Cy_DMAC_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDstIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDataCount(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor);
    }
    

Parameters
  • descriptor: The descriptor structure instance.

  • dstAddress: The destination address value for the descriptor.

void Cy_DMAC_Descriptor_SetXloopDataCount(cy_stc_dmac_descriptor_t *descriptor, uint32_t xCount)

Sets the number of data elements to transfer in the X loop for the specified descriptor (for all descriptor types except single transfer).

Based on the descriptor type, the offset of the address for the xCount register may vary: For the scatter transfer descriptors type, this register is at offset 0x8. For all the rest of the supported descriptor types, this register is at offset 0xc.

Function Usage

    
    /* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */
    
    #define DATACNT (8UL)
    cy_stc_dmac_descriptor_t descriptor = {0};
    cy_stc_dmac_descriptor_t nextDescriptor = {0};
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    if (&descriptor != Cy_DMAC_Channel_GetCurrentDescriptor(DMAC, 0UL)) /* Make sure it is not in use */
    {
        Cy_DMAC_Descriptor_SetRetrigger(&descriptor, CY_DMAC_RETRIG_IM);
        Cy_DMAC_Descriptor_SetInterruptType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetTriggerOutType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetChannelState(&descriptor, CY_DMAC_CHANNEL_ENABLED);
        Cy_DMAC_Descriptor_SetTriggerInType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetDataSize(&descriptor, CY_DMAC_WORD);
        Cy_DMAC_Descriptor_SetSrcTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDstTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDescriptorType(&descriptor, CY_DMAC_1D_TRANSFER);
        Cy_DMAC_Descriptor_SetSrcAddress(&descriptor, &src);
        Cy_DMAC_Descriptor_SetDstAddress(&descriptor, &dst);
        Cy_DMAC_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDstIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDataCount(&descriptor, DATACNT);
        Cy_DMAC_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDstIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDataCount(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor);
    }
    

Parameters
  • descriptor: The descriptor structure instance.

  • xCount: The number of data elements to transfer in the X loop. For scatter transfer descriptors the valid range is 1…32768. For all the rest of the descriptors (except single transfer), the valid range is 1…65536.

__STATIC_INLINE void Cy_DMAC_Descriptor_SetYloopDataCount (cy_stc_dmac_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_dmac_descriptor_t descriptor = {0};
    cy_stc_dmac_descriptor_t nextDescriptor = {0};
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    if (&descriptor != Cy_DMAC_Channel_GetCurrentDescriptor(DMAC, 0UL)) /* Make sure it is not in use */
    {
        Cy_DMAC_Descriptor_SetRetrigger(&descriptor, CY_DMAC_RETRIG_IM);
        Cy_DMAC_Descriptor_SetInterruptType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetTriggerOutType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetChannelState(&descriptor, CY_DMAC_CHANNEL_ENABLED);
        Cy_DMAC_Descriptor_SetTriggerInType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetDataSize(&descriptor, CY_DMAC_WORD);
        Cy_DMAC_Descriptor_SetSrcTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDstTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDescriptorType(&descriptor, CY_DMAC_1D_TRANSFER);
        Cy_DMAC_Descriptor_SetSrcAddress(&descriptor, &src);
        Cy_DMAC_Descriptor_SetDstAddress(&descriptor, &dst);
        Cy_DMAC_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDstIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDataCount(&descriptor, DATACNT);
        Cy_DMAC_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDstIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDataCount(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor);
    }
    

Parameters
  • descriptor: The descriptor structure instance.

  • yCount: The number of X loops to execute in the Y loop. The valid range is 1 … 65536.

__STATIC_INLINE void Cy_DMAC_Descriptor_SetXloopSrcIncrement (cy_stc_dmac_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_dmac_descriptor_t descriptor = {0};
    cy_stc_dmac_descriptor_t nextDescriptor = {0};
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    if (&descriptor != Cy_DMAC_Channel_GetCurrentDescriptor(DMAC, 0UL)) /* Make sure it is not in use */
    {
        Cy_DMAC_Descriptor_SetRetrigger(&descriptor, CY_DMAC_RETRIG_IM);
        Cy_DMAC_Descriptor_SetInterruptType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetTriggerOutType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetChannelState(&descriptor, CY_DMAC_CHANNEL_ENABLED);
        Cy_DMAC_Descriptor_SetTriggerInType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetDataSize(&descriptor, CY_DMAC_WORD);
        Cy_DMAC_Descriptor_SetSrcTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDstTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDescriptorType(&descriptor, CY_DMAC_1D_TRANSFER);
        Cy_DMAC_Descriptor_SetSrcAddress(&descriptor, &src);
        Cy_DMAC_Descriptor_SetDstAddress(&descriptor, &dst);
        Cy_DMAC_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDstIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDataCount(&descriptor, DATACNT);
        Cy_DMAC_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDstIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDataCount(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor);
    }
    

Parameters
  • descriptor: The descriptor structure instance.

  • srcXincrement: The value of the source increment. The valid range is -32768 … 32767.

__STATIC_INLINE void Cy_DMAC_Descriptor_SetXloopDstIncrement (cy_stc_dmac_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_dmac_descriptor_t descriptor = {0};
    cy_stc_dmac_descriptor_t nextDescriptor = {0};
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    if (&descriptor != Cy_DMAC_Channel_GetCurrentDescriptor(DMAC, 0UL)) /* Make sure it is not in use */
    {
        Cy_DMAC_Descriptor_SetRetrigger(&descriptor, CY_DMAC_RETRIG_IM);
        Cy_DMAC_Descriptor_SetInterruptType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetTriggerOutType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetChannelState(&descriptor, CY_DMAC_CHANNEL_ENABLED);
        Cy_DMAC_Descriptor_SetTriggerInType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetDataSize(&descriptor, CY_DMAC_WORD);
        Cy_DMAC_Descriptor_SetSrcTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDstTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDescriptorType(&descriptor, CY_DMAC_1D_TRANSFER);
        Cy_DMAC_Descriptor_SetSrcAddress(&descriptor, &src);
        Cy_DMAC_Descriptor_SetDstAddress(&descriptor, &dst);
        Cy_DMAC_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDstIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDataCount(&descriptor, DATACNT);
        Cy_DMAC_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDstIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDataCount(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor);
    }
    

Parameters
  • descriptor: The descriptor structure instance.

  • dstXincrement: The value of the destination increment. The valid range is -32768 … 32767.

__STATIC_INLINE void Cy_DMAC_Descriptor_SetYloopSrcIncrement (cy_stc_dmac_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_dmac_descriptor_t descriptor = {0};
    cy_stc_dmac_descriptor_t nextDescriptor = {0};
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    if (&descriptor != Cy_DMAC_Channel_GetCurrentDescriptor(DMAC, 0UL)) /* Make sure it is not in use */
    {
        Cy_DMAC_Descriptor_SetRetrigger(&descriptor, CY_DMAC_RETRIG_IM);
        Cy_DMAC_Descriptor_SetInterruptType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetTriggerOutType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetChannelState(&descriptor, CY_DMAC_CHANNEL_ENABLED);
        Cy_DMAC_Descriptor_SetTriggerInType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetDataSize(&descriptor, CY_DMAC_WORD);
        Cy_DMAC_Descriptor_SetSrcTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDstTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDescriptorType(&descriptor, CY_DMAC_1D_TRANSFER);
        Cy_DMAC_Descriptor_SetSrcAddress(&descriptor, &src);
        Cy_DMAC_Descriptor_SetDstAddress(&descriptor, &dst);
        Cy_DMAC_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDstIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDataCount(&descriptor, DATACNT);
        Cy_DMAC_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDstIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDataCount(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor);
    }
    

Parameters
  • descriptor: The descriptor structure instance.

  • srcYincrement: The value of the source increment. The valid range is -32768 … 32767.

__STATIC_INLINE void Cy_DMAC_Descriptor_SetYloopDstIncrement (cy_stc_dmac_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_dmac_descriptor_t descriptor = {0};
    cy_stc_dmac_descriptor_t nextDescriptor = {0};
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    if (&descriptor != Cy_DMAC_Channel_GetCurrentDescriptor(DMAC, 0UL)) /* Make sure it is not in use */
    {
        Cy_DMAC_Descriptor_SetRetrigger(&descriptor, CY_DMAC_RETRIG_IM);
        Cy_DMAC_Descriptor_SetInterruptType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetTriggerOutType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetChannelState(&descriptor, CY_DMAC_CHANNEL_ENABLED);
        Cy_DMAC_Descriptor_SetTriggerInType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetDataSize(&descriptor, CY_DMAC_WORD);
        Cy_DMAC_Descriptor_SetSrcTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDstTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDescriptorType(&descriptor, CY_DMAC_1D_TRANSFER);
        Cy_DMAC_Descriptor_SetSrcAddress(&descriptor, &src);
        Cy_DMAC_Descriptor_SetDstAddress(&descriptor, &dst);
        Cy_DMAC_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDstIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDataCount(&descriptor, DATACNT);
        Cy_DMAC_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDstIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDataCount(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor);
    }
    

Parameters
  • descriptor: The descriptor structure instance.

  • dstYincrement: The value of the destination increment. The valid range is -32768 … 32767.

__STATIC_INLINE void Cy_DMAC_Descriptor_SetInterruptType (cy_stc_dmac_descriptor_t *descriptor, cy_en_dmac_trigger_type_t interruptType)

Sets the interrupt type parameter for the specified descriptor.

Function Usage

    
    /* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */
    
    #define DATACNT (8UL)
    cy_stc_dmac_descriptor_t descriptor = {0};
    cy_stc_dmac_descriptor_t nextDescriptor = {0};
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    if (&descriptor != Cy_DMAC_Channel_GetCurrentDescriptor(DMAC, 0UL)) /* Make sure it is not in use */
    {
        Cy_DMAC_Descriptor_SetRetrigger(&descriptor, CY_DMAC_RETRIG_IM);
        Cy_DMAC_Descriptor_SetInterruptType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetTriggerOutType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetChannelState(&descriptor, CY_DMAC_CHANNEL_ENABLED);
        Cy_DMAC_Descriptor_SetTriggerInType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetDataSize(&descriptor, CY_DMAC_WORD);
        Cy_DMAC_Descriptor_SetSrcTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDstTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDescriptorType(&descriptor, CY_DMAC_1D_TRANSFER);
        Cy_DMAC_Descriptor_SetSrcAddress(&descriptor, &src);
        Cy_DMAC_Descriptor_SetDstAddress(&descriptor, &dst);
        Cy_DMAC_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDstIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDataCount(&descriptor, DATACNT);
        Cy_DMAC_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDstIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDataCount(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor);
    }
    

Parameters
  • descriptor: The descriptor structure instance.

  • interruptType: The interrupt type set for the descriptor. cy_en_dmac_trigger_type_t

__STATIC_INLINE void Cy_DMAC_Descriptor_SetTriggerInType (cy_stc_dmac_descriptor_t *descriptor, cy_en_dmac_trigger_type_t triggerInType)

Sets the Trigger In Type parameter for the specified descriptor.

Function Usage

    
    /* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */
    
    #define DATACNT (8UL)
    cy_stc_dmac_descriptor_t descriptor = {0};
    cy_stc_dmac_descriptor_t nextDescriptor = {0};
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    if (&descriptor != Cy_DMAC_Channel_GetCurrentDescriptor(DMAC, 0UL)) /* Make sure it is not in use */
    {
        Cy_DMAC_Descriptor_SetRetrigger(&descriptor, CY_DMAC_RETRIG_IM);
        Cy_DMAC_Descriptor_SetInterruptType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetTriggerOutType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetChannelState(&descriptor, CY_DMAC_CHANNEL_ENABLED);
        Cy_DMAC_Descriptor_SetTriggerInType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetDataSize(&descriptor, CY_DMAC_WORD);
        Cy_DMAC_Descriptor_SetSrcTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDstTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDescriptorType(&descriptor, CY_DMAC_1D_TRANSFER);
        Cy_DMAC_Descriptor_SetSrcAddress(&descriptor, &src);
        Cy_DMAC_Descriptor_SetDstAddress(&descriptor, &dst);
        Cy_DMAC_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDstIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDataCount(&descriptor, DATACNT);
        Cy_DMAC_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDstIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDataCount(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor);
    }
    

Parameters

__STATIC_INLINE void Cy_DMAC_Descriptor_SetTriggerOutType (cy_stc_dmac_descriptor_t *descriptor, cy_en_dmac_trigger_type_t triggerOutType)

Sets the Trigger Out Type parameter for the specified descriptor.

Function Usage

    
    /* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */
    
    #define DATACNT (8UL)
    cy_stc_dmac_descriptor_t descriptor = {0};
    cy_stc_dmac_descriptor_t nextDescriptor = {0};
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    if (&descriptor != Cy_DMAC_Channel_GetCurrentDescriptor(DMAC, 0UL)) /* Make sure it is not in use */
    {
        Cy_DMAC_Descriptor_SetRetrigger(&descriptor, CY_DMAC_RETRIG_IM);
        Cy_DMAC_Descriptor_SetInterruptType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetTriggerOutType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetChannelState(&descriptor, CY_DMAC_CHANNEL_ENABLED);
        Cy_DMAC_Descriptor_SetTriggerInType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetDataSize(&descriptor, CY_DMAC_WORD);
        Cy_DMAC_Descriptor_SetSrcTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDstTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDescriptorType(&descriptor, CY_DMAC_1D_TRANSFER);
        Cy_DMAC_Descriptor_SetSrcAddress(&descriptor, &src);
        Cy_DMAC_Descriptor_SetDstAddress(&descriptor, &dst);
        Cy_DMAC_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDstIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDataCount(&descriptor, DATACNT);
        Cy_DMAC_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDstIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDataCount(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor);
    }
    

Parameters
  • descriptor: The descriptor structure instance.

  • triggerOutType: The Trigger Out Type set for the descriptor. cy_en_dmac_trigger_type_t

__STATIC_INLINE void Cy_DMAC_Descriptor_SetDataSize (cy_stc_dmac_descriptor_t *descriptor, cy_en_dmac_data_size_t dataSize)

Sets the Data Element Size parameter for the specified descriptor.

Function Usage

    
    /* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */
    
    #define DATACNT (8UL)
    cy_stc_dmac_descriptor_t descriptor = {0};
    cy_stc_dmac_descriptor_t nextDescriptor = {0};
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    if (&descriptor != Cy_DMAC_Channel_GetCurrentDescriptor(DMAC, 0UL)) /* Make sure it is not in use */
    {
        Cy_DMAC_Descriptor_SetRetrigger(&descriptor, CY_DMAC_RETRIG_IM);
        Cy_DMAC_Descriptor_SetInterruptType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetTriggerOutType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetChannelState(&descriptor, CY_DMAC_CHANNEL_ENABLED);
        Cy_DMAC_Descriptor_SetTriggerInType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetDataSize(&descriptor, CY_DMAC_WORD);
        Cy_DMAC_Descriptor_SetSrcTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDstTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDescriptorType(&descriptor, CY_DMAC_1D_TRANSFER);
        Cy_DMAC_Descriptor_SetSrcAddress(&descriptor, &src);
        Cy_DMAC_Descriptor_SetDstAddress(&descriptor, &dst);
        Cy_DMAC_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDstIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDataCount(&descriptor, DATACNT);
        Cy_DMAC_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDstIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDataCount(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor);
    }
    

Parameters

__STATIC_INLINE void Cy_DMAC_Descriptor_SetSrcTransferSize (cy_stc_dmac_descriptor_t *descriptor, cy_en_dmac_transfer_size_t srcTransferSize)

Sets the Source Transfer Size parameter for the specified descriptor.

Function Usage

    
    /* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */
    
    #define DATACNT (8UL)
    cy_stc_dmac_descriptor_t descriptor = {0};
    cy_stc_dmac_descriptor_t nextDescriptor = {0};
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    if (&descriptor != Cy_DMAC_Channel_GetCurrentDescriptor(DMAC, 0UL)) /* Make sure it is not in use */
    {
        Cy_DMAC_Descriptor_SetRetrigger(&descriptor, CY_DMAC_RETRIG_IM);
        Cy_DMAC_Descriptor_SetInterruptType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetTriggerOutType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetChannelState(&descriptor, CY_DMAC_CHANNEL_ENABLED);
        Cy_DMAC_Descriptor_SetTriggerInType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetDataSize(&descriptor, CY_DMAC_WORD);
        Cy_DMAC_Descriptor_SetSrcTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDstTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDescriptorType(&descriptor, CY_DMAC_1D_TRANSFER);
        Cy_DMAC_Descriptor_SetSrcAddress(&descriptor, &src);
        Cy_DMAC_Descriptor_SetDstAddress(&descriptor, &dst);
        Cy_DMAC_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDstIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDataCount(&descriptor, DATACNT);
        Cy_DMAC_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDstIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDataCount(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor);
    }
    

Parameters

__STATIC_INLINE void Cy_DMAC_Descriptor_SetDstTransferSize (cy_stc_dmac_descriptor_t *descriptor, cy_en_dmac_transfer_size_t dstTransferSize)

Sets the Destination Transfer Size parameter for the specified descriptor.

Function Usage

    
    /* Scenario: Set or modify individual descriptor parameters dynamically. This snippet shows them all. */
    
    #define DATACNT (8UL)
    cy_stc_dmac_descriptor_t descriptor = {0};
    cy_stc_dmac_descriptor_t nextDescriptor = {0};
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    if (&descriptor != Cy_DMAC_Channel_GetCurrentDescriptor(DMAC, 0UL)) /* Make sure it is not in use */
    {
        Cy_DMAC_Descriptor_SetRetrigger(&descriptor, CY_DMAC_RETRIG_IM);
        Cy_DMAC_Descriptor_SetInterruptType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetTriggerOutType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetChannelState(&descriptor, CY_DMAC_CHANNEL_ENABLED);
        Cy_DMAC_Descriptor_SetTriggerInType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetDataSize(&descriptor, CY_DMAC_WORD);
        Cy_DMAC_Descriptor_SetSrcTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDstTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDescriptorType(&descriptor, CY_DMAC_1D_TRANSFER);
        Cy_DMAC_Descriptor_SetSrcAddress(&descriptor, &src);
        Cy_DMAC_Descriptor_SetDstAddress(&descriptor, &dst);
        Cy_DMAC_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDstIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDataCount(&descriptor, DATACNT);
        Cy_DMAC_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDstIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDataCount(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor);
    }
    

Parameters

__STATIC_INLINE void Cy_DMAC_Descriptor_SetRetrigger (cy_stc_dmac_descriptor_t *descriptor, cy_en_dmac_retrigger_t retrigger)

Sets the retrigger value which 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_dmac_descriptor_t descriptor = {0};
    cy_stc_dmac_descriptor_t nextDescriptor = {0};
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    if (&descriptor != Cy_DMAC_Channel_GetCurrentDescriptor(DMAC, 0UL)) /* Make sure it is not in use */
    {
        Cy_DMAC_Descriptor_SetRetrigger(&descriptor, CY_DMAC_RETRIG_IM);
        Cy_DMAC_Descriptor_SetInterruptType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetTriggerOutType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetChannelState(&descriptor, CY_DMAC_CHANNEL_ENABLED);
        Cy_DMAC_Descriptor_SetTriggerInType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetDataSize(&descriptor, CY_DMAC_WORD);
        Cy_DMAC_Descriptor_SetSrcTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDstTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDescriptorType(&descriptor, CY_DMAC_1D_TRANSFER);
        Cy_DMAC_Descriptor_SetSrcAddress(&descriptor, &src);
        Cy_DMAC_Descriptor_SetDstAddress(&descriptor, &dst);
        Cy_DMAC_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDstIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDataCount(&descriptor, DATACNT);
        Cy_DMAC_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDstIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDataCount(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor);
    }
    

Parameters
  • descriptor: The descriptor structure instance.

  • retrigger: The cy_en_dmac_retrigger_t parameter specifies whether the controller should wait for the input trigger to be deactivated.

__STATIC_INLINE void Cy_DMAC_Descriptor_SetChannelState (cy_stc_dmac_descriptor_t *descriptor, cy_en_dmac_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_dmac_descriptor_t descriptor = {0};
    cy_stc_dmac_descriptor_t nextDescriptor = {0};
    uint32_t src[DATACNT];
    uint32_t dst[DATACNT];
    
    if (&descriptor != Cy_DMAC_Channel_GetCurrentDescriptor(DMAC, 0UL)) /* Make sure it is not in use */
    {
        Cy_DMAC_Descriptor_SetRetrigger(&descriptor, CY_DMAC_RETRIG_IM);
        Cy_DMAC_Descriptor_SetInterruptType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetTriggerOutType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetChannelState(&descriptor, CY_DMAC_CHANNEL_ENABLED);
        Cy_DMAC_Descriptor_SetTriggerInType(&descriptor, CY_DMAC_DESCR);
        Cy_DMAC_Descriptor_SetDataSize(&descriptor, CY_DMAC_WORD);
        Cy_DMAC_Descriptor_SetSrcTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDstTransferSize(&descriptor, CY_DMAC_TRANSFER_SIZE_WORD);
        Cy_DMAC_Descriptor_SetDescriptorType(&descriptor, CY_DMAC_1D_TRANSFER);
        Cy_DMAC_Descriptor_SetSrcAddress(&descriptor, &src);
        Cy_DMAC_Descriptor_SetDstAddress(&descriptor, &dst);
        Cy_DMAC_Descriptor_SetXloopSrcIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDstIncrement(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetXloopDataCount(&descriptor, DATACNT);
        Cy_DMAC_Descriptor_SetYloopSrcIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDstIncrement(&descriptor, 0UL);
        Cy_DMAC_Descriptor_SetYloopDataCount(&descriptor, 1UL);
        Cy_DMAC_Descriptor_SetNextDescriptor(&descriptor, &nextDescriptor);
    }
    

Parameters

cy_stc_dmac_descriptor_t *Cy_DMAC_Descriptor_GetNextDescriptor(cy_stc_dmac_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 register may vary: For the single and scatter transfer descriptors, this register is at offset 0x0c. For the memory copy descriptor type, this register is at offset 0x10. For the 1D-transfer descriptor type, this register is at offset 0x14. For the 2D-transfer descriptor type, this register is at offset 0x1c.

Return

The pointer to the next 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_DMAC_Enable description */

    cy_en_dmac_retrigger_t       retrigger       = Cy_DMAC_Descriptor_GetRetrigger(&descriptor);
    cy_en_dmac_trigger_type_t    interruptType   = Cy_DMAC_Descriptor_GetInterruptType(&descriptor);
    cy_en_dmac_trigger_type_t    triggerOutType  = Cy_DMAC_Descriptor_GetTriggerOutType(&descriptor);
    cy_en_dmac_channel_state_t   channelState    = Cy_DMAC_Descriptor_GetChannelState(&descriptor);
    cy_en_dmac_trigger_type_t    triggerInType   = Cy_DMAC_Descriptor_GetTriggerInType(&descriptor);
    cy_en_dmac_data_size_t       dataSize        = Cy_DMAC_Descriptor_GetDataSize(&descriptor);
    cy_en_dmac_transfer_size_t   srcTransferSize = Cy_DMAC_Descriptor_GetSrcTransferSize(&descriptor);
    cy_en_dmac_transfer_size_t   dstTransferSize = Cy_DMAC_Descriptor_GetDstTransferSize(&descriptor);
    cy_en_dmac_descriptor_type_t descriptorType  = Cy_DMAC_Descriptor_GetDescriptorType(&descriptor);
                          void * srcAddress      = Cy_DMAC_Descriptor_GetSrcAddress(&descriptor);
                          void * dstAddress      = Cy_DMAC_Descriptor_GetDstAddress(&descriptor);
                       int32_t   srcXincrement   = Cy_DMAC_Descriptor_GetXloopSrcIncrement(&descriptor);
                       int32_t   dstXincrement   = Cy_DMAC_Descriptor_GetXloopDstIncrement(&descriptor);
                      uint32_t   xCount          = Cy_DMAC_Descriptor_GetXloopDataCount(&descriptor);
                       int32_t   srcYincrement   = Cy_DMAC_Descriptor_GetYloopSrcIncrement(&descriptor);
                       int32_t   dstYincrement   = Cy_DMAC_Descriptor_GetYloopDstIncrement(&descriptor);
                      uint32_t   yCount          = Cy_DMAC_Descriptor_GetYloopDataCount(&descriptor);
      cy_stc_dmac_descriptor_t * nextDescriptor  = Cy_DMAC_Descriptor_GetNextDescriptor(&descriptor);
    

Parameters
  • descriptor: The descriptor structure instance.

__STATIC_INLINE cy_en_dmac_descriptor_type_t Cy_DMAC_Descriptor_GetDescriptorType (cy_stc_dmac_descriptor_t const *descriptor)

Returns the descriptor’s type of the specified descriptor.

Return

The descriptor type cy_en_dmac_descriptor_type_t

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_DMAC_Enable description */

    cy_en_dmac_retrigger_t       retrigger       = Cy_DMAC_Descriptor_GetRetrigger(&descriptor);
    cy_en_dmac_trigger_type_t    interruptType   = Cy_DMAC_Descriptor_GetInterruptType(&descriptor);
    cy_en_dmac_trigger_type_t    triggerOutType  = Cy_DMAC_Descriptor_GetTriggerOutType(&descriptor);
    cy_en_dmac_channel_state_t   channelState    = Cy_DMAC_Descriptor_GetChannelState(&descriptor);
    cy_en_dmac_trigger_type_t    triggerInType   = Cy_DMAC_Descriptor_GetTriggerInType(&descriptor);
    cy_en_dmac_data_size_t       dataSize        = Cy_DMAC_Descriptor_GetDataSize(&descriptor);
    cy_en_dmac_transfer_size_t   srcTransferSize = Cy_DMAC_Descriptor_GetSrcTransferSize(&descriptor);
    cy_en_dmac_transfer_size_t   dstTransferSize = Cy_DMAC_Descriptor_GetDstTransferSize(&descriptor);
    cy_en_dmac_descriptor_type_t descriptorType  = Cy_DMAC_Descriptor_GetDescriptorType(&descriptor);
                          void * srcAddress      = Cy_DMAC_Descriptor_GetSrcAddress(&descriptor);
                          void * dstAddress      = Cy_DMAC_Descriptor_GetDstAddress(&descriptor);
                       int32_t   srcXincrement   = Cy_DMAC_Descriptor_GetXloopSrcIncrement(&descriptor);
                       int32_t   dstXincrement   = Cy_DMAC_Descriptor_GetXloopDstIncrement(&descriptor);
                      uint32_t   xCount          = Cy_DMAC_Descriptor_GetXloopDataCount(&descriptor);
                       int32_t   srcYincrement   = Cy_DMAC_Descriptor_GetYloopSrcIncrement(&descriptor);
                       int32_t   dstYincrement   = Cy_DMAC_Descriptor_GetYloopDstIncrement(&descriptor);
                      uint32_t   yCount          = Cy_DMAC_Descriptor_GetYloopDataCount(&descriptor);
      cy_stc_dmac_descriptor_t * nextDescriptor  = Cy_DMAC_Descriptor_GetNextDescriptor(&descriptor);
    

Parameters
  • descriptor: The descriptor structure instance.

__STATIC_INLINE void * Cy_DMAC_Descriptor_GetSrcAddress (cy_stc_dmac_descriptor_t const *descriptor)

Returns the source address of the specified descriptor.

Return

The source address value of the 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_DMAC_Enable description */

    cy_en_dmac_retrigger_t       retrigger       = Cy_DMAC_Descriptor_GetRetrigger(&descriptor);
    cy_en_dmac_trigger_type_t    interruptType   = Cy_DMAC_Descriptor_GetInterruptType(&descriptor);
    cy_en_dmac_trigger_type_t    triggerOutType  = Cy_DMAC_Descriptor_GetTriggerOutType(&descriptor);
    cy_en_dmac_channel_state_t   channelState    = Cy_DMAC_Descriptor_GetChannelState(&descriptor);
    cy_en_dmac_trigger_type_t    triggerInType   = Cy_DMAC_Descriptor_GetTriggerInType(&descriptor);
    cy_en_dmac_data_size_t       dataSize        = Cy_DMAC_Descriptor_GetDataSize(&descriptor);
    cy_en_dmac_transfer_size_t   srcTransferSize = Cy_DMAC_Descriptor_GetSrcTransferSize(&descriptor);
    cy_en_dmac_transfer_size_t   dstTransferSize = Cy_DMAC_Descriptor_GetDstTransferSize(&descriptor);
    cy_en_dmac_descriptor_type_t descriptorType  = Cy_DMAC_Descriptor_GetDescriptorType(&descriptor);
                          void * srcAddress      = Cy_DMAC_Descriptor_GetSrcAddress(&descriptor);
                          void * dstAddress      = Cy_DMAC_Descriptor_GetDstAddress(&descriptor);
                       int32_t   srcXincrement   = Cy_DMAC_Descriptor_GetXloopSrcIncrement(&descriptor);
                       int32_t   dstXincrement   = Cy_DMAC_Descriptor_GetXloopDstIncrement(&descriptor);
                      uint32_t   xCount          = Cy_DMAC_Descriptor_GetXloopDataCount(&descriptor);
                       int32_t   srcYincrement   = Cy_DMAC_Descriptor_GetYloopSrcIncrement(&descriptor);
                       int32_t   dstYincrement   = Cy_DMAC_Descriptor_GetYloopDstIncrement(&descriptor);
                      uint32_t   yCount          = Cy_DMAC_Descriptor_GetYloopDataCount(&descriptor);
      cy_stc_dmac_descriptor_t * nextDescriptor  = Cy_DMAC_Descriptor_GetNextDescriptor(&descriptor);
    

Parameters
  • descriptor: The descriptor structure instance.

__STATIC_INLINE void * Cy_DMAC_Descriptor_GetDstAddress (cy_stc_dmac_descriptor_t const *descriptor)

Returns the destination address of the specified descriptor.

Return

The destination address value of the 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_DMAC_Enable description */

    cy_en_dmac_retrigger_t       retrigger       = Cy_DMAC_Descriptor_GetRetrigger(&descriptor);
    cy_en_dmac_trigger_type_t    interruptType   = Cy_DMAC_Descriptor_GetInterruptType(&descriptor);
    cy_en_dmac_trigger_type_t    triggerOutType  = Cy_DMAC_Descriptor_GetTriggerOutType(&descriptor);
    cy_en_dmac_channel_state_t   channelState    = Cy_DMAC_Descriptor_GetChannelState(&descriptor);
    cy_en_dmac_trigger_type_t    triggerInType   = Cy_DMAC_Descriptor_GetTriggerInType(&descriptor);
    cy_en_dmac_data_size_t       dataSize        = Cy_DMAC_Descriptor_GetDataSize(&descriptor);
    cy_en_dmac_transfer_size_t   srcTransferSize = Cy_DMAC_Descriptor_GetSrcTransferSize(&descriptor);
    cy_en_dmac_transfer_size_t   dstTransferSize = Cy_DMAC_Descriptor_GetDstTransferSize(&descriptor);
    cy_en_dmac_descriptor_type_t descriptorType  = Cy_DMAC_Descriptor_GetDescriptorType(&descriptor);
                          void * srcAddress      = Cy_DMAC_Descriptor_GetSrcAddress(&descriptor);
                          void * dstAddress      = Cy_DMAC_Descriptor_GetDstAddress(&descriptor);
                       int32_t   srcXincrement   = Cy_DMAC_Descriptor_GetXloopSrcIncrement(&descriptor);
                       int32_t   dstXincrement   = Cy_DMAC_Descriptor_GetXloopDstIncrement(&descriptor);
                      uint32_t   xCount          = Cy_DMAC_Descriptor_GetXloopDataCount(&descriptor);
                       int32_t   srcYincrement   = Cy_DMAC_Descriptor_GetYloopSrcIncrement(&descriptor);
                       int32_t   dstYincrement   = Cy_DMAC_Descriptor_GetYloopDstIncrement(&descriptor);
                      uint32_t   yCount          = Cy_DMAC_Descriptor_GetYloopDataCount(&descriptor);
      cy_stc_dmac_descriptor_t * nextDescriptor  = Cy_DMAC_Descriptor_GetNextDescriptor(&descriptor);
    

Parameters
  • descriptor: The descriptor structure instance.

uint32_t Cy_DMAC_Descriptor_GetXloopDataCount(cy_stc_dmac_descriptor_t const *descriptor)

Returns the number of data elements for the X loop of the specified descriptor (for all descriptor types except single transfer).

Based on the descriptor type, the offset of the address for the xCount register may vary: For the scatter transfer descriptors type, this register is at offset 0x8. For all the rest supported descriptor types, this register is at offset 0xc.

Return

The number of data elements to transfer in the X loop. For scatter transfer descriptors the X loop count unit is an [address, data] pair (two words, or 8 bytes). For memory copy descriptors X loop count unit is one byte. For all the rest descriptors (except single transfer) the X loop count unit is specified by the data transfer size /ref cy_en_dmac_data_size_t.

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_DMAC_Enable description */

    cy_en_dmac_retrigger_t       retrigger       = Cy_DMAC_Descriptor_GetRetrigger(&descriptor);
    cy_en_dmac_trigger_type_t    interruptType   = Cy_DMAC_Descriptor_GetInterruptType(&descriptor);
    cy_en_dmac_trigger_type_t    triggerOutType  = Cy_DMAC_Descriptor_GetTriggerOutType(&descriptor);
    cy_en_dmac_channel_state_t   channelState    = Cy_DMAC_Descriptor_GetChannelState(&descriptor);
    cy_en_dmac_trigger_type_t    triggerInType   = Cy_DMAC_Descriptor_GetTriggerInType(&descriptor);
    cy_en_dmac_data_size_t       dataSize        = Cy_DMAC_Descriptor_GetDataSize(&descriptor);
    cy_en_dmac_transfer_size_t   srcTransferSize = Cy_DMAC_Descriptor_GetSrcTransferSize(&descriptor);
    cy_en_dmac_transfer_size_t   dstTransferSize = Cy_DMAC_Descriptor_GetDstTransferSize(&descriptor);
    cy_en_dmac_descriptor_type_t descriptorType  = Cy_DMAC_Descriptor_GetDescriptorType(&descriptor);
                          void * srcAddress      = Cy_DMAC_Descriptor_GetSrcAddress(&descriptor);
                          void * dstAddress      = Cy_DMAC_Descriptor_GetDstAddress(&descriptor);
                       int32_t   srcXincrement   = Cy_DMAC_Descriptor_GetXloopSrcIncrement(&descriptor);
                       int32_t   dstXincrement   = Cy_DMAC_Descriptor_GetXloopDstIncrement(&descriptor);
                      uint32_t   xCount          = Cy_DMAC_Descriptor_GetXloopDataCount(&descriptor);
                       int32_t   srcYincrement   = Cy_DMAC_Descriptor_GetYloopSrcIncrement(&descriptor);
                       int32_t   dstYincrement   = Cy_DMAC_Descriptor_GetYloopDstIncrement(&descriptor);
                      uint32_t   yCount          = Cy_DMAC_Descriptor_GetYloopDataCount(&descriptor);
      cy_stc_dmac_descriptor_t * nextDescriptor  = Cy_DMAC_Descriptor_GetNextDescriptor(&descriptor);
    

Parameters
  • descriptor: The descriptor structure instance.

__STATIC_INLINE uint32_t Cy_DMAC_Descriptor_GetYloopDataCount (cy_stc_dmac_descriptor_t const *descriptor)

Returns the number of X loops to execute in the Y loop of the specified descriptor (for 2D descriptors only).

Return

The number of X loops to execute in the Y loop. The range is 1 … 65536.

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_DMAC_Enable description */

    cy_en_dmac_retrigger_t       retrigger       = Cy_DMAC_Descriptor_GetRetrigger(&descriptor);
    cy_en_dmac_trigger_type_t    interruptType   = Cy_DMAC_Descriptor_GetInterruptType(&descriptor);
    cy_en_dmac_trigger_type_t    triggerOutType  = Cy_DMAC_Descriptor_GetTriggerOutType(&descriptor);
    cy_en_dmac_channel_state_t   channelState    = Cy_DMAC_Descriptor_GetChannelState(&descriptor);
    cy_en_dmac_trigger_type_t    triggerInType   = Cy_DMAC_Descriptor_GetTriggerInType(&descriptor);
    cy_en_dmac_data_size_t       dataSize        = Cy_DMAC_Descriptor_GetDataSize(&descriptor);
    cy_en_dmac_transfer_size_t   srcTransferSize = Cy_DMAC_Descriptor_GetSrcTransferSize(&descriptor);
    cy_en_dmac_transfer_size_t   dstTransferSize = Cy_DMAC_Descriptor_GetDstTransferSize(&descriptor);
    cy_en_dmac_descriptor_type_t descriptorType  = Cy_DMAC_Descriptor_GetDescriptorType(&descriptor);
                          void * srcAddress      = Cy_DMAC_Descriptor_GetSrcAddress(&descriptor);
                          void * dstAddress      = Cy_DMAC_Descriptor_GetDstAddress(&descriptor);
                       int32_t   srcXincrement   = Cy_DMAC_Descriptor_GetXloopSrcIncrement(&descriptor);
                       int32_t   dstXincrement   = Cy_DMAC_Descriptor_GetXloopDstIncrement(&descriptor);
                      uint32_t   xCount          = Cy_DMAC_Descriptor_GetXloopDataCount(&descriptor);
                       int32_t   srcYincrement   = Cy_DMAC_Descriptor_GetYloopSrcIncrement(&descriptor);
                       int32_t   dstYincrement   = Cy_DMAC_Descriptor_GetYloopDstIncrement(&descriptor);
                      uint32_t   yCount          = Cy_DMAC_Descriptor_GetYloopDataCount(&descriptor);
      cy_stc_dmac_descriptor_t * nextDescriptor  = Cy_DMAC_Descriptor_GetNextDescriptor(&descriptor);
    

Parameters
  • descriptor: The descriptor structure instance.

__STATIC_INLINE int32_t Cy_DMAC_Descriptor_GetXloopSrcIncrement (cy_stc_dmac_descriptor_t const *descriptor)

Returns the source increment parameter for the X loop of the specified descriptor (for 1D or 2D descriptors only).

Return

The value of the source increment. The range is -32768 … 32767.

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_DMAC_Enable description */

    cy_en_dmac_retrigger_t       retrigger       = Cy_DMAC_Descriptor_GetRetrigger(&descriptor);
    cy_en_dmac_trigger_type_t    interruptType   = Cy_DMAC_Descriptor_GetInterruptType(&descriptor);
    cy_en_dmac_trigger_type_t    triggerOutType  = Cy_DMAC_Descriptor_GetTriggerOutType(&descriptor);
    cy_en_dmac_channel_state_t   channelState    = Cy_DMAC_Descriptor_GetChannelState(&descriptor);
    cy_en_dmac_trigger_type_t    triggerInType   = Cy_DMAC_Descriptor_GetTriggerInType(&descriptor);
    cy_en_dmac_data_size_t       dataSize        = Cy_DMAC_Descriptor_GetDataSize(&descriptor);
    cy_en_dmac_transfer_size_t   srcTransferSize = Cy_DMAC_Descriptor_GetSrcTransferSize(&descriptor);
    cy_en_dmac_transfer_size_t   dstTransferSize = Cy_DMAC_Descriptor_GetDstTransferSize(&descriptor);
    cy_en_dmac_descriptor_type_t descriptorType  = Cy_DMAC_Descriptor_GetDescriptorType(&descriptor);
                          void * srcAddress      = Cy_DMAC_Descriptor_GetSrcAddress(&descriptor);
                          void * dstAddress      = Cy_DMAC_Descriptor_GetDstAddress(&descriptor);
                       int32_t   srcXincrement   = Cy_DMAC_Descriptor_GetXloopSrcIncrement(&descriptor);
                       int32_t   dstXincrement   = Cy_DMAC_Descriptor_GetXloopDstIncrement(&descriptor);
                      uint32_t   xCount          = Cy_DMAC_Descriptor_GetXloopDataCount(&descriptor);
                       int32_t   srcYincrement   = Cy_DMAC_Descriptor_GetYloopSrcIncrement(&descriptor);
                       int32_t   dstYincrement   = Cy_DMAC_Descriptor_GetYloopDstIncrement(&descriptor);
                      uint32_t   yCount          = Cy_DMAC_Descriptor_GetYloopDataCount(&descriptor);
      cy_stc_dmac_descriptor_t * nextDescriptor  = Cy_DMAC_Descriptor_GetNextDescriptor(&descriptor);
    

Parameters
  • descriptor: The descriptor structure instance.

__STATIC_INLINE int32_t Cy_DMAC_Descriptor_GetXloopDstIncrement (cy_stc_dmac_descriptor_t const *descriptor)

Returns the destination increment parameter for the X loop of the specified descriptor (for 1D or 2D descriptors only).

Return

The value of the destination increment. The range is -32768 … 32767.

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_DMAC_Enable description */

    cy_en_dmac_retrigger_t       retrigger       = Cy_DMAC_Descriptor_GetRetrigger(&descriptor);
    cy_en_dmac_trigger_type_t    interruptType   = Cy_DMAC_Descriptor_GetInterruptType(&descriptor);
    cy_en_dmac_trigger_type_t    triggerOutType  = Cy_DMAC_Descriptor_GetTriggerOutType(&descriptor);
    cy_en_dmac_channel_state_t   channelState    = Cy_DMAC_Descriptor_GetChannelState(&descriptor);
    cy_en_dmac_trigger_type_t    triggerInType   = Cy_DMAC_Descriptor_GetTriggerInType(&descriptor);
    cy_en_dmac_data_size_t       dataSize        = Cy_DMAC_Descriptor_GetDataSize(&descriptor);
    cy_en_dmac_transfer_size_t   srcTransferSize = Cy_DMAC_Descriptor_GetSrcTransferSize(&descriptor);
    cy_en_dmac_transfer_size_t   dstTransferSize = Cy_DMAC_Descriptor_GetDstTransferSize(&descriptor);
    cy_en_dmac_descriptor_type_t descriptorType  = Cy_DMAC_Descriptor_GetDescriptorType(&descriptor);
                          void * srcAddress      = Cy_DMAC_Descriptor_GetSrcAddress(&descriptor);
                          void * dstAddress      = Cy_DMAC_Descriptor_GetDstAddress(&descriptor);
                       int32_t   srcXincrement   = Cy_DMAC_Descriptor_GetXloopSrcIncrement(&descriptor);
                       int32_t   dstXincrement   = Cy_DMAC_Descriptor_GetXloopDstIncrement(&descriptor);
                      uint32_t   xCount          = Cy_DMAC_Descriptor_GetXloopDataCount(&descriptor);
                       int32_t   srcYincrement   = Cy_DMAC_Descriptor_GetYloopSrcIncrement(&descriptor);
                       int32_t   dstYincrement   = Cy_DMAC_Descriptor_GetYloopDstIncrement(&descriptor);
                      uint32_t   yCount          = Cy_DMAC_Descriptor_GetYloopDataCount(&descriptor);
      cy_stc_dmac_descriptor_t * nextDescriptor  = Cy_DMAC_Descriptor_GetNextDescriptor(&descriptor);
    

Parameters
  • descriptor: The descriptor structure instance.

__STATIC_INLINE int32_t Cy_DMAC_Descriptor_GetYloopSrcIncrement (cy_stc_dmac_descriptor_t const *descriptor)

Returns the source increment parameter for the Y loop of the specified descriptor (for 2D descriptors only).

Return

The value of source increment. The range is -32768 … 32767.

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_DMAC_Enable description */

    cy_en_dmac_retrigger_t       retrigger       = Cy_DMAC_Descriptor_GetRetrigger(&descriptor);
    cy_en_dmac_trigger_type_t    interruptType   = Cy_DMAC_Descriptor_GetInterruptType(&descriptor);
    cy_en_dmac_trigger_type_t    triggerOutType  = Cy_DMAC_Descriptor_GetTriggerOutType(&descriptor);
    cy_en_dmac_channel_state_t   channelState    = Cy_DMAC_Descriptor_GetChannelState(&descriptor);
    cy_en_dmac_trigger_type_t    triggerInType   = Cy_DMAC_Descriptor_GetTriggerInType(&descriptor);
    cy_en_dmac_data_size_t       dataSize        = Cy_DMAC_Descriptor_GetDataSize(&descriptor);
    cy_en_dmac_transfer_size_t   srcTransferSize = Cy_DMAC_Descriptor_GetSrcTransferSize(&descriptor);
    cy_en_dmac_transfer_size_t   dstTransferSize = Cy_DMAC_Descriptor_GetDstTransferSize(&descriptor);
    cy_en_dmac_descriptor_type_t descriptorType  = Cy_DMAC_Descriptor_GetDescriptorType(&descriptor);
                          void * srcAddress      = Cy_DMAC_Descriptor_GetSrcAddress(&descriptor);
                          void * dstAddress      = Cy_DMAC_Descriptor_GetDstAddress(&descriptor);
                       int32_t   srcXincrement   = Cy_DMAC_Descriptor_GetXloopSrcIncrement(&descriptor);
                       int32_t   dstXincrement   = Cy_DMAC_Descriptor_GetXloopDstIncrement(&descriptor);
                      uint32_t   xCount          = Cy_DMAC_Descriptor_GetXloopDataCount(&descriptor);
                       int32_t   srcYincrement   = Cy_DMAC_Descriptor_GetYloopSrcIncrement(&descriptor);
                       int32_t   dstYincrement   = Cy_DMAC_Descriptor_GetYloopDstIncrement(&descriptor);
                      uint32_t   yCount          = Cy_DMAC_Descriptor_GetYloopDataCount(&descriptor);
      cy_stc_dmac_descriptor_t * nextDescriptor  = Cy_DMAC_Descriptor_GetNextDescriptor(&descriptor);
    

Parameters
  • descriptor: The descriptor structure instance.

__STATIC_INLINE int32_t Cy_DMAC_Descriptor_GetYloopDstIncrement (cy_stc_dmac_descriptor_t const *descriptor)

Returns the destination increment parameter for the Y loop of the specified descriptor (for 2D descriptors only).

Return

The value of the destination increment. The range is -32768 … 32767.

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_DMAC_Enable description */

    cy_en_dmac_retrigger_t       retrigger       = Cy_DMAC_Descriptor_GetRetrigger(&descriptor);
    cy_en_dmac_trigger_type_t    interruptType   = Cy_DMAC_Descriptor_GetInterruptType(&descriptor);
    cy_en_dmac_trigger_type_t    triggerOutType  = Cy_DMAC_Descriptor_GetTriggerOutType(&descriptor);
    cy_en_dmac_channel_state_t   channelState    = Cy_DMAC_Descriptor_GetChannelState(&descriptor);
    cy_en_dmac_trigger_type_t    triggerInType   = Cy_DMAC_Descriptor_GetTriggerInType(&descriptor);
    cy_en_dmac_data_size_t       dataSize        = Cy_DMAC_Descriptor_GetDataSize(&descriptor);
    cy_en_dmac_transfer_size_t   srcTransferSize = Cy_DMAC_Descriptor_GetSrcTransferSize(&descriptor);
    cy_en_dmac_transfer_size_t   dstTransferSize = Cy_DMAC_Descriptor_GetDstTransferSize(&descriptor);
    cy_en_dmac_descriptor_type_t descriptorType  = Cy_DMAC_Descriptor_GetDescriptorType(&descriptor);
                          void * srcAddress      = Cy_DMAC_Descriptor_GetSrcAddress(&descriptor);
                          void * dstAddress      = Cy_DMAC_Descriptor_GetDstAddress(&descriptor);
                       int32_t   srcXincrement   = Cy_DMAC_Descriptor_GetXloopSrcIncrement(&descriptor);
                       int32_t   dstXincrement   = Cy_DMAC_Descriptor_GetXloopDstIncrement(&descriptor);
                      uint32_t   xCount          = Cy_DMAC_Descriptor_GetXloopDataCount(&descriptor);
                       int32_t   srcYincrement   = Cy_DMAC_Descriptor_GetYloopSrcIncrement(&descriptor);
                       int32_t   dstYincrement   = Cy_DMAC_Descriptor_GetYloopDstIncrement(&descriptor);
                      uint32_t   yCount          = Cy_DMAC_Descriptor_GetYloopDataCount(&descriptor);
      cy_stc_dmac_descriptor_t * nextDescriptor  = Cy_DMAC_Descriptor_GetNextDescriptor(&descriptor);
    

Parameters
  • descriptor: The descriptor structure instance.

__STATIC_INLINE cy_en_dmac_trigger_type_t Cy_DMAC_Descriptor_GetInterruptType (cy_stc_dmac_descriptor_t const *descriptor)

Returns the Interrupt-Type of the specified descriptor.

Return

The Interrupt-Type cy_en_dmac_trigger_type_t.

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_DMAC_Enable description */

    cy_en_dmac_retrigger_t       retrigger       = Cy_DMAC_Descriptor_GetRetrigger(&descriptor);
    cy_en_dmac_trigger_type_t    interruptType   = Cy_DMAC_Descriptor_GetInterruptType(&descriptor);
    cy_en_dmac_trigger_type_t    triggerOutType  = Cy_DMAC_Descriptor_GetTriggerOutType(&descriptor);
    cy_en_dmac_channel_state_t   channelState    = Cy_DMAC_Descriptor_GetChannelState(&descriptor);
    cy_en_dmac_trigger_type_t    triggerInType   = Cy_DMAC_Descriptor_GetTriggerInType(&descriptor);
    cy_en_dmac_data_size_t       dataSize        = Cy_DMAC_Descriptor_GetDataSize(&descriptor);
    cy_en_dmac_transfer_size_t   srcTransferSize = Cy_DMAC_Descriptor_GetSrcTransferSize(&descriptor);
    cy_en_dmac_transfer_size_t   dstTransferSize = Cy_DMAC_Descriptor_GetDstTransferSize(&descriptor);
    cy_en_dmac_descriptor_type_t descriptorType  = Cy_DMAC_Descriptor_GetDescriptorType(&descriptor);
                          void * srcAddress      = Cy_DMAC_Descriptor_GetSrcAddress(&descriptor);
                          void * dstAddress      = Cy_DMAC_Descriptor_GetDstAddress(&descriptor);
                       int32_t   srcXincrement   = Cy_DMAC_Descriptor_GetXloopSrcIncrement(&descriptor);
                       int32_t   dstXincrement   = Cy_DMAC_Descriptor_GetXloopDstIncrement(&descriptor);
                      uint32_t   xCount          = Cy_DMAC_Descriptor_GetXloopDataCount(&descriptor);
                       int32_t   srcYincrement   = Cy_DMAC_Descriptor_GetYloopSrcIncrement(&descriptor);
                       int32_t   dstYincrement   = Cy_DMAC_Descriptor_GetYloopDstIncrement(&descriptor);
                      uint32_t   yCount          = Cy_DMAC_Descriptor_GetYloopDataCount(&descriptor);
      cy_stc_dmac_descriptor_t * nextDescriptor  = Cy_DMAC_Descriptor_GetNextDescriptor(&descriptor);
    

Parameters
  • descriptor: The descriptor structure instance.

__STATIC_INLINE cy_en_dmac_trigger_type_t Cy_DMAC_Descriptor_GetTriggerInType (cy_stc_dmac_descriptor_t const *descriptor)

Returns the Trigger In Type of the specified descriptor.

Return

The Trigger In Type cy_en_dmac_trigger_type_t

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_DMAC_Enable description */

    cy_en_dmac_retrigger_t       retrigger       = Cy_DMAC_Descriptor_GetRetrigger(&descriptor);
    cy_en_dmac_trigger_type_t    interruptType   = Cy_DMAC_Descriptor_GetInterruptType(&descriptor);
    cy_en_dmac_trigger_type_t    triggerOutType  = Cy_DMAC_Descriptor_GetTriggerOutType(&descriptor);
    cy_en_dmac_channel_state_t   channelState    = Cy_DMAC_Descriptor_GetChannelState(&descriptor);
    cy_en_dmac_trigger_type_t    triggerInType   = Cy_DMAC_Descriptor_GetTriggerInType(&descriptor);
    cy_en_dmac_data_size_t       dataSize        = Cy_DMAC_Descriptor_GetDataSize(&descriptor);
    cy_en_dmac_transfer_size_t   srcTransferSize = Cy_DMAC_Descriptor_GetSrcTransferSize(&descriptor);
    cy_en_dmac_transfer_size_t   dstTransferSize = Cy_DMAC_Descriptor_GetDstTransferSize(&descriptor);
    cy_en_dmac_descriptor_type_t descriptorType  = Cy_DMAC_Descriptor_GetDescriptorType(&descriptor);
                          void * srcAddress      = Cy_DMAC_Descriptor_GetSrcAddress(&descriptor);
                          void * dstAddress      = Cy_DMAC_Descriptor_GetDstAddress(&descriptor);
                       int32_t   srcXincrement   = Cy_DMAC_Descriptor_GetXloopSrcIncrement(&descriptor);
                       int32_t   dstXincrement   = Cy_DMAC_Descriptor_GetXloopDstIncrement(&descriptor);
                      uint32_t   xCount          = Cy_DMAC_Descriptor_GetXloopDataCount(&descriptor);
                       int32_t   srcYincrement   = Cy_DMAC_Descriptor_GetYloopSrcIncrement(&descriptor);
                       int32_t   dstYincrement   = Cy_DMAC_Descriptor_GetYloopDstIncrement(&descriptor);
                      uint32_t   yCount          = Cy_DMAC_Descriptor_GetYloopDataCount(&descriptor);
      cy_stc_dmac_descriptor_t * nextDescriptor  = Cy_DMAC_Descriptor_GetNextDescriptor(&descriptor);
    

Parameters
  • descriptor: The descriptor structure instance.

__STATIC_INLINE cy_en_dmac_trigger_type_t Cy_DMAC_Descriptor_GetTriggerOutType (cy_stc_dmac_descriptor_t const *descriptor)

Returns the Trigger Out Type of the specified descriptor.

Return

The Trigger Out Type parameter cy_en_dmac_trigger_type_t.

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_DMAC_Enable description */

    cy_en_dmac_retrigger_t       retrigger       = Cy_DMAC_Descriptor_GetRetrigger(&descriptor);
    cy_en_dmac_trigger_type_t    interruptType   = Cy_DMAC_Descriptor_GetInterruptType(&descriptor);
    cy_en_dmac_trigger_type_t    triggerOutType  = Cy_DMAC_Descriptor_GetTriggerOutType(&descriptor);
    cy_en_dmac_channel_state_t   channelState    = Cy_DMAC_Descriptor_GetChannelState(&descriptor);
    cy_en_dmac_trigger_type_t    triggerInType   = Cy_DMAC_Descriptor_GetTriggerInType(&descriptor);
    cy_en_dmac_data_size_t       dataSize        = Cy_DMAC_Descriptor_GetDataSize(&descriptor);
    cy_en_dmac_transfer_size_t   srcTransferSize = Cy_DMAC_Descriptor_GetSrcTransferSize(&descriptor);
    cy_en_dmac_transfer_size_t   dstTransferSize = Cy_DMAC_Descriptor_GetDstTransferSize(&descriptor);
    cy_en_dmac_descriptor_type_t descriptorType  = Cy_DMAC_Descriptor_GetDescriptorType(&descriptor);
                          void * srcAddress      = Cy_DMAC_Descriptor_GetSrcAddress(&descriptor);
                          void * dstAddress      = Cy_DMAC_Descriptor_GetDstAddress(&descriptor);
                       int32_t   srcXincrement   = Cy_DMAC_Descriptor_GetXloopSrcIncrement(&descriptor);
                       int32_t   dstXincrement   = Cy_DMAC_Descriptor_GetXloopDstIncrement(&descriptor);
                      uint32_t   xCount          = Cy_DMAC_Descriptor_GetXloopDataCount(&descriptor);
                       int32_t   srcYincrement   = Cy_DMAC_Descriptor_GetYloopSrcIncrement(&descriptor);
                       int32_t   dstYincrement   = Cy_DMAC_Descriptor_GetYloopDstIncrement(&descriptor);
                      uint32_t   yCount          = Cy_DMAC_Descriptor_GetYloopDataCount(&descriptor);
      cy_stc_dmac_descriptor_t * nextDescriptor  = Cy_DMAC_Descriptor_GetNextDescriptor(&descriptor);
    

Parameters
  • descriptor: The descriptor structure instance.

__STATIC_INLINE cy_en_dmac_data_size_t Cy_DMAC_Descriptor_GetDataSize (cy_stc_dmac_descriptor_t const *descriptor)

Returns the Data Element Size of the specified descriptor.

Return

The Data Element Size cy_en_dmac_data_size_t.

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_DMAC_Enable description */

    cy_en_dmac_retrigger_t       retrigger       = Cy_DMAC_Descriptor_GetRetrigger(&descriptor);
    cy_en_dmac_trigger_type_t    interruptType   = Cy_DMAC_Descriptor_GetInterruptType(&descriptor);
    cy_en_dmac_trigger_type_t    triggerOutType  = Cy_DMAC_Descriptor_GetTriggerOutType(&descriptor);
    cy_en_dmac_channel_state_t   channelState    = Cy_DMAC_Descriptor_GetChannelState(&descriptor);
    cy_en_dmac_trigger_type_t    triggerInType   = Cy_DMAC_Descriptor_GetTriggerInType(&descriptor);
    cy_en_dmac_data_size_t       dataSize        = Cy_DMAC_Descriptor_GetDataSize(&descriptor);
    cy_en_dmac_transfer_size_t   srcTransferSize = Cy_DMAC_Descriptor_GetSrcTransferSize(&descriptor);
    cy_en_dmac_transfer_size_t   dstTransferSize = Cy_DMAC_Descriptor_GetDstTransferSize(&descriptor);
    cy_en_dmac_descriptor_type_t descriptorType  = Cy_DMAC_Descriptor_GetDescriptorType(&descriptor);
                          void * srcAddress      = Cy_DMAC_Descriptor_GetSrcAddress(&descriptor);
                          void * dstAddress      = Cy_DMAC_Descriptor_GetDstAddress(&descriptor);
                       int32_t   srcXincrement   = Cy_DMAC_Descriptor_GetXloopSrcIncrement(&descriptor);
                       int32_t   dstXincrement   = Cy_DMAC_Descriptor_GetXloopDstIncrement(&descriptor);
                      uint32_t   xCount          = Cy_DMAC_Descriptor_GetXloopDataCount(&descriptor);
                       int32_t   srcYincrement   = Cy_DMAC_Descriptor_GetYloopSrcIncrement(&descriptor);
                       int32_t   dstYincrement   = Cy_DMAC_Descriptor_GetYloopDstIncrement(&descriptor);
                      uint32_t   yCount          = Cy_DMAC_Descriptor_GetYloopDataCount(&descriptor);
      cy_stc_dmac_descriptor_t * nextDescriptor  = Cy_DMAC_Descriptor_GetNextDescriptor(&descriptor);
    

Parameters
  • descriptor: The descriptor structure instance.

__STATIC_INLINE cy_en_dmac_transfer_size_t Cy_DMAC_Descriptor_GetSrcTransferSize (cy_stc_dmac_descriptor_t const *descriptor)

Returns the Source Transfer Size of the specified descriptor.

Return

The Source Transfer Size cy_en_dmac_transfer_size_t.

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_DMAC_Enable description */

    cy_en_dmac_retrigger_t       retrigger       = Cy_DMAC_Descriptor_GetRetrigger(&descriptor);
    cy_en_dmac_trigger_type_t    interruptType   = Cy_DMAC_Descriptor_GetInterruptType(&descriptor);
    cy_en_dmac_trigger_type_t    triggerOutType  = Cy_DMAC_Descriptor_GetTriggerOutType(&descriptor);
    cy_en_dmac_channel_state_t   channelState    = Cy_DMAC_Descriptor_GetChannelState(&descriptor);
    cy_en_dmac_trigger_type_t    triggerInType   = Cy_DMAC_Descriptor_GetTriggerInType(&descriptor);
    cy_en_dmac_data_size_t       dataSize        = Cy_DMAC_Descriptor_GetDataSize(&descriptor);
    cy_en_dmac_transfer_size_t   srcTransferSize = Cy_DMAC_Descriptor_GetSrcTransferSize(&descriptor);
    cy_en_dmac_transfer_size_t   dstTransferSize = Cy_DMAC_Descriptor_GetDstTransferSize(&descriptor);
    cy_en_dmac_descriptor_type_t descriptorType  = Cy_DMAC_Descriptor_GetDescriptorType(&descriptor);
                          void * srcAddress      = Cy_DMAC_Descriptor_GetSrcAddress(&descriptor);
                          void * dstAddress      = Cy_DMAC_Descriptor_GetDstAddress(&descriptor);
                       int32_t   srcXincrement   = Cy_DMAC_Descriptor_GetXloopSrcIncrement(&descriptor);
                       int32_t   dstXincrement   = Cy_DMAC_Descriptor_GetXloopDstIncrement(&descriptor);
                      uint32_t   xCount          = Cy_DMAC_Descriptor_GetXloopDataCount(&descriptor);
                       int32_t   srcYincrement   = Cy_DMAC_Descriptor_GetYloopSrcIncrement(&descriptor);
                       int32_t   dstYincrement   = Cy_DMAC_Descriptor_GetYloopDstIncrement(&descriptor);
                      uint32_t   yCount          = Cy_DMAC_Descriptor_GetYloopDataCount(&descriptor);
      cy_stc_dmac_descriptor_t * nextDescriptor  = Cy_DMAC_Descriptor_GetNextDescriptor(&descriptor);
    

Parameters
  • descriptor: The descriptor structure instance.

__STATIC_INLINE cy_en_dmac_transfer_size_t Cy_DMAC_Descriptor_GetDstTransferSize (cy_stc_dmac_descriptor_t const *descriptor)

Returns the Destination Transfer Size of the specified descriptor.

Return

The Destination Transfer Size cy_en_dmac_transfer_size_t

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_DMAC_Enable description */

    cy_en_dmac_retrigger_t       retrigger       = Cy_DMAC_Descriptor_GetRetrigger(&descriptor);
    cy_en_dmac_trigger_type_t    interruptType   = Cy_DMAC_Descriptor_GetInterruptType(&descriptor);
    cy_en_dmac_trigger_type_t    triggerOutType  = Cy_DMAC_Descriptor_GetTriggerOutType(&descriptor);
    cy_en_dmac_channel_state_t   channelState    = Cy_DMAC_Descriptor_GetChannelState(&descriptor);
    cy_en_dmac_trigger_type_t    triggerInType   = Cy_DMAC_Descriptor_GetTriggerInType(&descriptor);
    cy_en_dmac_data_size_t       dataSize        = Cy_DMAC_Descriptor_GetDataSize(&descriptor);
    cy_en_dmac_transfer_size_t   srcTransferSize = Cy_DMAC_Descriptor_GetSrcTransferSize(&descriptor);
    cy_en_dmac_transfer_size_t   dstTransferSize = Cy_DMAC_Descriptor_GetDstTransferSize(&descriptor);
    cy_en_dmac_descriptor_type_t descriptorType  = Cy_DMAC_Descriptor_GetDescriptorType(&descriptor);
                          void * srcAddress      = Cy_DMAC_Descriptor_GetSrcAddress(&descriptor);
                          void * dstAddress      = Cy_DMAC_Descriptor_GetDstAddress(&descriptor);
                       int32_t   srcXincrement   = Cy_DMAC_Descriptor_GetXloopSrcIncrement(&descriptor);
                       int32_t   dstXincrement   = Cy_DMAC_Descriptor_GetXloopDstIncrement(&descriptor);
                      uint32_t   xCount          = Cy_DMAC_Descriptor_GetXloopDataCount(&descriptor);
                       int32_t   srcYincrement   = Cy_DMAC_Descriptor_GetYloopSrcIncrement(&descriptor);
                       int32_t   dstYincrement   = Cy_DMAC_Descriptor_GetYloopDstIncrement(&descriptor);
                      uint32_t   yCount          = Cy_DMAC_Descriptor_GetYloopDataCount(&descriptor);
      cy_stc_dmac_descriptor_t * nextDescriptor  = Cy_DMAC_Descriptor_GetNextDescriptor(&descriptor);
    

Parameters
  • descriptor: The descriptor structure instance.

__STATIC_INLINE cy_en_dmac_retrigger_t Cy_DMAC_Descriptor_GetRetrigger (cy_stc_dmac_descriptor_t const *descriptor)

Returns a value which specifies whether the controller should wait for the input trigger to be deactivated.

Return

The Retrigger setting cy_en_dmac_retrigger_t.

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_DMAC_Enable description */

    cy_en_dmac_retrigger_t       retrigger       = Cy_DMAC_Descriptor_GetRetrigger(&descriptor);
    cy_en_dmac_trigger_type_t    interruptType   = Cy_DMAC_Descriptor_GetInterruptType(&descriptor);
    cy_en_dmac_trigger_type_t    triggerOutType  = Cy_DMAC_Descriptor_GetTriggerOutType(&descriptor);
    cy_en_dmac_channel_state_t   channelState    = Cy_DMAC_Descriptor_GetChannelState(&descriptor);
    cy_en_dmac_trigger_type_t    triggerInType   = Cy_DMAC_Descriptor_GetTriggerInType(&descriptor);
    cy_en_dmac_data_size_t       dataSize        = Cy_DMAC_Descriptor_GetDataSize(&descriptor);
    cy_en_dmac_transfer_size_t   srcTransferSize = Cy_DMAC_Descriptor_GetSrcTransferSize(&descriptor);
    cy_en_dmac_transfer_size_t   dstTransferSize = Cy_DMAC_Descriptor_GetDstTransferSize(&descriptor);
    cy_en_dmac_descriptor_type_t descriptorType  = Cy_DMAC_Descriptor_GetDescriptorType(&descriptor);
                          void * srcAddress      = Cy_DMAC_Descriptor_GetSrcAddress(&descriptor);
                          void * dstAddress      = Cy_DMAC_Descriptor_GetDstAddress(&descriptor);
                       int32_t   srcXincrement   = Cy_DMAC_Descriptor_GetXloopSrcIncrement(&descriptor);
                       int32_t   dstXincrement   = Cy_DMAC_Descriptor_GetXloopDstIncrement(&descriptor);
                      uint32_t   xCount          = Cy_DMAC_Descriptor_GetXloopDataCount(&descriptor);
                       int32_t   srcYincrement   = Cy_DMAC_Descriptor_GetYloopSrcIncrement(&descriptor);
                       int32_t   dstYincrement   = Cy_DMAC_Descriptor_GetYloopDstIncrement(&descriptor);
                      uint32_t   yCount          = Cy_DMAC_Descriptor_GetYloopDataCount(&descriptor);
      cy_stc_dmac_descriptor_t * nextDescriptor  = Cy_DMAC_Descriptor_GetNextDescriptor(&descriptor);
    

Parameters
  • descriptor: The descriptor structure instance.

__STATIC_INLINE cy_en_dmac_channel_state_t Cy_DMAC_Descriptor_GetChannelState (cy_stc_dmac_descriptor_t const *descriptor)

Returns the channel state on completion of the specified descriptor.

Return

The Channel State setting cy_en_dmac_channel_state_t

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_DMAC_Enable description */

    cy_en_dmac_retrigger_t       retrigger       = Cy_DMAC_Descriptor_GetRetrigger(&descriptor);
    cy_en_dmac_trigger_type_t    interruptType   = Cy_DMAC_Descriptor_GetInterruptType(&descriptor);
    cy_en_dmac_trigger_type_t    triggerOutType  = Cy_DMAC_Descriptor_GetTriggerOutType(&descriptor);
    cy_en_dmac_channel_state_t   channelState    = Cy_DMAC_Descriptor_GetChannelState(&descriptor);
    cy_en_dmac_trigger_type_t    triggerInType   = Cy_DMAC_Descriptor_GetTriggerInType(&descriptor);
    cy_en_dmac_data_size_t       dataSize        = Cy_DMAC_Descriptor_GetDataSize(&descriptor);
    cy_en_dmac_transfer_size_t   srcTransferSize = Cy_DMAC_Descriptor_GetSrcTransferSize(&descriptor);
    cy_en_dmac_transfer_size_t   dstTransferSize = Cy_DMAC_Descriptor_GetDstTransferSize(&descriptor);
    cy_en_dmac_descriptor_type_t descriptorType  = Cy_DMAC_Descriptor_GetDescriptorType(&descriptor);
                          void * srcAddress      = Cy_DMAC_Descriptor_GetSrcAddress(&descriptor);
                          void * dstAddress      = Cy_DMAC_Descriptor_GetDstAddress(&descriptor);
                       int32_t   srcXincrement   = Cy_DMAC_Descriptor_GetXloopSrcIncrement(&descriptor);
                       int32_t   dstXincrement   = Cy_DMAC_Descriptor_GetXloopDstIncrement(&descriptor);
                      uint32_t   xCount          = Cy_DMAC_Descriptor_GetXloopDataCount(&descriptor);
                       int32_t   srcYincrement   = Cy_DMAC_Descriptor_GetYloopSrcIncrement(&descriptor);
                       int32_t   dstYincrement   = Cy_DMAC_Descriptor_GetYloopDstIncrement(&descriptor);
                      uint32_t   yCount          = Cy_DMAC_Descriptor_GetYloopDataCount(&descriptor);
      cy_stc_dmac_descriptor_t * nextDescriptor  = Cy_DMAC_Descriptor_GetNextDescriptor(&descriptor);
    

Parameters
  • descriptor: The descriptor structure instance.

struct cy_stc_dmac_descriptor_t
#include <cy_dmac.h>

DMAC descriptor structure type.

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

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

Public Members

uint32_t ctl

0x00000000 Descriptor control

uint32_t src

0x00000004 Descriptor source

uint32_t dst

0x00000008 Descriptor destination

uint32_t xSize

0x0000000C Descriptor X loop size

uint32_t xIncr

0x00000010 Descriptor X loop increment

uint32_t ySize

0x00000014 Descriptor Y loop size

uint32_t yIncr

0x00000010 Descriptor Y loop increment

uint32_t nextPtr

0x00000014 Descriptor next pointer

struct cy_stc_dmac_descriptor_config_t
#include <cy_dmac.h>

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

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

Public Members

cy_en_dmac_retrigger_t retrigger

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

cy_en_dmac_trigger_type_t interruptType

Sets the event that triggers an interrupt.

See cy_en_dmac_trigger_type_t.

cy_en_dmac_trigger_type_t triggerOutType

Sets the event that triggers an output.

See cy_en_dmac_trigger_type_t.

cy_en_dmac_channel_state_t channelState

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

cy_en_dmac_trigger_type_t triggerInType

Sets what type of transfer is triggered.

See cy_en_dmac_trigger_type_t.

bool dataPrefetch

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

cy_en_dmac_data_size_t dataSize

The size of the data bus for transfer.

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

cy_en_dmac_transfer_size_t srcTransferSize

The source transfer size.

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

cy_en_dmac_transfer_size_t dstTransferSize

The destination transfer size.

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

cy_en_dmac_descriptor_type_t descriptorType

The type of the descriptor.

See cy_en_dmac_descriptor_type_t.

void *srcAddress

The source address of the transfer.

void *dstAddress

The destination address of the transfer.

int32_t srcXincrement

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

Valid range is -32768…32767.

int32_t dstXincrement

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

Valid range is -32768…32767.

uint32_t xCount

The number of transfers in an X-loop.

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

int32_t srcYincrement

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

Valid range is -32768…32767.

int32_t dstYincrement

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

Valid range is -32768…32767.

uint32_t yCount

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

Valid range is 1…65536.

cy_stc_dmac_descriptor_t *nextDescriptor

The next descriptor to chain after completion.

A NULL value will signify no chaining.

struct cy_stc_dmac_channel_config_t
#include <cy_dmac.h>

This structure holds the initialization values for the DMAC channel.

Public Members

cy_stc_dmac_descriptor_t *descriptor

The DMAC descriptor associated with the channel being initialized.

uint32_t priority

This parameter specifies the channel’s priority.

bool enable

This parameter specifies if the channel is enabled after initializing.

bool bufferable

This parameter specifies whether a write transaction can complete.

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