FeikoWielsma/cm-pixel

GitHub: FeikoWielsma/cm-pixel

通过逆向工程 USB 协议,为 Cooler Master 六边形 LED 屏幕提供开源的显示驱动和编程控制工具包。

Stars: 0 | Forks: 0

# cm-pixel **Cooler Master MasterLiquid Atmos II Pixel LED** 的开源驱动程序 + 工具包 六边形像素屏幕 —— 官方 MasterCTRL 应用的纯净、轻量级替代方案 用于通过 USB 控制 LED。**仅限屏幕**(水泵/风扇为 PWM 控制,不受影响)。 USB 协议为从零开始逆向工程所得;详见 [`PROTOCOL.md`](PROTOCOL.md)。 ## 硬件 - Cooler Master "Atmos V2 - Pixel",USB `2516:021C`,标准 HID(无需特殊驱动)。 - 32×32 寻址网格,排列成六边形的 **556 个实际 LED**,RGB888。 ## 安装 本项目使用 [uv](https://docs.astral.sh/uv/)。克隆仓库后执行: ``` uv sync # creates .venv and installs everything (incl. uv.lock) uv run cm-pixel list # run the CLI ``` 或者将其添加到你自己的 uv 项目中: ``` uv add cm-pixel ``` (直接使用 pip 也可以:`pip install cm-pixel`。) ## CLI ``` cm-pixel color 255 0 0 # solid red cm-pixel image photo.png # show an image (auto-fit to the hexagon) cm-pixel gif spinner.gif # play a GIF cm-pixel text "HI" # static centered text cm-pixel scroll "HELLO WORLD" # scrolling marquee cm-pixel anim plasma # procedural animation cm-pixel anim fire --speed 1.5 cm-pixel list # list animations ``` 常用参数:`--fps`、`--duration`、`--mask`(屏蔽六边形外的像素)、`--keep`、 `--brightness 0-100`、`--rotate 0|90|180|270`。亮度与旋转通过软件实现 (设备本身不支持相关指令);180° 旋转为精确对齐,90/270° 旋转在六边形顶点处会有轻微裁剪。 动画效果:`plasma rainbow swirl ripple breathe sparkle fire starfield`。 ## 库 ``` from cmpixel import PixelDisplay, Canvas from cmpixel.font import draw_text with PixelDisplay() as d: c = Canvas().fill((0, 0, 20)) c.set_pixel(16, 16, (255, 255, 255)) draw_text(c, "GO", color=(0, 255, 0)) d.send_canvas(c) ``` ``` # 播放内置 animation from cmpixel import PixelDisplay from cmpixel.animations import plasma from cmpixel.media import play with PixelDisplay() as d: play(d, plasma(speed=1.0), fps=30, duration=10) ``` ## 工作原理(简述) 一帧由 28 个 64 字节的 HID output report 组成:`80 DD + 60 data`,以蛇形 LED 顺序拼接为 556×RGB 数据。流式传输一帧即可立即显示 —— 无需握手。 完整细节及 LED 布局图详见 [`PROTOCOL.md`](PROTOCOL.md) 和 `cmpixel/layout.json`。 ## 状态 v0.1 —— 绘图、文本、GIF、程序化动画、软件亮度与旋转。 ## 免责声明 非官方项目,与 Cooler Master 无任何隶属关系。使用风险自负;本工具仅操作 屏幕的 framebuffer(不涉及 firmware/DFU)。
标签:LED控制, Python, 云资产清单, 开源硬件, 无后门, 硬件驱动, 逆向工具, 逆向工程