megatec.h 1005 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. MegaTec_cmd_max
  26. } cmdMegaTecEnums_t;
  27. typedef struct{
  28. float Freq_in;
  29. float VAC_in;
  30. float VAC_out;
  31. float Temp;
  32. uint8_t Load;
  33. uint8_t SOC;
  34. uint8_t work_time;
  35. uint8_t Status;
  36. uint8_t Alarm;
  37. char model[11];
  38. char vertion[3];
  39. char serial[9];
  40. uint8_t cnt_err_ups;
  41. bool Present;
  42. bool Flag_Present;
  43. }UPS_value_t;
  44. extern UPS_value_t UPS;
  45. extern uint16_t TimeParam;
  46. extern uint16_t TimeParam2;
  47. extern float TimeParamFloat;
  48. int ups_metac_service_pdu(cmdMegaTecEnums_t command);
  49. void ups_megatec_init(void);
  50. #endif /* MEGATEC_H_ */