gr55xx_ll_pdm.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file gr55xx_ll_pdm.h
5 * @author BLE Driver Team
6 * @brief Header file containing functions prototypes of PDM LL library.
7 *
8 ****************************************************************************************
9 * @attention
10 #####Copyright (c) 2019 GOODIX
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 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
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 ****************************************************************************************
36 */
37
38 /** @addtogroup PERIPHERAL Peripheral Driver
39 * @{
40 */
41
42 /** @addtogroup LL_DRIVER LL Driver
43 * @{
44 */
45
46 /** @defgroup LL_PDM PDM
47 * @brief PDM LL module driver.
48 * @{
49 */
50
51 /* Define to prevent recursive inclusion -------------------------------------*/
52 #ifndef __GR55xx_LL_PDM_H__
53 #define __GR55xx_LL_PDM_H__
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58
59 /* Includes ------------------------------------------------------------------*/
60 #include "gr55xx.h"
61
62 #if defined (PDM)
63
64
65 /** @defgroup PDM_LL_STRUCTURES Structures
66 * @{
67 */
68
69 /* Exported types ------------------------------------------------------------*/
70 /** @defgroup PDM_LL_ES_INIT PDM Exported init structures
71 * @{
72 */
73 /**
74 * @brief LL PDM init Structure definition
75 */
76 typedef struct _ll_pdm_init
77 {
78 uint32_t mode; /**< Specifies the sample rate.must be a value of PDM_LL_MODE */
79
80 uint32_t gain_l; /**< Specifies the gain of left. must be a value between Min 0x0 ~ Max 0x3FFF. */
81
82 uint32_t gain_r; /**< Specifies the gain of right.must be a value between Min 0x0 ~ Max 0x3FFF. */
83
84 uint32_t sample_rate; /**< Specifies the sample rate.must be a value of PDM_LL_SAMPLE_RATE */
85
86 } ll_pdm_init_t;
87
88 /** @} */
89
90 /** @} */
91
92 /**
93 * @defgroup PDM_LL_MACRO Defines
94 * @{
95 */
96
97 /* Exported constants --------------------------------------------------------*/
98 /** @defgroup PDM_LL_Exported_Constants PDM Exported Constants
99 * @{
100 */
101
102 /** @defgroup LL_PDM_SAMPLE_RATE PDM Sample Rate
103 * @{
104 */
105
106 /**
107 * @brief PDM sample rate.
108 */
109 #define LL_PDM_SAMPLE_RATE_15_625K PDM_CLK_SAMPLE_RATE_15_625K /**< PDM sample rate 15.625K */
110 #define LL_PDM_SAMPLE_RATE_16K PDM_CLK_SAMPLE_RATE_16K /**< PDM sample rate 16K */
111 #define LL_PDM_SAMPLE_RATE_8K PDM_CLK_SAMPLE_RATE_8K /**< PDM sample rate 8K */
112 /** @} */
113
114 /** @defgroup LL_PDM_MODE PDM Mode Set Defines
115 * @{
116 */
117
118 /**
119 * @brief PDM operation mode.
120 */
121 #define LL_PDM_MODE_LEFT ((uint32_t)0x00000000U) /**< PDM left mono */
122 #define LL_PDM_MODE_RIGHT ((uint32_t)0x00000001U) /**< PDM right mono */
123 #define LL_PDM_MODE_STEREO ((uint32_t)0x00000002U) /**< PDM stereo mono */
124 /** @} */
125
126 /** @defgroup LL_PDM_CLK_EN PDM CLK Set Defines
127 * @{
128 */
129 #define LL_PDM_CLK_ENABLE PDM_CLK_EN_ENABLE /**< PDM clk enable */
130 #define LL_PDM_CLK_DISABLE PDM_CLK_EN_DISABLE /**< PDM clk disable*/
131 /** @} */
132
133 /** @defgroup LL_PDM_RX_EN PDM RX Set Defines
134 * @{
135 */
136 #define LL_PDM_LEFT_RX_ENABLE PDM_EN_L_EN_RX_ENABLE /**< PDM left rx enable*/
137 #define LL_PDM_LEFT_RX_DISABLE PDM_EN_L_EN_RX_DISABLE /**< PDM left rx disable*/
138 #define LL_PDM_RIGHT_RX_ENABLE PDM_EN_R_EN_RX_ENABLE /**< PDM right rx enable*/
139 #define LL_PDM_RIGHT_RX_DISABLE PDM_EN_R_EN_RX_DISABLE /**< PDM right rx disable*/
140 /** @} */
141
142 /** @defgroup LL_PDM_SAMPLE_DMIC_EN PDM Sample Dmic Set Defines
143 * @{
144 */
145 #define LL_PDM_LEFT_SAMPLE_DMIC_ENABLE PDM_EN_L_SMP_DMIC_ENABLE /**< PDM left sample dmic enable*/
146 #define LL_PDM_LEFT_SAMPLE_DMIC_DISABLE PDM_EN_L_SMP_DMIC_DISABLE /**< PDM left sample dmic disable*/
147 #define LL_PDM_RIGHT_SAMPLE_DMIC_ENABLE PDM_EN_R_SMP_DMIC_ENABLE /**< PDM right sample dmic enable*/
148 #define LL_PDM_RIGHT_SAMPLE_DMIC_DISABLE PDM_EN_R_SMP_DMIC_DISABLE /**< PDM right sample dmic disable*/
149 /** @} */
150
151 /** @defgroup LL_PDM_STAGE0_7_EN PDM Stage Set Defines
152 * @{
153 */
154 #define LL_PDM_LEFT_STAGE0_ENABLE PDM_EN_L_EN_STAGE0_ENABLE /**< PDM left stage0 enable*/
155 #define LL_PDM_LEFT_STAGE0_DISABLE PDM_EN_L_EN_STAGE0_DISABLE /**< PDM left stage0 disable*/
156 #define LL_PDM_LEFT_STAGE1_ENABLE PDM_EN_L_EN_STAGE1_ENABLE /**< PDM left stage1 enable*/
157 #define LL_PDM_LEFT_STAGE1_DISABLE PDM_EN_L_EN_STAGE1_DISABLE /**< PDM left stage1 disable*/
158 #define LL_PDM_LEFT_STAGE2_ENABLE PDM_EN_L_EN_STAGE2_ENABLE /**< PDM left stage2 enable*/
159 #define LL_PDM_LEFT_STAGE2_DISABLE PDM_EN_L_EN_STAGE2_DISABLE /**< PDM left stage2 disable*/
160 #define LL_PDM_LEFT_STAGE3_ENABLE PDM_EN_L_EN_STAGE3_ENABLE /**< PDM left stage3 enable*/
161 #define LL_PDM_LEFT_STAGE3_DISABLE PDM_EN_L_EN_STAGE3_DISABLE /**< PDM left stage3 disable*/
162 #define LL_PDM_LEFT_STAGE4_ENABLE PDM_EN_L_EN_STAGE4_ENABLE /**< PDM left stage4 enable*/
163 #define LL_PDM_LEFT_STAGE4_DISABLE PDM_EN_L_EN_STAGE4_DISABLE /**< PDM left stage4 disable*/
164 #define LL_PDM_LEFT_STAGE5_ENABLE PDM_EN_L_EN_STAGE5_ENABLE /**< PDM left stage5 enable*/
165 #define LL_PDM_LEFT_STAGE5_DISABLE PDM_EN_L_EN_STAGE5_DISABLE /**< PDM left stage5 disable*/
166 #define LL_PDM_LEFT_STAGE6_ENABLE PDM_EN_L_EN_STAGE6_ENABLE /**< PDM left stage6 enable*/
167 #define LL_PDM_LEFT_STAGE6_DISABLE PDM_EN_L_EN_STAGE6_DISABLE /**< PDM left stage6 disable*/
168 #define LL_PDM_LEFT_STAGE7_ENABLE PDM_EN_L_EN_STAGE7_ENABLE /**< PDM left stage7 enable*/
169 #define LL_PDM_LEFT_STAGE7_DISABLE PDM_EN_L_EN_STAGE7_DISABLE /**< PDM left stage7 disable*/
170 #define LL_PDM_RIGHT_STAGE0_ENABLE PDM_EN_R_EN_STAGE0_ENABLE /**< PDM right stage0 enable*/
171 #define LL_PDM_RIGHT_STAGE0_DISABLE PDM_EN_R_EN_STAGE0_DISABLE /**< PDM right stage0 disable*/
172 #define LL_PDM_RIGHT_STAGE1_ENABLE PDM_EN_R_EN_STAGE1_ENABLE /**< PDM right stage1 enable*/
173 #define LL_PDM_RIGHT_STAGE1_DISABLE PDM_EN_R_EN_STAGE1_DISABLE /**< PDM right stage1 disable*/
174 #define LL_PDM_RIGHT_STAGE2_ENABLE PDM_EN_R_EN_STAGE2_ENABLE /**< PDM right stage2 enable*/
175 #define LL_PDM_RIGHT_STAGE2_DISABLE PDM_EN_R_EN_STAGE2_DISABLE /**< PDM right stage2 disable*/
176 #define LL_PDM_RIGHT_STAGE3_ENABLE PDM_EN_R_EN_STAGE3_ENABLE /**< PDM right stage3 enable*/
177 #define LL_PDM_RIGHT_STAGE3_DISABLE PDM_EN_R_EN_STAGE3_DISABLE /**< PDM right stage3 disable*/
178 #define LL_PDM_RIGHT_STAGE4_ENABLE PDM_EN_R_EN_STAGE4_ENABLE /**< PDM right stage4 enable*/
179 #define LL_PDM_RIGHT_STAGE4_DISABLE PDM_EN_R_EN_STAGE4_DISABLE /**< PDM right stage4 disable*/
180 #define LL_PDM_RIGHT_STAGE5_ENABLE PDM_EN_R_EN_STAGE5_ENABLE /**< PDM right stage5 enable*/
181 #define LL_PDM_RIGHT_STAGE5_DISABLE PDM_EN_R_EN_STAGE5_DISABLE /**< PDM right stage5 disable*/
182 #define LL_PDM_RIGHT_STAGE6_ENABLE PDM_EN_R_EN_STAGE6_ENABLE /**< PDM right stage6 enable*/
183 #define LL_PDM_RIGHT_STAGE6_DISABLE PDM_EN_R_EN_STAGE6_DISABLE /**< PDM right stage6 disable*/
184 #define LL_PDM_RIGHT_STAGE7_ENABLE PDM_EN_R_EN_STAGE7_ENABLE /**< PDM right stage7 enable*/
185 #define LL_PDM_RIGHT_STAGE7_DISABLE PDM_EN_R_EN_STAGE7_DISABLE /**< PDM right stage7 disable*/
186 /** @} */
187
188 /** @defgroup LL_PDM_HPF_EN PDM HPF Set Defines
189 * @{
190 */
191 #define LL_PDM_LEFT_HPF_ENABLE PDM_EN_L_EN_HPF_ENABLE /**< PDM left hpf enable*/
192 #define LL_PDM_LEFT_HPF_DISABLE PDM_EN_L_EN_HPF_DISABLE /**< PDM left hpf disable*/
193 #define LL_PDM_RIGHT_HPF_ENABLE PDM_EN_R_EN_HPF_ENABLE /**< PDM right hpf enable*/
194 #define LL_PDM_RIGHT_HPF_DISABLE PDM_EN_R_EN_HPF_DISABLE /**< PDM right hpf disable*/
195 /** @} */
196
197 /** @defgroup LL_PDM_HPF_BYPASS_EN PDM HPF Bypass Set Defines
198 * @{
199 */
200 #define LL_PDM_LEFT_HPF_BYPASS_ENABLE PDM_HPF_CFG_L_BYPASS_ENABLE /**< PDM left hpf bypass enable*/
201 #define LL_PDM_LEFT_HPF_BYPASS_DISABLE PDM_HPF_CFG_L_BYPASS_DISABLE /**< PDM left hpf bypass disable*/
202 #define LL_PDM_RIGHT_HPF_BYPASS_ENABLE PDM_HPF_CFG_R_BYPASS_ENABLE /**< PDM right hpf bypass enable*/
203 #define LL_PDM_RIGHT_HPF_BYPASS_DISABLE PDM_HPF_CFG_R_BYPASS_DISABLE /**< PDM right hpf bypass disable*/
204 /** @} */
205
206 /** @defgroup LL_PDM_HPF_CORNER PDM HPF Corner
207 * @{
208 */
209 #define LL_PDM_LEFT_HPF_CORNER_0_25 PDM_HPF_CFG_L_CORNER_0_25 /**< PDM right hpf corner 0.25*/
210 #define LL_PDM_LEFT_HPF_CORNER_1 PDM_HPF_CFG_L_CORNER_1 /**< PDM right hpf corner 1*/
211 #define LL_PDM_LEFT_HPF_CORNER_4 PDM_HPF_CFG_L_CORNER_4 /**< PDM right hpf corner 4*/
212 #define LL_PDM_LEFT_HPF_CORNER_16 PDM_HPF_CFG_L_CORNER_16 /**< PDM right hpf corner 16*/
213 #define LL_PDM_RIGHT_HPF_CORNER_0_25 PDM_HPF_CFG_R_CORNER_0_25 /**< PDM right hpf corner 0.25*/
214 #define LL_PDM_RIGHT_HPF_CORNER_1 PDM_HPF_CFG_R_CORNER_1 /**< PDM right hpf corner 1*/
215 #define LL_PDM_RIGHT_HPF_CORNER_4 PDM_HPF_CFG_R_CORNER_4 /**< PDM right hpf corner 4*/
216 #define LL_PDM_RIGHT_HPF_CORNER_16 PDM_HPF_CFG_R_CORNER_16 /**< PDM right hpf corner 16*/
217 /** @} */
218
219 /** @defgroup LL_PDM_HPF_FREEZE_EN PDM HPF Freeze
220 * @{
221 */
222 #define LL_PDM_LEFT_HPF_FREEZE_ENABLE PDM_HPF_CFG_L_FREEZE_ENABLE /**< PDM left hpf freeze enable*/
223 #define LL_PDM_LEFT_HPF_FREEZE_DISABLE PDM_HPF_CFG_L_FREEZE_DISABLE /**< PDM left hpf freeze disable*/
224 #define LL_PDM_RIGHT_HPF_FREEZE_ENABLE PDM_HPF_CFG_R_FREEZE_ENABLE /**< PDM right hpf freeze enable*/
225 #define LL_PDM_RIGHT_HPF_FREEZE_DISABLE PDM_HPF_CFG_R_FREEZE_DISABLE /**< PDM right hpf freeze disable*/
226 /** @} */
227
228 /** @} */
229 /* Exported macro ------------------------------------------------------------*/
230 /** @defgroup PDM_LL_Exported_Macros PDM Exported Macros
231 * @{
232 */
233
234 /** @defgroup PDM_LL_EM_WRITE_READ Common Write and read registers Macros
235 * @{
236 */
237
238 /**
239 * @brief Write a value in PDM register
240 * @param __instance__ PDM instance
241 * @param __REG__ Register to be written
242 * @param __VALUE__ Value to be written in the register
243 * @retval None
244 */
245 #define LL_PDM_WriteReg(__instance__, __REG__, __VALUE__) WRITE_REG(__instance__->__REG__, (__VALUE__))
246
247 /**
248 * @brief Read a value in PDM register
249 * @param __instance__ PDM instance
250 * @param __REG__ Register to be read
251 * @retval Register value
252 */
253 #define LL_PDM_ReadReg(__instance__, __REG__) READ_REG(__instance__->__REG__)
254
255 /** @} */
256
257 /** @} */
258
259 /** @} */
260
261 /* Exported functions --------------------------------------------------------*/
262 /** @defgroup PDM_LL_DRIVER_FUNCTIONS Functions
263 * @{
264 */
265
266 /** @defgroup PDM_LL_EF_Configuration Configuration functions
267 * @{
268 */
269
270 /**
271 * @brief Enable PDM Module CLK.
272 * @note This function is used to enable the PDM Module CLK.
273 *
274 * Register|BitsName
275 * --------|--------
276 * PDM_CLK | EN
277 *
278 * @param PDMx PDM instance.
279 * @retval None
280 */
281 __STATIC_INLINE void ll_pdm_enable_clk(pdm_regs_t *PDMx)
282 {
283 MODIFY_REG(PDMx->CLK, PDM_CLK_EN, LL_PDM_CLK_ENABLE);
284 }
285
286 /**
287 * @brief Disable PDM Module CLK.
288 * @note This function is used to enable the PDM Module CLK.
289 *
290 * Register|BitsName
291 * --------|--------
292 * PDM_CLK | EN
293 *
294 * @param PDMx PDM instance.
295 * @retval None
296 */
297 __STATIC_INLINE void ll_pdm_disable_clk(pdm_regs_t *PDMx)
298 {
299 MODIFY_REG(PDMx->CLK, PDM_CLK_EN, LL_PDM_CLK_DISABLE);
300 }
301
302 /**
303 * @brief Disable PDM Module CLK.
304 * @note This function is used to check the PDM Module CLK is enabled.
305 *
306 * Register|BitsName
307 * --------|--------
308 * PDM_CLK | EN
309 *
310 * @param PDMx PDM instance.
311 * @retval None
312 */
313 __STATIC_INLINE uint32_t ll_pdm_is_enable_clk(pdm_regs_t *PDMx)
314 {
315 return (READ_BITS(PDMx->CLK, PDM_CLK_EN) == LL_PDM_CLK_ENABLE);
316 }
317
318 /**
319 * @brief Set PDM sample rate
320 * @note This function is Configures the sample rate for PDM
321 *
322 * Register|BitsName
323 * --------|--------
324 * PDM_CLK | SMAPLE_RATE
325 *
326 * @param PDMx PDM instance
327 * @param sample_rate This parameter can be one of the following values:
328 * @arg @ref LL_PDM_SAMPLE_RATE_15_625K
329 * @arg @ref LL_PDM_SAMPLE_RATE_16K
330 * @arg @ref LL_PDM_SAMPLE_RATE_8K
331 * @retval None
332 */
333 __STATIC_INLINE void ll_pdm_set_sample_rate(pdm_regs_t *PDMx, uint32_t sample_rate)
334 {
335 MODIFY_REG(PDMx->CLK, PDM_CLK_SAMPLE_RATE, sample_rate);
336 }
337
338 /**
339 * @brief Get PDM sample rate
340 *
341 * Register|BitsName
342 * --------|--------
343 * PDM_CLK | SMAPLE_RATE
344 *
345 * @param PDMx PDM instance
346 * @retval one of the following values:
347 * @arg @ref LL_PDM_SAMPLE_RATE_15_625K
348 * @arg @ref LL_PDM_SAMPLE_RATE_16K
349 * @arg @ref LL_PDM_SAMPLE_RATE_8K
350 */
351 __STATIC_INLINE uint32_t ll_pdm_get_sample_rate(pdm_regs_t *PDMx)
352 {
353 return (READ_BITS(PDMx->CLK, PDM_CLK_SAMPLE_RATE));
354 }
355
356 /**
357 * @brief Set PDM posedge en pulse cfg
358 * @note This function is Configures how many 16MHz clock cycles after rising edge of PDM_CLK to sample data (rising edge capture)
359 *
360 * Register|BitsName
361 * --------|--------
362 * PDM_CLK_DIV | TARGET
363 *
364 * @param PDMx PDM instance
365 * @param target This parameter can be one of the following values:
366 * Min_Data = 0 and Max_Data = 0xF
367 * @retval None
368 */
369 __STATIC_INLINE void ll_pdm_set_posedge_en_pulse_cfg(pdm_regs_t *PDMx, uint32_t target)
370 {
371 MODIFY_REG(PDMx->CLK_DIV, PDM_CLK_DIV_POSEDGE_EN_PULSE_CFG, (target << PDM_CLK_DIV_POSEDGE_EN_PULSE_CFG_POS));
372 }
373
374 /**
375 * @brief Get PDM posedge en pulse cfg
376 *
377 * Register|BitsName
378 * --------|--------
379 * PDM_CLK_DIV | TARGET
380 *
381 * @param PDMx PDM instance
382 * @retval None
383 */
384 __STATIC_INLINE uint32_t ll_pdm_get_posedge_en_pulse_cfg(pdm_regs_t *PDMx)
385 {
386 return (READ_BITS(PDMx->CLK_DIV, PDM_CLK_DIV_POSEDGE_EN_PULSE_CFG) >> PDM_CLK_DIV_POSEDGE_EN_PULSE_CFG_POS);
387 }
388
389 /**
390 * @brief Set PDM negedge en pulse cfg
391 * @note This function is Configures how many 16MHz clock cycles after rising edge of PDM_CLK to sample data (negative edge capture)
392 *
393 * Register|BitsName
394 * --------|--------
395 * PDM_CLK_DIV | TARGET
396 *
397 * @param PDMx PDM instance
398 * @param target This parameter can be one of the following values:
399 * Min_Data = 0 and Max_Data = 0xF
400 * @retval None
401 */
402 __STATIC_INLINE void ll_pdm_set_negedge_en_pulse_cfg(pdm_regs_t *PDMx, uint32_t target)
403 {
404 MODIFY_REG(PDMx->CLK_DIV, PDM_CLK_DIV_NEGEDGE_EN_PULSE_CFG, (target << PDM_CLK_DIV_NEGEDGE_EN_PULSE_CFG_POS));
405 }
406
407 /**
408 * @brief Get PDM posedge en pulse cfg
409 *
410 * Register|BitsName
411 * --------|--------
412 * PDM_CLK_DIV | TARGET
413 *
414 * @param PDMx PDM instance
415 * @retval None
416 */
417 __STATIC_INLINE uint32_t ll_pdm_get_negedge_en_pulse_cfg(pdm_regs_t *PDMx)
418 {
419 return (READ_BITS(PDMx->CLK_DIV, PDM_CLK_DIV_NEGEDGE_EN_PULSE_CFG) >> PDM_CLK_DIV_NEGEDGE_EN_PULSE_CFG_POS);
420 }
421
422 /**
423 * @brief PDM Module enable left channel sample dmic.
424 * @note This function is used to set PDM left enable register
425 *
426 * Register|BitsName
427 * --------|--------
428 * EN_L | ENABLE_RX
429 *
430 * @param PDMx PDM instance
431 * @retval None
432 */
433 __STATIC_INLINE void ll_pdm_enable_left_channel(pdm_regs_t *PDMx)
434 {
435
436 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_RX | PDM_EN_L_EN_STAGE0 | PDM_EN_L_EN_STAGE1 |\
437 PDM_EN_L_EN_STAGE2 | PDM_EN_L_EN_STAGE3 | PDM_EN_L_EN_STAGE4 |\
438 PDM_EN_L_EN_STAGE5 | PDM_EN_L_EN_STAGE6 | PDM_EN_L_EN_STAGE7 |\
439 PDM_EN_L_SMP_DMIC | PDM_EN_L_EN_HPF, \
440 PDM_EN_L_EN_RX_ENABLE | PDM_EN_L_SMP_DMIC_ENABLE | PDM_EN_L_EN_STAGE0_DISABLE |\
441 PDM_EN_L_EN_STAGE1_DISABLE | PDM_EN_L_EN_STAGE2_ENABLE | PDM_EN_L_EN_STAGE3_ENABLE |\
442 PDM_EN_L_EN_STAGE4_ENABLE | PDM_EN_L_EN_STAGE5_ENABLE | PDM_EN_L_EN_STAGE6_ENABLE |\
443 PDM_EN_L_EN_STAGE7_ENABLE | PDM_EN_L_EN_HPF_ENABLE);
444 }
445
446 /**
447 * @brief PDM Module disable left channel sample dmic.
448 * @note This function is used to set PDM left disable register
449 *
450 * Register|BitsName
451 * --------|--------
452 * EN_L | ENABLE_RX
453 *
454 * @param PDMx PDM instance
455 * @retval None
456 */
457 __STATIC_INLINE void ll_pdm_disable_left_channel(pdm_regs_t *PDMx)
458 {
459
460 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_RX | PDM_EN_L_EN_STAGE0 | PDM_EN_L_EN_STAGE1 |\
461 PDM_EN_L_EN_STAGE2 | PDM_EN_L_EN_STAGE3 | PDM_EN_L_EN_STAGE4 |\
462 PDM_EN_L_EN_STAGE5 | PDM_EN_L_EN_STAGE6 | PDM_EN_L_EN_STAGE7 |\
463 PDM_EN_L_SMP_DMIC | PDM_EN_L_EN_HPF, \
464 PDM_EN_L_EN_RX_DISABLE | PDM_EN_L_SMP_DMIC_DISABLE | PDM_EN_L_EN_STAGE0_DISABLE |\
465 PDM_EN_L_EN_STAGE1_DISABLE | PDM_EN_L_EN_STAGE2_DISABLE | PDM_EN_L_EN_STAGE3_DISABLE |\
466 PDM_EN_L_EN_STAGE4_DISABLE | PDM_EN_L_EN_STAGE5_DISABLE | PDM_EN_L_EN_STAGE6_DISABLE |\
467 PDM_EN_L_EN_STAGE7_DISABLE | PDM_EN_L_EN_HPF_DISABLE);
468 }
469
470 /**
471 * @brief PDM Module enable right channel sample dmic..
472 * @note This function is used to set PDM right enable register
473 *
474 * Register|BitsName
475 * --------|--------
476 * EN_L | ENABLE_RX
477 *
478 * @param PDMx PDM instance
479 * @retval None
480 */
481 __STATIC_INLINE void ll_pdm_enable_right_channel(pdm_regs_t *PDMx)
482 {
483
484 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_RX | PDM_EN_R_EN_STAGE0 | PDM_EN_R_EN_STAGE1 |\
485 PDM_EN_R_EN_STAGE2 | PDM_EN_R_EN_STAGE3 | PDM_EN_R_EN_STAGE4 |\
486 PDM_EN_R_EN_STAGE5 | PDM_EN_R_EN_STAGE6 | PDM_EN_R_EN_STAGE7 |\
487 PDM_EN_R_SMP_DMIC | PDM_EN_R_EN_HPF, \
488 PDM_EN_R_EN_RX_ENABLE | PDM_EN_R_SMP_DMIC_ENABLE | PDM_EN_R_EN_STAGE0_DISABLE |\
489 PDM_EN_R_EN_STAGE1_DISABLE | PDM_EN_R_EN_STAGE2_ENABLE | PDM_EN_R_EN_STAGE3_ENABLE |\
490 PDM_EN_R_EN_STAGE4_ENABLE | PDM_EN_R_EN_STAGE5_ENABLE | PDM_EN_R_EN_STAGE6_ENABLE |\
491 PDM_EN_R_EN_STAGE7_ENABLE | PDM_EN_R_EN_HPF_ENABLE);
492 }
493
494 /**
495 * @brief PDM Module disable right channel sample dmic..
496 * @note This function is used to set PDM right disable register
497 *
498 * Register|BitsName
499 * --------|--------
500 * EN_L | ENABLE_RX
501 *
502 * @param PDMx PDM instance
503 * @retval None
504 */
505 __STATIC_INLINE void ll_pdm_disable_right_channel(pdm_regs_t *PDMx)
506 {
507
508 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_RX | PDM_EN_R_EN_STAGE0 | PDM_EN_R_EN_STAGE1 |\
509 PDM_EN_R_EN_STAGE2 | PDM_EN_R_EN_STAGE3 | PDM_EN_R_EN_STAGE4 |\
510 PDM_EN_R_EN_STAGE5 | PDM_EN_R_EN_STAGE6 | PDM_EN_R_EN_STAGE7 |\
511 PDM_EN_R_SMP_DMIC | PDM_EN_R_EN_HPF, \
512 PDM_EN_R_EN_RX_DISABLE | PDM_EN_R_SMP_DMIC_DISABLE | PDM_EN_R_EN_STAGE0_DISABLE |\
513 PDM_EN_R_EN_STAGE1_DISABLE | PDM_EN_R_EN_STAGE2_DISABLE | PDM_EN_R_EN_STAGE3_DISABLE |\
514 PDM_EN_R_EN_STAGE4_DISABLE | PDM_EN_R_EN_STAGE5_DISABLE | PDM_EN_R_EN_STAGE6_DISABLE |\
515 PDM_EN_R_EN_STAGE7_DISABLE | PDM_EN_R_EN_HPF_DISABLE);
516 }
517
518 /**
519 * @brief Enable PDM Module Left RX.
520 * @note This function is used to set PDM left RX enable
521 *
522 * Register|BitsName
523 * --------|--------
524 * EN_L | ENABLE_RX
525 *
526 * @param PDMx PDM instance
527 * @retval None
528 */
529 __STATIC_INLINE void ll_pdm_enable_left_rx(pdm_regs_t *PDMx)
530 {
531 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_RX, LL_PDM_LEFT_RX_ENABLE);
532 }
533
534 /**
535 * @brief Disable PDM Module Left RX.
536 * @note This function is used to set PDM left RX disable
537 *
538 * Register|BitsName
539 * --------|--------
540 * EN_L | ENABLE_RX
541 *
542 * @param PDMx PDM instance
543 * @retval None
544 */
545 __STATIC_INLINE void ll_pdm_disable_left_rx(pdm_regs_t *PDMx)
546 {
547 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_RX, LL_PDM_LEFT_RX_DISABLE);
548 }
549
550 /**
551 * @brief is PDM enables left rx
552 * @note This function is used to check the PDM Module left rx is enabled.
553 *
554 * Register|BitsName
555 * --------|--------
556 * EN_L | ENABLE_RX
557 *
558 * @param PDMx PDM instance.
559 * @retval None
560 */
561 __STATIC_INLINE uint32_t ll_pdm_is_enable_left_rx(pdm_regs_t *PDMx)
562 {
563 return (READ_BITS(PDMx->EN_L, PDM_EN_L_EN_RX) == LL_PDM_LEFT_RX_ENABLE);
564 }
565
566
567 /**
568 * @brief Enable PDM Module right RX.
569 * @note This function is used to set PDM right RX enable
570 *
571 * Register|BitsName
572 * --------|--------
573 * EN_R | ENABLE_RX
574 *
575 * @param PDMx PDM instance
576 * @retval None
577 */
578 __STATIC_INLINE void ll_pdm_enable_right_rx(pdm_regs_t *PDMx)
579 {
580 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_RX, LL_PDM_RIGHT_RX_ENABLE);
581 }
582
583 /**
584 * @brief Disable PDM Module right RX.
585 * @note This function is used to set PDM right RX disable
586 *
587 * Register|BitsName
588 * --------|--------
589 * EN_R | ENABLE_RX
590 *
591 * @param PDMx PDM instance
592 * @retval None
593 */
594 __STATIC_INLINE void ll_pdm_disable_right_rx(pdm_regs_t *PDMx)
595 {
596 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_RX, LL_PDM_RIGHT_RX_DISABLE);
597 }
598
599 /**
600 * @brief is PDM enables right rx
601 * @note This function is used to check the PDM Module right rx is enabled.
602 *
603 * Register|BitsName
604 * --------|--------
605 * EN_R | EN
606 *
607 * @param PDMx PDM instance.
608 * @retval None
609 */
610 __STATIC_INLINE uint32_t ll_pdm_is_enable_right_rx(pdm_regs_t *PDMx)
611 {
612 return (READ_BITS(PDMx->EN_R, PDM_EN_R_EN_RX) == LL_PDM_RIGHT_RX_ENABLE);
613 }
614
615
616 /**
617 * @brief Enable PDM Module Left sample dmic.
618 * @note This function is used to set PDM Left sample dmic enable
619 *
620 * Register|BitsName
621 * --------|--------
622 * EN_L | SAMPLE_DMIC
623 *
624 * @param PDMx PDM instance
625 * @retval None
626 */
627 __STATIC_INLINE void ll_pdm_enable_left_sample_dmic(pdm_regs_t *PDMx)
628 {
629 MODIFY_REG(PDMx->EN_L, PDM_EN_L_SMP_DMIC, LL_PDM_LEFT_SAMPLE_DMIC_ENABLE);
630 }
631
632 /**
633 * @brief Disable PDM Module Left sample dmic.
634 * @note This function is used to set PDM Left sample dmic enable
635
636 * Register|BitsName
637 * --------|--------
638 * EN_L | SAMPLE_DMIC
639 *
640 * @param PDMx PDM instance
641 * @retval None
642 */
643 __STATIC_INLINE void ll_pdm_disable_left_sample_dmic(pdm_regs_t *PDMx)
644 {
645 MODIFY_REG(PDMx->EN_L, PDM_EN_L_SMP_DMIC, LL_PDM_LEFT_SAMPLE_DMIC_DISABLE);
646 }
647
648 /**
649 * @brief is PDM enables left rx
650 * @note This function is used to check the PDM Module left rx is enabled.
651 *
652 * Register|BitsName
653 * --------|--------
654 * EN_L | SAMPLE_DMIC
655 *
656 * @param PDMx PDM instance.
657 * @retval None
658 */
659 __STATIC_INLINE uint32_t ll_pdm_is_enable_left_sample_dmic(pdm_regs_t *PDMx)
660 {
661 return (READ_BITS(PDMx->EN_L, PDM_EN_L_SMP_DMIC) == LL_PDM_LEFT_SAMPLE_DMIC_ENABLE);
662 }
663
664 /**
665 * @brief Enable PDM Module right sample dmic.
666 * @note This function is used to set PDM right sample dmic enable
667 *
668 * Register|BitsName
669 * --------|--------
670 * EN_R | SAMPLE_DMIC
671 *
672 * @param PDMx PDM instance
673 * @retval None
674 */
675 __STATIC_INLINE void ll_pdm_enable_right_sample_dmic(pdm_regs_t *PDMx)
676 {
677 MODIFY_REG(PDMx->EN_R, PDM_EN_R_SMP_DMIC, LL_PDM_RIGHT_SAMPLE_DMIC_ENABLE);
678 }
679
680 /**
681 * @brief Disable PDM Module right sample dmic.
682 * @note This function is used to set PDM right sample dmic enable
683
684 * Register|BitsName
685 * --------|--------
686 * EN_R | SAMPLE_DMIC
687 *
688 * @param PDMx PDM instance
689 * @retval None
690 */
691 __STATIC_INLINE void ll_pdm_disable_right_sample_dmic(pdm_regs_t *PDMx)
692 {
693 MODIFY_REG(PDMx->EN_R, PDM_EN_R_SMP_DMIC, LL_PDM_RIGHT_SAMPLE_DMIC_DISABLE);
694 }
695
696 /**
697 * @brief is PDM enables right rx
698 * @note This function is used to check the PDM Module right rx is enabled.
699 *
700 * Register|BitsName
701 * --------|--------
702 * EN_R | SAMPLE_DMIC
703 *
704 * @param PDMx PDM instance.
705 * @retval None
706 */
707 __STATIC_INLINE uint32_t ll_pdm_is_enable_right_sample_dmic(pdm_regs_t *PDMx)
708 {
709 return (READ_BITS(PDMx->EN_R, PDM_EN_R_SMP_DMIC) == LL_PDM_RIGHT_SAMPLE_DMIC_ENABLE);
710 }
711
712 /**
713 * @brief Enable PDM Module Left stage0.
714 * @note This function is used to set PDM Left stage0 enable
715 *
716 * Register|BitsName
717 * --------|--------
718 * EN_L | EN_STAGE0
719 *
720 * @param PDMx PDM instance
721 * @retval None
722 */
723 __STATIC_INLINE void ll_pdm_enable_left_stage0(pdm_regs_t *PDMx)
724 {
725 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_STAGE0, LL_PDM_LEFT_STAGE0_ENABLE);
726 }
727
728 /**
729 * @brief Disable PDM Module Left stage0.
730 * @note This function is used to set PDM Left stage0 enable
731
732 * Register|BitsName
733 * --------|--------
734 * EN_L | EN_STAGE0
735 *
736 * @param PDMx PDM instance
737 * @retval None
738 */
739 __STATIC_INLINE void ll_pdm_disable_left_stage0(pdm_regs_t *PDMx)
740 {
741 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_STAGE0, LL_PDM_LEFT_STAGE0_DISABLE);
742 }
743
744 /**
745 * @brief is PDM enables left stage0
746 * @note This function is used to check the PDM Module left stage0 is enabled.
747 *
748 * Register|BitsName
749 * --------|--------
750 * EN_L | EN_STAGE0
751 *
752 * @param PDMx PDM instance.
753 * @retval None
754 */
755 __STATIC_INLINE uint32_t ll_pdm_is_enable_left_stage0(pdm_regs_t *PDMx)
756 {
757 return (READ_BITS(PDMx->EN_L, PDM_EN_L_EN_STAGE0) == LL_PDM_LEFT_STAGE0_ENABLE);
758 }
759
760 /**
761 * @brief Enable PDM Module right stage0
762 * @note This function is used to set PDM right stage0 enable
763 *
764 * Register|BitsName
765 * --------|--------
766 * EN_R | EN_STAGE0
767 *
768 * @param PDMx PDM instance
769 * @retval None
770 */
771 __STATIC_INLINE void ll_pdm_enable_right_stage0(pdm_regs_t *PDMx)
772 {
773 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_STAGE0, LL_PDM_RIGHT_STAGE0_ENABLE);
774 }
775
776 /**
777 * @brief Disable PDM Module right stage0
778 * @note This function is used to set PDM right stage0 enable
779
780 * Register|BitsName
781 * --------|--------
782 * EN_R | EN_STAGE0
783 *
784 * @param PDMx PDM instance
785 * @retval None
786 */
787 __STATIC_INLINE void ll_pdm_disable_right_stage0(pdm_regs_t *PDMx)
788 {
789 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_STAGE0, LL_PDM_RIGHT_STAGE0_DISABLE);
790 }
791
792 /**
793 * @brief is PDM enables right stage0
794 * @note This function is used to check the PDM Module right stage0is enabled.
795 *
796 * Register|BitsName
797 * --------|--------
798 * EN_R | EN_STAGE0
799 *
800 * @param PDMx PDM instance.
801 * @retval None
802 */
803 __STATIC_INLINE uint32_t ll_pdm_is_enable_right_stage0(pdm_regs_t *PDMx)
804 {
805 return (READ_BITS(PDMx->EN_R, PDM_EN_R_EN_STAGE0) == LL_PDM_RIGHT_STAGE0_ENABLE);
806 }
807
808 /**
809 * @brief Enable PDM Module Left stage1.
810 * @note This function is used to set PDM Left stage1 enable
811 *
812 * Register|BitsName
813 * --------|--------
814 * EN_L | EN_STAGE1
815 *
816 * @param PDMx PDM instance
817 * @retval None
818 */
819 __STATIC_INLINE void ll_pdm_enable_left_stage1(pdm_regs_t *PDMx)
820 {
821 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_STAGE1, LL_PDM_LEFT_STAGE1_ENABLE);
822 }
823
824 /**
825 * @brief Disable PDM Module Left stage1.
826 * @note This function is used to set PDM Left stage1 enable
827
828 * Register|BitsName
829 * --------|--------
830 * EN_L | EN_STAGE1
831 *
832 * @param PDMx PDM instance
833 * @retval None
834 */
835 __STATIC_INLINE void ll_pdm_disable_left_stage1(pdm_regs_t *PDMx)
836 {
837 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_STAGE1, LL_PDM_LEFT_STAGE1_DISABLE);
838 }
839
840 /**
841 * @brief is PDM enables left stage1
842 * @note This function is used to check the PDM Module left stage1 is enabled.
843 *
844 * Register|BitsName
845 * --------|--------
846 * EN_L | EN_STAGE1
847 *
848 * @param PDMx PDM instance.
849 * @retval None
850 */
851 __STATIC_INLINE uint32_t ll_pdm_is_enable_left_stage1(pdm_regs_t *PDMx)
852 {
853 return (READ_BITS(PDMx->EN_L, PDM_EN_L_EN_STAGE1) == LL_PDM_LEFT_STAGE1_ENABLE);
854 }
855
856 /**
857 * @brief Enable PDM Module right stage1
858 * @note This function is used to set PDM right stage1 enable
859 *
860 * Register|BitsName
861 * --------|--------
862 * EN_R | EN_STAGE1
863 *
864 * @param PDMx PDM instance
865 * @retval None
866 */
867 __STATIC_INLINE void ll_pdm_enable_right_stage1(pdm_regs_t *PDMx)
868 {
869 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_STAGE1, LL_PDM_RIGHT_STAGE1_ENABLE);
870 }
871
872 /**
873 * @brief Disable PDM Module right stage1
874 * @note This function is used to set PDM right stage1 enable
875
876 * Register|BitsName
877 * --------|--------
878 * EN_R | EN_STAGE1
879 *
880 * @param PDMx PDM instance
881 * @retval None
882 */
883 __STATIC_INLINE void ll_pdm_disable_right_stage1(pdm_regs_t *PDMx)
884 {
885 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_STAGE1, LL_PDM_RIGHT_STAGE1_DISABLE);
886 }
887
888 /**
889 * @brief is PDM enables right stage1
890 * @note This function is used to check the PDM Module right stage1is enabled.
891 *
892 * Register|BitsName
893 * --------|--------
894 * EN_R | EN_STAGE1
895 *
896 * @param PDMx PDM instance.
897 * @retval None
898 */
899 __STATIC_INLINE uint32_t ll_pdm_is_enable_right_stage1(pdm_regs_t *PDMx)
900 {
901 return (READ_BITS(PDMx->EN_R, PDM_EN_R_EN_STAGE1) == LL_PDM_RIGHT_STAGE1_ENABLE);
902 }
903
904 /**
905 * @brief Enable PDM Module Left stage2.
906 * @note This function is used to set PDM Left stage2 enable
907 *
908 * Register|BitsName
909 * --------|--------
910 * EN_L | EN_STAGE2
911 *
912 * @param PDMx PDM instance
913 * @retval None
914 */
915 __STATIC_INLINE void ll_pdm_enable_left_stage2(pdm_regs_t *PDMx)
916 {
917 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_STAGE2, LL_PDM_LEFT_STAGE2_ENABLE);
918 }
919
920 /**
921 * @brief Disable PDM Module Left stage2.
922 * @note This function is used to set PDM Left stage1 enable
923
924 * Register|BitsName
925 * --------|--------
926 * EN_L | EN_STAGE2
927 *
928 * @param PDMx PDM instance
929 * @retval None
930 */
931 __STATIC_INLINE void ll_pdm_disable_left_stage2(pdm_regs_t *PDMx)
932 {
933 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_STAGE2, LL_PDM_LEFT_STAGE2_DISABLE);
934 }
935
936 /**
937 * @brief is PDM enables left stage2
938 * @note This function is used to check the PDM Module left stage2 is enabled.
939 *
940 * Register|BitsName
941 * --------|--------
942 * EN_L | EN_STAGE2
943 *
944 * @param PDMx PDM instance.
945 * @retval None
946 */
947 __STATIC_INLINE uint32_t ll_pdm_is_enable_left_stage2(pdm_regs_t *PDMx)
948 {
949 return (READ_BITS(PDMx->EN_L, PDM_EN_L_EN_STAGE2) == LL_PDM_LEFT_STAGE2_ENABLE);
950 }
951
952 /**
953 * @brief Enable PDM Module right stage2
954 * @note This function is used to set PDM right stage2 enable
955 *
956 * Register|BitsName
957 * --------|--------
958 * EN_R | EN_STAGE2
959 *
960 * @param PDMx PDM instance
961 * @retval None
962 */
963 __STATIC_INLINE void ll_pdm_enable_right_stage2(pdm_regs_t *PDMx)
964 {
965 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_STAGE2, LL_PDM_RIGHT_STAGE2_ENABLE);
966 }
967
968 /**
969 * @brief Disable PDM Module right stage2
970 * @note This function is used to set PDM right stage2 enable
971
972 * Register|BitsName
973 * --------|--------
974 * EN_R | EN_STAGE2
975 *
976 * @param PDMx PDM instance
977 * @retval None
978 */
979 __STATIC_INLINE void ll_pdm_disable_right_stage2(pdm_regs_t *PDMx)
980 {
981 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_STAGE2, LL_PDM_RIGHT_STAGE2_DISABLE);
982 }
983
984 /**
985 * @brief is PDM enables right stage2
986 * @note This function is used to check the PDM Module right stage2 is enabled.
987 *
988 * Register|BitsName
989 * --------|--------
990 * EN_R | EN_STAGE2
991 *
992 * @param PDMx PDM instance.
993 * @retval None
994 */
995 __STATIC_INLINE uint32_t ll_pdm_is_enable_right_stage2(pdm_regs_t *PDMx)
996 {
997 return (READ_BITS(PDMx->EN_R, PDM_EN_R_EN_STAGE2) == LL_PDM_RIGHT_STAGE2_ENABLE);
998 }
999
1000 /**
1001 * @brief Enable PDM Module Left stage3.
1002 * @note This function is used to set PDM Left stage3 enable
1003 *
1004 * Register|BitsName
1005 * --------|--------
1006 * EN_L | EN_STAGE3
1007 *
1008 * @param PDMx PDM instance
1009 * @retval None
1010 */
1011 __STATIC_INLINE void ll_pdm_enable_left_stage3(pdm_regs_t *PDMx)
1012 {
1013 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_STAGE3, LL_PDM_LEFT_STAGE3_ENABLE);
1014 }
1015
1016 /**
1017 * @brief Disable PDM Module Left stage3.
1018 * @note This function is used to set PDM Left stage3 enable
1019
1020 * Register|BitsName
1021 * --------|--------
1022 * EN_L | EN_STAGE3
1023 *
1024 * @param PDMx PDM instance
1025 * @retval None
1026 */
1027 __STATIC_INLINE void ll_pdm_disable_left_stage3(pdm_regs_t *PDMx)
1028 {
1029 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_STAGE3, LL_PDM_LEFT_STAGE3_DISABLE);
1030 }
1031
1032 /**
1033 * @brief is PDM enables left stage3
1034 * @note This function is used to check the PDM Module left stage3 is enabled.
1035 *
1036 * Register|BitsName
1037 * --------|--------
1038 * EN_L | EN_STAGE3
1039 *
1040 * @param PDMx PDM instance.
1041 * @retval None
1042 */
1043 __STATIC_INLINE uint32_t ll_pdm_is_enable_left_stage3(pdm_regs_t *PDMx)
1044 {
1045 return (READ_BITS(PDMx->EN_L, PDM_EN_L_EN_STAGE3) == LL_PDM_LEFT_STAGE3_ENABLE);
1046 }
1047
1048 /**
1049 * @brief Enable PDM Module right stage3
1050 * @note This function is used to set PDM right stage3 enable
1051 *
1052 * Register|BitsName
1053 * --------|--------
1054 * EN_R | EN_STAGE3
1055 *
1056 * @param PDMx PDM instance
1057 * @retval None
1058 */
1059 __STATIC_INLINE void ll_pdm_enable_right_stage3(pdm_regs_t *PDMx)
1060 {
1061 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_STAGE3, LL_PDM_RIGHT_STAGE3_ENABLE);
1062 }
1063
1064 /**
1065 * @brief Disable PDM Module right stage3
1066 * @note This function is used to set PDM right stage3 enable
1067
1068 * Register|BitsName
1069 * --------|--------
1070 * EN_R | EN_STAGE3
1071 *
1072 * @param PDMx PDM instance
1073 * @retval None
1074 */
1075 __STATIC_INLINE void ll_pdm_disable_right_stage3(pdm_regs_t *PDMx)
1076 {
1077 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_STAGE3, LL_PDM_RIGHT_STAGE3_DISABLE);
1078 }
1079
1080 /**
1081 * @brief is PDM enables right stage3
1082 * @note This function is used to check the PDM Module right stage3 is enabled.
1083 *
1084 * Register|BitsName
1085 * --------|--------
1086 * EN_R | EN_STAGE3
1087 *
1088 * @param PDMx PDM instance.
1089 * @retval None
1090 */
1091 __STATIC_INLINE uint32_t ll_pdm_is_enable_right_stage3(pdm_regs_t *PDMx)
1092 {
1093 return (READ_BITS(PDMx->EN_R, PDM_EN_R_EN_STAGE3) == LL_PDM_RIGHT_STAGE3_ENABLE);
1094 }
1095
1096 /**
1097 * @brief Enable PDM Module Left stage4.
1098 * @note This function is used to set PDM Left stage4 enable
1099 *
1100 * Register|BitsName
1101 * --------|--------
1102 * EN_L | EN_STAGE4
1103 *
1104 * @param PDMx PDM instance
1105 * @retval None
1106 */
1107 __STATIC_INLINE void ll_pdm_enable_left_stage4(pdm_regs_t *PDMx)
1108 {
1109 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_STAGE4, LL_PDM_LEFT_STAGE4_ENABLE);
1110 }
1111
1112 /**
1113 * @brief Disable PDM Module Left stage4.
1114 * @note This function is used to set PDM Left stage4 enable
1115
1116 * Register|BitsName
1117 * --------|--------
1118 * EN_L | EN_STAGE4
1119 *
1120 * @param PDMx PDM instance
1121 * @retval None
1122 */
1123 __STATIC_INLINE void ll_pdm_disable_left_stage4(pdm_regs_t *PDMx)
1124 {
1125 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_STAGE4, LL_PDM_LEFT_STAGE4_DISABLE);
1126 }
1127
1128 /**
1129 * @brief is PDM enables left stage4
1130 * @note This function is used to check the PDM Module left stage4 is enabled.
1131 *
1132 * Register|BitsName
1133 * --------|--------
1134 * EN_L | EN_STAGE4
1135 *
1136 * @param PDMx PDM instance.
1137 * @retval None
1138 */
1139 __STATIC_INLINE uint32_t ll_pdm_is_enable_left_stage4(pdm_regs_t *PDMx)
1140 {
1141 return (READ_BITS(PDMx->EN_L, PDM_EN_L_EN_STAGE4) == LL_PDM_LEFT_STAGE4_ENABLE);
1142 }
1143
1144 /**
1145 * @brief Enable PDM Module right stage4
1146 * @note This function is used to set PDM right stage4 enable
1147 *
1148 * Register|BitsName
1149 * --------|--------
1150 * EN_R | EN_STAGE4
1151 *
1152 * @param PDMx PDM instance
1153 * @retval None
1154 */
1155 __STATIC_INLINE void ll_pdm_enable_right_stage4(pdm_regs_t *PDMx)
1156 {
1157 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_STAGE4, LL_PDM_RIGHT_STAGE4_ENABLE);
1158 }
1159
1160 /**
1161 * @brief Disable PDM Module right stage4
1162 * @note This function is used to set PDM right stage4 enable
1163
1164 * Register|BitsName
1165 * --------|--------
1166 * EN_R | EN_STAGE4
1167 *
1168 * @param PDMx PDM instance
1169 * @retval None
1170 */
1171 __STATIC_INLINE void ll_pdm_disable_right_stage4(pdm_regs_t *PDMx)
1172 {
1173 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_STAGE4, LL_PDM_RIGHT_STAGE4_DISABLE);
1174 }
1175
1176 /**
1177 * @brief is PDM enables right stage4
1178 * @note This function is used to check the PDM Module right stage4 is enabled.
1179 *
1180 * Register|BitsName
1181 * --------|--------
1182 * EN_R | EN_STAGE4
1183 *
1184 * @param PDMx PDM instance.
1185 * @retval None
1186 */
1187 __STATIC_INLINE uint32_t ll_pdm_is_enable_right_stage4(pdm_regs_t *PDMx)
1188 {
1189 return (READ_BITS(PDMx->EN_R, PDM_EN_R_EN_STAGE4) == LL_PDM_RIGHT_STAGE4_ENABLE);
1190 }
1191
1192 /**
1193 * @brief Enable PDM Module Left stage5.
1194 * @note This function is used to set PDM Left stage5 enable
1195 *
1196 * Register|BitsName
1197 * --------|--------
1198 * EN_L | EN_STAGE5
1199 *
1200 * @param PDMx PDM instance
1201 * @retval None
1202 */
1203 __STATIC_INLINE void ll_pdm_enable_left_stage5(pdm_regs_t *PDMx)
1204 {
1205 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_STAGE5, LL_PDM_LEFT_STAGE5_ENABLE);
1206 }
1207
1208 /**
1209 * @brief Disable PDM Module Left stage5.
1210 * @note This function is used to set PDM Left stage5 enable
1211
1212 * Register|BitsName
1213 * --------|--------
1214 * EN_L | EN_STAGE5
1215 *
1216 * @param PDMx PDM instance
1217 * @retval None
1218 */
1219 __STATIC_INLINE void ll_pdm_disable_left_stage5(pdm_regs_t *PDMx)
1220 {
1221 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_STAGE5, LL_PDM_LEFT_STAGE5_DISABLE);
1222 }
1223
1224 /**
1225 * @brief is PDM enables left stage5
1226 * @note This function is used to check the PDM Module left stage5 is enabled.
1227 *
1228 * Register|BitsName
1229 * --------|--------
1230 * EN_L | EN_STAGE5
1231 *
1232 * @param PDMx PDM instance.
1233 * @retval None
1234 */
1235 __STATIC_INLINE uint32_t ll_pdm_is_enable_left_stage5(pdm_regs_t *PDMx)
1236 {
1237 return (READ_BITS(PDMx->EN_L, PDM_EN_L_EN_STAGE5) == LL_PDM_LEFT_STAGE5_ENABLE);
1238 }
1239
1240 /**
1241 * @brief Enable PDM Module right stage5
1242 * @note This function is used to set PDM right stage5 enable
1243 *
1244 * Register|BitsName
1245 * --------|--------
1246 * EN_R | EN_STAGE5
1247 *
1248 * @param PDMx PDM instance
1249 * @retval None
1250 */
1251 __STATIC_INLINE void ll_pdm_enable_right_stage5(pdm_regs_t *PDMx)
1252 {
1253 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_STAGE5, LL_PDM_RIGHT_STAGE5_ENABLE);
1254 }
1255
1256 /**
1257 * @brief Disable PDM Module right stage5
1258 * @note This function is used to set PDM right stage5 enable
1259
1260 * Register|BitsName
1261 * --------|--------
1262 * EN_R | EN_STAGE5
1263 *
1264 * @param PDMx PDM instance
1265 * @retval None
1266 */
1267 __STATIC_INLINE void ll_pdm_disable_right_stage5(pdm_regs_t *PDMx)
1268 {
1269 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_STAGE5, LL_PDM_RIGHT_STAGE5_DISABLE);
1270 }
1271
1272 /**
1273 * @brief is PDM enables right stage5
1274 * @note This function is used to check the PDM Module right stage5 is enabled.
1275 *
1276 * Register|BitsName
1277 * --------|--------
1278 * EN_R | EN_STAGE5
1279 *
1280 * @param PDMx PDM instance.
1281 * @retval None
1282 */
1283 __STATIC_INLINE uint32_t ll_pdm_is_enable_right_stage5(pdm_regs_t *PDMx)
1284 {
1285 return (READ_BITS(PDMx->EN_R, PDM_EN_R_EN_STAGE5) == LL_PDM_RIGHT_STAGE5_ENABLE);
1286 }
1287
1288 /**
1289 * @brief Enable PDM Module Left stage6.
1290 * @note This function is used to set PDM Left stage6 enable
1291 *
1292 * Register|BitsName
1293 * --------|--------
1294 * EN_L | EN_STAGE6
1295 *
1296 * @param PDMx PDM instance
1297 * @retval None
1298 */
1299 __STATIC_INLINE void ll_pdm_enable_left_stage6(pdm_regs_t *PDMx)
1300 {
1301 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_STAGE6, LL_PDM_LEFT_STAGE6_ENABLE);
1302 }
1303
1304 /**
1305 * @brief Disable PDM Module Left stage6.
1306 * @note This function is used to set PDM Left stage6 enable
1307
1308 * Register|BitsName
1309 * --------|--------
1310 * EN_L | EN_STAGE6
1311 *
1312 * @param PDMx PDM instance
1313 * @retval None
1314 */
1315 __STATIC_INLINE void ll_pdm_disable_left_stage6(pdm_regs_t *PDMx)
1316 {
1317 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_STAGE6, LL_PDM_LEFT_STAGE6_DISABLE);
1318 }
1319
1320 /**
1321 * @brief is PDM enables left stage6
1322 * @note This function is used to check the PDM Module left stage6 is enabled.
1323 *
1324 * Register|BitsName
1325 * --------|--------
1326 * EN_L | EN_STAGE6
1327 *
1328 * @param PDMx PDM instance.
1329 * @retval None
1330 */
1331 __STATIC_INLINE uint32_t ll_pdm_is_enable_left_stage6(pdm_regs_t *PDMx)
1332 {
1333 return (READ_BITS(PDMx->EN_L, PDM_EN_L_EN_STAGE6) == LL_PDM_LEFT_STAGE6_ENABLE);
1334 }
1335
1336 /**
1337 * @brief Enable PDM Module right stage6
1338 * @note This function is used to set PDM right stage6 enable
1339 *
1340 * Register|BitsName
1341 * --------|--------
1342 * EN_R | EN_STAGE6
1343 *
1344 * @param PDMx PDM instance
1345 * @retval None
1346 */
1347 __STATIC_INLINE void ll_pdm_enable_right_stage6(pdm_regs_t *PDMx)
1348 {
1349 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_STAGE6, LL_PDM_RIGHT_STAGE6_ENABLE);
1350 }
1351
1352 /**
1353 * @brief Disable PDM Module right stage6
1354 * @note This function is used to set PDM right stage6 enable
1355
1356 * Register|BitsName
1357 * --------|--------
1358 * EN_R | EN_STAGE6
1359 *
1360 * @param PDMx PDM instance
1361 * @retval None
1362 */
1363 __STATIC_INLINE void ll_pdm_disable_right_stage6(pdm_regs_t *PDMx)
1364 {
1365 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_STAGE6, LL_PDM_RIGHT_STAGE6_DISABLE);
1366 }
1367
1368 /**
1369 * @brief is PDM enables right stage6
1370 * @note This function is used to check the PDM Module right stage6 is enabled.
1371 *
1372 * Register|BitsName
1373 * --------|--------
1374 * EN_R | EN_STAGE6
1375 *
1376 * @param PDMx PDM instance.
1377 * @retval None
1378 */
1379 __STATIC_INLINE uint32_t ll_pdm_is_enable_right_stage6(pdm_regs_t *PDMx)
1380 {
1381 return (READ_BITS(PDMx->EN_R, PDM_EN_R_EN_STAGE6) == LL_PDM_RIGHT_STAGE6_ENABLE);
1382 }
1383
1384 /**
1385 * @brief Enable PDM Module Left stage7.
1386 * @note This function is used to set PDM Left stage7 enable
1387 *
1388 * Register|BitsName
1389 * --------|--------
1390 * EN_L | EN_STAGE7
1391 *
1392 * @param PDMx PDM instance
1393 * @retval None
1394 */
1395 __STATIC_INLINE void ll_pdm_enable_left_stage7(pdm_regs_t *PDMx)
1396 {
1397 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_STAGE7, LL_PDM_LEFT_STAGE7_ENABLE);
1398 }
1399
1400 /**
1401 * @brief Disable PDM Module Left stage7.
1402 * @note This function is used to set PDM Left stage7 enable
1403
1404 * Register|BitsName
1405 * --------|--------
1406 * EN_L | EN_STAGE7
1407 *
1408 * @param PDMx PDM instance
1409 * @retval None
1410 */
1411 __STATIC_INLINE void ll_pdm_disable_left_stage7(pdm_regs_t *PDMx)
1412 {
1413 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_STAGE7, LL_PDM_LEFT_STAGE7_DISABLE);
1414 }
1415
1416 /**
1417 * @brief is PDM enables left stage7
1418 * @note This function is used to check the PDM Module left stage7 is enabled.
1419 *
1420 * Register|BitsName
1421 * --------|--------
1422 * EN_L | EN_STAGE7
1423 *
1424 * @param PDMx PDM instance.
1425 * @retval None
1426 */
1427 __STATIC_INLINE uint32_t ll_pdm_is_enable_left_stage7(pdm_regs_t *PDMx)
1428 {
1429 return (READ_BITS(PDMx->EN_L, PDM_EN_L_EN_STAGE7) == LL_PDM_LEFT_STAGE7_ENABLE);
1430 }
1431
1432 /**
1433 * @brief Enable PDM Module right stage7
1434 * @note This function is used to set PDM right stage7 enable
1435 *
1436 * Register|BitsName
1437 * --------|--------
1438 * EN_R | EN_STAGE7
1439 *
1440 * @param PDMx PDM instance
1441 * @retval None
1442 */
1443 __STATIC_INLINE void ll_pdm_enable_right_stage7(pdm_regs_t *PDMx)
1444 {
1445 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_STAGE7, LL_PDM_RIGHT_STAGE7_ENABLE);
1446 }
1447
1448 /**
1449 * @brief Disable PDM Module right stage7
1450 * @note This function is used to set PDM right stage7 enable
1451
1452 * Register|BitsName
1453 * --------|--------
1454 * EN_R | EN_STAGE7
1455 *
1456 * @param PDMx PDM instance
1457 * @retval None
1458 */
1459 __STATIC_INLINE void ll_pdm_disable_right_stage7(pdm_regs_t *PDMx)
1460 {
1461 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_STAGE7, LL_PDM_RIGHT_STAGE7_DISABLE);
1462 }
1463
1464 /**
1465 * @brief is PDM enables right stage7
1466 * @note This function is used to check the PDM Module right stage7 is enabled.
1467 *
1468 * Register|BitsName
1469 * --------|--------
1470 * EN_R | EN_STAGE7
1471 *
1472 * @param PDMx PDM instance.
1473 * @retval None
1474 */
1475 __STATIC_INLINE uint32_t ll_pdm_is_enable_right_stage7(pdm_regs_t *PDMx)
1476 {
1477 return (READ_BITS(PDMx->EN_R, PDM_EN_R_EN_STAGE7) == LL_PDM_RIGHT_STAGE7_ENABLE);
1478 }
1479
1480 /**
1481 * @brief Enable PDM Module Left hpf
1482 * @note This function is used to set PDM Left hpf enable
1483 *
1484 * Register|BitsName
1485 * --------|--------
1486 * EN_L | EN_HPF
1487 *
1488 * @param PDMx PDM instance
1489 * @retval None
1490 */
1491 __STATIC_INLINE void ll_pdm_enable_left_hpf(pdm_regs_t *PDMx)
1492 {
1493 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_HPF, LL_PDM_LEFT_HPF_ENABLE);
1494 }
1495
1496 /**
1497 * @brief Disable PDM Module Left hpf.
1498 * @note This function is used to set PDM Left hpf enable
1499
1500 * Register|BitsName
1501 * --------|--------
1502 * EN_L | EN_HPF
1503 *
1504 * @param PDMx PDM instance
1505 * @retval None
1506 */
1507 __STATIC_INLINE void ll_pdm_disable_left_hpf(pdm_regs_t *PDMx)
1508 {
1509 MODIFY_REG(PDMx->EN_L, PDM_EN_L_EN_HPF, LL_PDM_LEFT_HPF_DISABLE);
1510 }
1511
1512 /**
1513 * @brief is PDM enables left hpf
1514 * @note This function is used to check the PDM Module left hpf is enabled.
1515 *
1516 * Register|BitsName
1517 * --------|--------
1518 * EN_L | EN_HPF
1519 *
1520 * @param PDMx PDM instance.
1521 * @retval None
1522 */
1523 __STATIC_INLINE uint32_t ll_pdm_is_enable_left_hpf(pdm_regs_t *PDMx)
1524 {
1525 return (READ_BITS(PDMx->EN_L, PDM_EN_L_EN_HPF) == LL_PDM_LEFT_HPF_ENABLE);
1526 }
1527
1528 /**
1529 * @brief Enable PDM Module right hpf
1530 * @note This function is used to set PDM right hpf enable
1531 *
1532 * Register|BitsName
1533 * --------|--------
1534 * EN_R | EN_HPF
1535 *
1536 * @param PDMx PDM instance
1537 * @retval None
1538 */
1539 __STATIC_INLINE void ll_pdm_enable_right_hpf(pdm_regs_t *PDMx)
1540 {
1541 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_HPF, LL_PDM_RIGHT_HPF_ENABLE);
1542 }
1543
1544 /**
1545 * @brief Disable PDM Module right hpf.
1546 * @note This function is used to set PDM right hpf enable
1547
1548 * Register|BitsName
1549 * --------|--------
1550 * EN_R | EN_HPF
1551 *
1552 * @param PDMx PDM instance
1553 * @retval None
1554 */
1555 __STATIC_INLINE void ll_pdm_disable_right_hpf(pdm_regs_t *PDMx)
1556 {
1557 MODIFY_REG(PDMx->EN_R, PDM_EN_R_EN_HPF, LL_PDM_RIGHT_HPF_DISABLE);
1558 }
1559
1560 /**
1561 * @brief is PDM enables right hpf
1562 * @note This function is used to check the PDM Module right hpf is enabled.
1563 *
1564 * Register|BitsName
1565 * --------|--------
1566 * EN_R | EN_HPF
1567 *
1568 * @param PDMx PDM instance.
1569 * @retval None
1570 */
1571 __STATIC_INLINE uint32_t ll_pdm_is_enable_right_hpf(pdm_regs_t *PDMx)
1572 {
1573 return (READ_BITS(PDMx->EN_R, PDM_EN_R_EN_HPF) == LL_PDM_RIGHT_HPF_ENABLE);
1574 }
1575
1576 /**
1577 * @brief Set PDM left rxd upsample
1578 * @note This function is used to set PDM left rxd upsample
1579 *
1580 * Register|BitsName
1581 * --------|--------
1582 * INPUT_CFG_L | RXD_UPSAMPLE
1583 *
1584 * @param PDMx PDM instance
1585 * @param rxd_upsample This parameter can be one of the following values:
1586 * Min_Data = 0 and Max_Data = 0x1
1587 * @retval None
1588 */
1589 __STATIC_INLINE void ll_pdm_set_left_rxd_upsample(pdm_regs_t *PDMx, uint32_t rxd_upsample)
1590 {
1591 MODIFY_REG(PDMx->IN_CFG_L, PDM_IN_CFG_L_RX_UPSMP, rxd_upsample << PDM_IN_CFG_L_RX_UPSMP_POS);
1592 }
1593
1594 /**
1595 * @brief Get PDM left rxd upsample.
1596 * @note This function is used to get PDM left rxd upsample
1597 *
1598 * Register|BitsName
1599 * --------|--------
1600 * INPUT_CFG_L | RXD_UPSAMPLE
1601 *
1602 * @param PDMx PDM instance
1603 * @retval can be one of the following values:
1604 * 0x0 or 0x1
1605 */
1606 __STATIC_INLINE uint32_t ll_pdm_get_left_rxd_upsample(pdm_regs_t *PDMx)
1607 {
1608 return READ_BITS(PDMx->IN_CFG_L, PDM_IN_CFG_L_RX_UPSMP >> PDM_IN_CFG_L_RX_UPSMP_POS);
1609 }
1610
1611 /**
1612 * @brief Set PDM right rxd upsample
1613 * @note This function is used to set PDM right rxd upsample
1614 *
1615 * Register|BitsName
1616 * --------|--------
1617 * INPUT_CFG_R | RXD_UPSAMPLE
1618 *
1619 * @param PDMx PDM instance
1620 * @param rxd_upsample This parameter can be one of the following values:
1621 * Min_Data = 0 and Max_Data = 0x1
1622 * @retval None
1623 */
1624 __STATIC_INLINE void ll_pdm_set_right_rxd_upsample(pdm_regs_t *PDMx, uint32_t rxd_upsample)
1625 {
1626 MODIFY_REG(PDMx->IN_CFG_R, PDM_IN_CFG_R_RX_UPSMP, rxd_upsample << PDM_IN_CFG_R_RX_UPSMP_POS);
1627 }
1628
1629 /**
1630 * @brief Get PDM right rxd upsample.
1631 * @note This function is used to get PDM right rxd upsample
1632 *
1633 * Register|BitsName
1634 * --------|--------
1635 * INPUT_CFG_L | RXD_UPSAMPLE
1636 *
1637 * @param PDMx PDM instance
1638 * @retval can be one of the following values:
1639 * 0x0 or 0x1
1640 */
1641 __STATIC_INLINE uint32_t ll_pdm_get_right_rxd_upsample(pdm_regs_t *PDMx)
1642 {
1643 return READ_BITS(PDMx->IN_CFG_R, PDM_IN_CFG_R_RX_UPSMP >> PDM_IN_CFG_R_RX_UPSMP_POS);
1644 }
1645
1646 /**
1647 * @brief Set PDM left statge init
1648 * @note This function is used to set PDM left statge init
1649 *
1650 * Register|BitsName
1651 * --------|--------
1652 * INPUT_CFG_L | STAGE_INIT
1653 *
1654 * @param PDMx PDM instance
1655 * @param stage_init This parameter can be one of the following values:
1656 * Min_Data = 0 and Max_Data = 0x2
1657 * @retval None
1658 */
1659 __STATIC_INLINE void ll_pdm_set_left_stage_init(pdm_regs_t *PDMx, uint32_t stage_init)
1660 {
1661 MODIFY_REG(PDMx->IN_CFG_L, PDM_IN_CFG_L_STAGE_INIT, stage_init << PDM_IN_CFG_L_STAGE_INIT_POS);
1662 }
1663
1664 /**
1665 * @brief Get PDM left statge init
1666 * @note This function is used to get PDM left statge init
1667 *
1668 * Register|BitsName
1669 * --------|--------
1670 * INPUT_CFG_L | STAGE_INIT
1671 *
1672 * @param PDMx PDM instance
1673 * @retval can be one of the following values:
1674 * 0x0 or 0x2
1675 */
1676 __STATIC_INLINE uint32_t ll_pdm_get_left_stage_init(pdm_regs_t *PDMx)
1677 {
1678 return (READ_BITS(PDMx->IN_CFG_L, PDM_IN_CFG_L_STAGE_INIT) >> PDM_IN_CFG_L_STAGE_INIT_POS) ;
1679 }
1680
1681 /**
1682 * @brief Set PDM right statge init
1683 * @note This function is used to set PDM right statge init
1684 *
1685 * Register|BitsName
1686 * --------|--------
1687 * INPUT_CFG_R | STAGE_INIT
1688 *
1689 * @param PDMx PDM instance
1690 * @param stage_init This parameter can be one of the following values:
1691 * Min_Data = 0 and Max_Data = 0x2
1692 * @retval None
1693 */
1694 __STATIC_INLINE void ll_pdm_set_right_stage_init(pdm_regs_t *PDMx, uint32_t stage_init)
1695 {
1696 MODIFY_REG(PDMx->IN_CFG_R, PDM_IN_CFG_R_STAGE_INIT, stage_init << PDM_IN_CFG_R_STAGE_INIT_POS);
1697 }
1698
1699 /**
1700 * @brief Get PDM right statge init
1701 * @note This function is used to get PDM right statge init
1702 *
1703 * Register|BitsName
1704 * --------|--------
1705 * INPUT_CFG_R | STAGE_INIT
1706 *
1707 * @param PDMx PDM instance
1708 * @retval can be one of the following values:
1709 * 0x0 or 0x2
1710 */
1711 __STATIC_INLINE uint32_t ll_pdm_get_right_stage_init(pdm_regs_t *PDMx)
1712 {
1713 return (READ_BITS(PDMx->IN_CFG_R, PDM_IN_CFG_R_STAGE_INIT) >> PDM_IN_CFG_R_STAGE_INIT_POS) ;
1714 }
1715
1716 /**
1717 * @brief Set PDM left upsample factor
1718 * @note This function is used to set PDM left upsample factor
1719 *
1720 * Register|BitsName
1721 * --------|--------
1722 * LPF_CFG_L | UPSAMPLE_FACTOR
1723 *
1724 * @param PDMx PDM instance
1725 * @param upsample_factor This parameter can be one of the following values:
1726 * Min_Data = 0 and Max_Data = 0x2
1727 * @retval None
1728 */
1729 __STATIC_INLINE void ll_pdm_set_left_upsample_factor(pdm_regs_t *PDMx, uint32_t upsample_factor)
1730 {
1731 MODIFY_REG(PDMx->LPF_CFG_L, PDM_LPF_CFG_L_UPSMP_FACTOR, upsample_factor << PDM_LPF_CFG_L_UPSMP_FACTOR_POS);
1732 }
1733
1734 /**
1735 * @brief Get PDM left upsample factor
1736 * @note This function is used to get PDM left upsample factor
1737 *
1738 * Register|BitsName
1739 * --------|--------
1740 * LPF_CFG_L | UPSAMPLE_FACTOR
1741 *
1742 * @param PDMx PDM instance
1743 * @retval can be one of the following values:
1744 * 0x0 or 0x2
1745 */
1746 __STATIC_INLINE uint32_t ll_pdm_get_left_upsample_factor(pdm_regs_t *PDMx)
1747 {
1748 return (READ_BITS(PDMx->LPF_CFG_L, PDM_LPF_CFG_L_UPSMP_FACTOR) >> PDM_LPF_CFG_L_UPSMP_FACTOR_POS) ;
1749 }
1750
1751 /**
1752 * @brief Set PDM right upsample factor
1753 * @note This function is used to set PDM right upsample factor
1754 *
1755 * Register|BitsName
1756 * --------|--------
1757 * LPF_CFG_R | UPSAMPLE_FACTOR
1758 *
1759 * @param PDMx PDM instance
1760 * @param upsample_factor This parameter can be one of the following values:
1761 * Min_Data = 0 and Max_Data = 0x2
1762 * @retval None
1763 */
1764 __STATIC_INLINE void ll_pdm_set_right_upsample_factor(pdm_regs_t *PDMx, uint32_t upsample_factor)
1765 {
1766 MODIFY_REG(PDMx->LPF_CFG_R, PDM_LPF_CFG_R_UPSMP_FACTOR, upsample_factor << PDM_LPF_CFG_R_UPSMP_FACTOR_POS);
1767 }
1768
1769 /**
1770 * @brief Get PDM right upsample factor
1771 * @note This function is used to get PDM right upsample factor
1772 *
1773 * Register|BitsName
1774 * --------|--------
1775 * LPF_CFG_R | UPSAMPLE_FACTOR
1776 *
1777 * @param PDMx PDM instance
1778 * @retval can be one of the following values:
1779 * 0x0 or 0x2
1780 */
1781 __STATIC_INLINE uint32_t ll_pdm_get_right_upsample_factor(pdm_regs_t *PDMx)
1782 {
1783 return (READ_BITS(PDMx->LPF_CFG_R, PDM_LPF_CFG_R_UPSMP_FACTOR) >> PDM_LPF_CFG_R_UPSMP_FACTOR_POS) ;
1784 }
1785
1786 /**
1787 * @brief Enable PDM left hpf_bypass
1788 * @note This function is used to set PDM left hpf_bypass
1789 *
1790 * Register|BitsName
1791 * --------|--------
1792 * HPF_CFG_L | HPY_BYPASS
1793 *
1794 * @param PDMx PDM instance
1795 * @retval None
1796 */
1797 __STATIC_INLINE void ll_pdm_enable_left_hpy_bypass(pdm_regs_t *PDMx)
1798 {
1799 MODIFY_REG(PDMx->HPF_CFG_L, PDM_HPF_CFG_L_BYPASS, LL_PDM_LEFT_HPF_BYPASS_ENABLE);
1800 }
1801
1802 /**
1803 * @brief Disable PDM left hpf_bypass
1804 * @note This function is used to disable PDM left hpf_bypass
1805 *
1806 * Register|BitsName
1807 * --------|--------
1808 * HPF_CFG_L | HPY_BYPASS
1809 *
1810 * @param PDMx PDM instance
1811 */
1812 __STATIC_INLINE void ll_pdm_disable_left_hpy_bypass(pdm_regs_t *PDMx)
1813 {
1814 MODIFY_REG(PDMx->HPF_CFG_L, PDM_HPF_CFG_L_BYPASS, LL_PDM_LEFT_HPF_BYPASS_DISABLE);
1815 }
1816
1817 /**
1818 * @brief is PDM enables right stage7
1819 * @note This function is used to check the PDM Module right stage7 is enabled.
1820 *
1821 * Register|BitsName
1822 * --------|--------
1823 * EN_R | EN_STAGE7
1824 *
1825 * @param PDMx PDM instance.
1826 * @retval None
1827 */
1828 __STATIC_INLINE uint32_t ll_pdm_is_enable_left_hpy_bypass(pdm_regs_t *PDMx)
1829 {
1830 return (READ_BITS(PDMx->HPF_CFG_L, PDM_HPF_CFG_L_BYPASS) == LL_PDM_LEFT_HPF_BYPASS_ENABLE);
1831 }
1832
1833 /**
1834 * @brief Enable PDM right hpf_bypass
1835 * @note This function is used to set PDM right hpf_bypass
1836 *
1837 * Register|BitsName
1838 * --------|--------
1839 * HPF_CFG_R | HPY_BYPASS
1840 *
1841 * @param PDMx PDM instance
1842 * @retval None
1843 */
1844 __STATIC_INLINE void ll_pdm_enable_right_hpy_bypass(pdm_regs_t *PDMx)
1845 {
1846 MODIFY_REG(PDMx->HPF_CFG_R, PDM_HPF_CFG_R_BYPASS, LL_PDM_RIGHT_HPF_BYPASS_ENABLE);
1847 }
1848
1849 /**
1850 * @brief Disable PDM right hpf_bypass
1851 * @note This function is used to disable PDM right hpf_bypass
1852 *
1853 * Register|BitsName
1854 * --------|--------
1855 * HPF_CFG_R | HPY_BYPASS
1856 *
1857 * @param PDMx PDM instance
1858 */
1859 __STATIC_INLINE void ll_pdm_disable_right_hpy_bypass(pdm_regs_t *PDMx)
1860 {
1861 MODIFY_REG(PDMx->HPF_CFG_R, PDM_HPF_CFG_R_BYPASS, LL_PDM_RIGHT_HPF_BYPASS_DISABLE);
1862 }
1863
1864 /**
1865 * @brief is PDM enables right hpf_bypass
1866 * @note This function is used to check the PDM Module right hpf_bypass is enabled.
1867 *
1868 * Register|BitsName
1869 * --------|--------
1870 * HPF_CFG_R | HPY_BYPASS
1871 *
1872 * @param PDMx PDM instance.
1873 * @retval None
1874 */
1875 __STATIC_INLINE uint32_t ll_pdm_is_enable_right_hpy_bypass(pdm_regs_t *PDMx)
1876 {
1877 return (READ_BITS(PDMx->HPF_CFG_R, PDM_HPF_CFG_R_BYPASS) == LL_PDM_RIGHT_HPF_BYPASS_ENABLE);
1878 }
1879
1880 /**
1881 * @brief Set PDM left hpf corner
1882 * @note This function is used to set PDM left hpf corner
1883 *
1884 * Register|BitsName
1885 * --------|--------
1886 * HPF_CFG_L | HPF_CORNER
1887 *
1888 * @param PDMx PDM instance
1889 * @param hpf_corner This parameter can be one of the following values:
1890 * @arg @ref LL_PDM_LEFT_HPF_CORNER_0_25
1891 * @arg @ref LL_PDM_LEFT_HPF_CORNER_1
1892 * @arg @ref LL_PDM_LEFT_HPF_CORNER_4
1893 * @arg @ref LL_PDM_LEFT_HPF_CORNER_16
1894 * @retval None
1895 */
1896 __STATIC_INLINE void ll_pdm_set_left_hpf_corner(pdm_regs_t *PDMx, uint32_t hpf_corner)
1897 {
1898 MODIFY_REG(PDMx->HPF_CFG_L, PDM_HPF_CFG_L_CORNER, hpf_corner);
1899 }
1900
1901 /**
1902 * @brief Get PDM left hpf corner
1903 * @note This function is used to get PDM left hpf corner
1904 *
1905 * Register|BitsName
1906 * --------|--------
1907 * HPF_CFG_L | HPF_CORNER
1908 *
1909 * @param PDMx PDM instance
1910 * @retval can be one of the following values:
1911 * @arg @ref LL_PDM_LEFT_HPF_CORNER_0_25
1912 * @arg @ref LL_PDM_LEFT_HPF_CORNER_1
1913 * @arg @ref LL_PDM_LEFT_HPF_CORNER_4
1914 * @arg @ref LL_PDM_LEFT_HPF_CORNER_16
1915 */
1916 __STATIC_INLINE uint32_t ll_pdm_get_left_hpf_corner(pdm_regs_t *PDMx)
1917 {
1918 return READ_BITS(PDMx->HPF_CFG_L, PDM_HPF_CFG_L_CORNER);
1919 }
1920
1921 /**
1922 * @brief Set PDM right hpf corner
1923 * @note This function is used to set PDM right hpf corner
1924 *
1925 * Register|BitsName
1926 * --------|--------
1927 * HPF_CFG_R | HPF_CORNER
1928 *
1929 * @param PDMx PDM instance
1930 * @param hpf_corner This parameter can be one of the following values:
1931 * @arg @ref LL_PDM_LEFT_HPF_CORNER_0_25
1932 * @arg @ref LL_PDM_LEFT_HPF_CORNER_1
1933 * @arg @ref LL_PDM_LEFT_HPF_CORNER_4
1934 * @arg @ref LL_PDM_LEFT_HPF_CORNER_16
1935 * @retval None
1936 */
1937 __STATIC_INLINE void ll_pdm_set_right_hpf_corner(pdm_regs_t *PDMx, uint32_t hpf_corner)
1938 {
1939 MODIFY_REG(PDMx->HPF_CFG_R, PDM_HPF_CFG_R_CORNER, hpf_corner);
1940 }
1941
1942 /**
1943 * @brief Get PDM right hpf corner
1944 * @note This function is used to get PDM right hpf corner
1945 *
1946 * Register|BitsName
1947 * --------|--------
1948 * HPF_CFG_R | HPF_CORNER
1949 *
1950 * @param PDMx PDM instance
1951 * @retval can be one of the following values:
1952 * @arg @ref LL_PDM_LEFT_HPF_CORNER_0_25
1953 * @arg @ref LL_PDM_LEFT_HPF_CORNER_1
1954 * @arg @ref LL_PDM_LEFT_HPF_CORNER_4
1955 * @arg @ref LL_PDM_LEFT_HPF_CORNER_16
1956 */
1957 __STATIC_INLINE uint32_t ll_pdm_get_right_hpf_corner(pdm_regs_t *PDMx)
1958 {
1959 return READ_BITS(PDMx->HPF_CFG_R, PDM_HPF_CFG_R_CORNER);
1960 }
1961
1962 /**
1963 * @brief Enable PDM left hpf_freeze_en
1964 * @note This function is used to set PDM left hpf_freeze_en
1965 *
1966 * Register|BitsName
1967 * --------|--------
1968 * HPF_CFG_L | HPY_FREEZE_EN
1969 *
1970 * @param PDMx PDM instance
1971 * @retval None
1972 */
1973 __STATIC_INLINE void ll_pdm_enable_left_hpf_freeze_en(pdm_regs_t *PDMx)
1974 {
1975 MODIFY_REG(PDMx->HPF_CFG_L, PDM_HPF_CFG_L_FREEZE_EN, LL_PDM_LEFT_HPF_FREEZE_ENABLE);
1976 }
1977
1978 /**
1979 * @brief Disable PDM left hpf_freeze_en
1980 * @note This function is used to disable PDM left hpf_freeze_en
1981 *
1982 * Register|BitsName
1983 * --------|--------
1984 * HPF_CFG_L | HPY_FREEZE_EN
1985 *
1986 * @param PDMx PDM instance
1987 */
1988 __STATIC_INLINE void ll_pdm_disable_left_hpf_freeze_en(pdm_regs_t *PDMx)
1989 {
1990 MODIFY_REG(PDMx->HPF_CFG_L, PDM_HPF_CFG_L_FREEZE_EN, LL_PDM_LEFT_HPF_FREEZE_DISABLE);
1991 }
1992
1993 /**
1994 * @brief is PDM enables left hpf_freeze_en
1995 * @note This function is used to check the PDM Module left hpf_freeze_en is enabled.
1996 *
1997 * Register|BitsName
1998 * --------|--------
1999 * HPF_CFG_L | HPY_FREEZE_EN
2000 *
2001 * @param PDMx PDM instance.
2002 * @retval None
2003 */
2004 __STATIC_INLINE uint32_t ll_pdm_is_enable_left_hpf_freeze_en(pdm_regs_t *PDMx)
2005 {
2006 return (READ_BITS(PDMx->HPF_CFG_L, PDM_HPF_CFG_L_FREEZE_EN) == LL_PDM_LEFT_HPF_FREEZE_ENABLE);
2007 }
2008
2009 /**
2010 * @brief Enable PDM right hpf_freeze_en
2011 * @note This function is used to set PDM right hpf_freeze_en
2012 *
2013 * Register|BitsName
2014 * --------|--------
2015 * HPF_CFG_R | HPY_FREEZE_EN
2016 *
2017 * @param PDMx PDM instance
2018 * @retval None
2019 */
2020 __STATIC_INLINE void ll_pdm_enable_right_hpf_freeze_en(pdm_regs_t *PDMx)
2021 {
2022 MODIFY_REG(PDMx->HPF_CFG_R, PDM_HPF_CFG_R_FREEZE_EN, LL_PDM_RIGHT_HPF_FREEZE_ENABLE);
2023 }
2024
2025 /**
2026 * @brief Disable PDM right hpf_freeze_en
2027 * @note This function is used to disable PDM righthpf_freeze_en
2028 *
2029 * Register|BitsName
2030 * --------|--------
2031 * HPF_CFG_R | HPY_FREEZE_EN
2032 *
2033 * @param PDMx PDM instance
2034 */
2035 __STATIC_INLINE void ll_pdm_disable_right_hpf_freeze_en(pdm_regs_t *PDMx)
2036 {
2037 MODIFY_REG(PDMx->HPF_CFG_R, PDM_HPF_CFG_R_FREEZE_EN, LL_PDM_RIGHT_HPF_FREEZE_DISABLE);
2038 }
2039
2040 /**
2041 * @brief is PDM enables right hpf_freeze_en
2042 * @note This function is used to check the PDM Module right hpf_freeze_en is enabled.
2043 *
2044 * Register|BitsName
2045 * --------|--------
2046 * HPF_CFG_R | HPY_FREEZE_EN
2047 *
2048 * @param PDMx PDM instance.
2049 * @retval None
2050 */
2051 __STATIC_INLINE uint32_t ll_pdm_is_enable_right_hpf_freeze_en(pdm_regs_t *PDMx)
2052 {
2053 return (READ_BITS(PDMx->HPF_CFG_R, PDM_HPF_CFG_R_FREEZE_EN) == LL_PDM_RIGHT_HPF_FREEZE_ENABLE);
2054 }
2055
2056 /**
2057 * @brief Set PDM left pga_value
2058 * @note This function is used to set PDM left pga_value
2059 *
2060 * Register|BitsName
2061 * --------|--------
2062 * PGA_CFG_L | PGA_VAL
2063 *
2064 * @param PDMx PDM instance
2065 * @param pga_val This parameter can be one of the following values:
2066 * Min 0x0 Max 0x3FFF
2067 * @retval None
2068 */
2069 __STATIC_INLINE void ll_pdm_set_left_pga_val(pdm_regs_t *PDMx, uint32_t pga_val)
2070 {
2071 MODIFY_REG(PDMx->PGA_CFG_L, PDM_PGA_CFG_L_VAL, pga_val << PDM_PGA_CFG_L_VAL_POS);
2072 }
2073
2074 /**
2075 * @brief Get PDM left pga_value
2076 * @note This function is used to get PDM left pga_value
2077 *
2078 * Register|BitsName
2079 * --------|--------
2080 * PGA_CFG_L | PGA_VAL
2081 *
2082 * @param PDMx PDM instance
2083 * @retval can be one of the following values:
2084 * Min 0x0 Max 0x3FFF
2085 */
2086 __STATIC_INLINE uint32_t ll_pdm_get_left_pga_val(pdm_regs_t *PDMx)
2087 {
2088 return (READ_BITS(PDMx->PGA_CFG_L, PDM_PGA_CFG_L_VAL) >> PDM_PGA_CFG_L_VAL_POS);
2089 }
2090
2091 /**
2092 * @brief Set PDM right pga_value
2093 * @note This function is used to set PDM right pga_value
2094 *
2095 * Register|BitsName
2096 * --------|--------
2097 * PGA_CFG_R | PGA_VAL
2098 *
2099 * @param PDMx PDM instance
2100 * @param pga_val This parameter can be one of the following values:
2101 * Min 0x0 Max 0x3FFF
2102 * @retval None
2103 */
2104 __STATIC_INLINE void ll_pdm_set_right_pga_val(pdm_regs_t *PDMx, uint32_t pga_val)
2105 {
2106 MODIFY_REG(PDMx->PGA_CFG_R, PDM_PGA_CFG_R_VAL, pga_val << PDM_PGA_CFG_R_VAL_POS);
2107 }
2108
2109 /**
2110 * @brief Get PDM right pga_value
2111 * @note This function is used to get PDM right pga_value
2112 *
2113 * Register|BitsName
2114 * --------|--------
2115 * PGA_CFG_R | PGA_VAL
2116 *
2117 * @param PDMx PDM instance
2118 * @retval can be one of the following values:
2119 * Min 0x0 Max 0x3FFF
2120 */
2121 __STATIC_INLINE uint32_t ll_pdm_get_right_pga_val(pdm_regs_t *PDMx)
2122 {
2123 return (READ_BITS(PDMx->PGA_CFG_R, PDM_PGA_CFG_R_VAL) >> PDM_PGA_CFG_R_VAL_POS);
2124 }
2125
2126 /**
2127 * @brief Get PDM left data
2128 * @note This function is used to get PDM left data
2129 *
2130 * Register|BitsName
2131 * --------|--------
2132 * DATA_L | DATA
2133 *
2134 * @param PDMx PDM instance
2135 * @retval can be one of the following values:
2136 * Min 0x0 Max 0xFFFF
2137 */
2138 __STATIC_INLINE uint32_t ll_pdm_get_left_data(pdm_regs_t *PDMx)
2139 {
2140 return (READ_BITS(PDMx->DATA_L, PDM_DATA_L_DATA) >> PDM_DATA_L_DATA_POS);
2141 }
2142
2143 /**
2144 * @brief Get PDM right data
2145 * @note This function is used to get PDM right data
2146 *
2147 * Register|BitsName
2148 * --------|--------
2149 * DATA_R | DATA
2150 *
2151 * @param PDMx PDM instance
2152 * @retval can be one of the following values:
2153 * Min 0x0 Max 0xFFFF
2154 */
2155 __STATIC_INLINE uint32_t ll_pdm_get_right_data(pdm_regs_t *PDMx)
2156 {
2157 return (READ_BITS(PDMx->DATA_R, PDM_DATA_R_DATA) >> PDM_DATA_R_DATA_POS);
2158 }
2159
2160 /**
2161 * @brief Clean PDM left valid
2162 * @note This function is used to get PDM right overflow
2163 *
2164 * Register|BitsName
2165 * --------|--------
2166 * DATA_R | OVERFLOW
2167 *
2168 * @param PDMx PDM instance
2169 * @retval can be one of the following values:
2170 * LL_PDM_LEFT_DATA_OVERFLOW
2171 * LL_PDM_LEFGT_DATA_NO_OVERFLOW
2172 */
2173 __STATIC_INLINE void ll_pdm_left_clear_flag_valid(pdm_regs_t *PDMx)
2174 {
2175 MODIFY_REG(PDMx->DATA_L, PDM_DATA_L_VALID, (1 << PDM_DATA_L_VALID_POS));
2176 }
2177
2178 /**
2179 * @brief Get PDM left valid
2180 * @note This function is used to get PDM left valid
2181 *
2182 * Register|BitsName
2183 * --------|--------
2184 * DATA_L | VALID
2185 *
2186 * @param PDMx PDM instance
2187 * @retval can be one of the following values:
2188 * LL_PDM_LEFT_DATA_VALID
2189 * LL_PDM_LEFT_DATA_INVALID
2190 */
2191 __STATIC_INLINE uint32_t ll_pdm_left_is_active_flag_valid(pdm_regs_t *PDMx)
2192 {
2193 return ((READ_BITS(PDMx->DATA_L, PDM_DATA_L_VALID) >> PDM_DATA_L_VALID_POS) == 1);
2194 }
2195
2196 /**
2197 * @brief Clean PDM right valid
2198 * @note This function is used to get PDM right overflow
2199 *
2200 * Register|BitsName
2201 * --------|--------
2202 * DATA_R | OVERFLOW
2203 *
2204 * @param PDMx PDM instance
2205 * @retval can be one of the following values:
2206 * LL_PDM_LEFT_DATA_OVERFLOW
2207 * LL_PDM_LEFGT_DATA_NO_OVERFLOW
2208 */
2209 __STATIC_INLINE void ll_pdm_right_clear_flag_valid(pdm_regs_t *PDMx)
2210 {
2211 MODIFY_REG(PDMx->DATA_R, PDM_DATA_R_VALID, (1 << PDM_DATA_R_VALID_POS));
2212 }
2213
2214 /**
2215 * @brief Get PDM right valid
2216 * @note This function is used to get PDM right valid
2217 *
2218 * Register|BitsName
2219 * --------|--------
2220 * DATA_R | VALID
2221 *
2222 * @param PDMx PDM instance
2223 * @retval can be one of the following values:
2224 * LL_PDM_RIGHT_DATA_VALID
2225 * LL_PDM_RIGHT_DATA_INVALID
2226 */
2227 __STATIC_INLINE uint32_t ll_pdm_right_is_active_flag_valid(pdm_regs_t *PDMx)
2228 {
2229 return ((READ_BITS(PDMx->DATA_R, PDM_DATA_R_VALID) >> PDM_DATA_R_VALID_POS) == 1);
2230 }
2231
2232 /**
2233 * @brief Set PDM left overflow
2234 * @note This function is used to get PDM right overflow
2235 *
2236 * Register|BitsName
2237 * --------|--------
2238 * DATA_R | OVERFLOW
2239 *
2240 * @param PDMx PDM instance
2241 * @retval can be one of the following values:
2242 * LL_PDM_LEFT_DATA_OVERFLOW
2243 * LL_PDM_LEFGT_DATA_NO_OVERFLOW
2244 */
2245 __STATIC_INLINE void ll_pdm_left_clear_flag_overflow(pdm_regs_t *PDMx)
2246 {
2247 MODIFY_REG(PDMx->DATA_L, PDM_DATA_L_OVER, (1 << PDM_DATA_L_OVER_POS));
2248 }
2249
2250 /**
2251 * @brief Get PDM left overflow
2252 * @note This function is used to get PDM left overflow
2253 *
2254 * Register|BitsName
2255 * --------|--------
2256 * DATA_L | OVERFLOW
2257 *
2258 * @param PDMx PDM instance
2259 * @retval can be one of the following values:
2260 * LL_PDM_LEFT_DATA_OVERFLOW
2261 * LL_PDM_LEFT_DATA_NO_OVERFLOW
2262 */
2263 __STATIC_INLINE uint32_t ll_pdm_left_is_active_flag_overflow(pdm_regs_t *PDMx)
2264 {
2265 return ((READ_BITS(PDMx->DATA_L, PDM_DATA_L_OVER) >> PDM_DATA_L_OVER_POS) == 1);
2266 }
2267
2268 /**
2269 * @brief Set PDM right overflow
2270 * @note This function is used to get PDM right overflow
2271 *
2272 * Register|BitsName
2273 * --------|--------
2274 * DATA_R | OVERFLOW
2275 *
2276 * @param PDMx PDM instance
2277 * @retval can be one of the following values:
2278 * LL_PDM_RIGHT_DATA_OVERFLOW
2279 * LL_PDM_RIGHT_DATA_NO_OVERFLOW
2280 */
2281 __STATIC_INLINE void ll_pdm_right_clear_flag_overflow(pdm_regs_t *PDMx)
2282 {
2283 MODIFY_REG(PDMx->DATA_R, PDM_DATA_R_OVER, (1 << PDM_DATA_R_OVER_POS));
2284 }
2285
2286 /**
2287 * @brief Get PDM right overflow
2288 * @note This function is used to get PDM right overflow
2289 *
2290 * Register|BitsName
2291 * --------|--------
2292 * DATA_R | OVERFLOW
2293 *
2294 * @param PDMx PDM instance
2295 * @retval can be one of the following values:
2296 * LL_PDM_RIGHT_DATA_OVERFLOW
2297 * LL_PDM_RIGHT_DATA_NO_OVERFLOW
2298 */
2299 __STATIC_INLINE uint32_t ll_pdm_right_is_active_flag_overflow(pdm_regs_t *PDMx)
2300 {
2301 return ((READ_BITS(PDMx->DATA_R, PDM_DATA_R_OVER) >> PDM_DATA_R_OVER_POS) == 1);
2302 }
2303
2304 /**
2305 * @brief enable .valid inter
2306 *
2307 * Register|BitsName
2308 * --------|--------
2309 * INTR_L | VALID_INT_MASK
2310 *
2311 * @param PDMx PDMx instance
2312 * @retval State of bit (1 or 0).
2313 */
2314 __STATIC_INLINE void ll_pdm_left_enable_it_valid(pdm_regs_t *PDMx)
2315 {
2316 MODIFY_REG(PDMx->INT_L, PDM_INT_L_VALID_MASK,(0 << PDM_INT_L_VALID_MASK_POS));
2317 }
2318
2319 /**
2320 * @brief disable .valid inter
2321 *
2322 * Register|BitsName
2323 * --------|--------
2324 * INTR_L | VALID_INT_MASK
2325 *
2326 * @param PDMx PDMx instance
2327 * @retval None.
2328 */
2329 __STATIC_INLINE void ll_pdm_left_disable_it_valid(pdm_regs_t *PDMx)
2330 {
2331 MODIFY_REG(PDMx->INT_L, PDM_INT_L_VALID_MASK,(1 << PDM_INT_L_VALID_MASK_POS));
2332 }
2333
2334 /**
2335 * @brief Get .valid inter status
2336 *
2337 * Register|BitsName
2338 * --------|--------
2339 * INTR_L | VALID_INT_MASK
2340 *
2341 * @param PDMx PDMx instance
2342 * @retval None.
2343 */
2344 __STATIC_INLINE uint32_t ll_pdm_left_is_enable_it_valid(pdm_regs_t *PDMx)
2345 {
2346 return ((READ_BITS(PDMx->INT_L, PDM_INT_L_VALID_MASK) >> PDM_INT_L_VALID_MASK_POS) == 0);
2347 }
2348
2349 /**
2350 * @brief enable .valid inter
2351 *
2352 * Register|BitsName
2353 * --------|--------
2354 * INTR_R | VALID_INT_MASK
2355 *
2356 * @param PDMx PDMx instance
2357 * @retval State of bit (1 or 0).
2358 */
2359 __STATIC_INLINE void ll_pdm_right_enable_it_valid(pdm_regs_t *PDMx)
2360 {
2361 MODIFY_REG(PDMx->INT_R, PDM_INT_R_VALID_MASK,(0 << PDM_INT_R_VALID_MASK_POS));
2362 }
2363
2364 /**
2365 * @brief Clean the status of .valid inter status
2366 *
2367 * Register|BitsName
2368 * --------|--------
2369 * INTR_R | VALID_INT_MASK
2370 *
2371 * @param PDMx PDMx instance
2372 * @retval None.
2373 */
2374 __STATIC_INLINE void ll_pdm_right_disable_it_valid(pdm_regs_t *PDMx)
2375 {
2376 MODIFY_REG(PDMx->INT_R, PDM_INT_R_VALID_MASK,(1 << PDM_INT_R_VALID_MASK_POS));
2377 }
2378
2379 /**
2380 * @brief Get .valid inter status
2381 *
2382 * Register|BitsName
2383 * --------|--------
2384 * INTR_R | VALID_INT_MASK
2385 *
2386 * @param PDMx PDMx instance
2387 * @retval None.
2388 */
2389 __STATIC_INLINE uint32_t ll_pdm_right_is_enable_it_valid(pdm_regs_t *PDMx)
2390 {
2391 return ((READ_BITS(PDMx->INT_R, PDM_INT_R_VALID_MASK) >> PDM_INT_R_VALID_MASK_POS) == 0);
2392 }
2393
2394 /**
2395 * @brief enable .overflow inter
2396 *
2397 * Register|BitsName
2398 * --------|--------
2399 * INTR_L | OVERFLOW_INT_MASK
2400 *
2401 * @param PDMx PDMx instance
2402 * @retval State of bit (1 or 0).
2403 */
2404 __STATIC_INLINE void ll_pdm_left_enable_it_overflow(pdm_regs_t *PDMx)
2405 {
2406 MODIFY_REG(PDMx->INT_L, PDM_INT_L_OVER_MASK,(0 << PDM_INT_L_OVER_MASK_POS));
2407 }
2408
2409 /**
2410 * @brief disable .overflow inter
2411 *
2412 * Register|BitsName
2413 * --------|--------
2414 * INTR_L | OVERFLOW_INT_MASK
2415 *
2416 * @param PDMx PDMx instance
2417 * @retval None.
2418 */
2419 __STATIC_INLINE void ll_pdm_left_disable_it_overflow(pdm_regs_t *PDMx)
2420 {
2421 MODIFY_REG(PDMx->INT_L, PDM_INT_L_OVER_MASK,(1 << PDM_INT_L_OVER_MASK_POS));
2422 }
2423
2424 /**
2425 * @brief Get .overflow inter status
2426 *
2427 * Register|BitsName
2428 * --------|--------
2429 * INTR_L | OVERFLOW_INT_MASK
2430 *
2431 * @param PDMx PDMx instance
2432 * @retval None.
2433 */
2434 __STATIC_INLINE uint32_t ll_pdm_left_is_enable_it_overflow(pdm_regs_t *PDMx)
2435 {
2436 return ((READ_BITS(PDMx->INT_L, PDM_INT_L_OVER_MASK) >> PDM_INT_L_OVER_MASK_POS) == 0);
2437 }
2438
2439 /**
2440 * @brief enable .overflow inter
2441 *
2442 * Register|BitsName
2443 * --------|--------
2444 * INTR_R | OVERFLOW_INT_MASK
2445 *
2446 * @param PDMx PDMx instance
2447 * @retval State of bit (1 or 0).
2448 */
2449 __STATIC_INLINE void ll_pdm_right_enable_it_overflow(pdm_regs_t *PDMx)
2450 {
2451 MODIFY_REG(PDMx->INT_R, PDM_INT_R_OVER_MASK,(0 << PDM_INT_R_OVER_MASK_POS));
2452 }
2453
2454 /**
2455 * @brief disable .overflow inter
2456 *
2457 * Register|BitsName
2458 * --------|--------
2459 * INTR_R | OVERFLOW_INT_MASK
2460 *
2461 * @param PDMx PDMx instance
2462 * @retval None.
2463 */
2464 __STATIC_INLINE void ll_pdm_right_disable_it_overflow(pdm_regs_t *PDMx)
2465 {
2466 MODIFY_REG(PDMx->INT_R, PDM_INT_R_OVER_MASK,(1 << PDM_INT_R_OVER_MASK_POS));
2467 }
2468
2469 /**
2470 * @brief Get .overflow inter status
2471 *
2472 * Register|BitsName
2473 * --------|--------
2474 * INTR_R | OVERFLOW_INT_MASK
2475 *
2476 * @param PDMx PDMx instance
2477 * @retval None.
2478 */
2479 __STATIC_INLINE uint32_t ll_pdm_right_is_enable_it_overflow(pdm_regs_t *PDMx)
2480 {
2481 return ((READ_BITS(PDMx->INT_R, PDM_INT_R_OVER_MASK) >> PDM_INT_R_OVER_MASK_POS) == 0);
2482 }
2483
2484 /**
2485 * @brief set valid dma mask enable
2486 *
2487 * Register|BitsName
2488 * --------|--------
2489 * DATA_L | VALID_DMA_MASK
2490 *
2491 * @param PDMx PDMx instance
2492 * @retval None.
2493 */
2494 __STATIC_INLINE void ll_pdm_left_enable_dma_mask(pdm_regs_t *PDMx)
2495 {
2496 MODIFY_REG(PDMx->DATA_L, PDM_DATA_L_VALID_DMA_MASK,PDM_DATA_L_VALID_DMA_MASK_ENABLE);
2497 }
2498
2499 /**
2500 * @brief set valid dma mask disable
2501 *
2502 * Register|BitsName
2503 * --------|--------
2504 * DATA_L | VALID_DMA_MASK
2505 *
2506 * @param PDMx PDMx instance
2507 * @retval None.
2508 */
2509 __STATIC_INLINE void ll_pdm_left_disable_dma_mask(pdm_regs_t *PDMx)
2510 {
2511 MODIFY_REG(PDMx->DATA_L, PDM_DATA_L_VALID_DMA_MASK,PDM_DATA_L_VALID_DMA_MASK_DISABLE);
2512 }
2513
2514 /**
2515 * @brief set valid dma mask enable
2516 *
2517 * Register|BitsName
2518 * --------|--------
2519 * DATA_R | VALID_DMA_MASK
2520 *
2521 * @param PDMx PDMx instance
2522 * @retval None.
2523 */
2524 __STATIC_INLINE void ll_pdm_right_enable_dma_mask(pdm_regs_t *PDMx)
2525 {
2526 MODIFY_REG(PDMx->DATA_R, PDM_DATA_R_VALID_DMA_MASK,PDM_DATA_R_VALID_DMA_MASK_ENABLE);
2527 }
2528
2529 /**
2530 * @brief set valid dma mask disable
2531 *
2532 * Register|BitsName
2533 * --------|--------
2534 * DATA_R | VALID_DMA_MASK
2535 *
2536 * @param PDMx PDMx instance
2537 * @retval None.
2538 */
2539 __STATIC_INLINE void ll_pdm_right_disable_dma_mask(pdm_regs_t *PDMx)
2540 {
2541 MODIFY_REG(PDMx->DATA_R, PDM_DATA_R_VALID_DMA_MASK,PDM_DATA_R_VALID_DMA_MASK_DISABLE);
2542 }
2543
2544 /** @} */
2545
2546 /** @defgroup PDM_LL_EF_Init Initialization and de-initialization functions
2547 * @{
2548 */
2549
2550 /**
2551 * @brief De-initialize the PDM registers to their default reset values.
2552 * @param PDMx instance
2553 * @retval An error_status_t enumeration value:
2554 * - SUCCESS: PDM registers are de-initialized
2555 * - ERROR: PDM registers are not de-initialized
2556 */
2557 error_status_t ll_pdm_deinit(pdm_regs_t *PDMx);
2558
2559 /**
2560 * @brief Initialize the PDM registers according to the specified parameters in p_pdm_init.
2561 * @param PDMx instance
2562 * @param p_pdm_init pointer to a @ref ll_pdm_init_t structure.
2563 * @retval An error_status_t enumeration value:
2564 * - SUCCESS: PDM registers are initialized
2565 * - ERROR: Not applicable
2566 */
2567 error_status_t ll_pdm_init(pdm_regs_t *PDMx, ll_pdm_init_t *p_pdm_init);
2568
2569 /**
2570 * @brief Set each field of a @ref ll_pdm_init_t type structure to default value.
2571 * @param p_pdm_init Pointer to a @ref ll_pdm_init_t structure
2572 * whose fields will be set to default values.
2573 * @retval None
2574 */
2575 void ll_pdm_struct_init(ll_pdm_init_t *p_pdm_init);
2576
2577 /** @} */
2578
2579 /** @} */
2580
2581 #endif /* PDM */
2582
2583 #ifdef __cplusplus
2584 }
2585 #endif
2586
2587 #endif /* __GR55xx_LL_PDM_H__ */
2588
2589 /** @} */
2590
2591 /** @} */
2592
2593 /** @} */