IoT_SCV_CH584M/bsp/inc/bsp_adc.h

32 lines
554 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* bsp_adc.h
*
* Created on: 2024年11月29日
* Author: 123
*/
#ifndef __BSP_ADC_H__
#define __BSP_ADC_H__
#include "CONFIG.h"
// PA 2,3
#define ADC_VBAT_PIN GPIO_Pin_5
#define ADC_COIL_PIN GPIO_Pin_4
// channel
#define ADC_VBAT_CHANNEL 1
#define ADC_COIL_CHANNEL 0
#define VBAT_CHECK_EVT (0x0001 << 0)
extern tmosTaskID adc_task_id;
#define VBAT_LOW_MV 3000 // 电池电压低阈值单位mV
void BSP_ADC_Init(void);
uint16_t BSP_ReadVbat(void);
#endif /* __BSP_ADC_H__ */