![Geehy SEMICONDUCTOR APM32F405 Series Скачать руководство пользователя страница 378](http://html1.mh-extra.com/html/geehy-semiconductor/apm32f405-series/apm32f405-series_user-manual_573630378.webp)
www.geehy.com Page 377
MCOEN
CHLEN
Audio sampling frequency (Fs)
0
0
I2SxCLK/[
(
16*2
)
*
(
(
2*I2SPSC
)
+ODDPSC
)
]
0
1
I2SxCLK/[
(
32*2
)
*
(
(
2*I2SPSC
)
+ODDPSC
)
]
I2S mode
I2S can be configured as follows:
Transmit master or receive master of I2Sx is used in half-duplex mode
Master that receives and transmits concurrently in full-duplex mode
Table 104 I2S Run Mode
Run mode
SD
WS
CK
MCK
Master
transmitting
Output
Output
Output
Output/Not used
Master receiving
Input
Output
Output
Output/Not used
Slave transmitting
Output
Input
Input
Output/Not used
Slave receiving
Input
Input
Input
Output/Not used
I2S master mode
When I2S works in master mode, the serial clock is output by pin CK, and the
word select signal is generated by pin WS. It is controlled by
SPI_I2SPSC[MCOEN] whether to output master clock.
Configuration process:
Configure I2SPSC bit and ODDPSC bit of SPI_I2SPSC register to
define the baud rate of serial clock and the actual frequency division
factor corresponding to the audio sampling frequency.
Configure CPOL bit of SPI_I2SCFG register to define the clock polarity
of SPI in idle state.
Configure I2SMOD bit of SPI_I2SCFG register to activate I2S function
and configure I2SMOD and PFSSEL bits of SPI_I2SCFG register to
select I2S standard; configure DATALEN bit of SPI_I2SCFG register to
select the data bits of the sound channel, and configure I2SMOD bit to
select I2S master mode as transmitting terminal/receiving terminal.
Configure SPI_CTRL2 register to select to enable the interrupt and DMA
function or not (select required or not).
Configure WS pin and CK pin to output mode; when MCOEN bit of
SPI_I2SPSC is set to 1, the MCK pin should also be configured to
output mode.
Set the running mode of I2S by configuring the I2SMOD bit of
SPI_I2SCFG.
Set I2SEN bit of SPI_I2SCFG register to 1.