123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- #ifndef __IT6000_H__
- #define __IT6000_H__
- #define IT6000_NBR_MAX (1)
- enum it6000_cmd_t{
- CMD_it6000_set_dev_aps = 0,
- CMD_it6000_set_dev_startcmd,
- CMD_it6000_set_dev_stopcmd,
- };
- // enum it6000_runstat_t{
- // IES1000_RUNSTAT_STOP = 0,
- // IES1000_RUNSTAT_IDLE = 1,
- // IES1000_RUNSTAT_DHG = 2,
- // IES1000_RUNSTAT_CHG = 3,
- // };
- // enum ies1000_runmod_t{
- // IES1000_RUNMOD_ONGRID = 0,
- // IES1000_RUNMOD_OFFGRID = 1,
- // IES1000_RUNMOD_ONOFFGRID = 2,
- // };
- struct it6000_t{
- //int chan_idx;
- char szinfo[32];
- char szmodel[32];
- int model;
- //int adr; // modbus rtu addr, by cfg
- struct tick_t bsytik;
- struct power_t pow;
- struct comm_t comm;
- //struct dac_t dac;
- struct statemachine_t sm;
- int cmd; // sm cmd
- //充放电设定的保护值
- float uvp_set;
- float ovp_set;
- float ocp_set;//总是正值,放电时下发为负值,充电时下发为正值
- float Vh_set;
- float Vl_set;
- //sys
- int sysStatus;
- char szSysStatus[20];
- //dc info
- int dc_mode;
- char szDc_mode[20];
- float dc_volt;
- float dc_volt_rise;
- float dc_volt_fall;
- float dc_current;//pos:chg;neg:dhg
- float dc_current_rise;
- float dc_current_fall;
- float dc_v_high;
- float dc_v_low;
- float dc_i_high;
- float dc_i_low;
- int cc_speed_state;
- int cv_speed_state;
- float power_high;
- float power_low;
- //meter
- float meter_v_rms;
- float meter_i_rms;
- float meter_p_rms;
- int meter_op_reg;
- int meter_state_reg;
- int meter_ques_reg;
- //prot
- int dc_ovp_enable;
- float dc_ovp;
- float dc_ovp_delay;
- int dc_ocp_enable;
- float dc_ocp;
- float dc_ocp_delay;
- int dc_opp_enable;
- float dc_opp;
- float dc_opp_delay;
- int dc_ucp_enable;
- float dc_ucp;
- float dc_ucp_delay;
- float dc_ucp_warmup;
- int dc_uvp_enable;
- float dc_uvp;
- float dc_uvp_delay;
- float dc_uvp_warmup;
- int sw_prot;
- int hw_prot;
- };
- extern struct it6000_t it6000[IT6000_NBR_MAX + 1];
- int it6000_get_cmd( int idx );
- int it6000_get_comm_st(int idx);
- void it6000_reset_cmd(int idx);
- int it6000_get_state( int idx );
- char* it6000_get_state_str( int idx );
- int it6000_get_step( int idx );
- int it6000_get_tick( int idx );
- double it6000_get_tick_ave( int idx );
- double it6000_get_tick_cur( int idx );
- double it6000_get_tick_max( int idx );
- char* it6000_get_err_str( int idx );
- int it6000_chk_state( int idx, int stat );
- int it6000_get_sysstatus( int idx );
- int it6000_get_dc_mode( int idx );
- float it6000_get_dc_volt( int idx );
- float it6000_get_dc_volt_rise( int idx );
- float it6000_get_dc_volt_fall( int idx );
- float it6000_get_dc_current( int idx );
- float it6000_get_dc_current_rise( int idx );
- float it6000_get_dc_current_fall( int idx );
- float it6000_get_dc_v_high( int idx );
- float it6000_get_dc_v_low( int idx );
- float it6000_get_dc_i_high( int idx );
- float it6000_get_dc_i_low( int idx );
- int it6000_get_cc_speed_state( int idx );
- int it6000_get_cv_speed_state( int idx );
- float it6000_get_power_high( int idx );
- float it6000_get_power_low( int idx );
- float it6000_get_meter_v_rms( int idx );
- float it6000_get_meter_i_rms( int idx );
- float it6000_get_meter_p_rms( int idx );
- int it6000_get_meter_op_reg( int idx );
- int it6000_get_meter_state_reg( int idx );
- int it6000_get_meter_ques_reg( int idx );
- int it6000_get_dc_ovp_enable( int idx );
- float it6000_get_dc_ovp( int idx );
- float it6000_get_dc_ovp_delay( int idx );
- int it6000_get_dc_ocp_enable( int idx );
- float it6000_get_dc_ocp( int idx );
- float it6000_get_dc_ocp_delay( int idx );
- int it6000_get_dc_opp_enable( int idx );
- float it6000_get_dc_opp( int idx );
- float it6000_get_dc_opp_delay( int idx );
- int it6000_get_dc_ucp_enable( int idx );
- float it6000_get_dc_ucp( int idx );
- float it6000_get_dc_ucp_delay( int idx );
- float it6000_get_dc_ucp_warmup( int idx );
- int it6000_get_dc_uvp_enable( int idx );
- float it6000_get_dc_uvp( int idx );
- float it6000_get_dc_uvp_delay( int idx );
- float it6000_get_dc_uvp_warmup( int idx );
- int it6000_get_sw_prot( int idx );
- int it6000_get_hw_prot( int idx );
- int it6000_set_aps(int idx, int aps);
- int it6000_send_sm_cmd( int idx, int val );
- int it6000_init();
- int it6000_get_tool_data(int idx,char* buf);
- char* it6000_get_info_str(int idx);
- int it6000_get_chan_idx(int idx);
- int it6000_get_adr(int idx);
- char* it6000_get_comm_state_str(int idx);
- double it6000_get_dac_ave(int idx);
- double it6000_get_dac_cur(int idx);
- double it6000_get_dac_max(int idx);
- int it6000_get_dac_param_en(int idx);
- int it6000_get_bsytikchk_en(int idx);
- int it6000_get_bsytikchk_from_host(int idx);
- int it6000_set_bsytik(int idx);
- int it6000_set_bsytikchk_en(int idx, int val);
- int it6000_set_dac_param_en(int idx, int val);
- int it6000_is_bsytikchk_timeout(int idx);
- int it6000_get_aps(int idx);
- int it6000_get_ap( int idx );
- int it6000_reset_aps(int idx);
- int it6000_get_tbmqtt_main_data(int idx,char* buf);
- int it6000_get_tbmqtt_secondy_data(int idx,char* buf);
- #endif
|