feat: 添加 PID 控制器及霍尔传感器转速获取功能

This commit is contained in:
2026-04-04 00:44:37 +08:00
parent e382b06b03
commit a8c97567c8
7 changed files with 230 additions and 11 deletions

View File

@@ -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);