PSOC E8XXGP Device Support Library

| PSOC E8XXGP Device Support Library

Functions
Channel Functions
PDL API Reference » AXIDMAC (AXI Direct Memory Access Controller) » Functions

## General Description

## Functions
cy_en_axidmac_status_t | Cy_AXIDMAC_Channel_Init (AXI_DMAC_Type *base, uint32_t channel, cy_stc_axidmac_channel_config_t const *config)
| Initializes the AXIDMAC channel with a descriptor and other parameters. More...
void | Cy_AXIDMAC_Channel_DeInit (AXI_DMAC_Type *base, uint32_t channel)
| Clears the content of registers corresponding to the channel. More...
__STATIC_INLINE void | Cy_AXIDMAC_Channel_SetDescriptor (AXI_DMAC_Type *base, uint32_t channel, cy_stc_axidmac_descriptor_t const *descriptor)
| Sets a descriptor as current for the specified AXIDMAC channel. More...
__STATIC_INLINE void | Cy_AXIDMAC_Channel_Enable (AXI_DMAC_Type *base, uint32_t channel)
| Enables a AXIDMAC channel. More...
__STATIC_INLINE void | Cy_AXIDMAC_Channel_Disable (AXI_DMAC_Type *base, uint32_t channel)
| Disables a AXIDMAC channel. More...
__STATIC_INLINE void | Cy_AXIDMAC_Channel_SetPriority (AXI_DMAC_Type *base, uint32_t channel, uint32_t priority)
| The function is used to set a priority for the AXIDMAC channel. More...
__STATIC_INLINE uint32_t | Cy_AXIDMAC_Channel_GetPriority (AXI_DMAC_Type const *base, uint32_t channel)
| Returns the priority of the AXIDMAC channel. More...
__STATIC_INLINE uint32_t | Cy_AXIDMAC_Channel_GetStatus (AXI_DMAC_Type const *base, uint32_t channel)
| Returns the enable status of the AXIDMAC channel. More...
__STATIC_INLINE void * | Cy_AXIDMAC_Channel_GetCurrentSrcAddress (AXI_DMAC_Type const *base, uint32_t channel)
| Returns the source address being used for the current transfer. More...
__STATIC_INLINE void * | Cy_AXIDMAC_Channel_GetCurrentDstAddress (AXI_DMAC_Type const *base, uint32_t channel)
| Returns the destination address being used for the current transfer. More...
__STATIC_INLINE uint32_t | Cy_AXIDMAC_Channel_GetCurrentXloopIndex (AXI_DMAC_Type const *base, uint32_t channel)
| Returns the current transfer X-loop index. More...
__STATIC_INLINE uint32_t | Cy_AXIDMAC_Channel_GetCurrentYloopIndex (AXI_DMAC_Type const *base, uint32_t channel)
| Returns the current transfer Y-loop index. More...
__STATIC_INLINE uint32_t | Cy_AXIDMAC_Channel_GetCurrentMloopIndex (AXI_DMAC_Type const *base, uint32_t channel)
| Returns the current transfer M-loop index. More...
__STATIC_INLINE cy_stc_axidmac_descriptor_t * | Cy_AXIDMAC_Channel_GetCurrentDescriptor (AXI_DMAC_Type const *base, uint32_t channel)
| Returns the descriptor that is active in the channel. More...
__STATIC_INLINE uint32_t | Cy_AXIDMAC_Channel_GetInterruptStatus (AXI_DMAC_Type const *base, uint32_t channel)
| Returns the interrupt status of the specified channel. More...
__STATIC_INLINE void | Cy_AXIDMAC_Channel_ClearInterrupt (AXI_DMAC_Type *base, uint32_t channel, uint32_t interrupt)
| Clears the interrupt status of the specified channel. More...
__STATIC_INLINE void | Cy_AXIDMAC_Channel_SetInterrupt (AXI_DMAC_Type *base, uint32_t channel, uint32_t interrupt)
| Sets the interrupt for the specified channel. More...
__STATIC_INLINE uint32_t | Cy_AXIDMAC_Channel_GetInterruptMask (AXI_DMAC_Type const *base, uint32_t channel)
| Returns the interrupt mask value of the specified channel. More...
__STATIC_INLINE void | Cy_AXIDMAC_Channel_SetInterruptMask (AXI_DMAC_Type *base, uint32_t channel, uint32_t interrupt)
| Sets an interrupt mask value for the specified channel. More...
__STATIC_INLINE uint32_t | Cy_AXIDMAC_Channel_GetInterruptStatusMasked (AXI_DMAC_Type const *base, uint32_t channel)
| Returns the logical AND of the corresponding INTR and INTR_MASK fields in a single-load operation. More...
__STATIC_INLINE void | Cy_AXIDMAC_Channel_SetSwTrigger (AXI_DMAC_Type *base, uint32_t channel)
| The function is used to set a SW trigger for a channel. More...

## Function Documentation

## ◆ Cy_AXIDMAC_Channel_Init()

cy_en_axidmac_status_t Cy_AXIDMAC_Channel_Init | ( | AXI_DMAC_Type * | base,
|  | uint32_t | channel,
|  | cy_stc_axidmac_channel_config_t const * | config
| ) |  |

Initializes the AXIDMAC channel with a descriptor and other parameters.

Parameters

  base | The pointer to the hardware AXIDMAC block.
  channel | A channel number.
  config | The structure that has the initialization information for the channel.

Returns
  The status cy_en_axidmac_status_t.

