M471M/R1/S BSP V3.01.000
The Board Support Package for M4521
Macros | Functions
Collaboration diagram for PDMA Exported Functions:

Macros

#define PDMA_GET_INT_STATUS()   ((uint32_t)(PDMA->INTSTS))
 Get PDMA Interrupt Status. More...
 
#define PDMA_GET_TD_STS()   ((uint32_t)(PDMA->TDSTS))
 Get Transfer Done Interrupt Status. More...
 
#define PDMA_CLR_TD_FLAG(u32Mask)   ((uint32_t)(PDMA->TDSTS = (u32Mask)))
 Clear Transfer Done Interrupt Status. More...
 
#define PDMA_GET_ABORT_STS()   ((uint32_t)(PDMA->ABTSTS))
 Get Target Abort Interrupt Status. More...
 
#define PDMA_CLR_ABORT_FLAG(u32Mask)   ((uint32_t)(PDMA->ABTSTS = (u32Mask)))
 Clear Target Abort Interrupt Status. More...
 
#define PDMA_GET_EMPTY_STS()   ((uint32_t)(PDMA->SCATSTS))
 Get Scatter-Gather Table Empty Interrupt Status. More...
 
#define PDMA_CLR_EMPTY_FLAG(u32Mask)   ((uint32_t)(PDMA->SCATSTS = (u32Mask)))
 Clear Scatter-Gather Table Empty Interrupt Status. More...
 
#define PDMA_CLR_TMOUT_FLAG(u32Ch)   ((uint32_t)(PDMA->INTSTS = (1 << ((u32Ch) + 8))))
 Clear Timeout Interrupt Status. More...
 
#define PDMA_IS_CH_BUSY(u32Ch)   ((uint32_t)(PDMA->TRGSTS & (1 << (u32Ch)))? 1 : 0)
 Check Channel Status. More...
 
#define PDMA_SET_SRC_ADDR(u32Ch, u32Addr)   ((uint32_t)(PDMA->DSCT[(u32Ch)].SA = (u32Addr)))
 Set Source Address. More...
 
#define PDMA_SET_DST_ADDR(u32Ch, u32Addr)   ((uint32_t)(PDMA->DSCT[(u32Ch)].DA = (u32Addr)))
 Set Destination Address. More...
 
#define PDMA_SET_TRANS_CNT(u32Ch, u32TransCount)   ((uint32_t)(PDMA->DSCT[(u32Ch)].CTL=(PDMA->DSCT[(u32Ch)].CTL&~PDMA_DSCT_CTL_TXCNT_Msk)|(((u32TransCount)-1) << PDMA_DSCT_CTL_TXCNT_Pos)))
 Set Transfer Count. More...
 
#define PDMA_SET_SCATTER_DESC(u32Ch, u32Addr)   ((uint32_t)(PDMA->DSCT[(u32Ch)].NEXT = (u32Addr) - (PDMA->SCATBA)))
 Set Scatter-gather descriptor Address. More...
 
#define PDMA_STOP(u32Ch)   ((uint32_t)(PDMA->STOP = (1 << (u32Ch))))
 Stop the channel. More...
 

Functions

void PDMA_Open (uint32_t u32Mask)
 PDMA Open. More...
 
void PDMA_Close (void)
 PDMA Close. More...
 
void PDMA_SetTransferCnt (uint32_t u32Ch, uint32_t u32Width, uint32_t u32TransCount)
 Set PDMA Transfer Count. More...
 
void PDMA_SetTransferAddr (uint32_t u32Ch, uint32_t u32SrcAddr, uint32_t u32SrcCtrl, uint32_t u32DstAddr, uint32_t u32DstCtrl)
 Set PDMA Transfer Address. More...
 
void PDMA_SetTransferMode (uint32_t u32Ch, uint32_t u32Peripheral, uint32_t u32ScatterEn, uint32_t u32DescAddr)
 Set PDMA Transfer Mode. More...
 
void PDMA_SetBurstType (uint32_t u32Ch, uint32_t u32BurstType, uint32_t u32BurstSize)
 Set PDMA Burst Type and Size. More...
 
void PDMA_EnableTimeout (uint32_t u32Mask)
 Enable timeout function. More...
 
void PDMA_DisableTimeout (uint32_t u32Mask)
 Disable timeout function. More...
 
void PDMA_SetTimeOut (uint32_t u32Ch, uint32_t u32OnOff, uint32_t u32TimeOutCnt)
 Set PDMA Timeout Count. More...
 
void PDMA_Trigger (uint32_t u32Ch)
 Trigger PDMA. More...
 
void PDMA_EnableInt (uint32_t u32Ch, uint32_t u32Mask)
 Enable Interrupt. More...
 
void PDMA_DisableInt (uint32_t u32Ch, uint32_t u32Mask)
 Disable Interrupt. More...
 

Detailed Description

Macro Definition Documentation

◆ PDMA_CLR_ABORT_FLAG

#define PDMA_CLR_ABORT_FLAG (   u32Mask)    ((uint32_t)(PDMA->ABTSTS = (u32Mask)))

Clear Target Abort Interrupt Status.

