| M480 BSP V3.05.001 The Board Support Package for M480 Series

Macros | Functions
PDMA Exported Functions
Standard Driver » PDMA Driver

## Macros
#define | PDMA_GET_INT_STATUS(pdma)
| Get PDMA Interrupt Status. More...
#define | PDMA_GET_TD_STS(pdma)
| Get Transfer Done Interrupt Status. More...
#define | PDMA_CLR_TD_FLAG(pdma, u32Mask)
| Clear Transfer Done Interrupt Status. More...
#define | PDMA_GET_ABORT_STS(pdma)
| Get Target Abort Interrupt Status. More...
#define | PDMA_CLR_ABORT_FLAG(pdma, u32Mask)
| Clear Target Abort Interrupt Status. More...
#define | PDMA_GET_ALIGN_STS(pdma)
| Get Alignment Interrupt Status. More...
#define | PDMA_CLR_ALIGN_FLAG(pdma, u32Mask)
| Clear Alignment Interrupt Status. More...
#define | PDMA_CLR_TMOUT_FLAG(pdma, u32Ch)
| Clear Timeout Interrupt Status. More...
#define | PDMA_IS_CH_BUSY(pdma, u32Ch)
| Check Channel Status. More...
#define | PDMA_SET_SRC_ADDR(pdma, u32Ch, u32Addr)
| Set Source Address. More...
#define | PDMA_SET_DST_ADDR(pdma, u32Ch, u32Addr)
| Set Destination Address. More...
#define | PDMA_SET_TRANS_CNT(pdma, u32Ch, u32TransCount)
| Set Transfer Count. More...
#define | PDMA_SET_SCATTER_DESC(pdma, u32Ch, u32Addr)
| Set Scatter-gather descriptor Address. More...
#define | PDMA_STOP(pdma, u32Ch)
| Stop the channel. More...
#define | PDMA_PAUSE(pdma, u32Ch)
| Pause the channel. More...

## Functions
void | PDMA_Open (PDMA_T *pdma, uint32_t u32Mask)
| PDMA Open. More...
void | PDMA_Close (PDMA_T *pdma)
| PDMA Close. More...
void | PDMA_SetTransferCnt (PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Width, uint32_t u32TransCount)
| Set PDMA Transfer Count. More...
void | PDMA_SetTransferAddr (PDMA_T *pdma, uint32_t u32Ch, uint32_t u32SrcAddr, uint32_t u32SrcCtrl, uint32_t u32DstAddr, uint32_t u32DstCtrl)
| Set PDMA Transfer Address. More...
void | PDMA_SetTransferMode (PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Peripheral, uint32_t u32ScatterEn, uint32_t u32DescAddr)
| Set PDMA Transfer Mode. More...
void | PDMA_SetBurstType (PDMA_T *pdma, uint32_t u32Ch, uint32_t u32BurstType, uint32_t u32BurstSize)
| Set PDMA Burst Type and Size. More...
void | PDMA_EnableTimeout (PDMA_T *pdma, uint32_t u32Mask)
| Enable timeout function. More...
void | PDMA_DisableTimeout (PDMA_T *pdma, uint32_t u32Mask)
| Disable timeout function. More...
void | PDMA_SetTimeOut (PDMA_T *pdma, uint32_t u32Ch, uint32_t u32OnOff, uint32_t u32TimeOutCnt)
| Set PDMA Timeout Count. More...
void | PDMA_Trigger (PDMA_T *pdma, uint32_t u32Ch)
| Trigger PDMA. More...
void | PDMA_EnableInt (PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask)
| Enable Interrupt. More...
void | PDMA_DisableInt (PDMA_T *pdma, uint32_t u32Ch, uint32_t u32Mask)
| Disable Interrupt. More...
void | PDMA_SetStride (PDMA_T *pdma, uint32_t u32Ch, uint32_t u32DestLen, uint32_t u32SrcLen, uint32_t u32TransCount)
| Set PDMA Stride Mode. More...
void | PDMA_SetRepeat (PDMA_T *pdma, uint32_t u32Ch, uint32_t u32DestInterval, uint32_t u32SrcInterval, uint32_t u32RepeatCount)
| Set PDMA Repeat. More...

## Detailed Description

## Macro Definition Documentation

## ◆ PDMA_CLR_ABORT_FLAG

#define PDMA_CLR_ABORT_FLAG | ( |  | pdma,
|  |  | u32Mask
| ) |  |

Clear Target Abort Interrupt Status.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Mask | The channel mask

Returns
  None

Clear the target abort Interrupt status.

Definition at line 222 of file pdma.h.

## ◆ PDMA_CLR_ALIGN_FLAG

#define PDMA_CLR_ALIGN_FLAG | ( |  | pdma,
|  |  | u32Mask
| ) |  |

