32 lines
554 B
C
32 lines
554 B
C
/*
|
||
* 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_4
|
||
#define ADC_COIL_PIN GPIO_Pin_5
|
||
|
||
// channel
|
||
#define ADC_VBAT_CHANNEL 0
|
||
#define ADC_COIL_CHANNEL 1
|
||
|
||
#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__ */
|