#ifndef __TYPEDEF_H_
#define __TYPEDEF_H_
typedef enum{
	MODE_STOP,
	MODE_CHARGE,
	MODE_REPAIR,
	MODE_DISCHARGE,
	MODE_TEST
}work_mode_t;

typedef enum{
	ALL_VOL_IDX,
	ALL_CUR_IDX,
	CH1_VOL_IDX,
	CH1_TEMP_IDX,
	CH2_VOL_IDX,
	CH2_TEMP_IDX,
	CH3_VOL_IDX,
	CH3_TEMP_IDX,
	CH4_VOL_IDX,
	CH4_TEMP_IDX,
	CH5_VOL_IDX,
	CH5_TEMP_IDX,
	CH6_VOL_IDX,
	CH6_TEMP_IDX
}ad_channel_t;
typedef struct{
	u16 all_vol_dcos;
	u16 all_cur_dcos;
	u16 ch1_vol_dcos;
	u16 ch1_temp_dcos;
	u16 ch2_vol_dcos;
	u16 ch2_temp_dcos;
	u16 ch3_vol_dcos;
	u16 ch3_temp_dcos;
	u16 ch4_vol_dcos;
	u16 ch4_temp_dcos;
	u16 ch5_vol_dcos;
	u16 ch5_temp_dcos;
	u16 ch6_vol_dcos;
	u16 ch6_temp_dcos;
}ad_dcos_t;
typedef struct{
	int all_vol_offset;
	int all_cur_offset;
	int ch1_vol_offset;
	int ch1_temp_offset;
	int ch2_vol_offset;
	int ch2_temp_offset;
	int ch3_vol_offset;
	int ch3_temp_offset;
	int ch4_vol_offset;
	int ch4_temp_offset;
	int ch5_vol_offset;
	int ch5_temp_offset;
	int ch6_vol_offset;
	int ch6_temp_offset;
}ad_offset_t;
	
typedef enum{
	MAIN_MENU,
	PARAM_SETTING_MENU,
	OFFSET_MENU
}menu_status_t;

typedef struct{
	float cur_vol;
	float cur_cur;
	float ch1_vol;
	float ch1_temp;
	float ch2_vol;
	float ch2_temp;	
	float ch3_vol;
	float ch3_temp;
	float ch4_vol;
	float ch4_temp;
	float ch5_vol;
	float ch5_temp;
	float ch6_vol;
	float ch6_temp;
	float ch1_resist;
	float ch2_resist;
	float ch3_resist;
	float ch4_resist;
	float ch5_resist;
	float ch6_resist;
	float cur_cap;
	float	cur_power;
	float cur_qe;
	float sparam;
	u16 minutes;
	u16 res_u16;
	u8 battery_count;
	u8 mode;
	u8 res1;
	u8 res2;
	
}system_data_t;

typedef struct{
	u16 system_run:1;
  u16 run_finish:1;
	u16 has_alarm:1;
	u16 cur_mode:4;
  u16 menu_index:4;
	u16 ch_index:3;
	u16 res:2;
}system_status_t;

typedef struct{
	float hilimit;
	float lolimit;
}limit_t;

typedef struct{
	u8 mode;
	u8 res1;
	u8 res2;
	u8 res3;
	float chg_hivol;
	float dchg_lovol;
	float repr_hivol;
	float	repr_hitemp;
	float test_lovol;
}setting_t;
#endif
