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   * Copyright (c) 2017 STMicroelectronics.
10   * All rights reserved.
11   *
12   * This software is licensed under terms that can be found in the LICENSE file
13   * in the root directory of this software component.
14   * If no LICENSE file comes with this software, it is provided AS-IS.
15   *
16   ******************************************************************************
17   */
18 
19 /* Define to prevent recursive inclusion -------------------------------------*/
20 #ifndef __STM32F4xx_HAL_SAI_EX_H
21 #define __STM32F4xx_HAL_SAI_EX_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /* Includes ------------------------------------------------------------------*/
28 #include "stm32f4xx_hal_def.h"
29 
30 /** @addtogroup STM32F4xx_HAL_Driver
31   * @{
32   */
33 
34 /** @addtogroup SAIEx
35   * @{
36   */
37 
38 #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || \
39     defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F413xx) || \
40     defined(STM32F423xx)
41 
42 /* Exported types ------------------------------------------------------------*/
43 /* Exported constants --------------------------------------------------------*/
44 /** @defgroup SAI_Clock_Source  SAI Clock Source
45   * @{
46   */
47 #if defined(STM32F413xx) || defined(STM32F423xx)
48 #define SAI_CLKSOURCE_PLLI2S             0x00000000U
49 #define SAI_CLKSOURCE_EXT                0x00100000U
50 #define SAI_CLKSOURCE_PLLR               0x00200000U
51 #define SAI_CLKSOURCE_HS                 0x00300000U
52 #else
53 #define SAI_CLKSOURCE_PLLSAI             0x00000000U
54 #define SAI_CLKSOURCE_PLLI2S             0x00100000U
55 #define SAI_CLKSOURCE_EXT                0x00200000U
56 #define SAI_CLKSOURCE_NA                 0x00400000U /*!< No applicable for STM32F446xx */
57 #endif
58 
59 
60 /**
61   * @}
62   */
63 
64 /* Exported functions --------------------------------------------------------*/
65 /** @addtogroup SAIEx_Exported_Functions
66   * @{
67   */
68 
69 /** @addtogroup SAIEx_Exported_Functions_Group1
70   * @{
71   */
72 
73 /* Extended features functions ************************************************/
74 void SAI_BlockSynchroConfig(SAI_HandleTypeDef *hsai);
75 uint32_t SAI_GetInputClock(SAI_HandleTypeDef *hsai);
76 /**
77   * @}
78   */
79 
80 /**
81   * @}
82   */
83 /* Private types -------------------------------------------------------------*/
84 /* Private variables ---------------------------------------------------------*/
85 /* Private constants ---------------------------------------------------------*/
86 /* Private macros ------------------------------------------------------------*/
87 #if defined(STM32F413xx) || defined(STM32F423xx)
88 #define IS_SAI_CLK_SOURCE(SOURCE) (((SOURCE) == SAI_CLKSOURCE_PLLI2S) ||\
89                                    ((SOURCE) == SAI_CLKSOURCE_EXT)||\
90                                    ((SOURCE) == SAI_CLKSOURCE_PLLR)||\
91                                    ((SOURCE) == SAI_CLKSOURCE_HS))
92 #else
93 #define IS_SAI_CLK_SOURCE(SOURCE) (((SOURCE) == SAI_CLKSOURCE_PLLSAI) ||\
94                                    ((SOURCE) == SAI_CLKSOURCE_EXT)||\
95                                    ((SOURCE) == SAI_CLKSOURCE_PLLI2S)||\
96                                    ((SOURCE) == SAI_CLKSOURCE_NA))
97 #endif
98 /* Private functions ---------------------------------------------------------*/
99 
100 #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx || STM32F413xx || STM32F423xx */
101 /**
102   * @}
103   */
104 
105 /**
106   * @}
107   */
108 
109 #ifdef __cplusplus
110 }
111 #endif
112 
113 #endif /* __STM32F4xx_HAL_SAI_EX_H */
114 
115