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