GD32F20x User Manual
567
precision demand, an external precise I2S clock can be imported from I2S_CKIN pin.
21.9.3.
Operation
Operation modes
The operation mode is selected by the I2SOPMOD bits in the SPI_I2SCTL register. There
are four available operation modes, including master transmission mode, master reception
mode, slave transmission mode, and slave reception mode. The direction of I2S interface
signals for each operation mode is shown in the
Table 21-7. Direction of I2S interface
signals for each operation mode.
Table 21-7. Direction of I2S interface signals for each operation mode
Operation mode
I2S_MCK
I2S_CK
I2S_WS
I2S_SD
Master transmission
output or NU(1)
output
output
output
Master reception
output or NU(1)
output
output
input
Slave transmission
input or NU(1)
input
input
output
Slave reception
input or NU(1)
input
input
input
1. NU means the pin is not used by I2S and can be used by other functions.
I2S initialization sequence
I2S initialization sequence contains five steps shown below. In order to initialize I2S working
in master mode, all the five steps should be done. In order to initialize I2S working in slave
mode, only step 2, step 3, step 4 and step 5 should be done.
Step 1: Configure the DIV [7:0] bits, the OF bit, and the MCKOEN bit in the SPI_I2SPSC
register, in order to define the I2S bitrate and whether I2S_MCK needs to be provided or
not.
Step 2: Configure the CKPL in the SPI_I2SCTL register, in order to define the idle state
clock polarity.
Step 3: Configure the I2SSEL bit, the I2SSTD [1:0] bits, the PCMSMOD bit, the
I2SOPMOD [1:0] bits, the DTLEN [1:0] bits, and the CHLEN bit in the SPI_I2SCTL
register, in order to define the I2S feature.
Step 4: Configure the TBEIE bit, the RBNEIE bit, the ERRIE bit, the DMATEN bit, and
the DMAREN bit in the SPI_CTL1 register, in order to select the potential interrupt
sources and the DMA capabilities. This step is optional.
Step 5: Set the I2SEN bit in the SPI_I2SCTL register to enable I2S.
Содержание GD32F20 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F20x ARM Cortex M3 32 bit MCU User Manual Revision 2 2 Oct 2019 ...
Страница 191: ...GD32F20x User Manual 191 Bits Fields Descriptions 31 0 TRNDATA 31 0 32 Bit Random data ...
Страница 290: ...GD32F20x User Manual 290 conversion is ongoing ...
Страница 325: ...GD32F20x User Manual 325 15 0 ALRM 15 0 RTC alarm value low ...
Страница 385: ...GD32F20x User Manual 385 ...
Страница 523: ...GD32F20x User Manual 523 clears AERR bit by writing 0 to it ...