GD32W51x User Manual
694
So, in order to get the desired audio sampling frequency, the clock generator needs to be
configured according to the formulas listed in
Table 20-6. Audio sampling frequency
Table 20-6. Audio sampling frequency calculation formulas
MCKOEN
CHLEN
Form ula
0
0
I2SCLK / (32 * (DIV * 2 + OF))
0
1
I2SCLK / (64 * (DIV * 2 + OF))
1
0
I2SCLK / (256 * (DIV * 2 + OF))
1
1
I2SCLK / (256 * (DIV * 2 + OF))
20.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 20-7. Direction of I2S interface
signals for each operation mode.
Table 20-7. Direction of I2S interface signals for each operation mode
Operation m ode
I2S_MCK
I2S_CK
I2S_WS
I2S_SD
I2S_ADD_SD(2)
Master transmission
output or
NU(1)
output
output
output
NU(1)
Master reception
output or
NU(1)
output
output
input
NU(1)
Slave transmission
input or
NU(1)
input
input
output
NU(1)
Slave reception
input or
NU(1)
input
input
input
NU(1)
Full-duplex
output or
NU(1)
output
output
output or
input
Input or output
1. NU means the pin is not used by I2S and can be used by other functions.
2. In order to support the full-duplex operation mode, I2S1 requires an additional on-chip
I2S module: I2S_ADD1. The I2S_ADD_SD pin is the data pin of the I2S_ADD module.
The full-duplex mode will be described in detail in this chapters.
I2S initialization sequence
I2S initialization sequence contains five steps shown below. In order to initialize I2S to master
mode, all the five steps should be done. In order to initialize I2S to slave mode, only step 2,