PAN1080 Peripheral API
Macros | Functions
pan_i2s.h File Reference

Panchip series i2s driver header file. More...

Go to the source code of this file.

Macros

#define I2S_WORD_SEL_16_CYCLE   (0)
 
#define I2S_WORD_SEL_24_CYCLE   (1)
 
#define I2S_WORD_SEL_32_CYCLE   (2)
 
#define I2S_CLK_GATING_SEL_0_CYCLE   (0)
 
#define I2S_CLK_GATING_SEL_12_CYCLE   (1)
 
#define I2S_CLK_GATING_SEL_16_CYCLE   (2)
 
#define I2S_CLK_GATING_SEL_24_CYCLE   (3)
 
#define I2S_CLK_GATING_SEL_32_CYCLE   (4)
 
#define I2S_WORD_LEN_IGNORE   (0)
 
#define I2S_WORD_LEN_12_BIT_RESOLUTION   (1)
 
#define I2S_WORD_LEN_16_BIT_RESOLUTION   (2)
 
#define I2S_WORD_LEN_20_BIT_RESOLUTION   (3)
 
#define I2S_WORD_LEN_24_BIT_RESOLUTION   (4)
 
#define I2S_WORD_LEN_32_BIT_RESOLUTION   (5)
 
#define I2S_INT_TX_OVER   (1<<5)
 
#define I2S_INT_TX_EMPTY   (1<<4)
 
#define I2S_INT_RX_OVER   (1<<1)
 
#define I2S_INT_RX_VALID   (1<<0)
 
#define I2S_INT_NONE   (0)
 
#define I2S_ENABLE_COMMON_BIT0   (1)
 
#define I2S_SCLK_GATING_Pos   (0)
 
#define I2S_SCLK_GATING_Msk   (0x7ul << I2S_SCLK_GATING_Pos)
 
#define I2S_WORD_SELECT_LEN_Pos   (3)
 
#define I2S_WORD_SELECT_LEN_Msk   (0x3ul << I2S_WORD_SELECT_LEN_Pos)
 
#define I2S_WORD_LENGTH_SET_Pos   (0)
 
#define I2S_WORD_LENGTH_SET_Msk   (0x7ul << I2S_WORD_LENGTH_SET_Pos)
 
#define I2S_SINGLE_STEREO_BUFSEL_L   (0)
 
#define I2S_SINGLE_STEREO_BUFSEL_R   (1)
 
#define I2S_SINGLE_STEREO_TX   (1<<16)
 
#define I2S_SINGLE_TX_BUFSEL_Pos   (17)
 
#define I2S_SINGLE_TX_BUFSEL_Msk   (1<<I2S_SINGLE_TX_BUFSEL_Pos)
 
#define I2S_SINGLE_STEREO_RX   (1<<18)
 
#define I2S_SINGLE_RX_BUFSEL_Pos   (19)
 
#define I2S_SINGLE_RX_BUFSEL_Msk   (1<<I2S_SINGLE_RX_BUFSEL_Pos)
 

Functions

__STATIC_INLINE void I2S_EnableI2s (I2S_T *I2Sx)
 Set I2s module enable. More...
 
__STATIC_INLINE void I2S_DisableI2s (I2S_T *I2Sx)
 Set I2s module disable. More...
 
__STATIC_INLINE void I2S_EnableRecBlock (I2S_T *I2Sx)
 Set I2s received block enable. More...
 
__STATIC_INLINE void I2S_DisableRecBlock (I2S_T *I2Sx)
 Set I2s received block disable. More...
 
__STATIC_INLINE void I2S_EnableTransmitBlock (I2S_T *I2Sx)
 Set I2s transmitter block enable. More...
 
__STATIC_INLINE void I2S_DisableTransmitBlock (I2S_T *I2Sx)
 Set I2s transmitter block disable. More...
 
__STATIC_INLINE void I2S_EnableClk (I2S_T *I2Sx)
 Set I2s CLK generation enable. More...
 
__STATIC_INLINE void I2S_DisableClk (I2S_T *I2Sx)
 Set I2s CLK generation disable. More...
 
__STATIC_INLINE void I2S_SetRecFifoRst (I2S_T *I2Sx)
 Set I2s receive fifo reset. More...
 
__STATIC_INLINE void I2S_SetTransmitFifoRst (I2S_T *I2Sx)
 Set I2s transmitter fifo reset. More...
 
__STATIC_INLINE void I2S_EnRecChannel (I2S_T *I2Sx, uint8_t Ch)
 Set I2s receive channel enable. More...
 
__STATIC_INLINE void I2S_DisableRecChannel (I2S_T *I2Sx, uint8_t Ch)
 Set I2s receive channel disable. More...
 
__STATIC_INLINE void I2S_EnableTransmitCh (I2S_T *I2Sx, uint8_t Ch)
 Set I2s transmitter channel enable. More...
 