Parameters
[in]u32MaskThe channel mask
Returns
None

Clear the target abort Interrupt status.

Definition at line 158 of file pdma.h.

◆ PDMA_CLR_EMPTY_FLAG

#define PDMA_CLR_EMPTY_FLAG (   u32Mask)    ((uint32_t)(PDMA->SCATSTS = (u32Mask)))

Clear Scatter-Gather Table Empty Interrupt Status.

Parameters
[in]u32MaskThe channel mask
Returns
None

Clear the scatter-gather table empty Interrupt status.

Definition at line 180 of file pdma.h.

◆ PDMA_CLR_TD_FLAG

#define PDMA_CLR_TD_FLAG (   u32Mask)    ((uint32_t)(PDMA->TDSTS = (u32Mask)))

Clear Transfer Done Interrupt Status.

Parameters
[in]u32MaskThe channel mask
Returns
None

Clear the transfer done Interrupt status.

Definition at line 136 of file pdma.h.

◆ PDMA_CLR_TMOUT_FLAG

#define PDMA_CLR_TMOUT_FLAG (   u32Ch)    ((uint32_t)(PDMA->INTSTS = (1 << ((u32Ch) + 8))))

Clear Timeout Interrupt Status.

Parameters
[in]u32ChThe selected channel
Returns
None

Clear the selected channel timeout interrupt status.

Definition at line 191 of file pdma.h.

◆ PDMA_GET_ABORT_STS

#define PDMA_GET_ABORT_STS ( )    ((uint32_t)(PDMA->ABTSTS))

Get Target Abort Interrupt Status.

Parameters
[in]None
Returns
None

Get the target abort Interrupt status.

Definition at line 147 of file pdma.h.

◆ PDMA_GET_EMPTY_STS

#define PDMA_GET_EMPTY_STS ( )    ((uint32_t)(PDMA->SCATSTS))

Get Scatter-Gather Table Empty Interrupt Status.

Parameters
[in]None
Returns
None

Get the scatter-gather table empty Interrupt status.

Definition at line 169 of file pdma.h.

◆ PDMA_GET_INT_STATUS

#define PDMA_GET_INT_STATUS ( )    ((uint32_t)(PDMA->INTSTS))

Get PDMA Interrupt Status.

Parameters
[in]None
Returns
None

This macro gets the interrupt status.

Definition at line 114 of file pdma.h.

◆ PDMA_GET_TD_STS

#define PDMA_GET_TD_STS ( )    ((uint32_t)(PDMA->TDSTS))

Get Transfer Done Interrupt Status.

Parameters
[in]None
Returns
None

Get the transfer done Interrupt status.

Definition at line 125 of file pdma.h.

◆ PDMA_IS_CH_BUSY

#define PDMA_IS_CH_BUSY (   u32Ch)    ((uint32_t)(PDMA->TRGSTS & (1 << (u32Ch)))? 1 : 0)

Check Channel Status.

Parameters
[in]u32ChThe selected channel
Return values
0Idle state
1Busy state

Check the selected channel is busy or not.

Definition at line 203 of file pdma.h.

◆ PDMA_SET_DST_ADDR

#define PDMA_SET_DST_ADDR (   u32Ch,
  u32Addr 
)    ((uint32_t)(PDMA->DSCT[(u32Ch)].DA = (u32Addr)))

Set Destination Address.

Parameters
[in]u32ChThe selected channel
[in]u32AddrThe selected address
Returns
None

This macro set the selected channel destination address.

Definition at line 227 of file pdma.h.

◆ PDMA_SET_SCATTER_DESC

#define PDMA_SET_SCATTER_DESC (   u32Ch,
  u32Addr 
)    ((uint32_t)(PDMA->DSCT[(u32Ch)].NEXT = (u32Addr) - (PDMA->SCATBA)))

Set Scatter-gather descriptor Address.

Parameters
[in]u32ChThe selected channel
[in]u32AddrThe descriptor address
Returns
None

This macro set the selected channel scatter-gather descriptor address.

Definition at line 251 of file pdma.h.

◆ PDMA_SET_SRC_ADDR

#define PDMA_SET_SRC_ADDR (   u32Ch,
  u32Addr 
)    ((uint32_t)(PDMA->DSCT[(u32Ch)].SA = (u32Addr)))

Set Source Address.

Parameters
[in]u32ChThe selected channel
[in]u32AddrThe selected address
Returns
None

This macro set the selected channel source address.

Definition at line 215 of file pdma.h.

◆ PDMA_SET_TRANS_CNT

#define PDMA_SET_TRANS_CNT (   u32Ch,
  u32TransCount 
)    ((uint32_t)(PDMA->DSCT[(u32Ch)].CTL=(PDMA->DSCT[(u32Ch)].CTL&~PDMA_DSCT_CTL_TXCNT_Msk)|(((u32TransCount)-1) << PDMA_DSCT_CTL_TXCNT_Pos)))

Set Transfer Count.

Parameters
[in]u32ChThe selected channel
[in]u32TransCountTransfer Count
Returns
None

This macro set the selected channel transfer count.

