2 ******************************************************************************
3 * @file stm32f4xx_sai.h
4 * @author MCD Application Team
7 * @brief This file contains all the functions prototypes for the SAI
9 ******************************************************************************
12 * <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2>
14 * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
15 * You may not use this file except in compliance with the License.
16 * You may obtain a copy of the License at:
18 * http://www.st.com/software_license_agreement_liberty_v2
20 * Unless required by applicable law or agreed to in writing, software
21 * distributed under the License is distributed on an "AS IS" BASIS,
22 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 * See the License for the specific language governing permissions and
24 * limitations under the License.
26 ******************************************************************************
29 /* Define to prevent recursive inclusion -------------------------------------*/
30 #ifndef __STM32F4xx_SAI_H
31 #define __STM32F4xx_SAI_H
37 /* Includes ------------------------------------------------------------------*/
38 #include "stm32f4xx.h"
40 /** @addtogroup STM32F4xx_StdPeriph_Driver
47 #if defined (STM32F40_41xxx) || defined (STM32F427_437xx) || defined (STM32F429_439xx) || defined (STM32F401xx) || defined (STM32F411xE) || defined (STM32F446xx) || defined (STM32F469_479xx)
48 /* Exported types ------------------------------------------------------------*/
51 * @brief SAI Block Init structure definition
56 uint32_t SAI_AudioMode
; /*!< Specifies the SAI Block Audio Mode.
57 This parameter can be a value of @ref SAI_Block_Mode */
59 uint32_t SAI_Protocol
; /*!< Specifies the SAI Block Protocol.
60 This parameter can be a value of @ref SAI_Block_Protocol */
62 uint32_t SAI_DataSize
; /*!< Specifies the SAI Block data size.
63 This parameter can be a value of @ref SAI_Block_Data_Size
64 @note this value is ignored when AC'97 or SPDIF protocols are selected.*/
66 uint32_t SAI_FirstBit
; /*!< Specifies whether data transfers start from MSB or LSB bit.
67 This parameter can be a value of @ref SAI_Block_MSB_LSB_transmission
68 @note this value has no meaning when AC'97 or SPDIF protocols are selected.*/
70 uint32_t SAI_ClockStrobing
; /*!< Specifies the SAI Block clock strobing edge sensitivity.
71 This parameter can be a value of @ref SAI_Block_Clock_Strobing */
73 uint32_t SAI_Synchro
; /*!< Specifies SAI Block synchronization
74 This parameter can be a value of @ref SAI_Block_Synchronization */
76 uint32_t SAI_OUTDRIV
; /*!< Specifies when SAI Block outputs are driven.
77 This parameter can be a value of @ref SAI_Block_Output_Drive
78 @note this value has to be set before enabling the audio block
79 but after the audio block configuration. */
81 uint32_t SAI_NoDivider
; /*!< Specifies whether Master Clock will be divided or not.
82 This parameter can be a value of @ref SAI_Block_NoDivider */
84 uint32_t SAI_MasterDivider
; /*!< Specifies SAI Block Master Clock Divider.
85 @note the Master Clock Frequency is calculated accordingly to the
86 following formula : MCLK_x = SAI_CK_x/(MCKDIV[3:0]*2)*/
88 uint32_t SAI_FIFOThreshold
; /*!< Specifies SAI Block FIFO Threshold.
89 This parameter can be a value of @ref SAI_Block_Fifo_Threshold */
93 * @brief SAI Block Frame Init structure definition
99 uint32_t SAI_FrameLength
; /*!< Specifies the Frame Length, the number of SCK clocks
100 for each audio frame.
101 This parameter must be a number between 8 and 256.
102 @note If master Clock MCLK_x pin is declared as an output, the frame length
103 should be Aligned to a number equal to power of 2 in order to keep
104 in an audio frame, an integer number of MCLK pulses by bit Clock.
105 @note this value is ignored when AC'97 or SPDIF protocols are selected.*/
107 uint32_t SAI_ActiveFrameLength
; /*!< Specifies the Frame synchronization active level length.
108 This Parameter specifies the length in number of bit clock (SCK + 1)
109 of the active level of FS signal in audio frame.
110 This parameter must be a number between 1 and 128.
111 @note this value is ignored when AC'97 or SPDIF protocols are selected.*/
113 uint32_t SAI_FSDefinition
; /*!< Specifies the Frame Synchronization definition.
114 This parameter can be a value of @ref SAI_Block_FS_Definition
115 @note this value is ignored when AC'97 or SPDIF protocols are selected.*/
117 uint32_t SAI_FSPolarity
; /*!< Specifies the Frame Synchronization Polarity.
118 This parameter can be a value of @ref SAI_Block_FS_Polarity
119 @note this value is ignored when AC'97 or SPDIF protocols are selected.*/
121 uint32_t SAI_FSOffset
; /*!< Specifies the Frame Synchronization Offset.
122 This parameter can be a value of @ref SAI_Block_FS_Offset
123 @note this value is ignored when AC'97 or SPDIF protocols are selected.*/
125 }SAI_FrameInitTypeDef
;
128 * @brief SAI Block Slot Init Structure definition
133 uint32_t SAI_FirstBitOffset
; /*!< Specifies the position of first data transfer bit in the slot.
134 This parameter must be a number between 0 and 24.
135 @note this value is ignored when AC'97 or SPDIF protocols are selected.*/
137 uint32_t SAI_SlotSize
; /*!< Specifies the Slot Size.
138 This parameter can be a value of @ref SAI_Block_Slot_Size
139 @note this value is ignored when AC'97 or SPDIF protocols are selected.*/
141 uint32_t SAI_SlotNumber
; /*!< Specifies the number of slot in the audio frame.
142 This parameter must be a number between 1 and 16.
143 @note this value is ignored when AC'97 or SPDIF protocols are selected.*/
145 uint32_t SAI_SlotActive
; /*!< Specifies the slots in audio frame that will be activated.
146 This parameter can be a value of @ ref SAI_Block_Slot_Active
147 @note this value is ignored when AC'97 or SPDIF protocols are selected.*/
148 }SAI_SlotInitTypeDef
;
150 /* Exported constants --------------------------------------------------------*/
152 /** @defgroup SAI_Exported_Constants
156 #if defined(STM32F446xx)
157 #define IS_SAI_PERIPH(PERIPH) (((PERIPH) == SAI1) || (PERIPH) == SAI2)
159 #define IS_SAI_BLOCK_PERIPH(PERIPH) (((PERIPH) == SAI1_Block_A) || \
160 ((PERIPH) == SAI1_Block_B) || \
161 ((PERIPH) == SAI2_Block_A) || \
162 ((PERIPH) == SAI2_Block_B))
163 #endif /* STM32F446xx */
165 #if defined (STM32F40_41xxx) || defined (STM32F427_437xx) || defined (STM32F429_439xx) || defined (STM32F401xx) || defined (STM32F411xE) || defined (STM32F469_479xx)
167 #define IS_SAI_PERIPH(PERIPH) ((PERIPH) == SAI1)
169 #define IS_SAI_BLOCK_PERIPH(PERIPH) (((PERIPH) == SAI1_Block_A) || \
170 ((PERIPH) == SAI1_Block_B))
171 #endif /* STM32F40_41xxx || STM32F427_437xx || STM32F429_439xx || STM32F401xx || STM32F411xE || STM32F469_479xx */
173 /** @defgroup SAI_Block_Mode
176 #define SAI_Mode_MasterTx ((uint32_t)0x00000000)
177 #define SAI_Mode_MasterRx ((uint32_t)0x00000001)
178 #define SAI_Mode_SlaveTx ((uint32_t)0x00000002)
179 #define SAI_Mode_SlaveRx ((uint32_t)0x00000003)
180 #define IS_SAI_BLOCK_MODE(MODE) (((MODE) == SAI_Mode_MasterTx) || \
181 ((MODE) == SAI_Mode_MasterRx) || \
182 ((MODE) == SAI_Mode_SlaveTx) || \
183 ((MODE) == SAI_Mode_SlaveRx))
188 /** @defgroup SAI_Block_Protocol
192 #define SAI_Free_Protocol ((uint32_t)0x00000000)
193 #define SAI_SPDIF_Protocol ((uint32_t)SAI_xCR1_PRTCFG_0)
194 #define SAI_AC97_Protocol ((uint32_t)SAI_xCR1_PRTCFG_1)
195 #define IS_SAI_BLOCK_PROTOCOL(PROTOCOL) (((PROTOCOL) == SAI_Free_Protocol) || \
196 ((PROTOCOL) == SAI_SPDIF_Protocol) || \
197 ((PROTOCOL) == SAI_AC97_Protocol))
202 /** @defgroup SAI_Block_Data_Size
206 #define SAI_DataSize_8b ((uint32_t)0x00000040)
207 #define SAI_DataSize_10b ((uint32_t)0x00000060)
208 #define SAI_DataSize_16b ((uint32_t)0x00000080)
209 #define SAI_DataSize_20b ((uint32_t)0x000000A0)
210 #define SAI_DataSize_24b ((uint32_t)0x000000C0)
211 #define SAI_DataSize_32b ((uint32_t)0x000000E0)
212 #define IS_SAI_BLOCK_DATASIZE(DATASIZE) (((DATASIZE) == SAI_DataSize_8b) || \
213 ((DATASIZE) == SAI_DataSize_10b) || \
214 ((DATASIZE) == SAI_DataSize_16b) || \
215 ((DATASIZE) == SAI_DataSize_20b) || \
216 ((DATASIZE) == SAI_DataSize_24b) || \
217 ((DATASIZE) == SAI_DataSize_32b))
222 /** @defgroup SAI_Block_MSB_LSB_transmission
226 #define SAI_FirstBit_MSB ((uint32_t)0x00000000)
227 #define SAI_FirstBit_LSB ((uint32_t)SAI_xCR1_LSBFIRST)
228 #define IS_SAI_BLOCK_FIRST_BIT(BIT) (((BIT) == SAI_FirstBit_MSB) || \
229 ((BIT) == SAI_FirstBit_LSB))
234 /** @defgroup SAI_Block_Clock_Strobing
238 #define SAI_ClockStrobing_FallingEdge ((uint32_t)0x00000000)
239 #define SAI_ClockStrobing_RisingEdge ((uint32_t)SAI_xCR1_CKSTR)
240 #define IS_SAI_BLOCK_CLOCK_STROBING(CLOCK) (((CLOCK) == SAI_ClockStrobing_FallingEdge) || \
241 ((CLOCK) == SAI_ClockStrobing_RisingEdge))
246 /** @defgroup SAI_Block_Synchronization
250 #define SAI_Asynchronous ((uint32_t)0x00000000)
251 #define SAI_Synchronous ((uint32_t)SAI_xCR1_SYNCEN_0)
252 #define IS_SAI_BLOCK_SYNCHRO(SYNCHRO) (((SYNCHRO) == SAI_Synchronous) || \
253 ((SYNCHRO) == SAI_Asynchronous))
258 /** @defgroup SAI_Block_Output_Drive
262 #define SAI_OutputDrive_Disabled ((uint32_t)0x00000000)
263 #define SAI_OutputDrive_Enabled ((uint32_t)SAI_xCR1_OUTDRIV)
264 #define IS_SAI_BLOCK_OUTPUT_DRIVE(DRIVE) (((DRIVE) == SAI_OutputDrive_Disabled) || \
265 ((DRIVE) == SAI_OutputDrive_Enabled))
272 /** @defgroup SAI_Block_NoDivider
276 #define SAI_MasterDivider_Enabled ((uint32_t)0x00000000)
277 #define SAI_MasterDivider_Disabled ((uint32_t)SAI_xCR1_NODIV)
278 #define IS_SAI_BLOCK_NODIVIDER(NODIVIDER) (((NODIVIDER) == SAI_MasterDivider_Enabled) || \
279 ((NODIVIDER) == SAI_MasterDivider_Disabled))
285 /** @defgroup SAI_Block_Master_Divider
288 #define IS_SAI_BLOCK_MASTER_DIVIDER(DIVIDER) ((DIVIDER) <= 15)
294 /** @defgroup SAI_Block_Frame_Length
297 #define IS_SAI_BLOCK_FRAME_LENGTH(LENGTH) ((8 <= (LENGTH)) && ((LENGTH) <= 256))
303 /** @defgroup SAI_Block_Active_FrameLength
306 #define IS_SAI_BLOCK_ACTIVE_FRAME(LENGTH) ((1 <= (LENGTH)) && ((LENGTH) <= 128))
312 /** @defgroup SAI_Block_FS_Definition
316 #define SAI_FS_StartFrame ((uint32_t)0x00000000)
317 #define I2S_FS_ChannelIdentification ((uint32_t)SAI_xFRCR_FSDEF)
318 #define IS_SAI_BLOCK_FS_DEFINITION(DEFINITION) (((DEFINITION) == SAI_FS_StartFrame) || \
319 ((DEFINITION) == I2S_FS_ChannelIdentification))
324 /** @defgroup SAI_Block_FS_Polarity
328 #define SAI_FS_ActiveLow ((uint32_t)0x00000000)
329 #define SAI_FS_ActiveHigh ((uint32_t)SAI_xFRCR_FSPO)
330 #define IS_SAI_BLOCK_FS_POLARITY(POLARITY) (((POLARITY) == SAI_FS_ActiveLow) || \
331 ((POLARITY) == SAI_FS_ActiveHigh))
336 /** @defgroup SAI_Block_FS_Offset
340 #define SAI_FS_FirstBit ((uint32_t)0x00000000)
341 #define SAI_FS_BeforeFirstBit ((uint32_t)SAI_xFRCR_FSOFF)
342 #define IS_SAI_BLOCK_FS_OFFSET(OFFSET) (((OFFSET) == SAI_FS_FirstBit) || \
343 ((OFFSET) == SAI_FS_BeforeFirstBit))
348 /** @defgroup SAI_Block_Slot_FirstBit_Offset
351 #define IS_SAI_BLOCK_FIRSTBIT_OFFSET(OFFSET) ((OFFSET) <= 24)
357 /** @defgroup SAI_Block_Slot_Size
360 #define SAI_SlotSize_DataSize ((uint32_t)0x00000000)
361 #define SAI_SlotSize_16b ((uint32_t)SAI_xSLOTR_SLOTSZ_0)
362 #define SAI_SlotSize_32b ((uint32_t)SAI_xSLOTR_SLOTSZ_1)
363 #define IS_SAI_BLOCK_SLOT_SIZE(SIZE) (((SIZE) == SAI_SlotSize_DataSize) || \
364 ((SIZE) == SAI_SlotSize_16b) || \
365 ((SIZE) == SAI_SlotSize_32b))
371 /** @defgroup SAI_Block_Slot_Number
374 #define IS_SAI_BLOCK_SLOT_NUMBER(NUMBER) ((1 <= (NUMBER)) && ((NUMBER) <= 16))
380 /** @defgroup SAI_Block_Slot_Active
383 #define SAI_Slot_NotActive ((uint32_t)0x00000000)
384 #define SAI_SlotActive_0 ((uint32_t)0x00010000)
385 #define SAI_SlotActive_1 ((uint32_t)0x00020000)
386 #define SAI_SlotActive_2 ((uint32_t)0x00040000)
387 #define SAI_SlotActive_3 ((uint32_t)0x00080000)
388 #define SAI_SlotActive_4 ((uint32_t)0x00100000)
389 #define SAI_SlotActive_5 ((uint32_t)0x00200000)
390 #define SAI_SlotActive_6 ((uint32_t)0x00400000)
391 #define SAI_SlotActive_7 ((uint32_t)0x00800000)
392 #define SAI_SlotActive_8 ((uint32_t)0x01000000)
393 #define SAI_SlotActive_9 ((uint32_t)0x02000000)
394 #define SAI_SlotActive_10 ((uint32_t)0x04000000)
395 #define SAI_SlotActive_11 ((uint32_t)0x08000000)
396 #define SAI_SlotActive_12 ((uint32_t)0x10000000)
397 #define SAI_SlotActive_13 ((uint32_t)0x20000000)
398 #define SAI_SlotActive_14 ((uint32_t)0x40000000)
399 #define SAI_SlotActive_15 ((uint32_t)0x80000000)
400 #define SAI_SlotActive_ALL ((uint32_t)0xFFFF0000)
402 #define IS_SAI_SLOT_ACTIVE(ACTIVE) ((ACTIVE) != 0)
408 /** @defgroup SAI_Mono_Streo_Mode
412 #define SAI_MonoMode ((uint32_t)SAI_xCR1_MONO)
413 #define SAI_StreoMode ((uint32_t)0x00000000)
414 #define IS_SAI_BLOCK_MONO_STREO_MODE(MODE) (((MODE) == SAI_MonoMode) ||\
415 ((MODE) == SAI_StreoMode))
420 /** @defgroup SAI_TRIState_Management
424 #define SAI_Output_NotReleased ((uint32_t)0x00000000)
425 #define SAI_Output_Released ((uint32_t)SAI_xCR2_TRIS)
426 #define IS_SAI_BLOCK_TRISTATE_MANAGEMENT(STATE) (((STATE) == SAI_Output_NotReleased) ||\
427 ((STATE) == SAI_Output_Released))
432 /** @defgroup SAI_Block_Fifo_Threshold
436 #define SAI_Threshold_FIFOEmpty ((uint32_t)0x00000000)
437 #define SAI_FIFOThreshold_1QuarterFull ((uint32_t)0x00000001)
438 #define SAI_FIFOThreshold_HalfFull ((uint32_t)0x00000002)
439 #define SAI_FIFOThreshold_3QuartersFull ((uint32_t)0x00000003)
440 #define SAI_FIFOThreshold_Full ((uint32_t)0x00000004)
441 #define IS_SAI_BLOCK_FIFO_THRESHOLD(THRESHOLD) (((THRESHOLD) == SAI_Threshold_FIFOEmpty) || \
442 ((THRESHOLD) == SAI_FIFOThreshold_1QuarterFull) || \
443 ((THRESHOLD) == SAI_FIFOThreshold_HalfFull) || \
444 ((THRESHOLD) == SAI_FIFOThreshold_3QuartersFull) || \
445 ((THRESHOLD) == SAI_FIFOThreshold_Full))
450 /** @defgroup SAI_Block_Companding_Mode
454 #define SAI_NoCompanding ((uint32_t)0x00000000)
455 #define SAI_ULaw_1CPL_Companding ((uint32_t)0x00008000)
456 #define SAI_ALaw_1CPL_Companding ((uint32_t)0x0000C000)
457 #define SAI_ULaw_2CPL_Companding ((uint32_t)0x0000A000)
458 #define SAI_ALaw_2CPL_Companding ((uint32_t)0x0000E000)
459 #define IS_SAI_BLOCK_COMPANDING_MODE(MODE) (((MODE) == SAI_NoCompanding) || \
460 ((MODE) == SAI_ULaw_1CPL_Companding) || \
461 ((MODE) == SAI_ALaw_1CPL_Companding) || \
462 ((MODE) == SAI_ULaw_2CPL_Companding) || \
463 ((MODE) == SAI_ALaw_2CPL_Companding))
468 /** @defgroup SAI_Block_Mute_Value
472 #define SAI_ZeroValue ((uint32_t)0x00000000)
473 #define SAI_LastSentValue ((uint32_t)SAI_xCR2_MUTEVAL)
474 #define IS_SAI_BLOCK_MUTE_VALUE(VALUE) (((VALUE) == SAI_ZeroValue) || \
475 ((VALUE) == SAI_LastSentValue))
480 /** @defgroup SAI_Block_Mute_Frame_Counter
484 #define IS_SAI_BLOCK_MUTE_COUNTER(COUNTER) ((COUNTER) <= 63)
490 /** @defgroup SAI_Block_Interrupts_Definition
494 #define SAI_IT_OVRUDR ((uint32_t)SAI_xIMR_OVRUDRIE)
495 #define SAI_IT_MUTEDET ((uint32_t)SAI_xIMR_MUTEDETIE)
496 #define SAI_IT_WCKCFG ((uint32_t)SAI_xIMR_WCKCFGIE)
497 #define SAI_IT_FREQ ((uint32_t)SAI_xIMR_FREQIE)
498 #define SAI_IT_CNRDY ((uint32_t)SAI_xIMR_CNRDYIE)
499 #define SAI_IT_AFSDET ((uint32_t)SAI_xIMR_AFSDETIE)
500 #define SAI_IT_LFSDET ((uint32_t)SAI_xIMR_LFSDETIE)
502 #define IS_SAI_BLOCK_CONFIG_IT(IT) (((IT) == SAI_IT_OVRUDR) || \
503 ((IT) == SAI_IT_MUTEDET) || \
504 ((IT) == SAI_IT_WCKCFG) || \
505 ((IT) == SAI_IT_FREQ) || \
506 ((IT) == SAI_IT_CNRDY) || \
507 ((IT) == SAI_IT_AFSDET) || \
508 ((IT) == SAI_IT_LFSDET))
513 /** @defgroup SAI_Block_Flags_Definition
517 #define SAI_FLAG_OVRUDR ((uint32_t)SAI_xSR_OVRUDR)
518 #define SAI_FLAG_MUTEDET ((uint32_t)SAI_xSR_MUTEDET)
519 #define SAI_FLAG_WCKCFG ((uint32_t)SAI_xSR_WCKCFG)
520 #define SAI_FLAG_FREQ ((uint32_t)SAI_xSR_FREQ)
521 #define SAI_FLAG_CNRDY ((uint32_t)SAI_xSR_CNRDY)
522 #define SAI_FLAG_AFSDET ((uint32_t)SAI_xSR_AFSDET)
523 #define SAI_FLAG_LFSDET ((uint32_t)SAI_xSR_LFSDET)
525 #define IS_SAI_BLOCK_GET_FLAG(FLAG) (((FLAG) == SAI_FLAG_OVRUDR) || \
526 ((FLAG) == SAI_FLAG_MUTEDET) || \
527 ((FLAG) == SAI_FLAG_WCKCFG) || \
528 ((FLAG) == SAI_FLAG_FREQ) || \
529 ((FLAG) == SAI_FLAG_CNRDY) || \
530 ((FLAG) == SAI_FLAG_AFSDET) || \
531 ((FLAG) == SAI_FLAG_LFSDET))
533 #define IS_SAI_BLOCK_CLEAR_FLAG(FLAG) (((FLAG) == SAI_FLAG_OVRUDR) || \
534 ((FLAG) == SAI_FLAG_MUTEDET) || \
535 ((FLAG) == SAI_FLAG_WCKCFG) || \
536 ((FLAG) == SAI_FLAG_FREQ) || \
537 ((FLAG) == SAI_FLAG_CNRDY) || \
538 ((FLAG) == SAI_FLAG_AFSDET) || \
539 ((FLAG) == SAI_FLAG_LFSDET))
544 /** @defgroup SAI_Block_Fifo_Status_Level
547 #define SAI_FIFOStatus_Empty ((uint32_t)0x00000000)
548 #define SAI_FIFOStatus_Less1QuarterFull ((uint32_t)0x00010000)
549 #define SAI_FIFOStatus_1QuarterFull ((uint32_t)0x00020000)
550 #define SAI_FIFOStatus_HalfFull ((uint32_t)0x00030000)
551 #define SAI_FIFOStatus_3QuartersFull ((uint32_t)0x00040000)
552 #define SAI_FIFOStatus_Full ((uint32_t)0x00050000)
554 #define IS_SAI_BLOCK_FIFO_STATUS(STATUS) (((STATUS) == SAI_FIFOStatus_Less1QuarterFull ) || \
555 ((STATUS) == SAI_FIFOStatus_HalfFull) || \
556 ((STATUS) == SAI_FIFOStatus_1QuarterFull) || \
557 ((STATUS) == SAI_FIFOStatus_3QuartersFull) || \
558 ((STATUS) == SAI_FIFOStatus_Full) || \
559 ((STATUS) == SAI_FIFOStatus_Empty))
569 /* Exported macro ------------------------------------------------------------*/
570 /* Exported functions --------------------------------------------------------*/
572 /* Function used to set the SAI configuration to the default reset state *****/
573 void SAI_DeInit(SAI_TypeDef
* SAIx
);
575 /* Initialization and Configuration functions *********************************/
576 void SAI_Init(SAI_Block_TypeDef
* SAI_Block_x
, SAI_InitTypeDef
* SAI_InitStruct
);
577 void SAI_FrameInit(SAI_Block_TypeDef
* SAI_Block_x
, SAI_FrameInitTypeDef
* SAI_FrameInitStruct
);
578 void SAI_SlotInit(SAI_Block_TypeDef
* SAI_Block_x
, SAI_SlotInitTypeDef
* SAI_SlotInitStruct
);
579 void SAI_StructInit(SAI_InitTypeDef
* SAI_InitStruct
);
580 void SAI_FrameStructInit(SAI_FrameInitTypeDef
* SAI_FrameInitStruct
);
581 void SAI_SlotStructInit(SAI_SlotInitTypeDef
* SAI_SlotInitStruct
);
583 void SAI_Cmd(SAI_Block_TypeDef
* SAI_Block_x
, FunctionalState NewState
);
584 void SAI_MonoModeConfig(SAI_Block_TypeDef
* SAI_Block_x
, uint32_t SAI_Mono_StreoMode
);
585 void SAI_TRIStateConfig(SAI_Block_TypeDef
* SAI_Block_x
, uint32_t SAI_TRIState
);
586 void SAI_CompandingModeConfig(SAI_Block_TypeDef
* SAI_Block_x
, uint32_t SAI_CompandingMode
);
587 void SAI_MuteModeCmd(SAI_Block_TypeDef
* SAI_Block_x
, FunctionalState NewState
);
588 void SAI_MuteValueConfig(SAI_Block_TypeDef
* SAI_Block_x
, uint32_t SAI_MuteValue
);
589 void SAI_MuteFrameCounterConfig(SAI_Block_TypeDef
* SAI_Block_x
, uint32_t SAI_MuteCounter
);
590 void SAI_FlushFIFO(SAI_Block_TypeDef
* SAI_Block_x
);
592 /* Data transfers functions ***************************************************/
593 void SAI_SendData(SAI_Block_TypeDef
* SAI_Block_x
, uint32_t Data
);
594 uint32_t SAI_ReceiveData(SAI_Block_TypeDef
* SAI_Block_x
);
596 /* DMA transfers management functions *****************************************/
597 void SAI_DMACmd(SAI_Block_TypeDef
* SAI_Block_x
, FunctionalState NewState
);
599 /* Interrupts and flags management functions **********************************/
600 void SAI_ITConfig(SAI_Block_TypeDef
* SAI_Block_x
, uint32_t SAI_IT
, FunctionalState NewState
);
601 FlagStatus
SAI_GetFlagStatus(SAI_Block_TypeDef
* SAI_Block_x
, uint32_t SAI_FLAG
);
602 void SAI_ClearFlag(SAI_Block_TypeDef
* SAI_Block_x
, uint32_t SAI_FLAG
);
603 ITStatus
SAI_GetITStatus(SAI_Block_TypeDef
* SAI_Block_x
, uint32_t SAI_IT
);
604 void SAI_ClearITPendingBit(SAI_Block_TypeDef
* SAI_Block_x
, uint32_t SAI_IT
);
605 FunctionalState
SAI_GetCmdStatus(SAI_Block_TypeDef
* SAI_Block_x
);
606 uint32_t SAI_GetFIFOStatus(SAI_Block_TypeDef
* SAI_Block_x
);
608 #endif /* STM32F40_41xxx || STM32F427_437xx || STM32F429_439xx || STM32F401xx || STM32F411xE || STM32F446xx || STM32F469_479xx */
621 #endif /*__STM32F4xx_SAI_H */
623 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/