mppt/Hardware/inc/adc.h

37 lines
1.3 KiB
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.

#ifndef __ADC_H
#define __ADC_H
#include "ch32l103.h"
//typedef struct _ADC_DATA {
// uint16_t total_CHG_CURR; /* 一个控制周期中adc采集的值之和 充电电流 */
// uint16_t num_CHG_CURR; /* 一个控制周期中adc采集次数之和 */
// uint16_t total_PV_VOLT_OUT; /* 输出电压 */
// uint16_t num_PV_VOLT_OUT;
// uint16_t total_DSG_CURR; /* 放电电流 */
// uint16_t num_DSG_CURR;
// uint16_t total_PV1_VOLT_IN; /* 系统输入电压 */
// uint16_t num_PV1_VOLT_IN;
// uint16_t total_PV_VOLT_IN1; /* 太阳能板输出电压 */
// uint16_t num_PV_VOLT_IN1;
// uint16_t total_MOSFET_Temper; /* mos管温度 */
// uint16_t num_MOSFET_Temper;
//}ADC_DATA;
typedef struct _ADC_DATA {
uint16_t num; /* 一个控制周期中adc采集次数之和 */
uint16_t total_CHG_CURR; /* 一个控制周期中adc采集的值之和 充电电流 */
uint16_t total_PV_VOLT_OUT; /* 输出电压 */
uint16_t total_DSG_CURR; /* 放电电流 */
uint16_t total_PV1_VOLT_IN; /* 太阳能板输出电压 */
uint16_t total_PV_VOLT_IN1; /* 系统输入电压 */
uint16_t total_MOSFET_Temper; /* mos管温度 */
}ADC_DATA;
extern ADC_DATA g_adcData;
extern int16_t Calibrattion_Val;
void ADC_all_Init(void);
void ADC_TIM_DMA_Init(void);
#endif