PAN1080 Peripheral API
Data Structures | Macros | Typedefs | Functions
pan_dmac.h File Reference

Panchip series dma driver header file. More...

Go to the source code of this file.

Data Structures

struct  __DMAC_ChannelConfigTypeDef
 Structure with dma channel config feature. More...
 
struct  DMAC_ChannelConfigTypeDef
 Structure with dma channel detail config. More...
 

Macros

#define DMAC_CHANNEL_NUMBER   (3)
 
#define DMA_INVLID_CHANNEL   (~0ul)
 
#define DMAC_TransferType_Mem2Mem   (0)
 
#define DMAC_TransferType_Mem2Per   (1)
 
#define DMAC_TransferType_Per2Mem   (2)
 
#define DMAC_TransferType_Per2Per   (3)
 
#define DMAC_FlowControl_DMA   (0)
 
#define DMAC_FlowControl_Peripheral   (1)
 
#define DMAC_BurstLen_1   (0)
 
#define DMAC_BurstLen_4   (1)
 
#define DMAC_BurstLen_8   (2)
 
#define DMAC_BurstLen_16   (3)
 
#define DMAC_BurstLen_32   (4)
 
#define DMAC_BurstLen_64   (5)
 
#define DMAC_BurstLen_128   (6)
 
#define DMAC_BurstLen_256   (7)
 
#define DMAC_AddrChange_Increment   (0)
 
#define DMAC_AddrChange_Decrement   (1)
 
#define DMAC_AddrChange_NoChange   (2)
 
#define DMAC_DataWidth_8   (0)
 
#define DMAC_DataWidth_16   (1)
 
#define DMAC_DataWidth_32   (2)
 
#define DMAC_DataWidth_64   (3)
 
#define DMAC_DataWidth_128   (4)
 
#define DMAC_DataWidth_256   (5)
 
#define DMAC_Peripheral_I2C0_Tx   (0)
 
#define DMAC_Peripheral_I2C0_Rx   (1)
 
#define DMAC_Peripheral_SPI0_Tx   (2)
 
#define DMAC_Peripheral_SPI0_Rx   (3)
 
#define DMAC_Peripheral_UART0_Tx   (4)
 
#define DMAC_Peripheral_UART0_Rx   (5)
 
#define DMAC_Peripheral_IIS_Tx   (6)
 
#define DMAC_Peripheral_IIS_Rx   (7)
 
#define DMAC_Peripheral_SPI1_Tx   (8)
 
#define DMAC_Peripheral_SPI1_Rx   (9)
 
#define DMAC_Peripheral_UART1_Tx   (10)
 
#define DMAC_Peripheral_UART1_Rx   (11)
 
#define DMAC_Peripheral_ADC   (12)
 
#define DMAC_HandshakePolarity_Low   (1)
 
#define DMAC_HandshakePolarity_High   (0)
 
#define DMAC_Handshake_Default   (1)
 
#define DMAC_Handshake_Software   (1)
 
#define DMAC_Handshake_Hardware   (0)
 
#define DMAC_LockLevel_Tfr_Complete   (0)
 
#define DMAC_LockLevel_Block_Complete   (1)
 
#define DMAC_LockLevel_Transaction_Complete   (2)
 
#define DMAC_ChannelPriority_0   (0)
 
#define DMAC_ChannelPriority_1   (1)
 
#define DMAC_ChannelPriority_2   (2)
 
#define DMAC_ChannelPriority_3   (3)
 
#define DMAC_ChannelPriority_4   (4)
 
#define DMAC_ChannelPriority_5   (5)
 
#define DMAC_ChannelPriority_6   (6)
 
#define DMAC_ChannelPriority_7   (7)
 
#define DMAC_CHANNELALL_MASK   (~((~0ul)<<DMAC_CHANNEL_NUMBER))
 
#define DMAC_FLAG_INDEX_TFR   (0<<1)
 
#define DMAC_FLAG_INDEX_BLK   (1<<1)
 
#define DMAC_FLAG_INDEX_SRCTFR   (2<<1)
 
#define DMAC_FLAG_INDEX_DSTTFR   (3<<1)
 