Clear Alignment Interrupt Status.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Mask | The channel mask

Returns
  None

Clear the Alignment Interrupt status.

Definition at line 247 of file pdma.h.

## ◆ PDMA_CLR_TD_FLAG

#define PDMA_CLR_TD_FLAG | ( |  | pdma,
|  |  | u32Mask
| ) |  |

Clear Transfer Done Interrupt Status.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Mask | The channel mask

Returns
  None

Clear the transfer done Interrupt status.

Definition at line 196 of file pdma.h.

## ◆ PDMA_CLR_TMOUT_FLAG

#define PDMA_CLR_TMOUT_FLAG | ( |  | pdma,
|  |  | u32Ch
| ) |  |

Clear Timeout Interrupt Status.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Ch | The selected channel

Returns
  None

Clear the selected channel timeout interrupt status.

Definition at line 260 of file pdma.h.

## ◆ PDMA_GET_ABORT_STS

#define PDMA_GET_ABORT_STS | ( |  | pdma | ) |

Get Target Abort Interrupt Status.

Parameters

  [in] | pdma | The pointer of the specified PDMA module

Returns
  None

Get the target abort Interrupt status.

Definition at line 208 of file pdma.h.

## ◆ PDMA_GET_ALIGN_STS

#define PDMA_GET_ALIGN_STS | ( |  | pdma | ) |

Get Alignment Interrupt Status.

Parameters

  [in] | pdma | The pointer of the specified PDMA module

Returns
  None

Get Alignment Interrupt status.

Definition at line 234 of file pdma.h.

## ◆ PDMA_GET_INT_STATUS

#define PDMA_GET_INT_STATUS | ( |  | pdma | ) |

Get PDMA Interrupt Status.

Parameters

  [in] | pdma | The pointer of the specified PDMA module

Returns
  None

This macro gets the interrupt status.

Definition at line 170 of file pdma.h.

## ◆ PDMA_GET_TD_STS

#define PDMA_GET_TD_STS | ( |  | pdma | ) |

Get Transfer Done Interrupt Status.

Parameters

  [in] | pdma | The pointer of the specified PDMA module

Returns
  None

Get the transfer done Interrupt status.

Definition at line 182 of file pdma.h.

## ◆ PDMA_IS_CH_BUSY

#define PDMA_IS_CH_BUSY | ( |  | pdma,
|  |  | u32Ch
| ) |  |

Check Channel Status.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Ch | The selected channel

Return values

  0 | Idle state
  1 | Busy state

Check the selected channel is busy or not.

Definition at line 274 of file pdma.h.

## ◆ PDMA_PAUSE

#define PDMA_PAUSE | ( |  | pdma,
|  |  | u32Ch
| ) |  |

Pause the channel.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Ch | The selected channel

Returns
  None

This macro pause the selected channel.

Definition at line 358 of file pdma.h.

## ◆ PDMA_SET_DST_ADDR

#define PDMA_SET_DST_ADDR | ( |  | pdma,
|  |  | u32Ch,
|  |  | u32Addr
| ) |  |

Set Destination Address.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Ch | The selected channel
  [in] | u32Addr | The selected address

Returns
  None

This macro set the selected channel destination address.

Definition at line 302 of file pdma.h.

## ◆ PDMA_SET_SCATTER_DESC

#define PDMA_SET_SCATTER_DESC | ( |  | pdma,
|  |  | u32Ch,
|  |  | u32Addr
| ) |  |

Set Scatter-gather descriptor Address.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Ch | The selected channel
  [in] | u32Addr | The descriptor address

Returns
  None

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

Definition at line 330 of file pdma.h.

## ◆ PDMA_SET_SRC_ADDR

#define PDMA_SET_SRC_ADDR | ( |  | pdma,
|  |  | u32Ch,
|  |  | u32Addr
| ) |  |

Set Source Address.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Ch | The selected channel
  [in] | u32Addr | The selected address

Returns
  None

This macro set the selected channel source address.

Definition at line 288 of file pdma.h.

## ◆ PDMA_SET_TRANS_CNT

#define PDMA_SET_TRANS_CNT | ( |  | pdma,
|  |  | u32Ch,
|  |  | u32TransCount
| ) |  |

Set Transfer Count.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Ch | The selected channel
  [in] | u32TransCount | Transfer Count

Returns
  None

This macro set the selected channel transfer count.

Definition at line 316 of file pdma.h.

## ◆ PDMA_STOP

#define PDMA_STOP | ( |  | pdma,
|  |  | u32Ch
| ) |  |

Stop the channel.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Ch | The selected channel

Returns
  None

This macro stop the selected channel.

Definition at line 344 of file pdma.h.

## Function Documentation

## ◆ PDMA_Close()

