2018-12-10 09:48:01 +08:00
|
|
|
/*
|
2021-03-08 22:40:39 +08:00
|
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
2018-12-10 09:48:01 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2018-12-07 zylx first version
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ADC_CONFIG_H__
|
|
|
|
#define __ADC_CONFIG_H__
|
|
|
|
|
|
|
|
#include <rtthread.h>
|
|
|
|
|
2019-01-09 10:10:39 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2018-12-10 09:48:01 +08:00
|
|
|
#ifdef BSP_USING_ADC1
|
|
|
|
#ifndef ADC1_CONFIG
|
|
|
|
#define ADC1_CONFIG \
|
|
|
|
{ \
|
|
|
|
.Instance = ADC1, \
|
|
|
|
.Init.DataAlign = ADC_DATAALIGN_RIGHT, \
|
|
|
|
.Init.ScanConvMode = ADC_SCAN_DISABLE, \
|
|
|
|
.Init.ContinuousConvMode = DISABLE, \
|
|
|
|
.Init.NbrOfConversion = 1, \
|
|
|
|
.Init.DiscontinuousConvMode = DISABLE, \
|
|
|
|
.Init.NbrOfDiscConversion = 1, \
|
|
|
|
.Init.ExternalTrigConv = ADC_SOFTWARE_START, \
|
2021-03-08 22:40:39 +08:00
|
|
|
}
|
2018-12-10 09:48:01 +08:00
|
|
|
#endif /* ADC1_CONFIG */
|
|
|
|
#endif /* BSP_USING_ADC1 */
|
|
|
|
|
|
|
|
#ifdef BSP_USING_ADC2
|
|
|
|
#ifndef ADC2_CONFIG
|
|
|
|
#define ADC2_CONFIG \
|
|
|
|
{ \
|
|
|
|
.Instance = ADC2, \
|
|
|
|
.Init.DataAlign = ADC_DATAALIGN_RIGHT, \
|
|
|
|
.Init.ScanConvMode = ADC_SCAN_DISABLE, \
|
|
|
|
.Init.ContinuousConvMode = DISABLE, \
|
|
|
|
.Init.NbrOfConversion = 1, \
|
|
|
|
.Init.DiscontinuousConvMode = DISABLE, \
|
|
|
|
.Init.NbrOfDiscConversion = 1, \
|
|
|
|
.Init.ExternalTrigConv = ADC_SOFTWARE_START, \
|
2021-03-08 22:40:39 +08:00
|
|
|
}
|
2018-12-10 09:48:01 +08:00
|
|
|
#endif /* ADC2_CONFIG */
|
|
|
|
#endif /* BSP_USING_ADC2 */
|
|
|
|
|
|
|
|
#ifdef BSP_USING_ADC3
|
|
|
|
#ifndef ADC3_CONFIG
|
|
|
|
#define ADC3_CONFIG \
|
|
|
|
{ \
|
|
|
|
.Instance = ADC3, \
|
|
|
|
.Init.DataAlign = ADC_DATAALIGN_RIGHT, \
|
|
|
|
.Init.ScanConvMode = ADC_SCAN_DISABLE, \
|
|
|
|
.Init.ContinuousConvMode = DISABLE, \
|
|
|
|
.Init.NbrOfConversion = 1, \
|
|
|
|
.Init.DiscontinuousConvMode = DISABLE, \
|
|
|
|
.Init.NbrOfDiscConversion = 1, \
|
|
|
|
.Init.ExternalTrigConv = ADC_SOFTWARE_START, \
|
2021-03-08 22:40:39 +08:00
|
|
|
}
|
2018-12-10 09:48:01 +08:00
|
|
|
#endif /* ADC3_CONFIG */
|
|
|
|
#endif /* BSP_USING_ADC3 */
|
|
|
|
|
2019-01-09 10:10:39 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2018-12-10 09:48:01 +08:00
|
|
|
#endif /* __ADC_CONFIG_H__ */
|