You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

135 lines
5.1 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_hal_sai_ex.h
  4. * @author MCD Application Team
  5. * @version V1.7.1
  6. * @date 14-April-2017
  7. * @brief Header file of SAI Extension HAL module.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
  12. *
  13. * Redistribution and use in source and binary forms, with or without modification,
  14. * are permitted provided that the following conditions are met:
  15. * 1. Redistributions of source code must retain the above copyright notice,
  16. * this list of conditions and the following disclaimer.
  17. * 2. Redistributions in binary form must reproduce the above copyright notice,
  18. * this list of conditions and the following disclaimer in the documentation
  19. * and/or other materials provided with the distribution.
  20. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  21. * may be used to endorse or promote products derived from this software
  22. * without specific prior written permission.
  23. *
  24. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  25. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  26. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  27. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  28. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  29. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  30. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  31. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  32. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  33. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  34. *
  35. ******************************************************************************
  36. */
  37. /* Define to prevent recursive inclusion -------------------------------------*/
  38. #ifndef __STM32F4xx_HAL_SAI_EX_H
  39. #define __STM32F4xx_HAL_SAI_EX_H
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. /* Includes ------------------------------------------------------------------*/
  44. #include "stm32f4xx_hal_def.h"
  45. /** @addtogroup STM32F4xx_HAL_Driver
  46. * @{
  47. */
  48. /** @addtogroup SAIEx
  49. * @{
  50. */
  51. #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) || \
  52. defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F413xx) || \
  53. defined(STM32F423xx)
  54. /* Exported types ------------------------------------------------------------*/
  55. /* Exported constants --------------------------------------------------------*/
  56. /** @defgroup SAI_Clock_Source SAI Clock Source
  57. * @{
  58. */
  59. #if defined(STM32F413xx) || defined(STM32F423xx)
  60. #define SAI_CLKSOURCE_PLLI2S 0x00000000U
  61. #define SAI_CLKSOURCE_EXT 0x00100000U
  62. #define SAI_CLKSOURCE_PLLR 0x00200000U
  63. #define SAI_CLKSOURCE_HS 0x00300000U
  64. #else
  65. #define SAI_CLKSOURCE_PLLSAI 0x00000000U
  66. #define SAI_CLKSOURCE_PLLI2S 0x00100000U
  67. #define SAI_CLKSOURCE_EXT 0x00200000U
  68. #define SAI_CLKSOURCE_NA 0x00400000U /*!< No applicable for STM32F446xx */
  69. #endif
  70. /**
  71. * @}
  72. */
  73. /* Exported functions --------------------------------------------------------*/
  74. /** @addtogroup SAIEx_Exported_Functions
  75. * @{
  76. */
  77. /** @addtogroup SAIEx_Exported_Functions_Group1
  78. * @{
  79. */
  80. /* Extended features functions ************************************************/
  81. void SAI_BlockSynchroConfig(SAI_HandleTypeDef *hsai);
  82. uint32_t SAI_GetInputClock(SAI_HandleTypeDef *hsai);
  83. /**
  84. * @}
  85. */
  86. /**
  87. * @}
  88. */
  89. /* Private types -------------------------------------------------------------*/
  90. /* Private variables ---------------------------------------------------------*/
  91. /* Private constants ---------------------------------------------------------*/
  92. /* Private macros ------------------------------------------------------------*/
  93. #if defined(STM32F413xx) || defined(STM32F423xx)
  94. #define IS_SAI_CLK_SOURCE(SOURCE) (((SOURCE) == SAI_CLKSOURCE_PLLI2S) ||\
  95. ((SOURCE) == SAI_CLKSOURCE_EXT)||\
  96. ((SOURCE) == SAI_CLKSOURCE_PLLR)||\
  97. ((SOURCE) == SAI_CLKSOURCE_HS))
  98. #else
  99. #define IS_SAI_CLK_SOURCE(SOURCE) (((SOURCE) == SAI_CLKSOURCE_PLLSAI) ||\
  100. ((SOURCE) == SAI_CLKSOURCE_EXT)||\
  101. ((SOURCE) == SAI_CLKSOURCE_PLLI2S)||\
  102. ((SOURCE) == SAI_CLKSOURCE_NA))
  103. #endif
  104. /* Private functions ---------------------------------------------------------*/
  105. #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx || STM32F413xx || STM32F423xx */
  106. /**
  107. * @}
  108. */
  109. /**
  110. * @}
  111. */
  112. #ifdef __cplusplus
  113. }
  114. #endif
  115. #endif /* __STM32F4xx_HAL_SAI_EX_H */
  116. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/