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文档说明新的目录结构 优势: ✅ 更好的代码组织和管理 ✅ 便于添加、删除、修改模板 ✅ 清晰的模块划分 ✅ 向后兼容现有结构
48 lines
1.3 KiB
C
48 lines
1.3 KiB
C
#pragma once
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* Includes ----------------------------------------------------------------- */
|
|
#include <stdint.h>
|
|
#include "tim.h"
|
|
#include "bsp.h"
|
|
|
|
/* USER INCLUDE BEGIN */
|
|
|
|
/* USER INCLUDE END */
|
|
|
|
|
|
/* Exported constants ------------------------------------------------------- */
|
|
/* Exported macro ----------------------------------------------------------- */
|
|
/* USER DEFINE BEGIN */
|
|
|
|
/* USER DEFINE END */
|
|
|
|
/* Exported types ----------------------------------------------------------- */
|
|
/* PWM通道 */
|
|
typedef enum {
|
|
/* AUTO GENERATED BSP_PWM_ENUM */
|
|
BSP_PWM_NUM,
|
|
BSP_PWM_ERR,
|
|
} BSP_PWM_Channel_t;
|
|
|
|
/* Exported functions prototypes -------------------------------------------- */
|
|
int8_t BSP_PWM_Start(BSP_PWM_Channel_t ch);
|
|
int8_t BSP_PWM_SetComp(BSP_PWM_Channel_t ch, float duty_cycle);
|
|
int8_t BSP_PWM_SetFreq(BSP_PWM_Channel_t ch, float freq);
|
|
int8_t BSP_PWM_Stop(BSP_PWM_Channel_t ch);
|
|
uint32_t BSP_PWM_GetAutoReloadPreload(BSP_PWM_Channel_t ch);
|
|
uint16_t BSP_PWM_GetChannel(BSP_PWM_Channel_t ch);
|
|
TIM_HandleTypeDef* BSP_PWM_GetHandle(BSP_PWM_Channel_t ch);
|
|
int8_t BSP_PWM_Start_DMA(BSP_PWM_Channel_t ch, uint32_t *pData, uint16_t Length);
|
|
int8_t BSP_PWM_Stop_DMA(BSP_PWM_Channel_t ch);
|
|
|
|
/* USER FUNCTION BEGIN */
|
|
|
|
/* USER FUNCTION END */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif |