diff --git a/README.md b/README.md index 405fc10..36f1510 100644 --- a/README.md +++ b/README.md @@ -12,4 +12,5 @@ This repository specifies the control protocol implemented by [gex-core](https:/ - [UNIT_DO.md](UNIT_DO.md) - Digital Output - [UNIT_DI.md](UNIT_DI.md) - Digital Input +- [UNIT_NEOPIXEL.md](UNIT_NEOPIXEL.md) - NeoPixel driver diff --git a/UNIT_NEOPIXEL.md b/UNIT_NEOPIXEL.md new file mode 100644 index 0000000..c0dcf16 --- /dev/null +++ b/UNIT_NEOPIXEL.md @@ -0,0 +1,44 @@ +# NeoPixel + +Implements the NeoPixel protocol for driving addressable LED strips. +The strip length is configured in the unit settings. + +## Commands + +### CLEAR (0x00) +Set all pixels to black. This is automatically executed on start-up to clear the strip. + +### LOAD (0x01) +Load packed RGB data to the strip. + +*Payload:* + +- a byte array `(R,G,B)` x length + +### LOAD_U32_LE (0x02) +Load 32-bit `0x00BBGGRR` words encoded in little-endian as `(R,G,B,0)`. +This is more convenient for the PC script, but wastes 1/4 of the payload by padding +null bytes. + +*Payload:* + +- a byte array `(R,G,B,0)` x length + +### LOAD_U32_BE (0x03) +Load 32-bit `0x00BBGGRR` words encoded in big-endian as `(0,B,G,R)`. + +*Payload:* + +- a byte array `(0,B,G,R)` x length + + +### GET_LEN (0x04) +Read the neopixel strip length as configured in the settings. + +*Response:* + +- u16 - number of pixels + +## Events + +*No events defined for this unit type.*