#ifndef _Limit_H__
#define _Limit_H__
#include "os/os_types.h"

#define HW_LIMIT_NONE ((u16)0x7FFF)

typedef struct {
	bool is_limit;
	u32  lim_ticks;
	s16  high; //exsit_low -> lower -> higher
	u16  high_lim;
	s16  mid;
	u16  mid_lim;
	s16  start;
	u16  start_lim;
	float curr_lim;
	u16   temp_sensor_err;
	s16   temp;
}temp_lim_t;

typedef struct {
	bool is_limit;
	u32  ticks;
	s16  crit_low;
	s16  lower;
	u16  lower_lim;
}vol_limt_t;

float motor_temp_high_limit(void);
float mos_temp_high_limit(void);
u16   vbus_voltage_low_limit(void);
bool motor_temp_limited(void);
bool mos_temp_limited(void);
float motor_temp_high_limit_test(s16 temp);
float mos_temp_high_limit_test(s16 temp);
u16 vbus_voltage_low_limit_test(s16 vol);

#endif /* _Limit_H__ */