Definition at line 239 of file pdma.h.

◆ PDMA_STOP

#define PDMA_STOP (   u32Ch)    ((uint32_t)(PDMA->STOP = (1 << (u32Ch))))

Stop the channel.

Parameters
[in]u32ChThe selected channel
Returns
None

This macro stop the selected channel.

Definition at line 262 of file pdma.h.

Function Documentation

◆ PDMA_Close()

void PDMA_Close ( void  )

PDMA Close.

Parameters
None
Returns
None

This function disable all PDMA channels.

Definition at line 57 of file pdma.c.

◆ PDMA_DisableInt()

void PDMA_DisableInt ( uint32_t  u32Ch,
uint32_t  u32Mask 
)

Disable Interrupt.

Parameters
[in]u32ChThe selected channel
[in]u32MaskThe Interrupt Type. Valid values are
Returns
None

This function disable the selected channel interrupt.

Definition at line 346 of file pdma.c.

◆ PDMA_DisableTimeout()

void PDMA_DisableTimeout ( uint32_t  u32Mask)

Disable timeout function.

Parameters
[in]u32MaskChannel enable bits.
Returns
None

This function disable timeout function of the selected channel(s).

Definition at line 231 of file pdma.c.

◆ PDMA_EnableInt()

void PDMA_EnableInt ( uint32_t  u32Ch,
uint32_t  u32Mask 
)

Enable Interrupt.

Parameters
[in]u32ChThe selected channel
[in]u32MaskThe Interrupt Type. Valid values are
Returns
None

This function enable the selected channel interrupt.

Definition at line 314 of file pdma.c.

◆ PDMA_EnableTimeout()

void PDMA_EnableTimeout ( uint32_t  u32Mask)

Enable timeout function.

Parameters
[in]u32MaskChannel enable bits.
Returns
None

This function enable timeout function of the selected channel(s).

Definition at line 217 of file pdma.c.

◆ PDMA_Open()

void PDMA_Open ( uint32_t  u32Mask)

PDMA Open.

Parameters
[in]u32MaskChannel enable bits.
Returns
None

This function enable the PDMA channels.

Definition at line 35 of file pdma.c.

◆ PDMA_SetBurstType()

void PDMA_SetBurstType ( uint32_t  u32Ch,
uint32_t  u32BurstType,
uint32_t  u32BurstSize 
)

Set PDMA Burst Type and Size.

Parameters
[in]u32ChThe selected channel
[in]u32BurstTypeBurst mode or single mode. Valid values are
[in]u32BurstSizeSet the size of burst mode. Valid values are
Returns
None

This function set the selected channel burst type and size.

Definition at line 202 of file pdma.c.

◆ PDMA_SetTimeOut()

void PDMA_SetTimeOut ( uint32_t  u32Ch,
uint32_t  u32OnOff,
uint32_t  u32TimeOutCnt 
)

Set PDMA Timeout Count.

Parameters
[in]u32ChThe selected channel
[in]u32OnOffEnable/disable time out function
[in]u32TimeOutCntTimeout count
Returns
None

This function set the timeout count.

Definition at line 247 of file pdma.c.

◆ PDMA_SetTransferAddr()

void PDMA_SetTransferAddr ( uint32_t  u32Ch,
uint32_t  u32SrcAddr,
uint32_t  u32SrcCtrl,
uint32_t  u32DstAddr,
uint32_t  u32DstCtrl 
)

Set PDMA Transfer Address.

Parameters
[in]u32ChThe selected channel
[in]u32SrcAddrSource address
[in]u32SrcCtrlSource control attribute. Valid values are
[in]u32DstAddrdestination address
[in]u32DstCtrldestination control attribute. Valid values are
Returns
None

This function set the selected channel source/destination address and attribute.

Definition at line 99 of file pdma.c.

◆ PDMA_SetTransferCnt()

void PDMA_SetTransferCnt ( uint32_t  u32Ch,
uint32_t  u32Width,
uint32_t  u32TransCount 
)

Set PDMA Transfer Count.

Parameters
[in]u32ChThe selected channel
[in]u32WidthData width. Valid values are
[in]u32TransCountTransfer count
Returns
None

This function set the selected channel data width and transfer count.

Definition at line 76 of file pdma.c.

◆ PDMA_SetTransferMode()

void PDMA_SetTransferMode ( uint32_t  u32Ch,
uint32_t  u32Peripheral,
uint32_t  u32ScatterEn,
uint32_t  u32DescAddr 
)

Set PDMA Transfer Mode.

Parameters
[in]u32ChThe selected channel
[in]u32PeripheralThe selected peripheral. Valid values are
[in]u32ScatterEnScatter-gather mode enable
[in]u32DescAddrScatter-gather descriptor address
Returns
None

This function set the selected channel transfer mode. Include peripheral setting.

Definition at line 139 of file pdma.c.

◆ PDMA_Trigger()

void PDMA_Trigger ( uint32_t  u32Ch)

Trigger PDMA.

Parameters
[in]u32ChThe selected channel
Returns
None

This function trigger the selected channel.

Definition at line 295 of file pdma.c.