Skip to content

新增 sean_ws2812b 软件包 #1886

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

godmial
Copy link

@godmial godmial commented Apr 29, 2025

新增软件包:sean_ws2812b

简介

新增 sean_ws2812b 灯带驱动软件包,基于 SPI 接口控制 WS2812B RGB 灯带,适用于 RT-Thread 4.1.0 系统。

该软件包体积小巧、接口规范、功能完整,支持单颗灯珠控制、批量设置、全局亮度调整以及内置 Gamma 校正。

功能特性

  • 支持通过 SPI 接口控制 WS2812B 灯带
  • 支持单颗灯珠独立设置颜色
  • 支持批量设置所有灯珠颜色
  • 支持全局亮度调节(0~255)
  • 支持 Gamma 矫正,亮度更自然
  • 提供基础灯效示例(如流水灯、呼吸灯)
  • 支持 Kconfig 配置 SPI 总线、设备名称、片选引脚、灯珠数量等参数
  • 提供详细的 README.md 使用说明文档

适配平台

  • 当前版本基于 RT-Thread 4.1.0 设计
  • 实测平台:
    • STM32F103(主频48MHz)运行正常
    • STM32H743(主频68MHz)运行正常

使用说明

  • 需要在 RT-Thread menuconfig 中开启 SPI 驱动(RT_USING_SPI)
  • 在工程 board.h 文件中取消注释对应的 SPI 总线宏
  • 在 STM32CubeMX 中配置 SPI 接口为 "半双工单向发送(Transmit Only Half Duplex)" 模式

详细使用方法和注意事项请参考软件包自带的 README.md

TODO清单

  • 增加基于 PWM 方式的 WS2812B 驱动支持
  • 适配 RT-Thread 5.1.0 及以上版本

许可协议

本软件包遵循 Apache-2.0 许可证。


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant