stm32g4xx_hal_sai_ex.h 2.8 KB

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