MG32F10x Standard Peripherals Firmware Library
Modules | Functions

I2S driver modules. More...

Modules

 I2S_Exported_Constants
 
 I2S_Private_Functions
 

Functions

void I2S_DeInit (void)
 Deinitializes the I2S peripheral registers to their default reset values. More...
 
void I2S_Cmd (FunctionalState NewState)
 Enables or disables the specified I2S peripheral. More...
 
void I2S_ReceiverCmd (FunctionalState NewState)
 Enables or disables the I2S receiver block. More...
 
void I2S_TransmitterCmd (FunctionalState NewState)
 Enables or disables the I2S transmitter block. More...
 
void I2S_ClockConfig (uint32_t I2S_WordSelectSize, uint32_t I2S_SclkGate)
 Configures I2S Clock Generation block. More...
 
void I2S_ClockCmd (FunctionalState NewState)
 Enables or disables the I2S clock generation block. More...
 
void I2S_ReceiverFIFOFlush (void)
 Flushes all the RX FIFOs. More...
 
void I2S_TransmitterFIFOFlush (void)
 Flushes all the TX FIFOs. More...
 
uint32_t I2S_Channel_ReadLeftData (uint32_t I2S_Channel)
 Read the left stereo data from Rx FIFO. More...
 
uint32_t I2S_Channel_ReadRightData (uint32_t I2S_Channel)
 Read the right stereo data from Rx FIFO. More...
 
void I2S_Channel_WriteLeftData (uint32_t I2S_Channel, uint32_t LeftData)
 Write the left stereo data to Tx FIFO. More...
 
void I2S_Channel_WriteRightData (uint32_t I2S_Channel, uint32_t RightData)
 Write the right stereo data to Tx FIFO. More...
 
void I2S_Channel_ReceiveCmd (uint32_t I2S_Channel, FunctionalState NewState)
 Enables or disables the receive channel. More...
 
void I2S_Channel_TransmitCmd (uint32_t I2S_Channel, FunctionalState NewState)
 Enables or disables the transmit channel. More...
 
void I2S_Channel_ReceiveConfig (uint32_t I2S_Channel, uint32_t I2S_DataFormat)
 Configures the desired data resolution of the receiver. More...
 
void I2S_Channel_TransmitConfig (uint32_t I2S_Channel, uint32_t I2S_DataFormat)
 Configures the data resolution of the transmitter. More...
 
void I2S_Channel_ITConfig (uint32_t I2S_Channel, uint8_t I2S_IT, FunctionalState NewState)
 Enables or disables the specified I2S interrupts. More...
 
ITStatus I2S_Channel_GetITStatus (uint32_t I2S_Channel, uint8_t I2S_IT)
 Checks whether the specified I2S interrupt has occurred or not. More...
 
void I2S_Channel_ClearITPendingBit (uint32_t I2S_Channel, uint8_t I2S_IT)
 Clears the I2S interrupt pending bits. More...
 
void I2S_Channel_ReceiveFIFOConfig (uint32_t I2S_Channel, uint8_t Threshold)
 Configures the Rx FIFO threshold. More...
 
void I2S_Channel_TransmitFIFOConfig (uint32_t I2S_Channel, uint8_t Threshold)
 Configures the Tx FIFO threshold. More...
 
void I2S_Channel_ReceiveFIFOFlush (uint32_t I2S_Channel)
 Flushes the corresponding RX FIFO. More...
 
void I2S_Channel_TransmitFIFOFlush (uint32_t I2S_Channel)
 Flushes the corresponding TX FIFO. More...
 

Detailed Description

I2S driver modules.

Function Documentation

◆ I2S_Channel_ClearITPendingBit()

void I2S_Channel_ClearITPendingBit ( uint32_t  I2S_Channel,
uint8_t  I2S_IT 
)

Clears the I2S interrupt pending bits.

Parameters
I2S_Channelspecifies the selected I2S channel.
I2S_ITspecifies the interrupt pending bit to clear. This parameter can be a combination of the following values:
  • I2S_IT_RXFO: RX FIFO Overrun interrupt.
  • I2S_IT_TXFO: TX FIFO Overrun interrupt.