Function Usage
  #define AXIDMAC_DESCRIPTOR CY_SECTION(".cy_socmem_data") cy_stc_axidmac_descriptor_t
  /* Scenario: Initialize a 2D descriptor with descriptors, src and dst are in SOCMEM*/
  #define DATACNT (8UL)
  CY_SECTION(".cy_socmem_data") cy_stc_axidmac_descriptor_t firstDescriptor;
  CY_SECTION(".cy_socmem_data") cy_stc_axidmac_descriptor_t nextDescriptor;
  CY_SECTION(".cy_socmem_data") uint32_t src[DATACNT];
  CY_SECTION(".cy_socmem_data") uint32_t dst[DATACNT];
  CY_SECTION(".cy_socmem_data") cy_stc_axidmac_descriptor_config_t descriptor_cfg =
  {
  .retrigger = CY_AXIDMAC_RETRIG_IM,
  .interruptType = CY_AXIDMAC_DESCR,
  .triggerOutType = CY_AXIDMAC_DESCR,
  .channelState = CY_AXIDMAC_CHANNEL_ENABLED,
  .triggerInType = CY_AXIDMAC_DESCR,
  .descriptorType = CY_AXIDMAC_2D_MEMORY_COPY,
  .srcAddress = &src,
  .dstAddress = &dst,
  .mCount=1U,
  .srcXincrement = 1U,
  .dstXincrement = 1U,
  .xCount = DATACNT,
  .srcYincrement = 0U,
  .dstYincrement = 0U,
  .yCount = 1UL,
  .nextDescriptor = &nextDescriptor,
  };
  void snippet_Cy_AXIDMAC_Enable(void)
  {
  /* Scenario: Setup and enable the AXIDMAC channel 0 */
  cy_stc_axidmac_channel_config_t channelConfig;
  channelConfig.enable = false;
  channelConfig.bufferable = false;
  channelConfig.descriptor = &firstDescriptor;
  if (CY_AXIDMAC_SUCCESS != Cy_AXIDMAC_Descriptor_Init(&firstDescriptor, &descriptor_cfg))
  {
  /* Insert error handling */
  }
  if (CY_AXIDMAC_SUCCESS != Cy_AXIDMAC_Channel_Init(SAXI_DMAC, 0UL, &channelConfig))
  {
  /* Insert error handling */
  }
  Cy_AXIDMAC_Channel_SetDescriptor(SAXI_DMAC, 0UL, &firstDescriptor);
  Cy_AXIDMAC_Channel_SetPriority(SAXI_DMAC, 0UL, 3UL);
  Cy_AXIDMAC_Channel_Enable(SAXI_DMAC, 0UL);
  Cy_AXIDMAC_Enable(SAXI_DMAC);
  }
  Cy_AXIDMAC_Enable
  __STATIC_INLINE void Cy_AXIDMAC_Enable(AXI_DMAC_Type *base)
  Enables the AXIDMAC block.
  Definition: cy_axidmac.h:693
  Cy_AXIDMAC_Channel_SetPriority
  __STATIC_INLINE void Cy_AXIDMAC_Channel_SetPriority(AXI_DMAC_Type *base, uint32_t channel, uint32_t priority)
  The function is used to set a priority for the AXIDMAC channel.
  Definition: cy_axidmac.h:1575
  Cy_AXIDMAC_Channel_Enable
  __STATIC_INLINE void Cy_AXIDMAC_Channel_Enable(AXI_DMAC_Type *base, uint32_t channel)
  Enables a AXIDMAC channel.
  Definition: cy_axidmac.h:1524
  Cy_AXIDMAC_Channel_Init
  cy_en_axidmac_status_t Cy_AXIDMAC_Channel_Init(AXI_DMAC_Type *base, uint32_t channel, cy_stc_axidmac_channel_config_t const *config)
  Initializes the AXIDMAC channel with a descriptor and other parameters.
  Definition: cy_axidmac.c:131
  Cy_AXIDMAC_Channel_SetDescriptor
  __STATIC_INLINE void Cy_AXIDMAC_Channel_SetDescriptor(AXI_DMAC_Type *base, uint32_t channel, cy_stc_axidmac_descriptor_t const *descriptor)
  Sets a descriptor as current for the specified AXIDMAC channel.
  Definition: cy_axidmac.h:1500
  cy_stc_axidmac_descriptor_config_t::retrigger
  cy_en_axidmac_retrigger_t retrigger
  Specifies whether the AXIDMA controller should wait for the input trigger to be deactivated.
  Definition: cy_axidmac.h:338
  cy_stc_axidmac_channel_config_t::descriptor
  cy_stc_axidmac_descriptor_t * descriptor
  The AXIDMAC descriptor associated with the channel being initialized.
  Definition: cy_axidmac.h:365
  cy_stc_axidmac_channel_config_t::bufferable
  bool bufferable
  This parameter specifies whether a write transaction can complete.
  Definition: cy_axidmac.h:368
  cy_stc_axidmac_channel_config_t::enable
  bool enable
  This parameter specifies if the channel is enabled after initializing.
  Definition: cy_axidmac.h:367
  cy_stc_axidmac_channel_config_t
  This structure holds the initialization values for the AXIDMAC channel.
  Definition: cy_axidmac.h:364
  cy_stc_axidmac_descriptor_config_t
  This structure is a configuration structure pre-initialized by user and passed as a parameter to the ...
  Definition: cy_axidmac.h:337
  cy_stc_axidmac_descriptor_t
  AXIDMAC descriptor structure type.
  Definition: cy_axidmac.h:289
  Cy_AXIDMAC_Descriptor_Init
  cy_en_axidmac_status_t Cy_AXIDMAC_Descriptor_Init(cy_stc_axidmac_descriptor_t *descriptor, cy_stc_axidmac_descriptor_config_t const *config)
  Initializes the descriptor structure in SRAM from a pre-initialized configuration structure.
  Definition: cy_axidmac.c:44
  CY_AXIDMAC_DESCR
  @ CY_AXIDMAC_DESCR
  One descriptor transfer.
  Definition: cy_axidmac.h:206
  CY_AXIDMAC_SUCCESS
  @ CY_AXIDMAC_SUCCESS
  Success.
  Definition: cy_axidmac.h:230
  CY_AXIDMAC_RETRIG_IM
  @ CY_AXIDMAC_RETRIG_IM
  Retrigger immediately.
  Definition: cy_axidmac.h:213
  CY_AXIDMAC_CHANNEL_ENABLED
  @ CY_AXIDMAC_CHANNEL_ENABLED
  Channel stays enabled.
  Definition: cy_axidmac.h:223
  CY_AXIDMAC_2D_MEMORY_COPY
  @ CY_AXIDMAC_2D_MEMORY_COPY
  2D Memory copy
  Definition: cy_axidmac.h:197

