limit.h 758 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef _Limit_H__
  2. #define _Limit_H__
  3. #include "os/os_types.h"
  4. #define HW_LIMIT_NONE ((u16)0x7FFF)
  5. typedef struct {
  6. bool is_limit;
  7. u32 lim_ticks;
  8. s16 high; //exsit_low -> lower -> higher
  9. u16 high_lim;
  10. s16 mid;
  11. u16 mid_lim;
  12. s16 start;
  13. u16 start_lim;
  14. float curr_lim;
  15. u16 temp_sensor_err;
  16. s16 temp;
  17. }temp_lim_t;
  18. typedef struct {
  19. bool is_limit;
  20. u32 ticks;
  21. s16 crit_low;
  22. s16 lower;
  23. u16 lower_lim;
  24. }vol_limt_t;
  25. float motor_temp_high_limit(void);
  26. float mos_temp_high_limit(void);
  27. u16 vbus_voltage_low_limit(void);
  28. bool motor_temp_limited(void);
  29. bool mos_temp_limited(void);
  30. float motor_temp_high_limit_test(s16 temp);
  31. float mos_temp_high_limit_test(s16 temp);
  32. u16 vbus_voltage_low_limit_test(s16 vol);
  33. #endif /* _Limit_H__ */