123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- #ifndef ZH200_H
- #define ZH200_H
- #define ZH200_NBR_MAX (1)
- #include "plt.h"
- struct zh200_t
- {
- int idx_in_ess;
- int chan_idx;
- // int sn;
- char szinfo[32];
- int idx;
- char szdev_id[SNOW_ID_BUF_SIZE];
- // char szmodel[32];
- // int model;
- //int adr;
- int modbus_tcp_slave_port;
- int modbus_tcp_slave_port_EMA;
- char sztime[32];
- int cmd;
- unsigned short cmdpara[4];
- // int rawState;
- int cell_otp; // over temp protect
- int cell_utp; // under temp protect
- double max_v;
- double min_v;
- double socc;
- double socd;
- struct tick_t bsytik; /* ctn and sta */
- struct tick_t pcstik; /* pcs and ctn */
- struct tick_t bmstik; /* bms and ctn */
- struct power_t pow;
- struct statemachine_t sm;
- //run info
- char szRunInfo[256];
- };
- extern struct zh200_t zh200[ZH200_NBR_MAX + 1];
- int zh200_init(void);
- int zh200_send_cmd(int idx, int cmd);
- int zh200_set_aps(int idx, int P);
- int zh200_reset_aps(int idx);
- int zh200_get_ap(int idx);
- int zh200_get_aps(int idx);
- int zh200_get_last_aps(int idx);
- double zh200_get_soc(int idx);
- double zh200_get_soh(int idx);
- void zh200_set_state(int idx, int state, int err);
- int zh200_get_state(int idx);
- char *zh200_get_state_str(int idx);
- char *zh200_get_err_str(int idx);
- int zh200_enable_bsytikchk(int idx);
- int zh200_disable_bsytikchk(int idx);
- int zh200_get_bsytikchk_timeout(int idx);
- int zh200_get_bsytikchk_from_host(int idx);
- int zh200_get_bsytikchk_en(int idx);
- int zh200_enable_pcs_bsytiksnd(int idx);
- int zh200_disable_pcs_bsytiksnd(int idx);
- int zh200_get_pcs_bsytiksnd_en(int idx);
- int zh200_enable_bms_bsytiksnd(int idx);
- int zh200_disable_bms_bsytiksnd(int idx);
- int zh200_get_bms_bsytiksnd_en(int idx);
- int zh200_get_norm_cap(int idx);
- int zh200_get_norm_pow(int idx);
- int zh200_get_min_pow(int idx);
- int zh200_get_cmd(int idx);
- void zh200_reset_cmd(int idx);
- int zh200_get_dhgable(int idx);
- int zh200_get_chgable(int idx);
- void zh200_set_dhgable(int idx, int val);
- void zh200_set_chgable(int idx, int val);
- int zh200_is_aps_changed(int idx);
- int zh200_set_socd(int idx, double val);
- int zh200_set_socc(int idx, double val);
- double zh200_get_socd(int idx);
- double zh200_get_socc(int idx);
- int zh200_get_cell_otp(int idx);
- int zh200_get_cell_utp(int idx);
- int zh200_get_step(int idx);
- int zh200_get_tick(int idx);
- double zh200_get_tick_ave(int idx);
- double zh200_get_tick_cur(int idx);
- double zh200_get_tick_max(int idx);
- int zh200_cfg_save_socd(int idx);
- int zh200_cfg_save_socc(int idx);
- int zh200_get_err(int idx);
- int zh200_get_tool_data(int idx, char *buf);
- unsigned short zh200_get_cmd_param1(int idx);
- unsigned short zh200_get_cmd_param2(int idx);
- unsigned short zh200_get_cmd_param3(int idx);
- unsigned short zh200_get_cmd_param4(int idx);
- int zh200_set_cmd(int idx, int cmd);
- int zh200_set_cmd_param1(int idx, unsigned short param);
- int zh200_set_cmd_param2(int idx, unsigned short param);
- int zh200_set_cmd_param3(int idx, unsigned short param);
- int zh200_set_cmd_param4(int idx, unsigned short param);
- int zh200_set_bsytikchk_from_host(int idx, unsigned char tick);
- char *zh200_get_devid(int idx);
- int zh200_get_init_data(int idx, char *buf);
- int zh200_get_tbmqtt_data(int idx, char *buff);
- #endif /* ZH200_H */
|