megatec.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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_kestar,
  14. ups_voltronic,
  15. type_ups_max
  16. } typeUPSEnums_t;
  17. typedef enum{
  18. ups_status_req,
  19. ups_test_10sec,
  20. ups_test_low_bat,
  21. ups_test_time,
  22. ups_beep,
  23. ups_shutdown,
  24. ups_shutdown_restore,
  25. ups_cancel_shut_down,
  26. ups_cancel_test,
  27. ups_info,
  28. ups_rating_info,
  29. ups_remain_time_reg,
  30. ups_general_status_req,
  31. ups_akb_info,
  32. ups_model_req,
  33. ups_version_req,
  34. ups_serial_req,
  35. ups_protocol_id_req,
  36. ups_offline_status_req,
  37. ups_passw_req,
  38. MegaTec_cmd_max
  39. } cmdMegaTecEnums_t;
  40. typedef struct{
  41. float Freq_in;
  42. float VAC_in;
  43. float VAC_out;
  44. float Temp;
  45. uint8_t Load;
  46. uint8_t SOC;
  47. uint8_t work_time;
  48. uint8_t Status;
  49. uint8_t Alarm;
  50. char model[16];
  51. char vertion[5];
  52. char serial[9];
  53. uint8_t cnt_err_ups;
  54. bool Present;
  55. bool Flag_Present;
  56. }UPS_value_t;
  57. extern UPS_value_t UPS;
  58. extern uint16_t TimeParam;
  59. extern uint16_t TimeParam2;
  60. extern float TimeParamFloat;
  61. int ups_metac_service_pdu(cmdMegaTecEnums_t command);
  62. void ups_megatec_init(void);
  63. #endif /* MEGATEC_H_ */