#ifndef _THROTTLE_H__ #define _THROTTLE_H__ #define THRO1_5V_ERR_BIT 0x01 #define THRO2_5V_ERR_BIT 0x02 #define THRO1_SIG_ERR_BIT 0x04 #define THRO2_SIG_ERR_BIT 0x08 #define THRO_NOT_RELEASED 0x10 typedef struct { bool accl; float torque_req; float torque_real; float torque_compensation; float vel_filted; float pedal_opening; float prev_pedal_opening; u8 gear; }throttle_torque_t; void throttle_init(void); bool throttle_is_released(void); bool throttle_is_all_error(void); bool throttle_not_released_err(void); u8 throttle_get_errors(void); float throttle_get_signal(void); void throttle_detect(bool ready); bool throttle1_is_error(void); bool throttle2_is_error(void); float throttle_start_vol(void); float throttle_end_vol(void); float throttle_vol_range(void); void throttle_set_torque(mot_contrl_t * ctrl, float torque); float throttle_get_torque(mot_contrl_t * ctrl, float vol); float throttle_get_open_ration_filted(void); float get_user_request_torque(void); float throttle_opening_to_vol(float r); float throttle_vol_to_opening(float thro_val); void throttle_torque_reset(void); #endif /* _THROTTLE_H__ */