__STATIC_INLINE void I2S_DisableTransmitCh (I2S_T *I2Sx, uint8_t Ch)
 Set I2s transmitter channel disable. More...
 
__STATIC_INLINE void I2S_SetIntMsk (I2S_T *I2Sx, uint8_t Ch, uint8_t Msk)
 Set I2s interrupt mask. More...
 
__STATIC_INLINE void I2S_ClearIntMsk (I2S_T *I2Sx, uint8_t Ch, uint8_t Msk)
 Clear I2s interrupt mask. More...
 
__STATIC_INLINE bool I2S_IsIntMsk (I2S_T *I2Sx, uint8_t Ch, uint8_t Msk)
 Set I2s interrupt mask. More...
 
__STATIC_INLINE void I2S_SetRxTrigLevel (I2S_T *I2Sx, uint8_t Ch, uint8_t Level)
 Set I2s rx trigger level. More...
 
__STATIC_INLINE void I2S_SetTxTrigLevel (I2S_T *I2Sx, uint8_t Ch, uint8_t Level)
 Set I2s tx trigger level. More...
 
__STATIC_INLINE void I2S_SetRecChFifoRst (I2S_T *I2Sx, uint8_t Ch)
 Set I2s receive channel fifo reset. More...
 
__STATIC_INLINE void I2S_SetTransmitChFifoRst (I2S_T *I2Sx, uint8_t Ch)
 Set I2s transmitter channel fifo reset. More...
 
__STATIC_INLINE void I2S_WriteTxDmaDat (I2S_T *I2Sx, uint32_t Data)
 Write I2s tx dma data. More...
 
__STATIC_INLINE uint32_t I2S_ReadRxDmaDat (I2S_T *I2Sx)
 Read I2s rx dma data. More...
 
__STATIC_INLINE uint8_t I2S_GetIntStatus (I2S_T *I2Sx, uint8_t Ch)
 Get I2s interrupt status. More...
 
__STATIC_INLINE bool I2S_IsIntOccured (I2S_T *I2Sx, uint8_t Ch, uint8_t Msk)
 Adjust which i2s interrupt occured. More...
 
__STATIC_INLINE void I2S_WriteLeftTransmitData (I2S_T *I2Sx, uint8_t Ch, uint16_t Data)
 Write I2s left transmitter data. More...
 
__STATIC_INLINE uint16_t I2S_ReadLeftRecData (I2S_T *I2Sx, uint8_t Ch)
 Read I2s left receive data. More...
 
__STATIC_INLINE void I2S_WriteRightTransmitData (I2S_T *I2Sx, uint8_t Ch, uint16_t Data)
 Write I2s right transmitter data. More...
 
__STATIC_INLINE uint16_t I2S_ReadRightRecData (I2S_T *I2Sx, uint8_t Ch)
 Read I2s left receive data. More...
 
__STATIC_INLINE void I2S_TxSingleStereoEnable (I2S_T *I2Sx, bool enable)
 Enable I2s single stereo TX function. More...
 
__STATIC_INLINE void I2S_TxSingleStereoBufSel (I2S_T *I2Sx, uint32_t bufSel)
 buffer select in single stereo TX mode More...
 
__STATIC_INLINE void I2S_RxSingleStereoEnable (I2S_T *I2Sx, bool enable)
 Enable I2s single stereo RX function. More...
 
__STATIC_INLINE void I2S_RxSingleStereoBufSel (I2S_T *I2Sx, uint32_t bufSel)
 buffer select in single stereo TX mode More...
 
void I2S_SetWordSelectLen (I2S_T *i2s, uint8_t u8WordSel)
 set I2s word select lenth,default 16 clk cycle More...
 
void I2S_SetSclkGate (I2S_T *i2s, uint8_t u8SclkSel)
 set I2s clk gating cycle,default:no gating More...
 
void I2S_SetRecWordLen (I2S_T *i2s, uint8_t ch, uint8_t u8WordLen)
 set I2s receive word length resolution,default:no word length More...
 
void I2S_SetTrmWordLen (I2S_T *i2s, uint8_t ch, uint8_t u8WordLen)
 set I2s transmitter word length resolution,default:no word length More...
 
uint32_t I2S_ClearRxOverInt (I2S_T *i2s, uint8_t ch)
 Clear rx fifo over interrupt status. More...
 
uint32_t I2S_ClearTxOverInt (I2S_T *i2s, uint8_t ch)
 Clear tx fifo over interrupt status. More...
 
void I2S_Send (I2S_T *I2Sx, uint8_t Ch, uint32_t *LeftBuf, uint32_t *RightBuf, uint32_t Size)
 I2S send data. More...
 
void I2S_Receive (I2S_T *I2Sx, uint8_t Ch, uint32_t *LeftBuf, uint32_t *RightBuf, uint32_t Size)
 I2S send data. More...
 

Detailed Description

Panchip series i2s driver header file.

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