## ◆ Cy_AXIDMAC_Channel_DeInit()

void Cy_AXIDMAC_Channel_DeInit | ( | AXI_DMAC_Type * | base,
|  | uint32_t | channel
| ) |  |

Clears the content of registers corresponding to the channel.

Parameters

  base | The pointer to the hardware AXIDMAC block.
  channel | A channel number.

Function Usage
  /* Scenario: Disable the AXIDMAC channel 0 if it's priority equals 3 */
  if (3UL == Cy_AXIDMAC_Channel_GetPriority(SAXI_DMAC, 0UL))
  {
  if (0UL != Cy_AXIDMAC_Channel_GetStatus(SAXI_DMAC, 0UL))
  {
  Cy_AXIDMAC_Channel_Disable(SAXI_DMAC, 0UL);
  Cy_AXIDMAC_Channel_DeInit(SAXI_DMAC, 0UL);
  /* if needed (if there is only channel used) the whole block can be disabled */
  Cy_AXIDMAC_Disable(SAXI_DMAC);
  }
  }
  Cy_AXIDMAC_Disable
  __STATIC_INLINE void Cy_AXIDMAC_Disable(AXI_DMAC_Type *base)
  Disables the AXIDMAC block.
  Definition: cy_axidmac.h:712
  Cy_AXIDMAC_Channel_Disable
  __STATIC_INLINE void Cy_AXIDMAC_Channel_Disable(AXI_DMAC_Type *base, uint32_t channel)
  Disables a AXIDMAC channel.
  Definition: cy_axidmac.h:1548
  Cy_AXIDMAC_Channel_GetStatus
  __STATIC_INLINE uint32_t Cy_AXIDMAC_Channel_GetStatus(AXI_DMAC_Type const *base, uint32_t channel)
  Returns the enable status of the AXIDMAC channel.
  Definition: cy_axidmac.h:1629
  Cy_AXIDMAC_Channel_DeInit
  void Cy_AXIDMAC_Channel_DeInit(AXI_DMAC_Type *base, uint32_t channel)
  Clears the content of registers corresponding to the channel.
  Definition: cy_axidmac.c:161
  Cy_AXIDMAC_Channel_GetPriority
  __STATIC_INLINE uint32_t Cy_AXIDMAC_Channel_GetPriority(AXI_DMAC_Type const *base, uint32_t channel)
  Returns the priority of the AXIDMAC channel.
  Definition: cy_axidmac.h:1603

## ◆ Cy_AXIDMAC_Channel_SetDescriptor()

__STATIC_INLINE void Cy_AXIDMAC_Channel_SetDescriptor | ( | AXI_DMAC_Type * | base,
|  | uint32_t | channel,
|  | cy_stc_axidmac_descriptor_t const * | descriptor
| ) |  |

Sets a descriptor as current for the specified AXIDMAC channel.

Parameters

  base | The pointer to the hardware AXIDMAC block.
  channel | The channel number.
  descriptor | This is the descriptor to be associated with the channel.

Function Usage
  #define AXIDMAC_DESCRIPTOR CY_SECTION(".cy_socmem_data") cy_stc_axidmac_descriptor_t
  /* Scenario: Initialize a 2D descriptor with descriptors, src and dst are in SOCMEM*/
  #define DATACNT (8UL)
  CY_SECTION(".cy_socmem_data") cy_stc_axidmac_descriptor_t firstDescriptor;
  CY_SECTION(".cy_socmem_data") cy_stc_axidmac_descriptor_t nextDescriptor;
  CY_SECTION(".cy_socmem_data") uint32_t src[DATACNT];
  CY_SECTION(".cy_socmem_data") uint32_t dst[DATACNT];
  CY_SECTION(".cy_socmem_data") cy_stc_axidmac_descriptor_config_t descriptor_cfg =
  {
  .retrigger = CY_AXIDMAC_RETRIG_IM,
  .interruptType = CY_AXIDMAC_DESCR,
  .triggerOutType = CY_AXIDMAC_DESCR,
  .channelState = CY_AXIDMAC_CHANNEL_ENABLED,
  .triggerInType = CY_AXIDMAC_DESCR,
  .descriptorType = CY_AXIDMAC_2D_MEMORY_COPY,
  .srcAddress = &src,
  .dstAddress = &dst,
  .mCount=1U,
  .srcXincrement = 1U,
  .dstXincrement = 1U,
  .xCount = DATACNT,
  .srcYincrement = 0U,
  .dstYincrement = 0U,
  .yCount = 1UL,
  .nextDescriptor = &nextDescriptor,
  };
  void snippet_Cy_AXIDMAC_Enable(void)
  {
  /* Scenario: Setup and enable the AXIDMAC channel 0 */
  cy_stc_axidmac_channel_config_t channelConfig;
  channelConfig.enable = false;
  channelConfig.bufferable = false;
  channelConfig.descriptor = &firstDescriptor;
  if (CY_AXIDMAC_SUCCESS != Cy_AXIDMAC_Descriptor_Init(&firstDescriptor, &descriptor_cfg))
  {
  /* Insert error handling */
  }
  if (CY_AXIDMAC_SUCCESS != Cy_AXIDMAC_Channel_Init(SAXI_DMAC, 0UL, &channelConfig))
  {
  /* Insert error handling */
  }
  Cy_AXIDMAC_Channel_SetDescriptor(SAXI_DMAC, 0UL, &firstDescriptor);
  Cy_AXIDMAC_Channel_SetPriority(SAXI_DMAC, 0UL, 3UL);
  Cy_AXIDMAC_Channel_Enable(SAXI_DMAC, 0UL);
  Cy_AXIDMAC_Enable(SAXI_DMAC);
  }

## ◆ Cy_AXIDMAC_Channel_Enable()

__STATIC_INLINE void Cy_AXIDMAC_Channel_Enable | ( | AXI_DMAC_Type * | base,
|  | uint32_t | channel
| ) |  |

Enables a AXIDMAC channel.

Parameters

  base | The pointer to the hardware AXIDMAC block.
  channel | The channel number.

Function Usage
  #define AXIDMAC_DESCRIPTOR CY_SECTION(".cy_socmem_data") cy_stc_axidmac_descriptor_t
  /* Scenario: Initialize a 2D descriptor with descriptors, src and dst are in SOCMEM*/
  #define DATACNT (8UL)
  CY_SECTION(".cy_socmem_data") cy_stc_axidmac_descriptor_t firstDescriptor;
  CY_SECTION(".cy_socmem_data") cy_stc_axidmac_descriptor_t nextDescriptor;
  CY_SECTION(".cy_socmem_data") uint32_t src[DATACNT];
  CY_SECTION(".cy_socmem_data") uint32_t dst[DATACNT];
  CY_SECTION(".cy_socmem_data") cy_stc_axidmac_descriptor_config_t descriptor_cfg =
  {
  .retrigger = CY_AXIDMAC_RETRIG_IM,
  .interruptType = CY_AXIDMAC_DESCR,
  .triggerOutType = CY_AXIDMAC_DESCR,
  .channelState = CY_AXIDMAC_CHANNEL_ENABLED,
  .triggerInType = CY_AXIDMAC_DESCR,
  .descriptorType = CY_AXIDMAC_2D_MEMORY_COPY,
  .srcAddress = &src,
  .dstAddress = &dst,
  .mCount=1U,
  .srcXincrement = 1U,
  .dstXincrement = 1U,
  .xCount = DATACNT,
  .srcYincrement = 0U,
  .dstYincrement = 0U,
  .yCount = 1UL,
  .nextDescriptor = &nextDescriptor,
  };
  void snippet_Cy_AXIDMAC_Enable(void)
  {
  /* Scenario: Setup and enable the AXIDMAC channel 0 */
  cy_stc_axidmac_channel_config_t channelConfig;
  channelConfig.enable = false;
  channelConfig.bufferable = false;
  channelConfig.descriptor = &firstDescriptor;
  if (CY_AXIDMAC_SUCCESS != Cy_AXIDMAC_Descriptor_Init(&firstDescriptor, &descriptor_cfg))
  {
  /* Insert error handling */
  }
  if (CY_AXIDMAC_SUCCESS != Cy_AXIDMAC_Channel_Init(SAXI_DMAC, 0UL, &channelConfig))
  {
  /* Insert error handling */
  }
  Cy_AXIDMAC_Channel_SetDescriptor(SAXI_DMAC, 0UL, &firstDescriptor);
  Cy_AXIDMAC_Channel_SetPriority(SAXI_DMAC, 0UL, 3UL);
  Cy_AXIDMAC_Channel_Enable(SAXI_DMAC, 0UL);
  Cy_AXIDMAC_Enable(SAXI_DMAC);
  }

## ◆ Cy_AXIDMAC_Channel_Disable()

__STATIC_INLINE void Cy_AXIDMAC_Channel_Disable | ( | AXI_DMAC_Type * | base,
|  | uint32_t | channel
| ) |  |

Disables a AXIDMAC channel.

Parameters

  base | The pointer to the hardware AXIDMAC block.
  channel | The channel number.

Function Usage
  /* Scenario: Disable the AXIDMAC channel 0 if it's priority equals 3 */
  if (3UL == Cy_AXIDMAC_Channel_GetPriority(SAXI_DMAC, 0UL))
  {
  if (0UL != Cy_AXIDMAC_Channel_GetStatus(SAXI_DMAC, 0UL))
  {
  Cy_AXIDMAC_Channel_Disable(SAXI_DMAC, 0UL);
  Cy_AXIDMAC_Channel_DeInit(SAXI_DMAC, 0UL);
  /* if needed (if there is only channel used) the whole block can be disabled */
  Cy_AXIDMAC_Disable(SAXI_DMAC);
  }
  }

## ◆ Cy_AXIDMAC_Channel_SetPriority()

__STATIC_INLINE void Cy_AXIDMAC_Channel_SetPriority | ( | AXI_DMAC_Type * | base,
|  | uint32_t | channel,
|  | uint32_t | priority
| ) |  |

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

Parameters

  base | The pointer to the hardware AXIDMAC block.
  channel | The channel number.
  priority | The priority to be set for the AXIDMAC channel. The allowed values are 0,1,2,3.

Function Usage
  #define AXIDMAC_DESCRIPTOR CY_SECTION(".cy_socmem_data") cy_stc_axidmac_descriptor_t
  /* Scenario: Initialize a 2D descriptor with descriptors, src and dst are in SOCMEM*/
  #define DATACNT (8UL)
  CY_SECTION(".cy_socmem_data") cy_stc_axidmac_descriptor_t firstDescriptor;
  CY_SECTION(".cy_socmem_data") cy_stc_axidmac_descriptor_t nextDescriptor;
  CY_SECTION(".cy_socmem_data") uint32_t src[DATACNT];
  CY_SECTION(".cy_socmem_data") uint32_t dst[DATACNT];
  CY_SECTION(".cy_socmem_data") cy_stc_axidmac_descriptor_config_t descriptor_cfg =
  {
  .retrigger = CY_AXIDMAC_RETRIG_IM,
  .interruptType = CY_AXIDMAC_DESCR,
  .triggerOutType = CY_AXIDMAC_DESCR,
  .channelState = CY_AXIDMAC_CHANNEL_ENABLED,
  .triggerInType = CY_AXIDMAC_DESCR,
  .descriptorType = CY_AXIDMAC_2D_MEMORY_COPY,
  .srcAddress = &src,
  .dstAddress = &dst,
  .mCount=1U,
  .srcXincrement = 1U,
  .dstXincrement = 1U,
  .xCount = DATACNT,
  .srcYincrement = 0U,
  .dstYincrement = 0U,
  .yCount = 1UL,
  .nextDescriptor = &nextDescriptor,
  };
  void snippet_Cy_AXIDMAC_Enable(void)
  {
  /* Scenario: Setup and enable the AXIDMAC channel 0 */
  cy_stc_axidmac_channel_config_t channelConfig;
  channelConfig.enable = false;
  channelConfig.bufferable = false;
  channelConfig.descriptor = &firstDescriptor;
  if (CY_AXIDMAC_SUCCESS != Cy_AXIDMAC_Descriptor_Init(&firstDescriptor, &descriptor_cfg))
  {
  /* Insert error handling */
  }
  if (CY_AXIDMAC_SUCCESS != Cy_AXIDMAC_Channel_Init(SAXI_DMAC, 0UL, &channelConfig))
  {
  /* Insert error handling */
  }
  Cy_AXIDMAC_Channel_SetDescriptor(SAXI_DMAC, 0UL, &firstDescriptor);
  Cy_AXIDMAC_Channel_SetPriority(SAXI_DMAC, 0UL, 3UL);
  Cy_AXIDMAC_Channel_Enable(SAXI_DMAC, 0UL);
  Cy_AXIDMAC_Enable(SAXI_DMAC);
  }

