main.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /*********************************************************************************************************
  2. * Module : main.h
  3. * Abstract : main modules is defined data structure!
  4. * Version : 1.0.0
  5. * Author : Leopul(COPYRIGHT 2025 - 2027 Leopul. All rights reserved.)
  6. * Complete : 2025-02-16
  7. * Content : None
  8. * Note : None
  9. *********************************************************************************************************/
  10. #ifndef __MAIN_H
  11. #define __MAIN_H
  12. #include "stdint.h"
  13. #define IIC_INPUT_THRESHOLD_START (10)
  14. #define IIC_INPUT_THRESHOLD_LENTH (20)
  15. #define IIC_OUTPUT_THRESHOLD_START (50)
  16. #define IIC_OUTPUT_THRESHOLD_LENTH (30)
  17. #define IIC_TEMPRATURE_THRESHOLD_START (100)
  18. #define IIC_TEMPRATURE_THRESHOLD_LENTH (4)
  19. #define IIC_OVER_FUNC_START (110)
  20. #define IIC_OVER_FUNC_LENTH (1)
  21. //#pragma pack (2)
  22. typedef struct {
  23. uint32_t uniq_ID_64_95;
  24. uint32_t uniq_ID_32_63;
  25. uint32_t uniq_ID_00_31;
  26. uint32_t channels;
  27. char ver[12];
  28. char date[32];
  29. }md_information_t;
  30. typedef struct {
  31. uint32_t voltage;
  32. uint32_t current;
  33. uint32_t power;
  34. uint32_t consumer;
  35. uint32_t freq;
  36. uint32_t factor;
  37. uint32_t angle;
  38. }md_out_power_info;
  39. typedef struct {
  40. uint32_t voltage;
  41. uint32_t freq;
  42. }md_input_info;
  43. typedef struct{
  44. uint16_t choise_ch;
  45. }md_chiose_ch;
  46. typedef struct{
  47. uint16_t input_status[2];
  48. }md_input_status;
  49. typedef struct{
  50. uint16_t fan_status;
  51. }md_fans;
  52. typedef struct{
  53. uint16_t waning[2]; /* two input */
  54. }md_in_wanning;
  55. typedef struct {
  56. uint16_t waning;
  57. }md_out_wanning;
  58. typedef struct {
  59. uint32_t voltage_max;
  60. uint32_t voltage_min;
  61. uint32_t current_max;
  62. uint32_t power_max;
  63. uint32_t consumer_max;
  64. }iic_out_threshold_t;
  65. typedef struct {
  66. uint32_t voltage_max;
  67. uint32_t voltage_min;
  68. uint32_t freq_max;
  69. uint32_t freq_min;
  70. }iic_in_threshold_t;
  71. typedef struct{
  72. uint16_t fans_max_temp;
  73. uint16_t fans_min_temp;
  74. }iic_temp_threshold_t;
  75. typedef uint16_t iic_over_func;
  76. typedef struct{
  77. uint16_t dev;
  78. md_information_t info;
  79. md_input_info input[2];
  80. md_chiose_ch md_choise;
  81. md_input_status input_status;
  82. md_in_wanning input_wanning;
  83. md_out_wanning output_waning;
  84. md_out_power_info out_power;
  85. iic_in_threshold_t input_th[2];
  86. iic_out_threshold_t output_th;
  87. iic_temp_threshold_t temprature;
  88. iic_over_func over_func;
  89. }md_data_t;
  90. typedef struct{
  91. uint8_t led_flag;
  92. uint8_t count_start_flag;
  93. uint8_t switch_flag;
  94. uint8_t over_func_flag;
  95. md_data_t data;
  96. }sts_data_t;
  97. //#pragma pack ()
  98. sts_data_t *get_sts(void);
  99. #endif