void PDMA_Close | ( | PDMA_T * | pdma | ) |

PDMA Close.

Parameters

  [in] | pdma | The pointer of the specified PDMA module

Returns
  None

This function disable all PDMA channels.

Definition at line 63 of file pdma.c.

## ◆ PDMA_DisableInt()

void PDMA_DisableInt | ( | PDMA_T * | pdma,
|  | uint32_t | u32Ch,
|  | uint32_t | u32Mask
| ) |  |

Disable Interrupt.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Ch | The selected channel
  [in] | u32Mask | The Interrupt Type. Valid values are PDMA_INT_TRANS_DONE PDMA_INT_TEMPTY PDMA_INT_TIMEOUT

Returns
  None

This function disable the selected channel interrupt.

Definition at line 462 of file pdma.c.

## ◆ PDMA_DisableTimeout()

void PDMA_DisableTimeout | ( | PDMA_T * | pdma,
|  | uint32_t | u32Mask
| ) |  |

Disable timeout function.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Mask | Channel enable bits.

Returns
  None

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

Definition at line 358 of file pdma.c.

## ◆ PDMA_EnableInt()

void PDMA_EnableInt | ( | PDMA_T * | pdma,
|  | uint32_t | u32Ch,
|  | uint32_t | u32Mask
| ) |  |

Enable Interrupt.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Ch | The selected channel
  [in] | u32Mask | The Interrupt Type. Valid values are PDMA_INT_TRANS_DONE PDMA_INT_TEMPTY PDMA_INT_TIMEOUT

Returns
  None

This function enable the selected channel interrupt.

Definition at line 429 of file pdma.c.

## ◆ PDMA_EnableTimeout()

void PDMA_EnableTimeout | ( | PDMA_T * | pdma,
|  | uint32_t | u32Mask
| ) |  |

Enable timeout function.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Mask | Channel enable bits.

Returns
  None

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

Definition at line 342 of file pdma.c.

## ◆ PDMA_Open()

void PDMA_Open | ( | PDMA_T * | pdma,
|  | uint32_t | u32Mask
| ) |  |

PDMA Open.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Mask | Channel enable bits.

Returns
  None

This function enable the PDMA channels.

Definition at line 38 of file pdma.c.

## ◆ PDMA_SetBurstType()

void PDMA_SetBurstType | ( | PDMA_T * | pdma,
|  | uint32_t | u32Ch,
|  | uint32_t | u32BurstType,
|  | uint32_t | u32BurstSize
| ) |  |

Set PDMA Burst Type and Size.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Ch | The selected channel
  [in] | u32BurstType | Burst mode or single mode. Valid values are PDMA_REQ_SINGLE PDMA_REQ_BURST
  [in] | u32BurstSize | Set the size of burst mode. Valid values are PDMA_BURST_128 PDMA_BURST_64 PDMA_BURST_32 PDMA_BURST_16 PDMA_BURST_8 PDMA_BURST_4 PDMA_BURST_2 PDMA_BURST_1

Returns
  None

This function set the selected channel burst type and size.

Definition at line 325 of file pdma.c.

## ◆ PDMA_SetRepeat()

void PDMA_SetRepeat | ( | PDMA_T * | pdma,
|  | uint32_t | u32Ch,
|  | uint32_t | u32DestInterval,
|  | uint32_t | u32SrcInterval,
|  | uint32_t | u32RepeatCount
| ) |  |

Set PDMA Repeat.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Ch | The selected channel
  [in] | u32DestInterval | Destination address interval count
  [in] | u32SrcInterval | Source address interval count
  [in] | u32RepeatCount | Repeat count

Returns
  None

This function set the selected repeat.

Definition at line 122 of file pdma.c.

## ◆ PDMA_SetStride()

void PDMA_SetStride | ( | PDMA_T * | pdma,
|  | uint32_t | u32Ch,
|  | uint32_t | u32DestLen,
|  | uint32_t | u32SrcLen,
|  | uint32_t | u32TransCount
| ) |  |

Set PDMA Stride Mode.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Ch | The selected channel
  [in] | u32DestLen | Destination stride count
  [in] | u32SrcLen | Source stride count
  [in] | u32TransCount | Transfer count

Returns
  None

This function set the selected stride mode.

Definition at line 102 of file pdma.c.

## ◆ PDMA_SetTimeOut()

void PDMA_SetTimeOut | ( | PDMA_T * | pdma,
|  | uint32_t | u32Ch,
|  | uint32_t | u32OnOff,
|  | uint32_t | u32TimeOutCnt
| ) |  |

Set PDMA Timeout Count.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Ch | The selected channel,
  [in] | u32OnOff | Enable/disable time out function
  [in] | u32TimeOutCnt | Timeout count