Returns
None.

◆ I2S_Channel_GetITStatus()

ITStatus I2S_Channel_GetITStatus ( uint32_t  I2S_Channel,
uint8_t  I2S_IT 
)

Checks whether the specified I2S interrupt has occurred or not.

Parameters
I2S_Channelspecifies the selected I2S channel.
I2S_ITspecifies the I2S interrupt source to check. This parameter can be one of the following values:
  • I2S_IT_RXDA: RX FIFO Data Available interrupt.
  • I2S_IT_RXFO: RX FIFO Overrun interrupt.
  • I2S_IT_TXFE: TX FIFO Empty interrupt.
  • I2S_IT_TXFO: TX FIFO Overrun interrupt.
Returns
The new state of I2S_IT (SET or RESET).

◆ I2S_Channel_ITConfig()

void I2S_Channel_ITConfig ( uint32_t  I2S_Channel,
uint8_t  I2S_IT,
FunctionalState  NewState 
)

Enables or disables the specified I2S interrupts.

Parameters
I2S_Channelspecifies the selected I2S channel.
I2S_ITspecifies the I2S interrupt source to be enabled or disabled. This parameter can be a combination of the following values:
  • I2S_IT_RXDA: RX FIFO Data Available interrupt.
  • I2S_IT_RXFO: RX FIFO Overrun interrupt.
  • I2S_IT_TXFE: TX FIFO Empty interrupt.
  • I2S_IT_TXFO: TX FIFO Overrun interrupt.
NewStatenew state of the specified I2S interrupt. This parameter can be: ENABLE or DISABLE.
Returns
None.

◆ I2S_Channel_ReadLeftData()

uint32_t I2S_Channel_ReadLeftData ( uint32_t  I2S_Channel)

Read the left stereo data from Rx FIFO.

Parameters
I2S_Channelspecifies the selected I2S channel.
Returns
The left stereo data.

◆ I2S_Channel_ReadRightData()

uint32_t I2S_Channel_ReadRightData ( uint32_t  I2S_Channel)

Read the right stereo data from Rx FIFO.

Parameters
I2S_Channelspecifies the selected I2S channel.
Returns
The right stereo data.

◆ I2S_Channel_ReceiveCmd()

void I2S_Channel_ReceiveCmd ( uint32_t  I2S_Channel,
FunctionalState  NewState 
)

Enables or disables the receive channel.

Parameters
I2S_Channelspecifies the selected I2S channel.
NewStatenew state of the receive channel. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ I2S_Channel_ReceiveConfig()

void I2S_Channel_ReceiveConfig ( uint32_t  I2S_Channel,
uint32_t  I2S_DataFormat 
)

Configures the desired data resolution of the receiver.

Parameters
I2S_Channelspecifies the selected I2S channel.
I2S_DataFormatspecifies the desired data resolution. This parameter can be one of the following values:
  • I2S_DataFormat_Ignore
  • I2S_DataFormat_12b
  • I2S_DataFormat_16b
  • I2S_DataFormat_20b
  • I2S_DataFormat_24b
  • I2S_DataFormat_32b
Returns
None

◆ I2S_Channel_ReceiveFIFOConfig()

void I2S_Channel_ReceiveFIFOConfig ( uint32_t  I2S_Channel,
uint8_t  Threshold 
)

Configures the Rx FIFO threshold.

Parameters
I2S_Channelspecifies the selected I2S channel.
ThresholdThe Rx FIFO threshold to set.
Note
The RX FIFO Data Available interrupt will trigger when the level > Threshold.
Returns
None.

◆ I2S_Channel_ReceiveFIFOFlush()

void I2S_Channel_ReceiveFIFOFlush ( uint32_t  I2S_Channel)

Flushes the corresponding RX FIFO.

Parameters
I2S_Channelspecifies the selected I2S channel.
Returns
None

◆ I2S_Channel_TransmitCmd()

void I2S_Channel_TransmitCmd ( uint32_t  I2S_Channel,
FunctionalState  NewState 
)

Enables or disables the transmit channel.

