2024-01-30 03:31:27 +00:00
|
|
|
|
#ifndef __ADC_H
|
|
|
|
|
#define __ADC_H
|
|
|
|
|
|
|
|
|
|
#include "stm32f10x.h"
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
|
|
enum sampling
|
|
|
|
|
{
|
|
|
|
|
ADC_TEMP1, //<2F><><EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>
|
|
|
|
|
TEMPL_AD, //ǹ<><C7B9><EFBFBD>¶<EFBFBD>
|
|
|
|
|
CC_AD, //CC2<43><32><EFBFBD><EFBFBD>
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
/**************<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>****************/
|
|
|
|
|
void Adc_Init(void);
|
|
|
|
|
/**************<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><D1AD><EFBFBD>ɼ<EFBFBD>*****************/
|
|
|
|
|
extern sampl_funtion Sampl_Funtion;
|
|
|
|
|
/**************<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>*****************/
|
|
|
|
|
extern get_sampl_data Get_Sampl_Data;
|
|
|
|
|
/*************<2A><>ȡ <20><>ǹ<EFBFBD><C7B9>ֵ**************/
|
|
|
|
|
float Get_R_Value(void);
|
|
|
|
|
void Scan_work(void);
|
|
|
|
|
#include "GUNDiscriminate.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|