32 lines
531 B
C
32 lines
531 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_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 ADC_SAMPLING_TIME 20
|
|
|
|
void BSP_ADC_Init(void);
|
|
|
|
uint16_t BSP_ReadVbat(void);
|
|
|
|
#endif /* __BSP_ADC_H__ */
|