Returns
  None

This function set the timeout count.

Note
  M480 only supported channel 0/1.

Definition at line 376 of file pdma.c.

## ◆ PDMA_SetTransferAddr()

void PDMA_SetTransferAddr | ( | PDMA_T * | pdma,
|  | uint32_t | u32Ch,
|  | uint32_t | u32SrcAddr,
|  | uint32_t | u32SrcCtrl,
|  | uint32_t | u32DstAddr,
|  | uint32_t | u32DstCtrl
| ) |  |

Set PDMA Transfer Address.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Ch | The selected channel
  [in] | u32SrcAddr | Source address
  [in] | u32SrcCtrl | Source control attribute. Valid values are PDMA_SAR_INC PDMA_SAR_FIX
  [in] | u32DstAddr | destination address
  [in] | u32DstCtrl | destination control attribute. Valid values are PDMA_DAR_INC PDMA_DAR_FIX

Returns
  None

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

Definition at line 147 of file pdma.c.

## ◆ PDMA_SetTransferCnt()

void PDMA_SetTransferCnt | ( | PDMA_T * | pdma,
|  | uint32_t | u32Ch,
|  | uint32_t | u32Width,
|  | uint32_t | u32TransCount
| ) |  |

Set PDMA Transfer Count.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Ch | The selected channel
  [in] | u32Width | Data width. Valid values are PDMA_WIDTH_8 PDMA_WIDTH_16 PDMA_WIDTH_32
  [in] | u32TransCount | Transfer count

Returns
  None

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

Definition at line 83 of file pdma.c.

## ◆ PDMA_SetTransferMode()

void PDMA_SetTransferMode | ( | PDMA_T * | pdma,
|  | uint32_t | u32Ch,
|  | uint32_t | u32Peripheral,
|  | uint32_t | u32ScatterEn,
|  | uint32_t | u32DescAddr
| ) |  |

Set PDMA Transfer Mode.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Ch | The selected channel
  [in] | u32Peripheral | The selected peripheral. Valid values are PDMA_MEM PDMA_USB_TX PDMA_USB_RX PDMA_UART0_TX PDMA_UART0_RX PDMA_UART1_TX PDMA_UART1_RX PDMA_UART2_TX PDMA_UART2_RX PDMA_UART3_TX PDMA_UART3_RX PDMA_UART4_TX PDMA_UART4_RX PDMA_UART5_TX PDMA_UART5_RX PDMA_USCI0_TX PDMA_USCI0_RX PDMA_USCI1_TX PDMA_USCI1_RX PDMA_QSPI0_TX PDMA_QSPI0_RX PDMA_SPI0_TX PDMA_SPI0_RX PDMA_SPI1_TX PDMA_SPI1_RX PDMA_SPI2_TX PDMA_SPI2_RX PDMA_SPI3_TX PDMA_SPI3_RX PDMA_EPWM0_P1_RX PDMA_EPWM0_P2_RX PDMA_EPWM0_P3_RX PDMA_EPWM1_P1_RX PDMA_EPWM1_P2_RX PDMA_EPWM1_P3_RX PDMA_I2C0_TX PDMA_I2C0_RX PDMA_I2C1_TX PDMA_I2C1_RX PDMA_I2C2_TX PDMA_I2C2_RX PDMA_I2S0_TX PDMA_I2S0_RX PDMA_TMR0 PDMA_TMR1 PDMA_TMR2 PDMA_TMR3 PDMA_EADC0_RX PDMA_DAC0_TX PDMA_DAC1_TX PDMA_EPWM0_CH0_TX PDMA_EPWM0_CH1_TX PDMA_EPWM0_CH2_TX PDMA_EPWM0_CH3_TX PDMA_EPWM0_CH4_TX PDMA_EPWM0_CH5_TX PDMA_EPWM1_CH0_TX PDMA_EPWM1_CH1_TX PDMA_EPWM1_CH2_TX PDMA_EPWM1_CH3_TX PDMA_EPWM1_CH4_TX PDMA_EPWM1_CH5_TX PDMA_UART6_TX PDMA_UART6_RX PDMA_UART7_TX PDMA_UART7_RX PDMA_EADC1_RX
  [in] | u32ScatterEn | Scatter-gather mode enable
  [in] | u32DescAddr | Scatter-gather descriptor address

Returns
  None

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

Definition at line 235 of file pdma.c.

## ◆ PDMA_Trigger()

void PDMA_Trigger | ( | PDMA_T * | pdma,
|  | uint32_t | u32Ch
| ) |  |

Trigger PDMA.

Parameters

  [in] | pdma | The pointer of the specified PDMA module
  [in] | u32Ch | The selected channel

Returns
  None

This function trigger the selected channel.

Definition at line 406 of file pdma.c.