MTB CAT1 Peripheral driver library

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_tCy_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
baseThe pointer to the hardware AXIDMAC block.
channelA channel number.
configThe structure that has the initialization information for the channel.
Returns
The status /ref 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 descriptor;
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 =
{
.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 */
channelConfig.enable = false;
channelConfig.bufferable = false;
channelConfig.descriptor = &descriptor;
if (CY_AXIDMAC_SUCCESS != Cy_AXIDMAC_Descriptor_Init(&descriptor, &descriptor_cfg))
{
/* Insert error handling */
}
if (CY_AXIDMAC_SUCCESS != Cy_AXIDMAC_Channel_Init(AXI_DMAC, 0UL, &channelConfig))
{
/* Insert error handling */
}
Cy_AXIDMAC_Channel_SetDescriptor(AXI_DMAC, 0UL, &descriptor);
Cy_AXIDMAC_Channel_SetPriority(AXI_DMAC, 0UL, 3UL);
Cy_AXIDMAC_Channel_Enable(AXI_DMAC, 0UL);
Cy_AXIDMAC_Enable(AXI_DMAC);
}

◆ 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
baseThe pointer to the hardware AXIDMAC block.
channelA channel number.
Function Usage
/* Scenario: Disable the AXIDMAC channel 0 if it's priority equals 3 */
if (3UL == Cy_AXIDMAC_Channel_GetPriority(AXI_DMAC, 0UL))
{
if (0UL != Cy_AXIDMAC_Channel_GetStatus(AXI_DMAC, 0UL))
{
Cy_AXIDMAC_Channel_DeInit(AXI_DMAC, 0UL);
/* if needed (if there is only channel used) the whole block can be disabled */
Cy_AXIDMAC_Disable(AXI_DMAC);
}
}

◆ 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
baseThe pointer to the hardware AXIDMAC block.
channelThe channel number.
descriptorThis 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 descriptor;
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 =
{
.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 */
channelConfig.enable = false;
channelConfig.bufferable = false;
channelConfig.descriptor = &descriptor;
if (CY_AXIDMAC_SUCCESS != Cy_AXIDMAC_Descriptor_Init(&descriptor, &descriptor_cfg))
{
/* Insert error handling */
}
if (CY_AXIDMAC_SUCCESS != Cy_AXIDMAC_Channel_Init(AXI_DMAC, 0UL, &channelConfig))
{
/* Insert error handling */
}
Cy_AXIDMAC_Channel_SetDescriptor(AXI_DMAC, 0UL, &descriptor);
Cy_AXIDMAC_Channel_SetPriority(AXI_DMAC, 0UL, 3UL);
Cy_AXIDMAC_Channel_Enable(AXI_DMAC, 0UL);
Cy_AXIDMAC_Enable(AXI_DMAC);
}

◆ Cy_AXIDMAC_Channel_Enable()

__STATIC_INLINE void Cy_AXIDMAC_Channel_Enable ( AXI_DMAC_Type *  base,
uint32_t  channel 
)

Enables a AXIDMAC channel.

Parameters
baseThe pointer to the hardware AXIDMAC block.
channelThe 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 descriptor;
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 =
{
.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 */
channelConfig.enable = false;
channelConfig.bufferable = false;
channelConfig.descriptor = &descriptor;
if (CY_AXIDMAC_SUCCESS != Cy_AXIDMAC_Descriptor_Init(&descriptor, &descriptor_cfg))
{
/* Insert error handling */
}
if (CY_AXIDMAC_SUCCESS != Cy_AXIDMAC_Channel_Init(AXI_DMAC, 0UL, &channelConfig))
{
/* Insert error handling */
}
Cy_AXIDMAC_Channel_SetDescriptor(AXI_DMAC, 0UL, &descriptor);
Cy_AXIDMAC_Channel_SetPriority(AXI_DMAC, 0UL, 3UL);
Cy_AXIDMAC_Channel_Enable(AXI_DMAC, 0UL);
Cy_AXIDMAC_Enable(AXI_DMAC);
}

◆ Cy_AXIDMAC_Channel_Disable()

