From embedded-dev — RIPER-5 嵌入式固件开发协议
Develops board support package (BSP) drivers for MCU peripherals like sensors, memory, or displays by searching, evaluating, and adapting open-source driver libraries to STM32 HAL conventions. Includes automatic scanning, adaptation, and scaffold generation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/embedded-dev:peripheral-driverThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- 需要为外部设备(AT24C02、MPU6050、SSD1306 等)开发 BSP 驱动。
AT24C02、MPU6050)。hi2c1、hspi2),通常来自 CubeMX 生成的代码。--scan 模式自动分析输入目录中的 C/H 文件,识别函数签名、HAL 调用模式、命名风格和 include 依赖。--list-devices 模式列出 device-adaptation.md 中已记录的设备和推荐库。device-adaptation.md 中有记录,直接提供推荐库和适配要点。--scan 分析开源代码,查看适配建议报告:
python3 scripts/bsp_adapter.py --scan ./downloaded_driver/
--adapt 将代码适配到 BSP 规范:
python3 scripts/bsp_adapter.py \
--adapt ./downloaded_driver/ \
--device <device_name> --handle <hal_handle> \
--output ./Hardware/bsp_<device>/
--scaffold 生成 BSP 骨架文件:
python3 scripts/bsp_adapter.py \
--scaffold --device <device_name> --bus <bus_type> \
--handle <hal_handle> --addr <i2c_addr> \
--output ./Hardware/bsp_<device>/
main.c 的 USER CODE 区域,参考脚本输出的集成指南。build-* skill。驱动架构设计和实现最佳实践参考 stm32-hal-development/references/peripheral-driver-guide.md。
--scaffold 生成骨架并提示用户参考规格书手动实现。project-config-error,建议手动适配通信层。build-* skill 处理构建错误。os、re、pathlib、argparse),无额外依赖。--scan 输出适配建议报告:检测到的函数、HAL 调用、命名风格、适配难度评估。--adapt 输出适配后的 BSP 文件和 main.c 集成指南。--scaffold 输出符合 BSP 模板规范的骨架文件。--list-devices 输出已记录设备的推荐库和适配难度。stm32-hal-development(提供方法论和 BSP 模板)。build-cmake、build-iar、build-keil(编译验证)。npx claudepluginhub duncanyoung-1/embedded-dev --plugin embedded-devBuilds device drivers or protocol handlers for I2C sensors, BLE services, MQTT clients, SPI peripherals using interrupt-driven I/O, HAL abstraction, and error handling in embedded projects.
Develops STM32 firmware on CubeMX-generated HAL projects with peripheral configuration, BSP driver structure, interrupt-safe code, and hardware-aware troubleshooting.
Build a device driver or protocol handler — I2C sensors, BLE services, MQTT clients, SPI peripherals with interrupt-driven I/O and clean HAL abstraction. Use when asked to "write a driver", "I2C device", "BLE service", "MQTT client", or "sensor integration".