
#ifndef FM_CAPTURE_H_
#define FM_CAPTURE_H_

#include "arm_math.h"

#define indata16_size 10
#define IODataF_size 4
#pragma pack(push,4)
typedef struct _adcCapture
{
    int16_t inData16[indata16_size];
    uint32_t totalInData;
    float32_t IODataF[IODataF_size];
    int16_t outData;
}adcCapture;
#pragma pack(pop)

// extern adcCapture WORK_VOLT_capture;
// extern adcCapture DSG_CURR_capture;
// extern adcCapture PV_VOLT_IN_capture;
// extern adcCapture CHG_CURR_capture;

void ADC_Capture_Init(void);
void proportionalInt(int mode);
uint16_t setfirstStageProtectionValue(float curr);

float get_CHG_CURR(void);
float get_PV_VOLT_OUT(void);
float get_DSG_CURR(void);
float get_PV1_VOLT_IN(void);
float get_PV_VOLT_IN1(void);
float get_MOSFET_Temper(void);
float get_EXCHG_CURR(void);

void adcCaptureFir();

extern void setSoftShortCircuit(uint16_t disChargCurrAdcNum);

extern void chargControl(void);

#endif