__STATIC_INLINE void Cy_AXIDMAC_Channel_Disable ( AXI_DMAC_Type *  base,
uint32_t  channel 
)

Disables a AXIDMAC channel.

Parameters
baseThe pointer to the hardware AXIDMAC block.
channelThe channel number.
Function Usage
/* Scenario: Disable the AXIDMAC channel 0 if it's priority equals 3 */
if (3UL == Cy_AXIDMAC_Channel_GetPriority(AXI_DMAC, 0UL))
{
if (0UL != Cy_AXIDMAC_Channel_GetStatus(AXI_DMAC, 0UL))
{
Cy_AXIDMAC_Channel_DeInit(AXI_DMAC, 0UL);
/* if needed (if there is only channel used) the whole block can be disabled */
Cy_AXIDMAC_Disable(AXI_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
baseThe pointer to the hardware AXIDMAC block.
channelThe channel number.
priorityThe 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 descriptor;
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 =
{
.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 */
channelConfig.enable = false;
channelConfig.bufferable = false;
channelConfig.descriptor = &descriptor;
if (CY_AXIDMAC_SUCCESS != Cy_AXIDMAC_Descriptor_Init(&descriptor, &descriptor_cfg))
{
/* Insert error handling */
}
if (CY_AXIDMAC_SUCCESS != Cy_AXIDMAC_Channel_Init(AXI_DMAC, 0UL, &channelConfig))
{
/* Insert error handling */
}
Cy_AXIDMAC_Channel_SetDescriptor(AXI_DMAC, 0UL, &descriptor);
Cy_AXIDMAC_Channel_SetPriority(AXI_DMAC, 0UL, 3UL);
Cy_AXIDMAC_Channel_Enable(AXI_DMAC, 0UL);
Cy_AXIDMAC_Enable(AXI_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
baseThe pointer to the hardware AXIDMAC block.
channelThe 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(AXI_DMAC, 0UL))
{
if (0UL != Cy_AXIDMAC_Channel_GetStatus(AXI_DMAC, 0UL))
{
Cy_AXIDMAC_Channel_DeInit(AXI_DMAC, 0UL);
/* if needed (if there is only channel used) the whole block can be disabled */
Cy_AXIDMAC_Disable(AXI_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
baseThe pointer to the hardware AXIDMAC block.
channelThe 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(AXI_DMAC, 0UL))
{
if (0UL != Cy_AXIDMAC_Channel_GetStatus(AXI_DMAC, 0UL))
{
Cy_AXIDMAC_Channel_DeInit(AXI_DMAC, 0UL);
/* if needed (if there is only channel used) the whole block can be disabled */
Cy_AXIDMAC_Disable(AXI_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
baseThe pointer to the hardware AXIDMAC block.
channelThe 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[16];
uint32_t dst[16];
if (((void*) src != Cy_AXIDMAC_Channel_GetCurrentSrcAddress(AXI_DMAC, 0UL)) &&
((void*) dst != Cy_AXIDMAC_Channel_GetCurrentDstAddress(AXI_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.

Parameters
baseThe pointer to the hardware AXIDMAC block.
channelThe 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[16];
uint32_t dst[16];
if (((void*) src != Cy_AXIDMAC_Channel_GetCurrentSrcAddress(AXI_DMAC, 0UL)) &&
((void*) dst != Cy_AXIDMAC_Channel_GetCurrentDstAddress(AXI_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
baseThe pointer to the hardware AXIDMAC block.
channelThe 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[16][16];
uint32_t m = 6;
uint32_t x = 7;
uint32_t y = 8;
if (((void*) src == Cy_AXIDMAC_Channel_GetCurrentSrcAddress(AXI_DMAC, 0UL)) &&
{
/* Modify the src arrays content here */
}

◆ 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
baseThe pointer to the hardware AXIDMAC block.
channelThe 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[16][16];
uint32_t m = 6;
uint32_t x = 7;
uint32_t y = 8;
if (((void*) src == Cy_AXIDMAC_Channel_GetCurrentSrcAddress(AXI_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
baseThe pointer to the hardware AXIDMAC block.
channelThe 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[16][16];
uint32_t m = 6;
uint32_t x = 7;
uint32_t y = 8;
if (((void*) src == Cy_AXIDMAC_Channel_GetCurrentSrcAddress(AXI_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
baseThe pointer to the hardware AXIDMAC block.
channelThe channel number.
Returns
The pointer to the descriptor associated with the channel.
Function Usage
/* Scenario: Disable a descriptor */
if (&descriptor != Cy_AXIDMAC_Channel_GetCurrentDescriptor(AXI_DMAC, 0UL)) /* Make sure it is not in use */
{
}

◆ 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
baseThe pointer to the hardware AXIDMAC block.
channelThe 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 (AXI_DMAC, 0UL))
{
/* The AXIDMAC channel 0 interrupt is pending */
}

◆ 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
baseThe pointer to the hardware AXIDMAC block.
channelThe channel number.
interruptThe interrupt mask, see Interrupt Masks.
Function Usage
/* Scenario: Inside the interrupt service routine for AXIDMAC channel 0: */
uint32_t interrupt = Cy_AXIDMAC_Channel_GetInterruptStatusMasked(AXI_DMAC, 0UL);
if (CY_AXIDMAC_INTR_COMPLETION == interrupt)
{
/* Insert completion interrupt handling */
}
/* Check for other interrupts */
/* Clear interrupts */
Cy_AXIDMAC_Channel_ClearInterrupt(AXI_DMAC, 0UL, interrupt);

◆ 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
baseThe pointer to the hardware AXIDMAC block.
channelThe channel number.
interruptThe interrupt mask. See Interrupt Masks.
Function Usage
/* Scenario: Enable interrupts for channel 0 */
Cy_AXIDMAC_Channel_SetInterruptMask (AXI_DMAC, 0UL, CY_AXIDMAC_INTR_MASK);
/* Scenario: Test the interrupt for channel 0 */
/* 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(AXI_DMAC, 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.

Parameters
baseThe pointer to the hardware AXIDMAC block.
channelThe channel number.
Returns
The interrupt mask value. See Interrupt Masks.
Function Usage
/* Scenario: Enable interrupts for channel 0 */
Cy_AXIDMAC_Channel_SetInterruptMask (AXI_DMAC, 0UL, CY_AXIDMAC_INTR_MASK);
/* Scenario: Test the interrupt for channel 0 */
/* 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(AXI_DMAC, 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
baseThe pointer to the hardware AXIDMAC block.
channelThe channel number.
interruptThe interrupt mask, see Interrupt Masks.
Function Usage
/* Scenario: Enable interrupts for channel 0 */
Cy_AXIDMAC_Channel_SetInterruptMask (AXI_DMAC, 0UL, CY_AXIDMAC_INTR_MASK);
/* Scenario: Test the interrupt for channel 0 */
/* 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(AXI_DMAC, 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
baseThe pointer to the hardware AXIDMAC block.
channelThe 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(AXI_DMAC, 0UL);
if (CY_AXIDMAC_INTR_COMPLETION == interrupt)
{
/* Insert completion interrupt handling */
}
/* Check for other interrupts */
/* Clear interrupts */
Cy_AXIDMAC_Channel_ClearInterrupt(AXI_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
baseThe pointer to the hardware AXIDMAC block.
channelThe 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 descriptor;
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 =
{
.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 */
channelConfig.enable = false;
channelConfig.bufferable = false;
channelConfig.descriptor = &descriptor;
if (CY_AXIDMAC_SUCCESS != Cy_AXIDMAC_Descriptor_Init(&descriptor, &descriptor_cfg))
{
/* Insert error handling */
}
if (CY_AXIDMAC_SUCCESS != Cy_AXIDMAC_Channel_Init(AXI_DMAC, 0UL, &channelConfig))
{
/* Insert error handling */
}
Cy_AXIDMAC_Channel_SetDescriptor(AXI_DMAC, 0UL, &descriptor);
Cy_AXIDMAC_Channel_SetPriority(AXI_DMAC, 0UL, 3UL);
Cy_AXIDMAC_Channel_Enable(AXI_DMAC, 0UL);
Cy_AXIDMAC_Enable(AXI_DMAC);
}