## ◆ Cy_AXIDMAC_Channel_GetPriority()

__STATIC_INLINE uint32_t Cy_AXIDMAC_Channel_GetPriority | ( | AXI_DMAC_Type const * | base,
|  | uint32_t | channel
| ) |  |

Returns the priority of the AXIDMAC channel.

Parameters

  base | The pointer to the hardware AXIDMAC block.
  channel | The channel number.

Returns
  The priority of the channel.

Function Usage
  /* Scenario: Disable the AXIDMAC channel 0 if it's priority equals 3 */
  if (3UL == Cy_AXIDMAC_Channel_GetPriority(SAXI_DMAC, 0UL))
  {
  if (0UL != Cy_AXIDMAC_Channel_GetStatus(SAXI_DMAC, 0UL))
  {
  Cy_AXIDMAC_Channel_Disable(SAXI_DMAC, 0UL);
  Cy_AXIDMAC_Channel_DeInit(SAXI_DMAC, 0UL);
  /* if needed (if there is only channel used) the whole block can be disabled */
  Cy_AXIDMAC_Disable(SAXI_DMAC);
  }
  }

## ◆ Cy_AXIDMAC_Channel_GetStatus()

__STATIC_INLINE uint32_t Cy_AXIDMAC_Channel_GetStatus | ( | AXI_DMAC_Type const * | base,
|  | uint32_t | channel
| ) |  |

Returns the enable status of the AXIDMAC channel.

Parameters

  base | The pointer to the hardware AXIDMAC block.
  channel | The channel number.

Returns
  The status of the channel.

Function Usage
  /* Scenario: Disable the AXIDMAC channel 0 if it's priority equals 3 */
  if (3UL == Cy_AXIDMAC_Channel_GetPriority(SAXI_DMAC, 0UL))
  {
  if (0UL != Cy_AXIDMAC_Channel_GetStatus(SAXI_DMAC, 0UL))
  {
  Cy_AXIDMAC_Channel_Disable(SAXI_DMAC, 0UL);
  Cy_AXIDMAC_Channel_DeInit(SAXI_DMAC, 0UL);
  /* if needed (if there is only channel used) the whole block can be disabled */
  Cy_AXIDMAC_Disable(SAXI_DMAC);
  }
  }

## ◆ Cy_AXIDMAC_Channel_GetCurrentSrcAddress()

__STATIC_INLINE void * Cy_AXIDMAC_Channel_GetCurrentSrcAddress | ( | AXI_DMAC_Type const * | base,
|  | uint32_t | channel
| ) |  |

Returns the source address being used for the current transfer.

Parameters

  base | The pointer to the hardware AXIDMAC block.
  channel | The channel number.

Returns
  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_data[16];
  uint32_t dst_data[16];
  if (((void*) src_data != Cy_AXIDMAC_Channel_GetCurrentSrcAddress(SAXI_DMAC, 0UL)) &&
  ((void*) dst_data != Cy_AXIDMAC_Channel_GetCurrentDstAddress(SAXI_DMAC, 0UL)))
  {
  /* Read the dst/modify the src arrays content here */
  }
  Cy_AXIDMAC_Channel_GetCurrentDstAddress
  __STATIC_INLINE void * Cy_AXIDMAC_Channel_GetCurrentDstAddress(AXI_DMAC_Type const *base, uint32_t channel)
  Returns the destination address being used for the current transfer.
  Definition: cy_axidmac.h:1682
  Cy_AXIDMAC_Channel_GetCurrentSrcAddress
  __STATIC_INLINE void * Cy_AXIDMAC_Channel_GetCurrentSrcAddress(AXI_DMAC_Type const *base, uint32_t channel)
  Returns the source address being used for the current transfer.
  Definition: cy_axidmac.h:1655

## ◆ Cy_AXIDMAC_Channel_GetCurrentDstAddress()

__STATIC_INLINE void * Cy_AXIDMAC_Channel_GetCurrentDstAddress | ( | AXI_DMAC_Type const * | base,
|  | uint32_t | channel
| ) |  |

Returns the destination address being used for the current transfer.

Parameters

  base | The pointer to the hardware AXIDMAC block.
  channel | The channel number.

Returns
  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_data[16];
  uint32_t dst_data[16];
  if (((void*) src_data != Cy_AXIDMAC_Channel_GetCurrentSrcAddress(SAXI_DMAC, 0UL)) &&
  ((void*) dst_data != Cy_AXIDMAC_Channel_GetCurrentDstAddress(SAXI_DMAC, 0UL)))
  {
  /* Read the dst/modify the src arrays content here */
  }

## ◆ Cy_AXIDMAC_Channel_GetCurrentXloopIndex()

__STATIC_INLINE uint32_t Cy_AXIDMAC_Channel_GetCurrentXloopIndex | ( | AXI_DMAC_Type const * | base,
|  | uint32_t | channel
| ) |  |

Returns the current transfer X-loop index.

