health.h 720 B

123456789101112131415161718192021222324252627282930
  1. #ifndef _HEALTH_H__
  2. #define _HEALTH_H__
  3. #include <stdint.h>
  4. /*
  5. * xxx_over_temp: 表示过高温(温度过高)
  6. * xxx_under_temp: 表示过低温(温度过低)
  7. */
  8. typedef struct {
  9. uint32_t charger_over_current:1;
  10. uint32_t charger_over_temp:1;
  11. uint32_t charger_lower_temp:1;
  12. uint32_t discharger_over_temp:1;
  13. uint32_t discharger_lower_temp:1;
  14. uint32_t discharger_lower_voltage:1;
  15. uint32_t powerdown_lower_voltage:1;
  16. uint32_t sigle_cell_lower_voltage:1;
  17. uint32_t sigle_cell_over_voltage:1;
  18. uint32_t load_current_short:1; //大电短路保护
  19. }bms_health_t;
  20. bms_health_t *bms_health(void);
  21. void health_init(void);
  22. void check_current_state(void);
  23. void check_voltage_state(void);
  24. void check_temp_state(void);
  25. #endif /* _HEALTH_H__ */