PSOC E8XXGP Device Support Library

| PSOC E8XXGP Device Support Library

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

## General Description

## Functions
__STATIC_INLINE void | Cy_AXIDMAC_Enable (AXI_DMAC_Type *base)
| Enables the AXIDMAC block. More...
__STATIC_INLINE void | Cy_AXIDMAC_Disable (AXI_DMAC_Type *base)
| Disables the AXIDMAC block. More...
__STATIC_INLINE uint32_t | Cy_AXIDMAC_GetAllChannelStatus (AXI_DMAC_Type *base)
| Returns the channel enabled status of all channels in a AXIDMAC block. More...
__STATIC_INLINE uint32_t | Cy_AXIDMAC_GetActiveChannel (AXI_DMAC_Type const *base)
| Returns the status of the active/pending channels of the AXIDMAC block. More...

## Function Documentation

## ◆ Cy_AXIDMAC_Enable()

__STATIC_INLINE void Cy_AXIDMAC_Enable | ( | AXI_DMAC_Type * | base | ) |

Enables the AXIDMAC block.

Parameters

  base | The pointer to the hardware AXIDMAC block.

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_Disable()

__STATIC_INLINE void Cy_AXIDMAC_Disable | ( | AXI_DMAC_Type * | base | ) |

Disables the AXIDMAC block.

Parameters

  base | The pointer to the hardware AXIDMAC block.

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_GetAllChannelStatus()

__STATIC_INLINE uint32_t Cy_AXIDMAC_GetAllChannelStatus | ( | AXI_DMAC_Type * | base | ) |

Returns the channel enabled status of all channels in a AXIDMAC block.

Example if return value is 7 then channel 0,1,2 are enabled.

Parameters

  base | The pointer to the hardware AXIDMAC block.

Returns
  Returns a bit-field with all of the currently enabled channels in the AXIDMAC block.

Function Usage
  /* Scenario: Get all channel status */
  Cy_AXIDMAC_GetAllChannelStatus (SAXI_DMAC);
  Cy_AXIDMAC_GetAllChannelStatus
  __STATIC_INLINE uint32_t Cy_AXIDMAC_GetAllChannelStatus(AXI_DMAC_Type *base)
  Returns the channel enabled status of all channels in a AXIDMAC block.
  Definition: cy_axidmac.h:735

## ◆ Cy_AXIDMAC_GetActiveChannel()

__STATIC_INLINE uint32_t Cy_AXIDMAC_GetActiveChannel | ( | AXI_DMAC_Type const * | base | ) |

Returns the status of the active/pending channels of the AXIDMAC block.

Parameters

  base | The pointer to the hardware AXIDMAC block.

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

Function Usage
  /* Scenario: Get the Active channel and disable channel 0 */
  Cy_AXIDMAC_Channel_Enable(SAXI_DMAC, 0UL);
  if (0UL != Cy_AXIDMAC_GetActiveChannel(SAXI_DMAC))
  {
  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_GetActiveChannel
  __STATIC_INLINE uint32_t Cy_AXIDMAC_GetActiveChannel(AXI_DMAC_Type const *base)
  Returns the status of the active/pending channels of the AXIDMAC block.
  Definition: cy_axidmac.h:758