health.h 782 B

12345678910111213141516171819202122232425262728293031
  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. uint16_t internal_resistance; //pack's internal resistance
  20. }bms_health_t;
  21. bms_health_t *bms_health(void);
  22. void health_init(void);
  23. void check_current_state(void);
  24. void check_voltage_state(void);
  25. void check_temp_state(void);
  26. #endif /* _HEALTH_H__ */