feat: 添加 PID 控制器及霍尔传感器转速获取功能
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "bsp_motor.h" // 确保 motor_id_t 类型可见
|
||||
#include "elog.h"
|
||||
#include "cmsis_os.h"
|
||||
|
||||
/**
|
||||
* @brief 霍尔周期/脉冲计数结构体
|
||||
*/
|
||||
@@ -14,6 +15,9 @@ typedef struct {
|
||||
float speed_rpm; // 计算得到的转速 (RPM)
|
||||
} hall_sensor_t;
|
||||
|
||||
/* 获取实时 RPM 接口 */
|
||||
float hall_get_speed(motor_id_t motor_id);
|
||||
|
||||
/* 初始化霍尔传感器 (GPIO 外部中断模式) */
|
||||
void hall_init(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user