| 1234567891011121314151617181920212223242526 |
- #ifndef _HALL_SPEED_H__
- #define _HALL_SPEED_H__
- #include "libs/types.h"
- #include "hal/hal.h"
- #define NEGATIVE (int8_t)-1
- #define POSITIVE (int8_t)1
- #define THETA_NONE (float)0xFFFF
- typedef struct {
- bool alignmnet;
- float theta;
- float rpm; //ÿ·ÖÖÓתËÙ
- u8 state;
- u32 ticks;
- bool working;
- s8 direction;
- float degree_per_s; //ÿÃë¶È£¬ ext: 10¶È/s
- }hall_t;
- void hall_sensor_init(void);
- float hall_sensor_get_theta(void); //return degree
- float hall_sensor_get_speed(void); //return rpm
- #endif /* _HALL_SPEED_H__ */
|