17 lines
695 B
C
17 lines
695 B
C
![]() |
#ifndef __ADC_H__
|
||
|
#define __ADC_H__
|
||
|
#include "./SYSTEM/sys/sys.h"
|
||
|
extern ADC_HandleTypeDef hadc3;
|
||
|
#define Offline_Detection1_Pin GPIO_PIN_3
|
||
|
#define Offline_Detection1_GPIO_Port GPIOF
|
||
|
|
||
|
#define Offline_Detection2_Pin GPIO_PIN_4
|
||
|
#define Offline_Detection2_GPIO_Port GPIOF
|
||
|
|
||
|
|
||
|
void MX_ADC3_Init(void); /* ADC初始化 */
|
||
|
void adc_channel_set(ADC_HandleTypeDef *adc_handle, uint32_t ch, uint32_t rank, uint32_t stime); /* ADC通道设置 */
|
||
|
uint32_t adc_get_result(uint32_t ch); /* 获得某个通道值 */
|
||
|
uint32_t adc_get_result_average(uint32_t ch, uint8_t times); /* 得到某个通道给定次数采样的平均值 */
|
||
|
|
||
|
#endif
|