PDL for FM0+  Version1.0
Peripheral Driverl Library for FM0+
C:/pdl_v10/library/driver/dma/dma.h File Reference
#include "mcu.h"
#include "pdl_user.h"
Include dependency graph for dma.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  stc_dma_int_sel
 DMA interrupt selection. More...
struct  stc_dma_int_cb
 DMA interrupt callback function. More...
struct  stc_dma_intern_data
 Datatype for holding internal data needed for DMA. More...
struct  stc_dma_config
 DMA configuration. More...

Defines

#define DMA_CH_COUNT   (4u)
#define DMA_MAX_CH_INDEX   (3u)
#define DMA_DMACA_OFFSET   0x00ul
#define DMA_DMACB_OFFSET   0x04ul
#define DMA_DMASA_OFFSET   0x08ul
#define DMA_DMADA_OFFSET   0x0Cul

Typedefs

typedef enum en_dma_transfermode en_dma_transfermode_t
 DMA transfer data width.
typedef enum en_dma_transferwidth en_dma_transferwidth_t
 DMA transfer data width.
typedef enum en_dma_idreq en_dma_idreq_t
 DMA IDREQ number.
typedef enum dma_stop_cause en_dma_stop_cause_t
 DMA stop cause.
typedef struct stc_dma_int_sel stc_dma_int_sel_t
 DMA interrupt selection.
typedef struct stc_dma_int_cb stc_dma_int_cb_t
 DMA interrupt callback function.
typedef struct stc_dma_intern_data stc_dma_intern_data_t
 Datatype for holding internal data needed for DMA.
typedef struct stc_dma_config stc_dma_config_t
 DMA configuration.

Enumerations

enum  en_dma_transfermode { DmaBlockTransfer = 0, DmaBurstTransfer = 1, DmaDemandTransfer = 2 }
 DMA transfer data width. More...
enum  en_dma_transferwidth { Dma8Bit = 0, Dma16Bit = 1, Dma32Bit = 2 }
 DMA transfer data width. More...
enum  en_dma_idreq {
  Adc0 = 5, Adc1 = 6, Adc2 = 7, Bt0Irq0 = 8,
  Bt2Irq0 = 9, Bt4Irq0 = 10, Bt6Irq0 = 11, MfsRx0 = 12,
  MfsTx0 = 13, MfsRx1 = 14, MfsTx1 = 15, MfsRx2 = 16,
  MfsTx2 = 17, MfsRx3 = 18, MfsTx3 = 19, MfsRx4 = 20,
  MfsTx4 = 21, MfsRx5 = 22, MfsTx5 = 23, MfsRx6 = 24,
  MfsTx6 = 25, MfsRx7 = 26, MfsTx7 = 27, ExtIrq0 = 28,
  ExtIrq1 = 29, ExtIrq2 = 30, ExtIrq3 = 31, Software = 1234
}
 DMA IDREQ number. More...
enum  dma_stop_cause {
  DmaStopByAddrOverflow = 0, DmaStopByTransferStopRqst = 1, DmaStopBySrcAccessError = 2, DmaStopByDstAccessError = 3,
  DmaStopByTransferComplete = 4, DmaStopByTransferPause = 5
}
 DMA stop cause. More...

Functions

void DmaIrqHandler (uint8_t u8DmaChannel)
 DMA interrupt handler.
en_result_t Dma_EnableInt (uint8_t u8DmaChannel, stc_dma_int_sel_t *pstcIntSel, stc_dma_int_cb_t *pstcIntCb)
 Enable interrupt of a DMA channel.
en_result_t Dma_DisableInt (uint8_t u8DmaChannel, stc_dma_int_sel_t *pstcIntSel)
 Disable interrupt of a DMA channel.
en_result_t Dma_Init_Channel (uint8_t u8DmaChannel, volatile stc_dma_config_t *pstcConfig)
 Initializes a DMA channel.
en_result_t Dma_DeInit_Channel (uint8_t u8DmaChannel)
 De-Initializes a DMA channel.
en_result_t Dma_SetChannel (uint8_t u8DmaChannel, boolean_t bEnable, boolean_t bPause, boolean_t bSoftwareTrigger)
 Enable, disable, pause, or trigger a DMA channel via configuration.
en_dma_stop_cause_t Dma_GetStopCause (uint8_t u8DmaChannel)
 Read stop cause of a DMA channel.
en_result_t Dma_Enable (void)
 Enable DMA globally.
en_result_t Dma_Disable (void)
 Disable DMA globally.

Variables

stc_dma_intern_data_t stcDmaInternData

Detailed Description

Headerfile for DMA functions

History:

  • 2014-02-19 0.1 Edison Zhang First version
  • 2014-03-04 0.2 Edison Zhang Delete USB triggers in the DMA hardware trigger list

Definition in file dma.h.