megatec.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * megatec.h
  3. *
  4. * Created on: 22.05.2017
  5. * Author: balbekova
  6. */
  7. #ifndef MEGATEC_H_
  8. #define MEGATEC_H_
  9. #include <stdbool.h>
  10. #include <stdint.h>
  11. #include <stdlib.h>
  12. typedef enum{
  13. ups_status_req,
  14. ups_test_10sec,
  15. ups_test_low_bat,
  16. ups_test_time,
  17. ups_beep,
  18. ups_shutdown,
  19. ups_shutdown_restore,
  20. ups_cancel_shut_down,
  21. ups_cancel_test,
  22. ups_info,
  23. ups_rating_info,
  24. ups_remain_time_reg,
  25. ups_general_status_req,
  26. ups_akb_info,
  27. ups_model_req,
  28. ups_version_req,
  29. ups_serial_req,
  30. ups_protocol_id_req,
  31. ups_offline_status_req,
  32. ups_passw_req,
  33. MegaTec_cmd_max
  34. } cmdMegaTecEnums_t;
  35. typedef struct{
  36. float Freq_in;
  37. float VAC_in;
  38. float VAC_out;
  39. float Temp;
  40. uint8_t Load;
  41. uint8_t SOC;
  42. uint8_t work_time;
  43. uint8_t Status;
  44. uint8_t Alarm;
  45. char model[16];
  46. char vertion[5];
  47. char serial[9];
  48. uint8_t cnt_err_ups;
  49. bool Present;
  50. bool Flag_Present;
  51. }UPS_value_t;
  52. extern UPS_value_t UPS;
  53. extern uint16_t TimeParam;
  54. extern uint16_t TimeParam2;
  55. extern float TimeParamFloat;
  56. int ups_metac_service_pdu(cmdMegaTecEnums_t command);
  57. void ups_megatec_init(void);
  58. #endif /* MEGATEC_H_ */