annotate Common/Drivers/STM32F4xx_HAL_DRIVER_v120/Inc/stm32f4xx_hal_sai.h @ 56:bab006305b58

language updates
author heinrichsweikamp
date Tue, 07 Aug 2018 17:03:36 +0200
parents 5f11787b4f42
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
1 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
2 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
3 * @file stm32f4xx_hal_sai.h
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
4 * @author MCD Application Team
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
5 * @version V1.2.0
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
6 * @date 26-December-2014
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
7 * @brief Header file of SAI HAL module.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
8 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
9 * @attention
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
10 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
12 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
13 * Redistribution and use in source and binary forms, with or without modification,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
14 * are permitted provided that the following conditions are met:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
15 * 1. Redistributions of source code must retain the above copyright notice,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
16 * this list of conditions and the following disclaimer.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
18 * this list of conditions and the following disclaimer in the documentation
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
19 * and/or other materials provided with the distribution.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
21 * may be used to endorse or promote products derived from this software
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
22 * without specific prior written permission.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
23 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
34 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
35 ******************************************************************************
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
36 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
37
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
38 /* Define to prevent recursive inclusion -------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
39 #ifndef __STM32F4xx_HAL_SAI_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
40 #define __STM32F4xx_HAL_SAI_H
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
41
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
42 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
43 extern "C" {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
44 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
45
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
46 /* Includes ------------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
47 #include "stm32f4xx_hal_def.h"
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
48
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
49 /** @addtogroup STM32F4xx_HAL_Driver
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
50 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
51 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
52 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
53
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
54 /** @addtogroup SAI
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
55 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
56 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
57
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
58 /* Exported types ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
59 /** @defgroup SAI_Exported_Types SAI Exported Types
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
60 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
61 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
62
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
63 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
64 * @brief HAL State structures definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
65 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
66 typedef enum
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
67 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
68 HAL_SAI_STATE_RESET = 0x00, /*!< SAI not yet initialized or disabled */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
69 HAL_SAI_STATE_READY = 0x01, /*!< SAI initialized and ready for use */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
70 HAL_SAI_STATE_BUSY = 0x02, /*!< SAI internal process is ongoing */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
71 HAL_SAI_STATE_BUSY_TX = 0x12, /*!< Data transmission process is ongoing */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
72 HAL_SAI_STATE_BUSY_RX = 0x22, /*!< Data reception process is ongoing */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
73 HAL_SAI_STATE_TIMEOUT = 0x03, /*!< SAI timeout state */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
74 HAL_SAI_STATE_ERROR = 0x04 /*!< SAI error state */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
75
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
76 }HAL_SAI_StateTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
77
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
78 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
79 * @brief SAI Init Structure definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
80 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
81 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
82 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
83 uint32_t Protocol; /*!< Specifies the SAI Block protocol.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
84 This parameter can be a value of @ref SAI_Block_Protocol */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
85
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
86 uint32_t AudioMode; /*!< Specifies the SAI Block audio Mode.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
87 This parameter can be a value of @ref SAI_Block_Mode */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
88
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
89 uint32_t DataSize; /*!< Specifies the SAI Block data size.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
90 This parameter can be a value of @ref SAI_Block_Data_Size */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
91
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
92 uint32_t FirstBit; /*!< Specifies whether data transfers start from MSB or LSB bit.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
93 This parameter can be a value of @ref SAI_Block_MSB_LSB_transmission */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
94
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
95 uint32_t ClockStrobing; /*!< Specifies the SAI Block clock strobing edge sensitivity.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
96 This parameter can be a value of @ref SAI_Block_Clock_Strobing */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
97
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
98 uint32_t Synchro; /*!< Specifies SAI Block synchronization
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
99 This parameter can be a value of @ref SAI_Block_Synchronization */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
100
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
101 uint32_t OutputDrive; /*!< Specifies when SAI Block outputs are driven.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
102 This parameter can be a value of @ref SAI_Block_Output_Drive
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
103 @note this value has to be set before enabling the audio block
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
104 but after the audio block configuration. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
105
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
106 uint32_t NoDivider; /*!< Specifies whether master clock will be divided or not.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
107 This parameter can be a value of @ref SAI_Block_NoDivider
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
108 @note: If bit NODIV in the SAI_xCR1 register is cleared, the frame length
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
109 should be aligned to a number equal to a power of 2, from 8 to 256.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
110 If bit NODIV in the SAI_xCR1 register is set, the frame length can
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
111 take any of the values without constraint since the input clock of
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
112 the audio block should be equal to the bit clock.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
113 There is no MCLK_x clock which can be output. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
114
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
115 uint32_t FIFOThreshold; /*!< Specifies SAI Block FIFO threshold.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
116 This parameter can be a value of @ref SAI_Block_Fifo_Threshold */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
117
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
118 uint32_t ClockSource; /*!< Specifies the SAI Block x Clock source.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
119 This parameter can be a value of @ref SAI_Clock_Source
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
120 @note: If ClockSource is equal to SAI_CLKSource_Ext, the PLLI2S
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
121 and PLLSAI divisions factors will be ignored. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
122
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
123 uint32_t AudioFrequency; /*!< Specifies the audio frequency sampling.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
124 This parameter can be a value of @ref SAI_Audio_Frequency */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
125
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
126 }SAI_InitTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
127
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
128 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
129 * @brief SAI Block Frame Init structure definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
130 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
131
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
132 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
133 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
134
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
135 uint32_t FrameLength; /*!< Specifies the Frame length, the number of SCK clocks for each audio frame.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
136 This parameter must be a number between Min_Data = 8 and Max_Data = 256.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
137 @note: If master clock MCLK_x pin is declared as an output, the frame length
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
138 should be aligned to a number equal to power of 2 in order to keep
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
139 in an audio frame, an integer number of MCLK pulses by bit Clock. */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
140
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
141 uint32_t ActiveFrameLength; /*!< Specifies the Frame synchronization active level length.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
142 This Parameter specifies the length in number of bit clock (SCK + 1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
143 of the active level of FS signal in audio frame.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
144 This parameter must be a number between Min_Data = 1 and Max_Data = 128 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
145
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
146 uint32_t FSDefinition; /*!< Specifies the Frame synchronization definition.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
147 This parameter can be a value of @ref SAI_Block_FS_Definition */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
148
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
149 uint32_t FSPolarity; /*!< Specifies the Frame synchronization Polarity.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
150 This parameter can be a value of @ref SAI_Block_FS_Polarity */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
151
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
152 uint32_t FSOffset; /*!< Specifies the Frame synchronization Offset.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
153 This parameter can be a value of @ref SAI_Block_FS_Offset */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
154
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
155 }SAI_FrameInitTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
156
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
157 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
158 * @brief SAI Block Slot Init Structure definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
159 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
160
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
161 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
162 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
163 uint32_t FirstBitOffset; /*!< Specifies the position of first data transfer bit in the slot.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
164 This parameter must be a number between Min_Data = 0 and Max_Data = 24 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
165
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
166 uint32_t SlotSize; /*!< Specifies the Slot Size.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
167 This parameter can be a value of @ref SAI_Block_Slot_Size */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
168
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
169 uint32_t SlotNumber; /*!< Specifies the number of slot in the audio frame.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
170 This parameter must be a number between Min_Data = 1 and Max_Data = 16 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
171
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
172 uint32_t SlotActive; /*!< Specifies the slots in audio frame that will be activated.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
173 This parameter can be a value of @ref SAI_Block_Slot_Active */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
174 }SAI_SlotInitTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
175
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
176 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
177 * @brief SAI handle Structure definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
178 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
179 typedef struct
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
180 {
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
181 SAI_Block_TypeDef *Instance; /*!< SAI Blockx registers base address */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
182
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
183 SAI_InitTypeDef Init; /*!< SAI communication parameters */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
184
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
185 SAI_FrameInitTypeDef FrameInit; /*!< SAI Frame configuration parameters */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
186
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
187 SAI_SlotInitTypeDef SlotInit; /*!< SAI Slot configuration parameters */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
188
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
189 uint16_t *pTxBuffPtr; /*!< Pointer to SAI Tx transfer Buffer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
190
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
191 uint16_t TxXferSize; /*!< SAI Tx transfer size */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
192
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
193 uint16_t TxXferCount; /*!< SAI Tx transfer counter */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
194
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
195 uint16_t *pRxBuffPtr; /*!< Pointer to SAI Rx transfer buffer */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
196
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
197 uint16_t RxXferSize; /*!< SAI Rx transfer size */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
198
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
199 uint16_t RxXferCount; /*!< SAI Rx transfer counter */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
200
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
201 DMA_HandleTypeDef *hdmatx; /*!< SAI Tx DMA handle parameters */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
202
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
203 DMA_HandleTypeDef *hdmarx; /*!< SAI Rx DMA handle parameters */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
204
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
205 HAL_LockTypeDef Lock; /*!< SAI locking object */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
206
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
207 __IO HAL_SAI_StateTypeDef State; /*!< SAI communication state */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
208
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
209 __IO uint32_t ErrorCode; /*!< SAI Error code */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
210 }SAI_HandleTypeDef;
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
211
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
212 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
213 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
214 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
215
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
216 /* Exported constants --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
217
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
218 /** @defgroup SAI_Exported_Constants SAI Exported Constants
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
219 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
220 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
221
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
222 /** @defgroup SAI_Error_Code SAI Error Code
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
223 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
224 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
225 #define HAL_SAI_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
226 #define HAL_SAI_ERROR_OVR ((uint32_t)0x00000001) /*!< Overrun Error */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
227 #define HAL_SAI_ERROR_UDR ((uint32_t)0x00000002) /*!< Underrun error */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
228 #define HAL_SAI_ERROR_TIMEOUT ((uint32_t)0x00000020) /*!< Timeout error */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
229 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
230 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
231 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
232
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
233 /** @defgroup SAI_Clock_Source SAI Clock Source
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
234 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
235 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
236 #define SAI_CLKSOURCE_PLLSAI ((uint32_t)RCC_SAIACLKSOURCE_PLLSAI)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
237 #define SAI_CLKSOURCE_PLLI2S ((uint32_t)RCC_SAIACLKSOURCE_PLLI2S)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
238 #define SAI_CLKSOURCE_EXT ((uint32_t)RCC_SAIACLKSOURCE_EXT)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
239
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
240 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
241 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
242 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
243
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
244 /** @defgroup SAI_Audio_Frequency SAI Audio Frequency
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
245 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
246 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
247 #define SAI_AUDIO_FREQUENCY_192K ((uint32_t)192000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
248 #define SAI_AUDIO_FREQUENCY_96K ((uint32_t)96000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
249 #define SAI_AUDIO_FREQUENCY_48K ((uint32_t)48000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
250 #define SAI_AUDIO_FREQUENCY_44K ((uint32_t)44100)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
251 #define SAI_AUDIO_FREQUENCY_32K ((uint32_t)32000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
252 #define SAI_AUDIO_FREQUENCY_22K ((uint32_t)22050)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
253 #define SAI_AUDIO_FREQUENCY_16K ((uint32_t)16000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
254 #define SAI_AUDIO_FREQUENCY_11K ((uint32_t)11025)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
255 #define SAI_AUDIO_FREQUENCY_8K ((uint32_t)8000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
256
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
257 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
258 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
259 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
260
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
261 /** @defgroup SAI_Block_Mode SAI Block Mode
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
262 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
263 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
264 #define SAI_MODEMASTER_TX ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
265 #define SAI_MODEMASTER_RX ((uint32_t)0x00000001)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
266 #define SAI_MODESLAVE_TX ((uint32_t)0x00000002)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
267 #define SAI_MODESLAVE_RX ((uint32_t)0x00000003)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
268
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
269 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
270 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
271 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
272
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
273 /** @defgroup SAI_Block_Protocol SAI Block Protocol
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
274 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
275 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
276 #define SAI_FREE_PROTOCOL ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
277 #define SAI_AC97_PROTOCOL ((uint32_t)SAI_xCR1_PRTCFG_1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
278
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
279 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
280 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
281 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
282
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
283 /** @defgroup SAI_Block_Data_Size SAI Block Data Size
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
284 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
285 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
286 #define SAI_DATASIZE_8 ((uint32_t)0x00000040)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
287 #define SAI_DATASIZE_10 ((uint32_t)0x00000060)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
288 #define SAI_DATASIZE_16 ((uint32_t)0x00000080)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
289 #define SAI_DATASIZE_20 ((uint32_t)0x000000A0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
290 #define SAI_DATASIZE_24 ((uint32_t)0x000000C0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
291 #define SAI_DATASIZE_32 ((uint32_t)0x000000E0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
292
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
293 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
294 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
295 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
296
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
297 /** @defgroup SAI_Block_MSB_LSB_transmission SAI Block MSB LSB transmission
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
298 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
299 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
300 #define SAI_FIRSTBIT_MSB ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
301 #define SAI_FIRSTBIT_LSB ((uint32_t)SAI_xCR1_LSBFIRST)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
302
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
303 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
304 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
305 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
306
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
307 /** @defgroup SAI_Block_Clock_Strobing SAI Block Clock Strobing
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
308 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
309 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
310 #define SAI_CLOCKSTROBING_FALLINGEDGE ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
311 #define SAI_CLOCKSTROBING_RISINGEDGE ((uint32_t)SAI_xCR1_CKSTR)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
312
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
313 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
314 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
315 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
316
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
317 /** @defgroup SAI_Block_Synchronization SAI Block Synchronization
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
318 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
319 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
320 #define SAI_ASYNCHRONOUS ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
321 #define SAI_SYNCHRONOUS ((uint32_t)SAI_xCR1_SYNCEN_0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
322
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
323 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
324 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
325 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
326
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
327 /** @defgroup SAI_Block_Output_Drive SAI Block Output Drive
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
328 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
329 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
330 #define SAI_OUTPUTDRIVE_DISABLE ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
331 #define SAI_OUTPUTDRIVE_ENABLE ((uint32_t)SAI_xCR1_OUTDRIV)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
332
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
333 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
334 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
335 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
336
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
337 /** @defgroup SAI_Block_NoDivider SAI Block NoDivider
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
338 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
339 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
340 #define SAI_MASTERDIVIDER_ENABLE ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
341 #define SAI_MASTERDIVIDER_DISABLE ((uint32_t)SAI_xCR1_NODIV)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
342
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
343 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
344 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
345 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
346
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
347
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
348 /** @defgroup SAI_Block_FS_Definition SAI Block FS Definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
349 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
350 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
351 #define SAI_FS_STARTFRAME ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
352 #define SAI_FS_CHANNEL_IDENTIFICATION ((uint32_t)SAI_xFRCR_FSDEF)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
353
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
354 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
355 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
356 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
357
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
358 /** @defgroup SAI_Block_FS_Polarity SAI Block FS Polarity
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
359 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
360 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
361 #define SAI_FS_ACTIVE_LOW ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
362 #define SAI_FS_ACTIVE_HIGH ((uint32_t)SAI_xFRCR_FSPO)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
363
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
364 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
365 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
366 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
367
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
368 /** @defgroup SAI_Block_FS_Offset SAI Block FS Offset
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
369 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
370 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
371 #define SAI_FS_FIRSTBIT ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
372 #define SAI_FS_BEFOREFIRSTBIT ((uint32_t)SAI_xFRCR_FSOFF)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
373
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
374 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
375 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
376 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
377
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
378
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
379 /** @defgroup SAI_Block_Slot_Size SAI Block Slot Size
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
380 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
381 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
382 #define SAI_SLOTSIZE_DATASIZE ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
383 #define SAI_SLOTSIZE_16B ((uint32_t)SAI_xSLOTR_SLOTSZ_0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
384 #define SAI_SLOTSIZE_32B ((uint32_t)SAI_xSLOTR_SLOTSZ_1)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
385 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
386 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
387 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
388
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
389 /** @defgroup SAI_Block_Slot_Active SAI Block Slot Active
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
390 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
391 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
392 #define SAI_SLOT_NOTACTIVE ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
393 #define SAI_SLOTACTIVE_0 ((uint32_t)0x00010000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
394 #define SAI_SLOTACTIVE_1 ((uint32_t)0x00020000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
395 #define SAI_SLOTACTIVE_2 ((uint32_t)0x00040000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
396 #define SAI_SLOTACTIVE_3 ((uint32_t)0x00080000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
397 #define SAI_SLOTACTIVE_4 ((uint32_t)0x00100000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
398 #define SAI_SLOTACTIVE_5 ((uint32_t)0x00200000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
399 #define SAI_SLOTACTIVE_6 ((uint32_t)0x00400000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
400 #define SAI_SLOTACTIVE_7 ((uint32_t)0x00800000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
401 #define SAI_SLOTACTIVE_8 ((uint32_t)0x01000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
402 #define SAI_SLOTACTIVE_9 ((uint32_t)0x02000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
403 #define SAI_SLOTACTIVE_10 ((uint32_t)0x04000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
404 #define SAI_SLOTACTIVE_11 ((uint32_t)0x08000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
405 #define SAI_SLOTACTIVE_12 ((uint32_t)0x10000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
406 #define SAI_SLOTACTIVE_13 ((uint32_t)0x20000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
407 #define SAI_SLOTACTIVE_14 ((uint32_t)0x40000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
408 #define SAI_SLOTACTIVE_15 ((uint32_t)0x80000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
409 #define SAI_SLOTACTIVE_ALL ((uint32_t)0xFFFF0000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
410
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
411 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
412 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
413 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
414
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
415 /** @defgroup SAI_Mono_Stereo_Mode SAI Mono Stereo Mode
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
416 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
417 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
418 #define SAI_MONOMODE ((uint32_t)SAI_xCR1_MONO)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
419 #define SAI_STEREOMODE ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
420
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
421 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
422 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
423 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
424
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
425 /** @defgroup SAI_TRIState_Management SAI TRIState Management
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
426 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
427 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
428 #define SAI_OUTPUT_NOTRELEASED ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
429 #define SAI_OUTPUT_RELEASED ((uint32_t)SAI_xCR2_TRIS)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
430
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
431 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
432 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
433 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
434
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
435 /** @defgroup SAI_Block_Fifo_Threshold SAI Block Fifo Threshold
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
436 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
437 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
438 #define SAI_FIFOTHRESHOLD_EMPTY ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
439 #define SAI_FIFOTHRESHOLD_1QF ((uint32_t)0x00000001)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
440 #define SAI_FIFOTHRESHOLD_HF ((uint32_t)0x00000002)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
441 #define SAI_FIFOTHRESHOLD_3QF ((uint32_t)0x00000003)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
442 #define SAI_FIFOTHRESHOLD_FULL ((uint32_t)0x00000004)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
443
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
444 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
445 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
446 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
447
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
448 /** @defgroup SAI_Block_Companding_Mode SAI Block Companding Mode
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
449 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
450 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
451 #define SAI_NOCOMPANDING ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
452 #define SAI_ULAW_1CPL_COMPANDING ((uint32_t)0x00008000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
453 #define SAI_ALAW_1CPL_COMPANDING ((uint32_t)0x0000C000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
454 #define SAI_ULAW_2CPL_COMPANDING ((uint32_t)0x0000A000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
455 #define SAI_ALAW_2CPL_COMPANDING ((uint32_t)0x0000E000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
456
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
457 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
458 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
459 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
460
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
461 /** @defgroup SAI_Block_Mute_Value SAI Block Mute Value
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
462 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
463 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
464 #define SAI_ZERO_VALUE ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
465 #define SAI_LAST_SENT_VALUE ((uint32_t)SAI_xCR2_MUTEVAL)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
466
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
467 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
468 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
469 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
470
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
471
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
472 /** @defgroup SAI_Block_Interrupts_Definition SAI Block Interrupts Definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
473 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
474 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
475 #define SAI_IT_OVRUDR ((uint32_t)SAI_xIMR_OVRUDRIE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
476 #define SAI_IT_MUTEDET ((uint32_t)SAI_xIMR_MUTEDETIE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
477 #define SAI_IT_WCKCFG ((uint32_t)SAI_xIMR_WCKCFGIE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
478 #define SAI_IT_FREQ ((uint32_t)SAI_xIMR_FREQIE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
479 #define SAI_IT_CNRDY ((uint32_t)SAI_xIMR_CNRDYIE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
480 #define SAI_IT_AFSDET ((uint32_t)SAI_xIMR_AFSDETIE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
481 #define SAI_IT_LFSDET ((uint32_t)SAI_xIMR_LFSDETIE)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
482
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
483 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
484 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
485 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
486
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
487 /** @defgroup SAI_Block_Flags_Definition SAI Block Flags Definition
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
488 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
489 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
490 #define SAI_FLAG_OVRUDR ((uint32_t)SAI_xSR_OVRUDR)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
491 #define SAI_FLAG_MUTEDET ((uint32_t)SAI_xSR_MUTEDET)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
492 #define SAI_FLAG_WCKCFG ((uint32_t)SAI_xSR_WCKCFG)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
493 #define SAI_FLAG_FREQ ((uint32_t)SAI_xSR_FREQ)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
494 #define SAI_FLAG_CNRDY ((uint32_t)SAI_xSR_CNRDY)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
495 #define SAI_FLAG_AFSDET ((uint32_t)SAI_xSR_AFSDET)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
496 #define SAI_FLAG_LFSDET ((uint32_t)SAI_xSR_LFSDET)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
497
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
498 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
499 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
500 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
501
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
502 /** @defgroup SAI_Block_Fifo_Status_Level SAI Block Fifo Status Level
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
503 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
504 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
505 #define SAI_FIFOSTATUS_EMPTY ((uint32_t)0x00000000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
506 #define SAI_FIFOSTATUS_LESS1QUARTERFULL ((uint32_t)0x00010000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
507 #define SAI_FIFOSTATUS_1QUARTERFULL ((uint32_t)0x00020000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
508 #define SAI_FIFOSTATUS_HALFFULL ((uint32_t)0x00030000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
509 #define SAI_FIFOSTATUS_3QUARTERFULL ((uint32_t)0x00040000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
510 #define SAI_FIFOSTATUS_FULL ((uint32_t)0x00050000)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
511
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
512 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
513 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
514 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
515
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
516 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
517 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
518 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
519
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
520 /* Exported macro ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
521
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
522 /** @defgroup SAI_Exported_Macros SAI Exported Macros
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
523 * @brief macros to handle interrupts and specific configurations
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
524 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
525 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
526
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
527 /** @brief Reset SAI handle state
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
528 * @param __HANDLE__: specifies the SAI Handle.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
529 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
530 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
531 #define __HAL_SAI_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_SAI_STATE_RESET)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
532
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
533 /** @brief Enable or disable the specified SAI interrupts.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
534 * @param __HANDLE__: specifies the SAI Handle.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
535 * @param __INTERRUPT__: specifies the interrupt source to enable or disable.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
536 * This parameter can be one of the following values:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
537 * @arg SAI_IT_OVRUDR: Overrun underrun interrupt enable
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
538 * @arg SAI_IT_MUTEDET: Mute detection interrupt enable
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
539 * @arg SAI_IT_WCKCFG: Wrong Clock Configuration interrupt enable
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
540 * @arg SAI_IT_FREQ: FIFO request interrupt enable
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
541 * @arg SAI_IT_CNRDY: Codec not ready interrupt enable
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
542 * @arg SAI_IT_AFSDET: Anticipated frame synchronization detection interrupt enable
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
543 * @arg SAI_IT_LFSDET: Late frame synchronization detection interrupt enable
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
544 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
545 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
546
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
547 #define __HAL_SAI_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IMR |= (__INTERRUPT__))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
548 #define __HAL_SAI_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->IMR &= (~(__INTERRUPT__)))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
549
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
550 /** @brief Check if the specified SAI interrupt source is enabled or disabled.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
551 * @param __HANDLE__: specifies the SAI Handle.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
552 * This parameter can be SAI where x: 1, 2, or 3 to select the SAI peripheral.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
553 * @param __INTERRUPT__: specifies the SAI interrupt source to check.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
554 * This parameter can be one of the following values:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
555 * @arg SAI_IT_TXE: Tx buffer empty interrupt enable.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
556 * @arg SAI_IT_RXNE: Rx buffer not empty interrupt enable.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
557 * @arg SAI_IT_ERR: Error interrupt enable.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
558 * @retval The new state of __INTERRUPT__ (TRUE or FALSE).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
559 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
560 #define __HAL_SAI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->IMR & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
561
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
562 /** @brief Check whether the specified SAI flag is set or not.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
563 * @param __HANDLE__: specifies the SAI Handle.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
564 * @param __FLAG__: specifies the flag to check.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
565 * This parameter can be one of the following values:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
566 * @arg SAI_FLAG_OVRUDR: Overrun underrun flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
567 * @arg SAI_FLAG_MUTEDET: Mute detection flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
568 * @arg SAI_FLAG_WCKCFG: Wrong Clock Configuration flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
569 * @arg SAI_FLAG_FREQ: FIFO request flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
570 * @arg SAI_FLAG_CNRDY: Codec not ready flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
571 * @arg SAI_FLAG_AFSDET: Anticipated frame synchronization detection flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
572 * @arg SAI_FLAG_LFSDET: Late frame synchronization detection flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
573 * @retval The new state of __FLAG__ (TRUE or FALSE).
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
574 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
575 #define __HAL_SAI_GET_FLAG(__HANDLE__, __FLAG__) ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
576
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
577 /** @brief Clears the specified SAI pending flag.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
578 * @param __HANDLE__: specifies the SAI Handle.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
579 * @param __FLAG__: specifies the flag to check.
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
580 * This parameter can be any combination of the following values:
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
581 * @arg SAI_FLAG_OVRUDR: Clear Overrun underrun
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
582 * @arg SAI_FLAG_MUTEDET: Clear Mute detection
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
583 * @arg SAI_FLAG_WCKCFG: Clear Wrong Clock Configuration
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
584 * @arg SAI_FLAG_FREQ: Clear FIFO request
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
585 * @arg SAI_FLAG_CNRDY: Clear Codec not ready
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
586 * @arg SAI_FLAG_AFSDET: Clear Anticipated frame synchronization detection
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
587 * @arg SAI_FLAG_LFSDET: Clear Late frame synchronization detection
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
588 *
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
589 * @retval None
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
590 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
591 #define __HAL_SAI_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->CLRFR = (__FLAG__))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
592
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
593 #define __HAL_SAI_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 |= SAI_xCR1_SAIEN)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
594 #define __HAL_SAI_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~SAI_xCR1_SAIEN)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
595
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
596 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
597 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
598 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
599
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
600 /* Exported functions --------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
601
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
602 /** @addtogroup SAI_Exported_Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
603 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
604 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
605
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
606 /* Initialization/de-initialization functions **********************************/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
607 /** @addtogroup SAI_Exported_Functions_Group1
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
608 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
609 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
610 HAL_StatusTypeDef HAL_SAI_Init(SAI_HandleTypeDef *hsai);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
611 HAL_StatusTypeDef HAL_SAI_DeInit (SAI_HandleTypeDef *hsai);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
612 void HAL_SAI_MspInit(SAI_HandleTypeDef *hsai);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
613 void HAL_SAI_MspDeInit(SAI_HandleTypeDef *hsai);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
614
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
615 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
616 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
617 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
618
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
619 /* I/O operation functions *****************************************************/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
620 /** @addtogroup SAI_Exported_Functions_Group2
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
621 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
622 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
623 /* Blocking mode: Polling */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
624 HAL_StatusTypeDef HAL_SAI_Transmit(SAI_HandleTypeDef *hsai, uint16_t *pData, uint16_t Size, uint32_t Timeout);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
625 HAL_StatusTypeDef HAL_SAI_Receive(SAI_HandleTypeDef *hsai, uint16_t *pData, uint16_t Size, uint32_t Timeout);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
626
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
627 /* Non-Blocking mode: Interrupt */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
628 HAL_StatusTypeDef HAL_SAI_Transmit_IT(SAI_HandleTypeDef *hsai, uint16_t *pData, uint16_t Size);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
629 HAL_StatusTypeDef HAL_SAI_Receive_IT(SAI_HandleTypeDef *hsai, uint16_t *pData, uint16_t Size);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
630
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
631 /* Non-Blocking mode: DMA */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
632 HAL_StatusTypeDef HAL_SAI_Transmit_DMA(SAI_HandleTypeDef *hsai, uint16_t *pData, uint16_t Size);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
633 HAL_StatusTypeDef HAL_SAI_Receive_DMA(SAI_HandleTypeDef *hsai, uint16_t *pData, uint16_t Size);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
634 HAL_StatusTypeDef HAL_SAI_DMAPause(SAI_HandleTypeDef *hsai);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
635 HAL_StatusTypeDef HAL_SAI_DMAResume(SAI_HandleTypeDef *hsai);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
636 HAL_StatusTypeDef HAL_SAI_DMAStop(SAI_HandleTypeDef *hsai);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
637
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
638 /* SAI IRQHandler and Callbacks used in non blocking modes (Interrupt and DMA) */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
639 void HAL_SAI_IRQHandler(SAI_HandleTypeDef *hsai);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
640 void HAL_SAI_TxHalfCpltCallback(SAI_HandleTypeDef *hsai);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
641 void HAL_SAI_TxCpltCallback(SAI_HandleTypeDef *hsai);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
642 void HAL_SAI_RxHalfCpltCallback(SAI_HandleTypeDef *hsai);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
643 void HAL_SAI_RxCpltCallback(SAI_HandleTypeDef *hsai);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
644 void HAL_SAI_ErrorCallback(SAI_HandleTypeDef *hsai);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
645 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
646 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
647 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
648
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
649 /** @addtogroup SAI_Exported_Functions_Group3
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
650 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
651 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
652 /* Peripheral State functions **************************************************/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
653 HAL_SAI_StateTypeDef HAL_SAI_GetState(SAI_HandleTypeDef *hsai);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
654 uint32_t HAL_SAI_GetError(SAI_HandleTypeDef *hsai);
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
655 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
656 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
657 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
658
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
659 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
660 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
661 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
662
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
663 /* Private types -------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
664 /** @defgroup SAI_Private_Types SAI Private Types
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
665 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
666 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
667
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
668 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
669 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
670 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
671
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
672 /* Private variables ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
673 /** @defgroup SAI_Private_Variables SAI Private Variables
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
674 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
675 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
676
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
677 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
678 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
679 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
680
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
681 /* Private constants ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
682 /** @defgroup SAI_Private_Constants SAI Private Constants
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
683 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
684 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
685
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
686 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
687 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
688 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
689
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
690 /* Private macros ------------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
691 /** @addtogroup SAI_Private_Macros
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
692 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
693 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
694 #define IS_SAI_CLK_SOURCE(SOURCE) (((SOURCE) == SAI_CLKSOURCE_PLLSAI) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
695 ((SOURCE) == SAI_CLKSOURCE_PLLI2S) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
696 ((SOURCE) == SAI_CLKSOURCE_EXT))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
697
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
698 #define IS_SAI_AUDIO_FREQUENCY(AUDIO) (((AUDIO) == SAI_AUDIO_FREQUENCY_192K) || ((AUDIO) == SAI_AUDIO_FREQUENCY_96K) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
699 ((AUDIO) == SAI_AUDIO_FREQUENCY_48K) || ((AUDIO) == SAI_AUDIO_FREQUENCY_44K) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
700 ((AUDIO) == SAI_AUDIO_FREQUENCY_32K) || ((AUDIO) == SAI_AUDIO_FREQUENCY_22K) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
701 ((AUDIO) == SAI_AUDIO_FREQUENCY_16K) || ((AUDIO) == SAI_AUDIO_FREQUENCY_11K) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
702 ((AUDIO) == SAI_AUDIO_FREQUENCY_8K))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
703
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
704 #define IS_SAI_BLOCK_MODE(MODE) (((MODE) == SAI_MODEMASTER_TX) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
705 ((MODE) == SAI_MODEMASTER_RX) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
706 ((MODE) == SAI_MODESLAVE_TX) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
707 ((MODE) == SAI_MODESLAVE_RX))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
708
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
709 #define IS_SAI_BLOCK_PROTOCOL(PROTOCOL) (((PROTOCOL) == SAI_FREE_PROTOCOL) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
710 ((PROTOCOL) == SAI_AC97_PROTOCOL))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
711
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
712 #define IS_SAI_BLOCK_DATASIZE(DATASIZE) (((DATASIZE) == SAI_DATASIZE_8) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
713 ((DATASIZE) == SAI_DATASIZE_10) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
714 ((DATASIZE) == SAI_DATASIZE_16) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
715 ((DATASIZE) == SAI_DATASIZE_20) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
716 ((DATASIZE) == SAI_DATASIZE_24) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
717 ((DATASIZE) == SAI_DATASIZE_32))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
718
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
719 #define IS_SAI_BLOCK_FIRST_BIT(BIT) (((BIT) == SAI_FIRSTBIT_MSB) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
720 ((BIT) == SAI_FIRSTBIT_LSB))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
721
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
722 #define IS_SAI_BLOCK_CLOCK_STROBING(CLOCK) (((CLOCK) == SAI_CLOCKSTROBING_FALLINGEDGE) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
723 ((CLOCK) == SAI_CLOCKSTROBING_RISINGEDGE))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
724
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
725 #define IS_SAI_BLOCK_SYNCHRO(SYNCHRO) (((SYNCHRO) == SAI_ASYNCHRONOUS) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
726 ((SYNCHRO) == SAI_SYNCHRONOUS))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
727
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
728 #define IS_SAI_BLOCK_OUTPUT_DRIVE(DRIVE) (((DRIVE) == SAI_OUTPUTDRIVE_DISABLE) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
729 ((DRIVE) == SAI_OUTPUTDRIVE_ENABLE))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
730
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
731 #define IS_SAI_BLOCK_NODIVIDER(NODIVIDER) (((NODIVIDER) == SAI_MASTERDIVIDER_ENABLE) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
732 ((NODIVIDER) == SAI_MASTERDIVIDER_DISABLE))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
733
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
734 #define IS_SAI_BLOCK_FIFO_STATUS(STATUS) (((STATUS) == SAI_FIFOSTATUS_LESS1QUARTERFULL ) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
735 ((STATUS) == SAI_FIFOSTATUS_HALFFULL) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
736 ((STATUS) == SAI_FIFOSTATUS_1QUARTERFULL) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
737 ((STATUS) == SAI_FIFOSTATUS_3QUARTERFULL) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
738 ((STATUS) == SAI_FIFOSTATUS_FULL) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
739 ((STATUS) == SAI_FIFOSTATUS_EMPTY))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
740
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
741 #define IS_SAI_BLOCK_MUTE_COUNTER(COUNTER) ((COUNTER) <= 63)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
742
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
743 #define IS_SAI_BLOCK_MUTE_VALUE(VALUE) (((VALUE) == SAI_ZERO_VALUE) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
744 ((VALUE) == SAI_LAST_SENT_VALUE))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
745
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
746 #define IS_SAI_BLOCK_COMPANDING_MODE(MODE) (((MODE) == SAI_NOCOMPANDING) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
747 ((MODE) == SAI_ULAW_1CPL_COMPANDING) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
748 ((MODE) == SAI_ALAW_1CPL_COMPANDING) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
749 ((MODE) == SAI_ULAW_2CPL_COMPANDING) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
750 ((MODE) == SAI_ALAW_2CPL_COMPANDING))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
751
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
752 #define IS_SAI_BLOCK_FIFO_THRESHOLD(THRESHOLD) (((THRESHOLD) == SAI_FIFOTHRESHOLD_EMPTY) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
753 ((THRESHOLD) == SAI_FIFOTHRESHOLD_1QF) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
754 ((THRESHOLD) == SAI_FIFOTHRESHOLD_HF) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
755 ((THRESHOLD) == SAI_FIFOTHRESHOLD_3QF) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
756 ((THRESHOLD) == SAI_FIFOTHRESHOLD_FULL))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
757
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
758 #define IS_SAI_BLOCK_TRISTATE_MANAGEMENT(STATE) (((STATE) == SAI_OUTPUT_NOTRELEASED) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
759 ((STATE) == SAI_OUTPUT_RELEASED))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
760
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
761 #define IS_SAI_BLOCK_MONO_STEREO_MODE(MODE) (((MODE) == SAI_MONOMODE) ||\
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
762 ((MODE) == SAI_STEREOMODE))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
763
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
764 #define IS_SAI_SLOT_ACTIVE(ACTIVE) ((ACTIVE) != 0)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
765
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
766 #define IS_SAI_BLOCK_SLOT_NUMBER(NUMBER) ((1 <= (NUMBER)) && ((NUMBER) <= 16))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
767
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
768 #define IS_SAI_BLOCK_SLOT_SIZE(SIZE) (((SIZE) == SAI_SLOTSIZE_DATASIZE) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
769 ((SIZE) == SAI_SLOTSIZE_16B) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
770 ((SIZE) == SAI_SLOTSIZE_32B))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
771
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
772 #define IS_SAI_BLOCK_FIRSTBIT_OFFSET(OFFSET) ((OFFSET) <= 24)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
773
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
774 #define IS_SAI_BLOCK_FS_OFFSET(OFFSET) (((OFFSET) == SAI_FS_FIRSTBIT) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
775 ((OFFSET) == SAI_FS_BEFOREFIRSTBIT))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
776
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
777 #define IS_SAI_BLOCK_FS_POLARITY(POLARITY) (((POLARITY) == SAI_FS_ACTIVE_LOW) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
778 ((POLARITY) == SAI_FS_ACTIVE_HIGH))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
779
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
780 #define IS_SAI_BLOCK_FS_DEFINITION(DEFINITION) (((DEFINITION) == SAI_FS_STARTFRAME) || \
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
781 ((DEFINITION) == SAI_FS_CHANNEL_IDENTIFICATION))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
782
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
783 #define IS_SAI_BLOCK_MASTER_DIVIDER(DIVIDER) ((DIVIDER) <= 15)
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
784
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
785 #define IS_SAI_BLOCK_FRAME_LENGTH(LENGTH) ((8 <= (LENGTH)) && ((LENGTH) <= 256))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
786
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
787 #define IS_SAI_BLOCK_ACTIVE_FRAME(LENGTH) ((1 <= (LENGTH)) && ((LENGTH) <= 128))
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
788
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
789 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
790 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
791 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
792
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
793 /* Private functions ---------------------------------------------------------*/
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
794 /** @defgroup SAI_Private_Functions SAI Private Functions
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
795 * @{
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
796 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
797
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
798 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
799 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
800 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
801
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
802 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
803 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
804 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
805 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
806
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
807 /**
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
808 * @}
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
809 */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
810
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
811 #ifdef __cplusplus
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
812 }
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
813 #endif
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
814
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
815 #endif /* __STM32F4xx_HAL_SAI_H */
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
816
5f11787b4f42 include in ostc4 repository
heinrichsweikamp
parents:
diff changeset
817 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/