#define DMAC_FLAG_INDEX_ERR   (4<<1)
 
#define DMAC_FLAG_MASK_TFR   (1ul<<(DMAC_FLAG_INDEX_TFR >>1))
 
#define DMAC_FLAG_MASK_BLK   (1ul<<(DMAC_FLAG_INDEX_BLK >>1))
 
#define DMAC_FLAG_MASK_SRCTFR   (1ul<<(DMAC_FLAG_INDEX_SRCTFR>>1))
 
#define DMAC_FLAG_MASK_DSTTFR   (1ul<<(DMAC_FLAG_INDEX_DSTTFR>>1))
 
#define DMAC_FLAG_MASK_ERR   (1ul<<(DMAC_FLAG_INDEX_ERR >>1))
 
#define DMAC_FLAG_MASK_ALL   (0x1Ful)
 
#define DMAC_ChannelMask(idx)   (1ul<<(idx))
 :Set interrupt mask of one dma channel More...
 

Typedefs

typedef struct __DMAC_ChannelConfigTypeDef __DMAC_ChannelConfigTypeDef
 Structure with dma channel config feature. More...
 
typedef struct DMAC_ChannelConfigTypeDef DMAC_ChannelConfigTypeDef
 Structure with dma channel detail config. More...
 

Functions

__STATIC_INLINE uint32_t DMAC_IsChannelValid (DMA_T *dma, uint32_t ChIdx)
 Adjust dma channel is busy or not. More...
 
__STATIC_INLINE uint32_t DMAC_CombinedIntStatus (DMA_T *dma, uint32_t FlgMsk)
 Adjust interrupt occured or not. More...
 
__STATIC_INLINE uint32_t DMAC_StatusFlag (DMA_T *dma, uint32_t ChIdx, uint32_t FlgIdx)
 Adjust interrupt raw flag set or not. More...
 
__STATIC_INLINE uint32_t DMAC_IntFlag (DMA_T *dma, uint32_t ChIdx, uint32_t FlgIdx)
 Adjust interrupt event occured or not after masking. More...
 
__STATIC_INLINE uint32_t DMAC_IntFlagMsk (DMA_T *dma, uint32_t ChIdx, uint32_t FlgIdx)
 Adjust interrupt mask set or not. More...
 
__STATIC_INLINE void DMAC_ClrIntFlag (DMA_T *dma, uint32_t ChIdx, uint32_t FlgIdx)
 Adjust interrupt mask cleared or not. More...
 
void DMAC_Init (DMA_T *dma)
 Enable dma. More...
 
void DMAC_DeInit (DMA_T *dma)
 Disable dma & mask all dma interrupt. More...
 
void DMAC_ClrIntFlagMsk (DMA_T *dma, uint32_t ChIdx, uint32_t FlgIdx)
 Clear interrupt mask to make sure intterupt enable. More...
 
void DMAC_SetIntFlagMsk (DMA_T *dma, uint32_t ChIdx, uint32_t FlgIdx)
 Mask interrupt,interrupt is useless. More...
 
void DMAC_SetChannelConfig (DMA_T *dma, uint32_t ChIdx, DMAC_ChannelConfigTypeDef *Config)
 Set dma channel config,include control register and config register. More...
 
void DMAC_GetChannelConfig (DMA_T *dma, uint32_t ChIdx, DMAC_ChannelConfigTypeDef *Config)
 Get dma channel config,include control register and config register. More...
 
void DMAC_StartChannel (DMA_T *dma, uint32_t ChIdx, void *Src, void *Dst, uint32_t Len)
 Start dma channel to transmit. More...
 
void DMAC_StopChannel (DMA_T *dma, uint32_t ChIdx)
 Stop dma channel. More...
 
uint32_t DMAC_AcquireChannel (DMA_T *dma)
 Acquire dma free channel. More...
 
void DMAC_ReleaseChannel (DMA_T *dma, uint32_t ChIdx)
 Release dma channel. More...
 

Detailed Description

Panchip series dma driver header file.

Version
V1.00
Revision
3
Date
21/11/12 18:33