1 /*
2  * Copyright (c) 2006-2023, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2018-12-24     zylx         first version
9  */
10 
11 #ifndef __ADC_CONFIG_H__
12 #define __ADC_CONFIG_H__
13 
14 #include <rtthread.h>
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 #ifdef BSP_USING_ADC1
21 #ifndef ADC1_CONFIG
22 #define ADC1_CONFIG                                                 \
23     {                                                               \
24        .Instance                   = ADC1,                          \
25        .Init.ClockPrescaler        = ADC_CLOCK_ASYNC_DIV1,          \
26        .Init.Resolution            = ADC_RESOLUTION_12B,            \
27        .Init.DataAlign             = ADC_DATAALIGN_RIGHT,           \
28        .Init.ScanConvMode          = ADC_SCAN_DIRECTION_FORWARD,    \
29        .Init.EOCSelection          = ADC_EOC_SINGLE_CONV,           \
30        .Init.LowPowerAutoWait      = DISABLE,                       \
31        .Init.LowPowerAutoPowerOff  = DISABLE,                       \
32        .Init.ContinuousConvMode    = DISABLE,                       \
33        .Init.DiscontinuousConvMode = ENABLE,                        \
34        .Init.ExternalTrigConv      = ADC_SOFTWARE_START,            \
35        .Init.ExternalTrigConvEdge  = ADC_EXTERNALTRIGCONVEDGE_NONE, \
36        .Init.DMAContinuousRequests = ENABLE,                        \
37        .Init.Overrun               = ADC_OVR_DATA_OVERWRITTEN,      \
38     }
39 #endif /* ADC1_CONFIG */
40 #endif /* BSP_USING_ADC1 */
41 
42 #ifdef __cplusplus
43 }
44 #endif
45 
46 #endif /* __ADC_CONFIG_H__ */
47