M480 BSP V3.05.005
The Board Support Package for M480 Series
Macros | Functions
i2s.h File Reference

M480 I2S driver header file. More...

Go to the source code of this file.

Macros

#define I2S_DATABIT_8
 
#define I2S_DATABIT_16
 
#define I2S_DATABIT_24
 
#define I2S_DATABIT_32
 
#define I2S_ENABLE_MONO
 
#define I2S_DISABLE_MONO
 
#define I2S_FORMAT_I2S
 
#define I2S_FORMAT_I2S_MSB
 
#define I2S_FORMAT_I2S_LSB
 
#define I2S_FORMAT_PCM
 
#define I2S_FORMAT_PCM_MSB
 
#define I2S_FORMAT_PCM_LSB
 
#define I2S_ORDER_AT_MSB
 
#define I2S_ORDER_AT_LSB
 
#define I2S_TDM_2CH
 
#define I2S_TDM_4CH
 
#define I2S_TDM_6CH
 
#define I2S_TDM_8CH
 
#define I2S_TDM_WIDTH_8BIT
 
#define I2S_TDM_WIDTH_16BIT
 
#define I2S_TDM_WIDTH_24BIT
 
#define I2S_TDM_WIDTH_32BIT
 
#define I2S_TDM_SYNC_ONE_BCLK
 
#define I2S_TDM_SYNC_ONE_CHANNEL
 
#define I2S_MODE_SLAVE
 
#define I2S_MODE_MASTER
 
#define I2S_FIFO_TX_LEVEL_WORD_0
 
#define I2S_FIFO_TX_LEVEL_WORD_1
 
#define I2S_FIFO_TX_LEVEL_WORD_2
 
#define I2S_FIFO_TX_LEVEL_WORD_3
 
#define I2S_FIFO_TX_LEVEL_WORD_4
 
#define I2S_FIFO_TX_LEVEL_WORD_5
 
#define I2S_FIFO_TX_LEVEL_WORD_6
 
#define I2S_FIFO_TX_LEVEL_WORD_7
 
#define I2S_FIFO_TX_LEVEL_WORD_8
 
#define I2S_FIFO_TX_LEVEL_WORD_9
 
#define I2S_FIFO_TX_LEVEL_WORD_10
 
#define I2S_FIFO_TX_LEVEL_WORD_11
 
#define I2S_FIFO_TX_LEVEL_WORD_12
 
#define I2S_FIFO_TX_LEVEL_WORD_13
 
#define I2S_FIFO_TX_LEVEL_WORD_14
 
#define I2S_FIFO_TX_LEVEL_WORD_15
 
#define I2S_FIFO_RX_LEVEL_WORD_1
 
#define I2S_FIFO_RX_LEVEL_WORD_2
 
#define I2S_FIFO_RX_LEVEL_WORD_3
 
#define I2S_FIFO_RX_LEVEL_WORD_4
 
#define I2S_FIFO_RX_LEVEL_WORD_5
 
#define I2S_FIFO_RX_LEVEL_WORD_6
 
#define I2S_FIFO_RX_LEVEL_WORD_7
 
#define I2S_FIFO_RX_LEVEL_WORD_8
 
#define I2S_FIFO_RX_LEVEL_WORD_9
 
#define I2S_FIFO_RX_LEVEL_WORD_10
 
#define I2S_FIFO_RX_LEVEL_WORD_11
 
#define I2S_FIFO_RX_LEVEL_WORD_12
 
#define I2S_FIFO_RX_LEVEL_WORD_13
 
#define I2S_FIFO_RX_LEVEL_WORD_14
 
#define I2S_FIFO_RX_LEVEL_WORD_15
 
#define I2S_FIFO_RX_LEVEL_WORD_16
 
#define I2S_MONO_RIGHT
 
#define I2S_MONO_LEFT
 
#define I2S_RIGHT
 
#define I2S_LEFT
 
#define I2S_ENABLE_TXDMA(i2s)
 Enable I2S Tx DMA function. I2S requests DMA to transfer data to Tx FIFO. More...
 
#define I2S_DISABLE_TXDMA(i2s)
 Disable I2S Tx DMA function. I2S requests DMA to transfer data to Tx FIFO. More...
 
#define I2S_ENABLE_RXDMA(i2s)
 Enable I2S Rx DMA function. I2S requests DMA to transfer data from Rx FIFO. More...
 
