STM CMSIS
stm32f4xx_hal_i2s_ex.h
Go to the documentation of this file.
1 
38 /* Define to prevent recursive inclusion -------------------------------------*/
39 #ifndef __STM32F4xx_HAL_I2S_EX_H
40 #define __STM32F4xx_HAL_I2S_EX_H
41 
42 #ifdef __cplusplus
43  extern "C" {
44 #endif
45 
46 /* Includes ------------------------------------------------------------------*/
47 #include "stm32f4xx_hal_def.h"
48 
57 /* Exported types ------------------------------------------------------------*/
65 /* Exported constants --------------------------------------------------------*/
74 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || \
75  defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || \
76  defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F469xx) || \
77  defined(STM32F479xx)
78 #define I2S_CLOCK_PLL ((uint32_t)0x00000000U)
79 #define I2S_CLOCK_EXTERNAL ((uint32_t)0x00000001U)
80 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx ||
81  STM32F401xC || STM32F401xE || STM32F411xE || STM32F469xx || STM32F479xx */
82 
83 #if defined(STM32F446xx) || defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx)
84 #define I2S_CLOCK_PLL ((uint32_t)0x00000000U)
85 #define I2S_CLOCK_EXTERNAL ((uint32_t)0x00000001U)
86 #define I2S_CLOCK_PLLR ((uint32_t)0x00000002U)
87 #define I2S_CLOCK_PLLSRC ((uint32_t)0x00000003U)
88 #endif /* STM32F446xx || STM32F412Zx || STM32F412Vx || STM32F412Rx || STM32F412Cx */
89 
90 #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx)
91 #define I2S_CLOCK_PLLSRC ((uint32_t)0x00000000U)
92 #define I2S_CLOCK_EXTERNAL ((uint32_t)0x00000001U)
93 #define I2S_CLOCK_PLLR ((uint32_t)0x00000002U)
94 #endif /* STM32F410Tx || STM32F410Cx || STM32F410Rx */
95 
103 /* Exported macro ------------------------------------------------------------*/
112 /* Exported functions --------------------------------------------------------*/
121 /* Extended features functions **************************************************/
122 /* Blocking mode: Polling */
123 HAL_StatusTypeDef HAL_I2SEx_TransmitReceive(I2S_HandleTypeDef *hi2s, uint16_t *pTxData, uint16_t *pRxData, uint16_t Size, uint32_t Timeout);
124 /* Non-Blocking mode: Interrupt */
125 HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_IT(I2S_HandleTypeDef *hi2s, uint16_t *pTxData, uint16_t *pRxData, uint16_t Size);
126 /* Non-Blocking mode: DMA */
127 HAL_StatusTypeDef HAL_I2SEx_TransmitReceive_DMA(I2S_HandleTypeDef *hi2s, uint16_t *pTxData, uint16_t *pRxData, uint16_t Size);
135 /* Private types -------------------------------------------------------------*/
136 /* Private variables ---------------------------------------------------------*/
137 /* Private constants ---------------------------------------------------------*/
145 /* Private macros ------------------------------------------------------------*/
149 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || \
150  defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || \
151  defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F411xE) || defined(STM32F469xx) || \
152  defined(STM32F479xx)
153 #define IS_I2S_CLOCKSOURCE(CLOCK) (((CLOCK) == I2S_CLOCK_EXTERNAL) ||\
154  ((CLOCK) == I2S_CLOCK_PLL))
155 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx ||
156  STM32F401xC || STM32F401xE || STM32F411xE || STM32F469xx || STM32F479xx */
157 
158 #if defined(STM32F446xx) || defined(STM32F412Zx) || defined(STM32F412Vx) ||\
159  defined(STM32F412Rx) || defined(STM32F412Cx)
160 #define IS_I2S_CLOCKSOURCE(CLOCK) (((CLOCK) == I2S_CLOCK_EXTERNAL) ||\
161  ((CLOCK) == I2S_CLOCK_PLL) ||\
162  ((CLOCK) == I2S_CLOCK_PLLSRC) ||\
163  ((CLOCK) == I2S_CLOCK_PLLR))
164 #endif /* STM32F446xx || STM32F412Zx || STM32F412Vx || STM32F412Rx || STM32F412Cx */
165 
166 #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx)
167 #define IS_I2S_CLOCKSOURCE(CLOCK) (((CLOCK) == I2S_CLOCK_EXTERNAL) ||\
168  ((CLOCK) == I2S_CLOCK_PLLSRC) ||\
169  ((CLOCK) == I2S_CLOCK_PLLR))
170 #endif /* STM32F410Tx || STM32F410Cx || STM32F410Rx */
171 
172 #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || \
173  defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || \
174  defined(STM32F401xC) || defined(STM32F401xE) || defined(STM32F410Cx) || defined(STM32F410Rx) || \
175  defined(STM32F411xE) || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) || \
176  defined(STM32F412Zx) || defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx)
177 #define I2SxEXT(__INSTANCE__) ((__INSTANCE__) == (SPI2)? (SPI_TypeDef *)(I2S2ext_BASE): (SPI_TypeDef *)(I2S3ext_BASE))
178 #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx ||
179  STM32F401xC || STM32F401xE || STM32F410Cx || STM32F410Rx || STM32F411xE || STM32F446xx || STM32F469xx || STM32F479xx ||
180  STM32F412Zx || STM32F412Vx || STM32F412Rx || STM32F412Cx */
181 
186 /* Private functions ---------------------------------------------------------*/
190 HAL_StatusTypeDef I2SEx_TransmitReceive_IT(I2S_HandleTypeDef *hi2s);
191 uint32_t I2S_GetInputClock(I2S_HandleTypeDef *hi2s);
204 #ifdef __cplusplus
205 }
206 #endif
207 
208 
209 #endif /* __STM32F4xx_HAL_I2S_EX_H */
210 
211 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
This file contains HAL common defines, enumeration, macros and structures definitions.
I2S handle Structure definition.
Definition: stm32f4xx_hal_i2s.h:112
HAL_StatusTypeDef
HAL Status structures definition.
Definition: stm32f4xx_hal_def.h:57