CELIS/SYSTEM/adc.h
lidun 7a7daad23a
完成UDS升级
Signed-off-by: lidun <1084178170@qq.com>
2024-01-30 11:31:27 +08:00

78 lines
1.3 KiB
C

#ifndef __ADC_H
#define __ADC_H
#include "stm32f10x.h"
#include <stdbool.h>
enum sampling
{
ADC_TEMP1, //板载温度
TEMPL_AD, //枪座温度
CC_AD, //CC2电阻
VIN_AD, //KL30
AD_NUM,
};
typedef enum
{
Normal_operation,
AC_Charging,
DC_Charging,
}work_mode;
typedef struct
{
uint8_t Flag;
uint16_t Sum;
uint8_t Count;
float volt_data;
}Filter_variable;
typedef struct
{
float CC_Volt;
float KL30_Volt;
uint8_t TEMP1_Data;
uint8_t GUN_TempData;
float BAT_B_Reverse_Voltage;
}Volt_sampldata;
extern Volt_sampldata Volt_SamplData;
typedef struct
{
int16_t TemperatureValue;
float R_Value;
}TempRes_TypeDef;
typedef struct
{
float Resistance_Value;
uint8_t (*TEMP1)();
uint8_t (*GUN_TEMP)();
uint16_t (*KL30_Volt)();
work_mode (*WorkMode)();
}get_sampl_data;
typedef struct
{
void (*CC_Voltag)();
void (*TEMP1_Voltage)();
void (*GUN_TEMP)();
void (*KL30_Voltage)();
}sampl_funtion;
/**************外设初始化****************/
void Adc_Init(void);
/**************对外调用循环采集*****************/
extern sampl_funtion Sampl_Funtion;
/**************对外调用获取数据*****************/
extern get_sampl_data Get_Sampl_Data;
/*************获取 插枪阻值**************/
float Get_R_Value(void);
void Scan_work(void);
#include "GUNDiscriminate.h"
#endif