#define I2S_DISABLE_RXDMA(i2s)
 Disable I2S Rx DMA function. I2S requests DMA to transfer data from Rx FIFO. More...
 
#define I2S_ENABLE_TX(i2s)
 Enable I2S Tx function . More...
 
#define I2S_DISABLE_TX(i2s)
 Disable I2S Tx function . More...
 
#define I2S_ENABLE_RX(i2s)
 Enable I2S Rx function . More...
 
#define I2S_DISABLE_RX(i2s)
 Disable I2S Rx function . More...
 
#define I2S_ENABLE_TX_MUTE(i2s)
 Enable Tx Mute function . More...
 
#define I2S_DISABLE_TX_MUTE(i2s)
 Disable Tx Mute function . More...
 
#define I2S_CLR_TX_FIFO(i2s)
 Clear Tx FIFO. Internal pointer is reset to FIFO start point. More...
 
#define I2S_CLR_RX_FIFO(i2s)
 Clear Rx FIFO. Internal pointer is reset to FIFO start point. More...
 
#define I2S_WRITE_TX_FIFO(i2s, u32Data)
 Write data to I2S Tx FIFO. More...
 
#define I2S_READ_RX_FIFO(i2s)
 Read Rx FIFO. More...
 
#define I2S_GET_INT_FLAG(i2s, u32Mask)
 This function gets the interrupt flag according to the mask parameter. More...
 
#define I2S_CLR_INT_FLAG(i2s, u32Mask)
 This function clears the interrupt flag according to the mask parameter. More...
 
#define I2S_GET_ZC_INT_FLAG(i2s, u32Mask)
 This function gets the zero crossing interrupt flag according to the mask parameter. More...
 
#define I2S_CLR_ZC_INT_FLAG(i2s, u32Mask)
 This function clears the zero crossing interrupt flag according to the mask parameter. More...
 
#define I2S_GET_TX_FIFO_LEVEL(i2s)
 Get transmit FIFO level. More...
 
#define I2S_GET_RX_FIFO_LEVEL(i2s)
 Get receive FIFO level. More...
 

Functions

__STATIC_INLINE void I2S_ENABLE_TX_ZCD (I2S_T *i2s, uint32_t u32ChMask)
 Enable zero cross detect function. More...
 
__STATIC_INLINE void I2S_DISABLE_TX_ZCD (I2S_T *i2s, uint32_t u32ChMask)
 Disable zero cross detect function. More...
 
__STATIC_INLINE void I2S_SET_MONO_RX_CHANNEL (I2S_T *i2s, uint32_t u32Ch)
 This function sets the recording source channel when mono mode is used. More...
 
void I2S_Close (I2S_T *i2s)
 Disable I2S function and I2S clock. More...
 
void I2S_EnableInt (I2S_T *i2s, uint32_t u32Mask)
 This function enables the interrupt according to the mask parameter. More...
 
void I2S_DisableInt (I2S_T *i2s, uint32_t u32Mask)
 This function disables the interrupt according to the mask parameter. More...
 
uint32_t I2S_EnableMCLK (I2S_T *i2s, uint32_t u32BusClock)
 Enable MCLK . More...
 
void I2S_DisableMCLK (I2S_T *i2s)
 Disable MCLK . More...
 
void I2S_SetFIFO (I2S_T *i2s, uint32_t u32TxThreshold, uint32_t u32RxThreshold)
 Configure FIFO threshold setting. More...
 
void I2S_ConfigureTDM (I2S_T *i2s, uint32_t u32ChannelWidth, uint32_t u32ChannelNum, uint32_t u32SyncWidth)
 Configure PCM(TDM) function parameters, such as channel width, channel number and sync pulse width. More...
 
uint32_t I2S_Open (I2S_T *i2s, uint32_t u32MasterSlave, uint32_t u32SampleRate, uint32_t u32WordWidth, uint32_t u32MonoData, uint32_t u32DataFormat)
 This function configures some parameters of I2S interface for general purpose use. The sample rate may not be used from the parameter, it depends on system's clock settings, but real sample rate used by system will be returned for reference. More...
 

Detailed Description

M480 I2S driver header file.

Version
V0.10

SPDX-License-Identifier: Apache-2.0

Definition in file i2s.h.