Parameters
I2S_Channelspecifies the selected I2S channel.
NewStatenew state of the transmit channel. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ I2S_Channel_TransmitConfig()

void I2S_Channel_TransmitConfig ( uint32_t  I2S_Channel,
uint32_t  I2S_DataFormat 
)

Configures the data resolution of the transmitter.

Parameters
I2S_Channelspecifies the selected I2S channel.
I2S_DataFormatspecifies the data resolution. This parameter can be one of the following values:
  • I2S_DataFormat_Ignore
  • I2S_DataFormat_12b
  • I2S_DataFormat_16b
  • I2S_DataFormat_20b
  • I2S_DataFormat_24b
  • I2S_DataFormat_32b
Returns
None

◆ I2S_Channel_TransmitFIFOConfig()

void I2S_Channel_TransmitFIFOConfig ( uint32_t  I2S_Channel,
uint8_t  Threshold 
)

Configures the Tx FIFO threshold.

Parameters
I2S_Channelspecifies the selected I2S channel.
ThresholdThe Tx FIFO threshold to set.
Note
The TX FIFO Empty interrupt will trigger when the level <= Threshold.
Returns
None.

◆ I2S_Channel_TransmitFIFOFlush()

void I2S_Channel_TransmitFIFOFlush ( uint32_t  I2S_Channel)

Flushes the corresponding TX FIFO.

Parameters
I2S_Channelspecifies the selected I2S channel.
Returns
None

◆ I2S_Channel_WriteLeftData()

void I2S_Channel_WriteLeftData ( uint32_t  I2S_Channel,
uint32_t  LeftData 
)

Write the left stereo data to Tx FIFO.

Parameters
I2S_Channelspecifies the selected I2S channel.
LeftDataThe left stereo data to write.
Returns
None

◆ I2S_Channel_WriteRightData()

void I2S_Channel_WriteRightData ( uint32_t  I2S_Channel,
uint32_t  RightData 
)

Write the right stereo data to Tx FIFO.

Parameters
I2S_Channelspecifies the selected I2S channel.
RightDataThe right stereo data to write.
Returns
None

◆ I2S_ClockCmd()

void I2S_ClockCmd ( FunctionalState  NewState)

Enables or disables the I2S clock generation block.

Parameters
NewStatenew state of the clock generation block. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ I2S_ClockConfig()

void I2S_ClockConfig ( uint32_t  I2S_WordSelectSize,
uint32_t  I2S_SclkGate 
)

Configures I2S Clock Generation block.

Parameters
I2S_WordSelectSizespecifies the number of sclk cycles for which the word select line stays in the left or right sample mode. This parameter can be one of the following values:
  • I2S_WordSelectSize_16
  • I2S_WordSelectSize_24
  • I2S_WordSelectSize_32
I2S_SclkGatespecifies the gating of sclk. This parameter can be one of the following values:
  • I2S_SclkGate_None
  • I2S_SclkGate_12
  • I2S_SclkGate_16
  • I2S_SclkGate_20
  • I2S_SclkGate_24
Returns
None

◆ I2S_Cmd()

void I2S_Cmd ( FunctionalState  NewState)

Enables or disables the specified I2S peripheral.

Parameters
NewStatenew state of the I2S peripheral. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ I2S_DeInit()

void I2S_DeInit ( void  )

Deinitializes the I2S peripheral registers to their default reset values.

Returns
None

◆ I2S_ReceiverCmd()

void I2S_ReceiverCmd ( FunctionalState  NewState)

Enables or disables the I2S receiver block.

Parameters
NewStatenew state of the receiver block. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ I2S_ReceiverFIFOFlush()

void I2S_ReceiverFIFOFlush ( void  )

Flushes all the RX FIFOs.

Returns
None

◆ I2S_TransmitterCmd()

void I2S_TransmitterCmd ( FunctionalState  NewState)

Enables or disables the I2S transmitter block.

Parameters
NewStatenew state of the transmitter block. This parameter can be: ENABLE or DISABLE.
Returns
None

◆ I2S_TransmitterFIFOFlush()

void I2S_TransmitterFIFOFlush ( void  )

Flushes all the TX FIFOs.

Returns
None