xref: /btstack/port/stm32-f4discovery-usb/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_sai_ex.h (revision a8f7f3fcbcd51f8d2e92aca076b6a9f812db358c)
1 /**
2   ******************************************************************************
3   * @file    stm32f4xx_hal_sai_ex.h
4   * @author  MCD Application Team
5   * @brief   Header file of SAI Extension HAL module.
6   ******************************************************************************
7   * @attention
8   *
9   * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
10   * All rights reserved.</center></h2>
11   *
12   * This software component is licensed by ST under BSD 3-Clause license,
13   * the "License"; You may not use this file except in compliance with the
14   * License. You may obtain a copy of the License at:
15   *                        opensource.org/licenses/BSD-3-Clause
16   *
17   ******************************************************************************
18   */
19 
20 /* Define to prevent recursive inclusion -------------------------------------*/
21 #ifndef __STM32F4xx_HAL_SAI_EX_H
22 #define __STM32F4xx_HAL_SAI_EX_H
23 
24 #ifdef __cplusplus
25  extern "C" {
26 #endif
27 
28 /* Includes ------------------------------------------------------------------*/
29 #include "stm32f4xx_hal_def.h"
30 
31 /** @addtogroup STM32F4xx_HAL_Driver
32   * @{
33   */
34 
35 /** @addtogroup SAIEx
36   * @{
37   */
38 
39 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || \
40     defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F413xx) || \
41     defined(STM32F423xx)
42 
43 /* Exported types ------------------------------------------------------------*/
44 /* Exported constants --------------------------------------------------------*/
45 /** @defgroup SAI_Clock_Source  SAI Clock Source
46   * @{
47   */
48 #if defined(STM32F413xx) || defined(STM32F423xx)
49 #define SAI_CLKSOURCE_PLLI2S             0x00000000U
50 #define SAI_CLKSOURCE_EXT                0x00100000U
51 #define SAI_CLKSOURCE_PLLR               0x00200000U
52 #define SAI_CLKSOURCE_HS                 0x00300000U
53 #else
54 #define SAI_CLKSOURCE_PLLSAI             0x00000000U
55 #define SAI_CLKSOURCE_PLLI2S             0x00100000U
56 #define SAI_CLKSOURCE_EXT                0x00200000U
57 #define SAI_CLKSOURCE_NA                 0x00400000U /*!< No applicable for STM32F446xx */
58 #endif
59 
60 
61 /**
62   * @}
63   */
64 
65 /* Exported functions --------------------------------------------------------*/
66 /** @addtogroup SAIEx_Exported_Functions
67   * @{
68   */
69 
70 /** @addtogroup SAIEx_Exported_Functions_Group1
71   * @{
72   */
73 
74 /* Extended features functions ************************************************/
75 void SAI_BlockSynchroConfig(SAI_HandleTypeDef *hsai);
76 uint32_t SAI_GetInputClock(SAI_HandleTypeDef *hsai);
77 /**
78   * @}
79   */
80 
81 /**
82   * @}
83   */
84 /* Private types -------------------------------------------------------------*/
85 /* Private variables ---------------------------------------------------------*/
86 /* Private constants ---------------------------------------------------------*/
87 /* Private macros ------------------------------------------------------------*/
88 #if defined(STM32F413xx) || defined(STM32F423xx)
89 #define IS_SAI_CLK_SOURCE(SOURCE) (((SOURCE) == SAI_CLKSOURCE_PLLI2S) ||\
90                                    ((SOURCE) == SAI_CLKSOURCE_EXT)||\
91                                    ((SOURCE) == SAI_CLKSOURCE_PLLR)||\
92                                    ((SOURCE) == SAI_CLKSOURCE_HS))
93 #else
94 #define IS_SAI_CLK_SOURCE(SOURCE) (((SOURCE) == SAI_CLKSOURCE_PLLSAI) ||\
95                                    ((SOURCE) == SAI_CLKSOURCE_EXT)||\
96                                    ((SOURCE) == SAI_CLKSOURCE_PLLI2S)||\
97                                    ((SOURCE) == SAI_CLKSOURCE_NA))
98 #endif
99 /* Private functions ---------------------------------------------------------*/
100 
101 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx || STM32F413xx || STM32F423xx */
102 /**
103   * @}
104   */
105 
106 /**
107   * @}
108   */
109 
110 #ifdef __cplusplus
111 }
112 #endif
113 
114 #endif /* __STM32F4xx_HAL_SAI_EX_H */
115 
116 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
117