mirror of
https://github.com/goldenfishs/MRobot.git
synced 2026-02-04 18:00:19 +08:00
主要更改: - 将所有BSP外设文件移动到独立子文件夹(can/, fdcan/, uart/等) - 将所有Component文件移动到独立子文件夹(pid/, filter/, cmd/等) - 将所有Device文件移动到独立子文件夹(dr16/, bmi088/等) - 更新代码生成器以支持新的文件夹结构 - 保持向后兼容性,支持从子文件夹或根目录加载模板 - 添加STRUCTURE.md文档说明新的目录结构 优势: ✅ 更好的代码组织和管理 ✅ 便于添加、删除、修改模板 ✅ 清晰的模块划分 ✅ 向后兼容现有结构
68 lines
1.2 KiB
C
68 lines
1.2 KiB
C
#pragma once
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* Includes ----------------------------------------------------------------- */
|
|
#include <cmsis_os2.h>
|
|
|
|
#include "bsp/pwm.h"
|
|
|
|
/* USER INCLUDE BEGIN */
|
|
|
|
/* USER INCLUDE END */
|
|
|
|
/* USER DEFINE BEGIN */
|
|
|
|
/* USER DEFINE END */
|
|
|
|
/* Exported constants ------------------------------------------------------- */
|
|
/* Exported macro ----------------------------------------------------------- */
|
|
/* Exported types ----------------------------------------------------------- */
|
|
|
|
/**
|
|
* @brief
|
|
*/
|
|
typedef struct {
|
|
BSP_PWM_Channel_t pwm_ch;
|
|
float min_duty;
|
|
float max_duty;
|
|
} SERVO_t;
|
|
|
|
/* USER STRUCT BEGIN */
|
|
|
|
/* USER STRUCT END */
|
|
|
|
/**
|
|
* @brief
|
|
* @param servo
|
|
* @retval BSP_OK / BSP_ERR
|
|
*/
|
|
|
|
int8_t SERVO_Init(SERVO_t *servo);
|
|
|
|
/**
|
|
* @brief
|
|
* @param servo
|
|
* @param angle
|
|
* @retval BSP_OK / BSP_ERR
|
|
*/
|
|
int8_t SERVO_SetAngle(SERVO_t *servo, float angle);
|
|
|
|
/**
|
|
* @brief
|
|
* @param servo
|
|
* @retval BSP_OK / BSP_ERR
|
|
*/
|
|
|
|
int8_t SERVO_Stop(SERVO_t *servo);
|
|
|
|
/* USER FUNCTION BEGIN */
|
|
|
|
/* USER FUNCTION END */
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif |