12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- /*
- * megatec.h
- *
- * Created on: 22.05.2017
- * Author: balbekova
- */
- #ifndef MEGATEC_H_
- #define MEGATEC_H_
- #include <stdbool.h>
- #include <stdint.h>
- #include <stdlib.h>
- #define K_EFFICIENCY 0.9
- #define AKB_VOLTAGE 12
- #define AKB_NUM_CELL 6
- typedef enum{
- ups_status_req,
- ups_test_10sec,
- ups_test_low_bat,
- ups_test_time,
- ups_beep,
- ups_shutdown,
- ups_shutdown_restore,
- ups_cancel_shut_down,
- ups_cancel_test,
- ups_info,
- ups_rating_info,
- ups_remain_time_reg,
- ups_general_status_req,
- ups_akb_info,
- ups_model_req,
- ups_version_req,
- ups_version2_req,
- ups_serial_req,
- ups_protocol_id_req,
- ups_offline_status_req,
- ups_passw_req,
- MegaTec_cmd_max
- } cmdMegaTecEnums_t;
- typedef struct{
- float Freq_in;
- float VAC_in;
- float VAC_out;
- float Temp;
- float Vakb_curr;
- uint8_t Load;
- uint8_t SOC;
- uint16_t work_time;
- uint32_t akb_work_time;
- uint8_t Status;
- uint8_t Alarm;
- char model[16];
- char vertion[18];
- char serial[15];
- uint8_t cnt_err_ups;
- bool Present;
- bool Flag_Present;
- }UPS_value_t;
- extern UPS_value_t UPS;
- extern uint16_t TimeParam;
- extern uint16_t TimeParam2;
- extern float TimeParamFloat;
- int ups_metac_service_pdu(cmdMegaTecEnums_t command);
- void ups_megatec_init(void);
- #endif /* MEGATEC_H_ */
|