Parameters

  base | The pointer to the hardware AXIDMAC block.
  channel | The channel number.

Returns
  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_data[16][16];
  uint32_t m = 6;
  uint32_t x = 7;
  uint32_t y = 8;
  if (((void*) src_data == Cy_AXIDMAC_Channel_GetCurrentSrcAddress(SAXI_DMAC, 0UL)) &&
  (m < Cy_AXIDMAC_Channel_GetCurrentMloopIndex(SAXI_DMAC, 0UL)) &&
  (x < Cy_AXIDMAC_Channel_GetCurrentXloopIndex(SAXI_DMAC, 0UL)) &&
  (y < Cy_AXIDMAC_Channel_GetCurrentYloopIndex(SAXI_DMAC, 0UL)))
  {
  /* Modify the src arrays content here */
  }
  Cy_AXIDMAC_Channel_GetCurrentMloopIndex
  __STATIC_INLINE uint32_t Cy_AXIDMAC_Channel_GetCurrentMloopIndex(AXI_DMAC_Type const *base, uint32_t channel)
  Returns the current transfer M-loop index.
  Definition: cy_axidmac.h:1763
  Cy_AXIDMAC_Channel_GetCurrentYloopIndex
  __STATIC_INLINE uint32_t Cy_AXIDMAC_Channel_GetCurrentYloopIndex(AXI_DMAC_Type const *base, uint32_t channel)
  Returns the current transfer Y-loop index.
  Definition: cy_axidmac.h:1736
  Cy_AXIDMAC_Channel_GetCurrentXloopIndex
  __STATIC_INLINE uint32_t Cy_AXIDMAC_Channel_GetCurrentXloopIndex(AXI_DMAC_Type const *base, uint32_t channel)
  Returns the current transfer X-loop index.
  Definition: cy_axidmac.h:1709

## ◆ Cy_AXIDMAC_Channel_GetCurrentYloopIndex()

__STATIC_INLINE uint32_t Cy_AXIDMAC_Channel_GetCurrentYloopIndex | ( | AXI_DMAC_Type const * | base,
|  | uint32_t | channel
| ) |  |

Returns the current transfer Y-loop index.

Parameters

  base | The pointer to the hardware AXIDMAC block.
  channel | The channel number.

Returns
  Returns the current transfer Y-loop index.

Function Usage
  /* Scenario: Make sure the current indexes are greater than a desired
  * data source item before modifying.
  */
  uint32_t src_data[16][16];
  uint32_t m = 6;
  uint32_t x = 7;
  uint32_t y = 8;
  if (((void*) src_data == Cy_AXIDMAC_Channel_GetCurrentSrcAddress(SAXI_DMAC, 0UL)) &&
  (m < Cy_AXIDMAC_Channel_GetCurrentMloopIndex(SAXI_DMAC, 0UL)) &&
  (x < Cy_AXIDMAC_Channel_GetCurrentXloopIndex(SAXI_DMAC, 0UL)) &&
  (y < Cy_AXIDMAC_Channel_GetCurrentYloopIndex(SAXI_DMAC, 0UL)))
  {
  /* Modify the src arrays content here */
  }

## ◆ Cy_AXIDMAC_Channel_GetCurrentMloopIndex()

__STATIC_INLINE uint32_t Cy_AXIDMAC_Channel_GetCurrentMloopIndex | ( | AXI_DMAC_Type const * | base,
|  | uint32_t | channel
| ) |  |

Returns the current transfer M-loop index.

Parameters

  base | The pointer to the hardware AXIDMAC block.
  channel | The channel number.

Returns
  Returns the current transfer M-loop index.

Function Usage
  /* Scenario: Make sure the current indexes are greater than a desired
  * data source item before modifying.
  */
  uint32_t src_data[16][16];
  uint32_t m = 6;
  uint32_t x = 7;
  uint32_t y = 8;
  if (((void*) src_data == Cy_AXIDMAC_Channel_GetCurrentSrcAddress(SAXI_DMAC, 0UL)) &&
  (m < Cy_AXIDMAC_Channel_GetCurrentMloopIndex(SAXI_DMAC, 0UL)) &&
  (x < Cy_AXIDMAC_Channel_GetCurrentXloopIndex(SAXI_DMAC, 0UL)) &&
  (y < Cy_AXIDMAC_Channel_GetCurrentYloopIndex(SAXI_DMAC, 0UL)))
  {
  /* Modify the src arrays content here */
  }

## ◆ Cy_AXIDMAC_Channel_GetCurrentDescriptor()

__STATIC_INLINE cy_stc_axidmac_descriptor_t * Cy_AXIDMAC_Channel_GetCurrentDescriptor | ( | AXI_DMAC_Type const * | base,
|  | uint32_t | channel
| ) |  |

Returns the descriptor that is active in the channel.

Parameters

  base | The pointer to the hardware AXIDMAC block.
  channel | The channel number.

Returns
  The pointer to the descriptor associated with the channel.

Function Usage
  /* Scenario: Disable a descriptor */
  if (&descriptor != Cy_AXIDMAC_Channel_GetCurrentDescriptor(SAXI_DMAC, 0UL)) /* Make sure it is not in use */
  {
  Cy_AXIDMAC_Descriptor_DeInit(&descriptor);
  }
  Cy_AXIDMAC_Channel_GetCurrentDescriptor
  __STATIC_INLINE cy_stc_axidmac_descriptor_t * Cy_AXIDMAC_Channel_GetCurrentDescriptor(AXI_DMAC_Type const *base, uint32_t channel)
  Returns the descriptor that is active in the channel.
  Definition: cy_axidmac.h:1815
  Cy_AXIDMAC_Descriptor_DeInit
  void Cy_AXIDMAC_Descriptor_DeInit(cy_stc_axidmac_descriptor_t *descriptor)
  Clears the content of the specified descriptor.
  Definition: cy_axidmac.c:109

## ◆ Cy_AXIDMAC_Channel_GetInterruptStatus()

__STATIC_INLINE uint32_t Cy_AXIDMAC_Channel_GetInterruptStatus | ( | AXI_DMAC_Type const * | base,
|  | uint32_t | channel
| ) |  |

