![]() |
M480 BSP V3.05.006
The Board Support Package for M480 Series
|
Macros | |
#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... | |
static uint32_t | I2S_GetSourceClockFreq (I2S_T *i2s) |
This function is used to get I2S source clock frequency. More... | |
#define I2S_CLR_INT_FLAG | ( | i2s, | |
u32Mask | |||
) |
#define I2S_CLR_RX_FIFO | ( | i2s | ) |
#define I2S_CLR_TX_FIFO | ( | i2s | ) |
#define I2S_CLR_ZC_INT_FLAG | ( | i2s, | |
u32Mask | |||
) |
#define I2S_DISABLE_RX | ( | i2s | ) |
#define I2S_DISABLE_RXDMA | ( | i2s | ) |
#define I2S_DISABLE_TX | ( | i2s | ) |
#define I2S_DISABLE_TX_MUTE | ( | i2s | ) |
#define I2S_DISABLE_TXDMA | ( | i2s | ) |
#define I2S_ENABLE_RX | ( | i2s | ) |
#define I2S_ENABLE_RXDMA | ( | i2s | ) |
#define I2S_ENABLE_TX | ( | i2s | ) |
#define I2S_ENABLE_TX_MUTE | ( | i2s | ) |
#define I2S_ENABLE_TXDMA | ( | i2s | ) |
#define I2S_GET_INT_FLAG | ( | i2s, | |
u32Mask | |||
) |
#define I2S_GET_RX_FIFO_LEVEL | ( | i2s | ) |
#define I2S_GET_TX_FIFO_LEVEL | ( | i2s | ) |
#define I2S_GET_ZC_INT_FLAG | ( | i2s, | |
u32Mask | |||
) |
#define I2S_READ_RX_FIFO | ( | i2s | ) |
#define I2S_WRITE_TX_FIFO | ( | i2s, | |
u32Data | |||
) |
void I2S_Close | ( | I2S_T * | i2s | ) |
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.
[in] | i2s | The pointer of the specified I2S module. |
[in] | u32ChannelWidth | Channel width. Valid values are: |
[in] | u32ChannelNum | Channel number. Valid values are: |
[in] | u32SyncWidth | Width for sync pulse. Valid values are: |
Set TX FIFO threshold and RX FIFO threshold configurations.
__STATIC_INLINE void I2S_DISABLE_TX_ZCD | ( | I2S_T * | i2s, |
uint32_t | u32ChMask | ||
) |
void I2S_DisableInt | ( | I2S_T * | i2s, |
uint32_t | u32Mask | ||
) |
void I2S_DisableMCLK | ( | I2S_T * | i2s | ) |
__STATIC_INLINE void I2S_ENABLE_TX_ZCD | ( | I2S_T * | i2s, |
uint32_t | u32ChMask | ||
) |
void I2S_EnableInt | ( | I2S_T * | i2s, |
uint32_t | u32Mask | ||
) |
uint32_t I2S_EnableMCLK | ( | I2S_T * | i2s, |
uint32_t | u32BusClock | ||
) |
|
static |
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.
[in] | i2s | is the base address of I2S module. |
[in] | u32MasterSlave | I2S operation mode. Valid values are: |
[in] | u32SampleRate | Sample rate |
[in] | u32WordWidth | Data length. Valid values are: |
[in] | u32MonoData | Set audio data to mono or not. Valid values are: |
[in] | u32DataFormat | Data format. This is also used to select I2S or PCM(TDM) function. Valid values are: |
__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.
[in] | i2s | is the base address of I2S module. |
[in] | u32Ch | left or right channel. Valid values are: |
void I2S_SetFIFO | ( | I2S_T * | i2s, |
uint32_t | u32TxThreshold, | ||
uint32_t | u32RxThreshold | ||
) |
Configure FIFO threshold setting.
[in] | i2s | The pointer of the specified I2S module. |
[in] | u32TxThreshold | Decides the TX FIFO threshold. It could be 0 ~ 7. |
[in] | u32RxThreshold | Decides the RX FIFO threshold. It could be 0 ~ 7. |
Set TX FIFO threshold and RX FIFO threshold configurations.