stm32l4xx_hal_sai_ex.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /**
  2. ******************************************************************************
  3. * @file stm32l4xx_hal_sai_ex.h
  4. * @author MCD Application Team
  5. * @brief Header file of SAI HAL extended 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. /* Define to prevent recursive inclusion -------------------------------------*/
  19. #ifndef STM32L4xx_HAL_SAI_EX_H
  20. #define STM32L4xx_HAL_SAI_EX_H
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. #if defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx) || \
  25. defined(STM32L4P5xx) || defined(STM32L4Q5xx)
  26. /* Includes ------------------------------------------------------------------*/
  27. #include "stm32l4xx_hal_def.h"
  28. /** @addtogroup STM32L4xx_HAL_Driver
  29. * @{
  30. */
  31. /** @addtogroup SAIEx
  32. * @{
  33. */
  34. /* Exported types ------------------------------------------------------------*/
  35. /** @defgroup SAIEx_Exported_Types SAIEx Exported Types
  36. * @{
  37. */
  38. /**
  39. * @brief PDM microphone delay structure definition
  40. */
  41. typedef struct
  42. {
  43. uint32_t MicPair; /*!< Specifies which pair of microphones is selected.
  44. This parameter must be a number between Min_Data = 1 and Max_Data = 3. */
  45. uint32_t LeftDelay; /*!< Specifies the delay in PDM clock unit to apply on left microphone.
  46. This parameter must be a number between Min_Data = 0 and Max_Data = 7. */
  47. uint32_t RightDelay; /*!< Specifies the delay in PDM clock unit to apply on right microphone.
  48. This parameter must be a number between Min_Data = 0 and Max_Data = 7. */
  49. } SAIEx_PdmMicDelayParamTypeDef;
  50. /**
  51. * @}
  52. */
  53. /* Exported constants --------------------------------------------------------*/
  54. /* Exported macros -----------------------------------------------------------*/
  55. /* Exported functions --------------------------------------------------------*/
  56. /** @addtogroup SAIEx_Exported_Functions SAIEx Extended Exported Functions
  57. * @{
  58. */
  59. /** @addtogroup SAIEx_Exported_Functions_Group1 Peripheral Control functions
  60. * @{
  61. */
  62. HAL_StatusTypeDef HAL_SAIEx_ConfigPdmMicDelay(const SAI_HandleTypeDef *hsai,
  63. const SAIEx_PdmMicDelayParamTypeDef *pdmMicDelay);
  64. /**
  65. * @}
  66. */
  67. /**
  68. * @}
  69. */
  70. /* Private macros ------------------------------------------------------------*/
  71. /** @addtogroup SAIEx_Private_Macros SAIEx Extended Private Macros
  72. * @{
  73. */
  74. #define IS_SAI_PDM_MIC_DELAY(VALUE) ((VALUE) <= 7U)
  75. /**
  76. * @}
  77. */
  78. /**
  79. * @}
  80. */
  81. /**
  82. * @}
  83. */
  84. #endif /* STM32L4R5xx || STM32L4R7xx || STM32L4R9xx || STM32L4S5xx || STM32L4S7xx || STM32L4S9xx || */
  85. /* STM32L4P5xx || STM32L4Q5xx */
  86. #ifdef __cplusplus
  87. }
  88. #endif
  89. #endif /* STM32L4xx_HAL_SAI_EX_H */