Returns the interrupt status of the specified channel.

Parameters

  base | The pointer to the hardware AXIDMAC block.
  channel | The channel number.

Returns
  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_AXIDMAC_INTR_MASK == Cy_AXIDMAC_Channel_GetInterruptStatus (SAXI_DMAC, 0UL))
  {
  /* The AXIDMAC channel 0 interrupt is pending */
  }
  Cy_AXIDMAC_Channel_GetInterruptStatus
  __STATIC_INLINE uint32_t Cy_AXIDMAC_Channel_GetInterruptStatus(AXI_DMAC_Type const *base, uint32_t channel)
  Returns the interrupt status of the specified channel.
  Definition: cy_axidmac.h:1842

## ◆ Cy_AXIDMAC_Channel_ClearInterrupt()

__STATIC_INLINE void Cy_AXIDMAC_Channel_ClearInterrupt | ( | AXI_DMAC_Type * | base,
|  | uint32_t | channel,
|  | uint32_t | interrupt
| ) |  |

Clears the interrupt status of the specified channel.

Parameters

  base | The pointer to the hardware AXIDMAC block.
  channel | The channel number.
  interrupt | The interrupt mask, see Interrupt Masks.

Function Usage
  /* Scenario: Inside the interrupt service routine for AXIDMAC channel 0: */
  uint32_t interrupt = Cy_AXIDMAC_Channel_GetInterruptStatusMasked(SAXI_DMAC, 0UL);
  if (CY_AXIDMAC_INTR_COMPLETION == interrupt)
  {
  /* Insert completion interrupt handling */
  }
  /* Check for other interrupts */
  /* Clear interrupts */
  Cy_AXIDMAC_Channel_ClearInterrupt(SAXI_DMAC, 0UL, interrupt);
  Cy_AXIDMAC_Channel_GetInterruptStatusMasked
  __STATIC_INLINE uint32_t Cy_AXIDMAC_Channel_GetInterruptStatusMasked(AXI_DMAC_Type const *base, uint32_t channel)
  Returns the logical AND of the corresponding INTR and INTR_MASK fields in a single-load operation.
  Definition: cy_axidmac.h:1982
  Cy_AXIDMAC_Channel_ClearInterrupt
  __STATIC_INLINE void Cy_AXIDMAC_Channel_ClearInterrupt(AXI_DMAC_Type *base, uint32_t channel, uint32_t interrupt)
  Clears the interrupt status of the specified channel.
  Definition: cy_axidmac.h:1869
  CY_AXIDMAC_INTR_COMPLETION
  #define CY_AXIDMAC_INTR_COMPLETION
  Bit 0: Completion of data transfer(s) as specified by the descriptor's interruptType setting.
  Definition: cy_axidmac.h:169

## ◆ Cy_AXIDMAC_Channel_SetInterrupt()

__STATIC_INLINE void Cy_AXIDMAC_Channel_SetInterrupt | ( | AXI_DMAC_Type * | base,
|  | uint32_t | channel,
|  | uint32_t | interrupt
| ) |  |

Sets the interrupt for the specified channel.

Parameters

  base | The pointer to the hardware AXIDMAC block.
  channel | The channel number.
  interrupt | The interrupt mask. See Interrupt Masks.

Function Usage
  /* Scenario: Enable interrupts for channel 0 */
  Cy_AXIDMAC_Channel_SetInterruptMask (SAXI_DMAC, 0UL, CY_AXIDMAC_INTR_MASK);
  /* Scenario: Test the interrupt for channel 0 */
  Cy_AXIDMAC_Channel_SetInterrupt(SAXI_DMAC, 0UL, CY_AXIDMAC_INTR_COMPLETION);
  /* Now the interrupt should occur (if it is enabled, of course) */
  /* Scenario: Disable interrupts for AXIDMAC channel 0 if it is enabled */
  if (CY_AXIDMAC_INTR_MASK == Cy_AXIDMAC_Channel_GetInterruptMask(SAXI_DMAC, 0UL))
  {
  Cy_AXIDMAC_Channel_SetInterruptMask (SAXI_DMAC, 0UL, 0UL);
  }
  Cy_AXIDMAC_Channel_GetInterruptMask
  __STATIC_INLINE uint32_t Cy_AXIDMAC_Channel_GetInterruptMask(AXI_DMAC_Type const *base, uint32_t channel)
  Returns the interrupt mask value of the specified channel.
  Definition: cy_axidmac.h:1927
  Cy_AXIDMAC_Channel_SetInterruptMask
  __STATIC_INLINE void Cy_AXIDMAC_Channel_SetInterruptMask(AXI_DMAC_Type *base, uint32_t channel, uint32_t interrupt)
  Sets an interrupt mask value for the specified channel.
  Definition: cy_axidmac.h:1954
  Cy_AXIDMAC_Channel_SetInterrupt
  __STATIC_INLINE void Cy_AXIDMAC_Channel_SetInterrupt(AXI_DMAC_Type *base, uint32_t channel, uint32_t interrupt)
  Sets the interrupt for the specified channel.
  Definition: cy_axidmac.h:1899

## ◆ Cy_AXIDMAC_Channel_GetInterruptMask()

__STATIC_INLINE uint32_t Cy_AXIDMAC_Channel_GetInterruptMask | ( | AXI_DMAC_Type const * | base,
|  | uint32_t | channel
| ) |  |

Returns the interrupt mask value of the specified channel.

Parameters

  base | The pointer to the hardware AXIDMAC block.
  channel | The channel number.

Returns
  The interrupt mask value. See Interrupt Masks.

