RM0090
29.14
Interrupt sources
The SAI has 7 possible interrupt sources as illustrated by
Interrupt
source
FREQ
OVRUDR ERROR
AFSDET
LFSDET
CNRDY
MUTEDE
T
WCKCFG ERROR
Below are the SAI configuration steps to follow when an interrupt occurs:
1.
Disable SAI interrupt.
2.
Configure SAI.
3.
Configure SAI interrupt source.
4.
Enable SAI.
29.15
Disabling the SAI
The audio block in the SAI can be disabled at any moment by clearing bit SAIxEN in the
SAI_xCR1 register. All the frames that have already started will be automatically completed
before the total extinction of the SAI. Bit SAIxEN in the SAI_xCR1 register will stay high until
the SAI is completely switched-off at the end of the current audio frame transfer.
Table 130. Interrupt sources
Interru
pt
Audio block mode
group
Master or Slave
FREQ
Receiver or transmitter
Master or Slave
Receiver or transmitter
Slave
ERROR
(Not used in AC'97
mode)
Slave
ERROR
(Not used in AC'97
mode)
Slave
ERROR
(Only in AC'97 mode)
Master or slave
MUTE
Receiver mode only
Master with NODIV = 0
in the SAI_xCR1
register
DocID018909 Rev 11
Serial audio interface (SAI)
Table
.
Interrupt enable
Depend on:
- FIFO threshold setting
(FLTH bits in SAI_CR2)
FREQIE in
- Communication direction
SAI_xIM register
transmitter or receiver
for more details please refer
to Internal FIFOs section
OVRUDRIE in
COVRUDR = 1 in
SAI_xIM register
SAI_xCLRFR register
AFSDETIE in
CAFSDET = 1 in
SAI_xIM register
SAI_xCLRFR register
LFSDETIE in
CLFSDET = 1 in
SAI_xIM register
SAI_xCLRFR register
CNRDYIE in
CCNRDY = 1 in
SAI_xIM register
SAI_xCLRFR register
MUTEDETIE in
CMUTEDET = 1 in
SAI_xIM register
SAI_xCLRFR register
WCKCFGIE in
CWCKCFG = 1 in
SAI_xIM register
SAI_xCLRFR register
Interrupt clear
941/1731
957
Need help?
Do you have a question about the STM32F405 and is the answer not in the manual?