/*
 * ad_sample.h
 *
 *  Created on: 2019-10-10
 *      Author: zhangguojun
 */

#ifndef AD_SAMPLE_H_
#define AD_SAMPLE_H_

extern int16   ad_run_flag,   ad_zero_flag;
extern float32   ad_ref_u_last,ad_ref_uu_last,ad_ref_v_last,ad_ref_vv_last;
extern float32   ad_ref_u_now,ad_ref_uu_now,ad_ref_v_now,ad_ref_vv_now;
extern Uint16   ad_ref_u_final,ad_ref_uu_final,ad_ref_v_final,ad_ref_vv_final;
extern float32  ad_filter_para;
extern Uint16   ad_data_u,ad_data_uu,ad_data_v,ad_data_vv,ad_data_resv1,ad_data_resv2,ad_data_resv3,ad_data_vdc;
extern float32  I_f_u,I_f_v;///AD输出U相V相电流
extern Uint16   U_VDC;////
extern float32  P_i_resolution,P_i_resolution_small;///电流分辨率
extern float32  P_vdc_resolution;///总线电压分辨率
extern void AD_test(void);
extern void read_addata(void);
extern void read_addata2(void);
extern void AD_adjust_cal(void);///ad 补偿系数计算
extern void I_adsample_cal(void);///电流满（大）量程计算
extern void AD_init(void);
extern float32 P_i_u_adjust,P_i_v_adjust;//////电流校正系数
extern Uint16  Flag_i_u_adjust,Flag_i_v_adjust;//////ad校正标识
extern float32 AD_adjust_cal_u,AD_adjust_cal_v;
extern Uint16  AD_adjcal_startflag,AD_adjcal_endflag;
extern Uint16 addata0,addata1,addata2,addata3,addata4,addata5,addata6,addata7,addata8,addata9,addata10,addata11,addata12,addata13,addata14,addata15;
extern Uint16 addata20,addata21,addata22,addata23,addata24,addata25,addata26,addata27;
extern _iq19 iq_u_now,iq_u_last,iq_uu_now,iq_uu_last,iq_v_now,iq_v_last,iq_vv_now,iq_vv_last;
extern _iq19 iq_last_p,iq_new_p;
extern _iq19 iq_I_f_u,iq_I_f_v,iq_P_i_resolution,iq_P_i_resolution_small,iq_P_i_u_adjust,iq_P_i_v_adjust;
extern _iq19 iq_minus_one;//负1
extern _iq19 iq_U_VDC,iq_P_vdc_resolution;
extern _iq19 iq_u_nnn,iq_u_lll;
extern int32 P_inttoiq;/////整形直接变为浮点的IQ值系数
extern Uint16 upper_limit,lower_limit;//////大小通道切换边界
extern float32  ad_I_range;


#endif /* AD_SAMPLE_H_ */