Function Usage
  /* Scenario: Enable interrupts for channel 0 */
  Cy_AXIDMAC_Channel_SetInterruptMask (SAXI_DMAC, 0UL, CY_AXIDMAC_INTR_MASK);
  /* Scenario: Test the interrupt for channel 0 */
  Cy_AXIDMAC_Channel_SetInterrupt(SAXI_DMAC, 0UL, CY_AXIDMAC_INTR_COMPLETION);
  /* Now the interrupt should occur (if it is enabled, of course) */
  /* Scenario: Disable interrupts for AXIDMAC channel 0 if it is enabled */
  if (CY_AXIDMAC_INTR_MASK == Cy_AXIDMAC_Channel_GetInterruptMask(SAXI_DMAC, 0UL))
  {
  Cy_AXIDMAC_Channel_SetInterruptMask (SAXI_DMAC, 0UL, 0UL);
  }

## ◆ Cy_AXIDMAC_Channel_SetInterruptMask()

__STATIC_INLINE void Cy_AXIDMAC_Channel_SetInterruptMask | ( | AXI_DMAC_Type * | base,
|  | uint32_t | channel,
|  | uint32_t | interrupt
| ) |  |

Sets an interrupt mask value for the specified channel.

Parameters

  base | The pointer to the hardware AXIDMAC block.
  channel | The channel number.
  interrupt | The interrupt mask, see Interrupt Masks.

Function Usage
  /* Scenario: Enable interrupts for channel 0 */
  Cy_AXIDMAC_Channel_SetInterruptMask (SAXI_DMAC, 0UL, CY_AXIDMAC_INTR_MASK);
  /* Scenario: Test the interrupt for channel 0 */
  Cy_AXIDMAC_Channel_SetInterrupt(SAXI_DMAC, 0UL, CY_AXIDMAC_INTR_COMPLETION);
  /* Now the interrupt should occur (if it is enabled, of course) */
  /* Scenario: Disable interrupts for AXIDMAC channel 0 if it is enabled */
  if (CY_AXIDMAC_INTR_MASK == Cy_AXIDMAC_Channel_GetInterruptMask(SAXI_DMAC, 0UL))
  {
  Cy_AXIDMAC_Channel_SetInterruptMask (SAXI_DMAC, 0UL, 0UL);
  }

## ◆ Cy_AXIDMAC_Channel_GetInterruptStatusMasked()

__STATIC_INLINE uint32_t Cy_AXIDMAC_Channel_GetInterruptStatusMasked | ( | AXI_DMAC_Type const * | base,
|  | uint32_t | channel
| ) |  |

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

Parameters

  base | The pointer to the hardware AXIDMAC block.
  channel | The channel number.

Returns
  The masked interrupt status. See Interrupt Masks.

Function Usage
  /* Scenario: Inside the interrupt service routine for AXIDMAC channel 0: */
  uint32_t interrupt = Cy_AXIDMAC_Channel_GetInterruptStatusMasked(SAXI_DMAC, 0UL);
  if (CY_AXIDMAC_INTR_COMPLETION == interrupt)
  {
  /* Insert completion interrupt handling */
  }
  /* Check for other interrupts */
  /* Clear interrupts */
  Cy_AXIDMAC_Channel_ClearInterrupt(SAXI_DMAC, 0UL, interrupt);

## ◆ Cy_AXIDMAC_Channel_SetSwTrigger()

__STATIC_INLINE void Cy_AXIDMAC_Channel_SetSwTrigger | ( | AXI_DMAC_Type * | base,
|  | uint32_t | channel
| ) |  |

The function is used to set a SW trigger for a channel.

Parameters

  base | The pointer to the hardware AXIDMAC block.
  channel | The channel number.

Note
  Channel must have been enabled before setting software trigger.

Function Usage
  #define AXIDMAC_DESCRIPTOR CY_SECTION(".cy_socmem_data") cy_stc_axidmac_descriptor_t
  /* Scenario: Initialize a 2D descriptor with descriptors, src and dst are in SOCMEM*/
  #define DATACNT (8UL)
  CY_SECTION(".cy_socmem_data") cy_stc_axidmac_descriptor_t firstDescriptor;
  CY_SECTION(".cy_socmem_data") cy_stc_axidmac_descriptor_t nextDescriptor;
  CY_SECTION(".cy_socmem_data") uint32_t src[DATACNT];
  CY_SECTION(".cy_socmem_data") uint32_t dst[DATACNT];
  CY_SECTION(".cy_socmem_data") cy_stc_axidmac_descriptor_config_t descriptor_cfg =
  {
  .retrigger = CY_AXIDMAC_RETRIG_IM,
  .interruptType = CY_AXIDMAC_DESCR,
  .triggerOutType = CY_AXIDMAC_DESCR,
  .channelState = CY_AXIDMAC_CHANNEL_ENABLED,
  .triggerInType = CY_AXIDMAC_DESCR,
  .descriptorType = CY_AXIDMAC_2D_MEMORY_COPY,
  .srcAddress = &src,
  .dstAddress = &dst,
  .mCount=1U,
  .srcXincrement = 1U,
  .dstXincrement = 1U,
  .xCount = DATACNT,
  .srcYincrement = 0U,
  .dstYincrement = 0U,
  .yCount = 1UL,
  .nextDescriptor = &nextDescriptor,
  };
  void snippet_Cy_AXIDMAC_Enable(void)
  {
  /* Scenario: Setup and enable the AXIDMAC channel 0 */
  cy_stc_axidmac_channel_config_t channelConfig;
  channelConfig.enable = false;
  channelConfig.bufferable = false;
  channelConfig.descriptor = &firstDescriptor;
  if (CY_AXIDMAC_SUCCESS != Cy_AXIDMAC_Descriptor_Init(&firstDescriptor, &descriptor_cfg))
  {
  /* Insert error handling */
  }
  if (CY_AXIDMAC_SUCCESS != Cy_AXIDMAC_Channel_Init(SAXI_DMAC, 0UL, &channelConfig))
  {
  /* Insert error handling */
  }
  Cy_AXIDMAC_Channel_SetDescriptor(SAXI_DMAC, 0UL, &firstDescriptor);
  Cy_AXIDMAC_Channel_SetPriority(SAXI_DMAC, 0UL, 3UL);
  Cy_AXIDMAC_Channel_Enable(SAXI_DMAC, 0UL);
  Cy_AXIDMAC_Enable(SAXI_DMAC);
  }