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