etcs.h 689 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef _ETSC_H__
  2. #define _ETSC_H__
  3. typedef struct {
  4. bool b_etcs_en;
  5. bool b_etcs_running;
  6. float f_fvel;
  7. float f_torque_ref;
  8. float f_torque_tcs;
  9. float f_acc;
  10. u32 n_fv_ts;
  11. int n_etcs_run_cnt;
  12. float output;
  13. }etcs_t;
  14. void etcs_set_fvel(etcs_t *etcs, float vel);//设置前轮速度
  15. bool etcs_is_running(etcs_t *etcs);
  16. void etcs_enable(etcs_t *etcs, bool enable);
  17. float etcs_process(etcs_t *etcs);
  18. static __INLINE bool etcs_is_running(etcs_t *etcs) {
  19. return etcs->b_etcs_running;
  20. }
  21. static __INLINE void etcs_enable(etcs_t *etcs, bool enable) {
  22. etcs->b_etcs_en = enable;
  23. }
  24. static __INLINE float etcs_get_output(etcs_t *etcs) {
  25. return etcs->output;
  26. }
  27. #endif /* _ETSC_H__ */