mppt/Hardware/inc/adc.h

49 lines
1.6 KiB
C
Raw Permalink Normal View History

2024-07-11 06:58:55 +00:00
#ifndef __ADC_H
#define __ADC_H
#include "ch32l103.h"
2024-10-14 02:39:02 +00:00
#include "ring_queue2.h"
2024-07-11 06:58:55 +00:00
2024-10-08 07:18:44 +00:00
//typedef struct _ADC_DATA {
// uint16_t total_CHG_CURR; /* һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD>adc<64>ɼ<EFBFBD><C9BC><EFBFBD>ֵ֮<D6B5><D6AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
// uint16_t num_CHG_CURR; /* һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD>adc<64>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD>֮<EFBFBD><D6AE> */
// uint16_t total_PV_VOLT_OUT; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ */
// uint16_t num_PV_VOLT_OUT;
// uint16_t total_DSG_CURR; /* <20>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD> */
// uint16_t num_DSG_CURR;
// uint16_t total_PV1_VOLT_IN; /* ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ */
// uint16_t num_PV1_VOLT_IN;
// uint16_t total_PV_VOLT_IN1; /* ̫<><CCAB><EFBFBD>ܰ<EFBFBD><DCB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ */
// uint16_t num_PV_VOLT_IN1;
// uint16_t total_MOSFET_Temper; /* mos<6F><73><EFBFBD><EFBFBD> */
// uint16_t num_MOSFET_Temper;
//}ADC_DATA;
2024-10-14 02:39:02 +00:00
//#define data_len 50
//typedef struct _ADC_DATA {
// uint16_t num; /* һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD>adc<64>ɼ<EFBFBD><C9BC><EFBFBD><EFBFBD><EFBFBD> */
// uint16_t CHG_CURR_array[data_len]; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
2024-10-14 02:39:02 +00:00
// uint16_t PV_VOLT_OUT_array[data_len]; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ */
// uint16_t DSG_CURR_array[data_len]; /* <20>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD> */
2024-10-14 02:39:02 +00:00
// uint16_t PV_VOLT_IN_array[data_len]; /* ̫<><CCAB><EFBFBD>ܰ<EFBFBD><DCB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ */
// uint16_t SYS_VOLT_IN_array[data_len]; /* ϵͳ<CFB5><CDB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ */
// uint16_t MOSFET_Temper_array[data_len]; /* mos<6F><73><EFBFBD><EFBFBD> */
//}ADC_DATA;
2024-10-08 07:18:44 +00:00
2024-10-14 02:39:02 +00:00
#define adcBuffSize 100
typedef struct _ADC_DATA {
RingQueue2 RQCHG_CURR;
uint32_t total_CHG_CURR; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>adcֵ<63>ĺ<EFBFBD> */
RingQueue2 RQDSG_CURR;
uint32_t total_DSG_CURR; /* <20>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>adcֵ<63>ĺ<EFBFBD> */
}ADC_DATA;
2024-10-08 07:18:44 +00:00
extern ADC_DATA g_adcData;
2024-07-11 06:58:55 +00:00
extern int16_t Calibrattion_Val;
void ADC_all_Init(void);
2024-10-08 07:18:44 +00:00
void ADC_TIM_DMA_Init(void);
2024-07-11 06:58:55 +00:00
#endif