| Item | Description |
|---|---|
| Communication method | UART / serial port asynchronous communication |
| Device | Chain RGB |
| SKU | U218 |
| Baud Rate | 115200 bps |
| Data Bits | 8 bit |
| Stop bit | 1 bit |
| Parity | None |
| Flow Control | None |
| Document version | V1.0 |
All packets start with 0xAA 0x55 and end with 0x55 0xAA. Multi-byte length fields are entered low byte first.
| Field | length | Description |
|---|---|---|
| Header | 2 | Fixed to 0xAA 0x55 |
| Length | 2 | Number of bytes from Index to CRC, low byte first |
| Index | 1 | The index ID of the device in the Chain link |
| Cmd | 1 | request command code |
| Req Data | n | Request parameters; if there are no parameters, the length is 0 |
| CRC | 1 | See "3. Verification Instructions" |
| Tail | 2 | Fixed to 0x55 0xAA |
Request Frame:
AA 55 <Length_low> <Length_high> <Index> <Cmd> <Req Data...> <CRC> 55 AA | Field | length | Description |
|---|---|---|
| Header | 2 | Fixed to 0xAA 0x55 |
| Length | 2 | Number of bytes from Index to CRC, low byte first |
| Index | 1 | The index ID of the device in the Chain link |
| Cmd | 1 | Consistent with request Cmd |
| Resp Data | n | Response data, the structure is defined by the corresponding command |
| CRC | 1 | See "3. Verification Instructions" |
| Tail | 2 | Fixed to 0x55 0xAA |
Response Frame:
AA 55 <Length_low> <Length_high> <Index> <Cmd> <Resp Data...> <CRC> 55 AA | situation | response rules |
|---|---|
| Reply with status code | Operation_status = 0 means the operation failed, Operation_status = 1 means the operation was successful |
| Reply without status code | The judgment method of success or failure shall be based on the "Notes" of the corresponding instruction. |
| Item | rules |
|---|---|
| Check field | CRC |
| Checksum range | Starting from Index, accumulate to the last byte of Data |
| Checksum algorithm | Excluding the packet header, packet trailer, Length and CRC, the remaining bytes are accumulated and the lower 8-bits are taken. |
| Empty Data | CRC = (Index + Cmd) & 0xFF |
| Checksum failure | discard the frame |
CRC = (Index + Cmd + Data[0] + ... + Data[n]) & 0xFF #include <stddef.h>
#include <stdint.h>
uint8_t chain_calc_crc(uint8_t index, uint8_t cmd,
const uint8_t *data, size_t data_len)
{
uint16_t sum = index + cmd;
for (size_t i = 0; i < data_len; i++) {
sum += data[i];
}
return (uint8_t)(sum & 0xFF);
} | Cmd | Command name | Request Length | Reply Length | Request clarification | Response description | Details |
|---|---|---|---|---|---|---|
0x10 | Set display mode | 0x0004 | 0x0004 | Index_id (device index ID), Mode (display mode) | Operation_status | 5.1 |
0x11 | Get display mode | 0x0003 | 0x0004 | Index_id (device index ID) | Mode | 5.2 |
0x30 | Set pixels | 0x0004+Num*3 | 0x0004 | Index_id (device index ID), Num (number of pixels to be set), Coordinate_xy (pixel XY coordinates), Pixel_color (pixel color) | Operation_status | 5.3 |
0x31 | Full screen display cache refresh | 0x0083 | 0x0004 | Index_id (device index ID), Display_buffer (full screen display cache) | Operation_status | 5.4 |
0x32 | Get pixel value | 0x0004+Num | 0x0003+Num*2 | Index_id (device index ID), Num (number of pixels to be obtained), Coordinate_xy (pixel coordinates) | Pixel_color (pixel color) | 5.5 |
0x33 | Get full screen display cache | 0x0003 | 0x0083 | Index_id (device index ID) | Display_buffer (full screen display buffer) | 5.6 |
0x34 | display characters | 0x0007 | 0x0004 | Index_id (device index ID), Char (ASCII code of the character to be displayed), Offset (displayed position offset), Color (character color) | Operation_status | 5.7 |
0x40 | Show scrolling string | 0x0009+String_length | 0x0004 | Index_id (device index ID), Scroll_mode (scrolling mode), Scroll_interval (scrolling interval), Color (character color), String_length (string length), char (character) | Operation_status | 5.8 |
0x41 | Get scrolling string | 0x0003 | 0x0009+String_length | Index_id (device index ID) | Scroll_mode (scrolling mode), Scroll_interval (scrolling interval), Color (character color), String_length (string length), char (character) | 5.9 |
0x42 | Set scroll string status | 0x0004 | 0x0004 | Index_id (device index ID), Scroll_state (scroll state) | Operation_status | 5.10 |
0x43 | Set scroll string status | 0x0003 | 0x0004 | Index_id (device index ID) | Scroll_state (scroll state) | 5.11 |
0xE0 | Set screen rotation angle | 0x0005 | 0x0004 | Index_id (device index ID), Screen_Rotation (screen rotation angle), Save_to_flash (whether to save to internal Flash) | Operation_status | 5.12 |
0xE1 | Get screen rotation angle | 0x0003 | 0x0004 | Index_id (device index ID) | Screen_Rotation (screen rotation angle) | 5.13 |
0xE2 | Set screen brightness | 0x0005 | 0x0004 | Index_id (device index ID), Brightness (screen brightness), Save_to_flash (whether to save to internal Flash) | Operation_status | 5.14 |
0xE3 | Get screen brightness | 0x0003 | 0x0004 | Index_id (device index ID) | Brightness(screen brightness) | 5.15 |
0xE4 | clear screen | 0x0003 | 0x0004 | Index_id (device index ID) | Operation_status | 5.16 |
0xF8 | Query device unique UID | 0x0004 | 0x0004+4/12 | Index_id (device index ID), UID_Type | Operation_status、UID | 5.17 |
0xF9 | Query the upgrade program version number | 0x0003 | 0x0004 | Index_id (device index ID) | Bootloader_version | 5.18 |
0xFA | Query the device software version number | 0x0003 | 0x0004 | Index_id (device index ID) | Firmware_version | 5.19 |
0xFB | Query device type | 0x0003 | 0x0005 | Index_id (device index ID) | Device_type | 5.20 |
0xFC | Enumeration request, sent by the chain link change end device, and when the device is powered on, notifying the host to update the link device status | Device-initiated report | Device-initiated report | none | none | 5.21 |
0xFD | Heartbeat packets, regular communication between chain devices, can self-discover whether they are end devices, and the host can also use heartbeat packets to determine whether there is a chain device connected. | 0x0003 | 0x0003 | none | none | 5.22 |
0xFE | Enumerate to obtain the number of cascaded devices | 0x0004 | 0x0004 | Send_num (default 0, used to record the number of devices) | Receive_num (the value represents the number of devices) | 5.23 |
Cmd 0x10Input parameters: Index_id (device index ID), Mode (display mode)
Request Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0x10 | Mode | CRC | 55 AA Return parameters: Operation_status
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0x10 | Operation_status | CRC | 55 AA 0: Operation failed1: Operation successful0: Pixel control mode (directly set pixel display)1: Scroll character mode (scrolling display string)Cmd 0x11Input parameter: Index_id (device index ID)
Request Frame:
AA 55 | 0x03 | 0x00 | Index_id | 0x11 | CRC | 55 AA Return parameters: Mode (display mode)
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0x11 | Mode | CRC | 55 AA 0: Pixel control mode (directly set pixel display)1: Scroll character mode (scrolling display string)Cmd 0x30Input parameters: Index_id (device index ID), Num (number of pixels to be set), Coordinate_xy (pixel XY coordinates), Pixel_color (pixel color)
Request Frame:
AA 55 | 0x04 + Num*3 | 0x00 | Index_id | 0x30 | Num | Coordinate_xy0 | Pixel_color_low0 | Pixel_color_high0 | Coordinate_xy1 | Pixel_color_low1 | ... | CRC | 55 AA Return parameters: Operation_status
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0x30 | Operation_status | CRC | 55 AA 0: Operation failed1: Operation successful2: Mode mismatch (needs to be configured as pixel control mode)Cmd 0x31Input parameters: Index_id (device index ID), Display_buffer (full-screen display cache)
Request Frame:
AA 55 | 0x83 | 0x00 | Index_id | 0x31 | Display_buffer_low0 | Display_buffer_high0 | Display_buffer_low1 | Display_buffer_high1 | Display_buffer_low2 | Display_buffer_high2 | ... | Display_buffer_high63 | CRC | 55 AA Return parameters: Operation_status
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0x31 | Operation_status | CRC | 55 AA 0: Operation failed1: Operation successful2: Mode mismatch (needs to be configured as pixel control mode)Cmd 0x32Input parameters: Index_id (device index ID), Num (number of pixels to be obtained), Coordinate_xy (pixel coordinates)
Request Frame:
AA 55 | 0x04 + Num | 0x00 | Index_id | 0x32 | Num | Coordinate_xy0 | Coordinate_xy1 | Coordinate_xy2 | Coordinate_xy3 | Coordinate_xy4 | Coordinate_xy5 | ... | CRC | 55 AA Return parameters: Pixel_color (pixel color)
Response Frame:
AA 55 | 0x03 + Num*2 | 0x00 | Index_id | 0x32 | Pixel_color_low0 | Pixel_color_high0 | Pixel_color_low1 | Pixel_color_high1 | Pixel_color_low2 | Pixel_color_high2 | Pixel_color_low3 | ... | CRC | 55 AA Cmd 0x33Input parameter: Index_id (device index ID)
Request Frame:
AA 55 | 0x03 | 0x00 | Index_id | 0x33 | CRC | 55 AA Return parameters: Display_buffer (full screen display cache)
Response Frame:
AA 55 | 0x83 | 0x00 | Index_id | 0x33 | Display_buffer_low0 | Display_buffer_high0 | Display_buffer_low1 | Display_buffer_high1 | Display_buffer_low2 | Display_buffer_high2 | ... | Display_buffer_high63 | CRC | 55 AA Cmd 0x34Input parameters: Index_id (device index ID), Char (ASCII code of the character to be displayed), Offset (displayed position offset), Color (character color)
Request Frame:
AA 55 | 0x07 | 0x00 | Index_id | 0x34 | Char | Offset | Color_low | Color_high | CRC | 55 AA Return parameters: Operation_status
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0x34 | Operation_status | CRC | 55 AA 0: Operation failed1: Operation successful2: Mode mismatch (needs to be configured as pixel control mode)Cmd 0x40Input parameters: Index_id (device index ID), Scroll_mode (scrolling mode), Scroll_interval (scrolling interval), Color (character color), String_length (string length), char (character)
Request Frame:
AA 55 | 0x09+String_length | 0x00 | Index_id | 0x40 | Scroll_mode | Scroll_interval_low | Scroll_interval_high | Color_low | Color_high | String_length | char1 | ... | CRC | 55 AA Return parameters: Operation_status
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0x40 | Operation_status | CRC | 55 AA 0: Operation failed1: Operation successful2: Pattern mismatch (rolling character mode needs to be configured)Cmd 0x41Input parameter: Index_id (device index ID)
Request Frame:
AA 55 | 0x03 | 0x00 | Index_id | 0x41 | CRC | 55 AA Return parameters: Scroll_mode (scrolling mode), Scroll_interval (scrolling interval), Color (character color), String_length (string length), char (character)
Response Frame:
AA 55 | 0x09+String_length | 0x00 | Index_id | 0x41 | Scroll_mode | Scroll_interval_low | Scroll_interval_high | Color_low | Color_high | String_length | Char1 | ... | CRC | 55 AA Cmd 0x42Input parameters: Index_id (device index ID), Scroll_state (scrolling state)
Request Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0x42 | Scroll_state | CRC | 55 AA Return parameters: Operation_status
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0x42 | Operation_status | CRC | 55 AA 0: Operation failed1: Operation successful2: Pattern mismatch (rolling character mode needs to be configured)0: Start/continue scrolling1: Pause scrolling (the screen keeps the current character displayed statically)2: Stop and clear (clear the displayed characters and start from the beginning next time the setting is started)Cmd 0x43Input parameter: Index_id (device index ID)
Request Frame:
AA 55 | 0x03 | 0x00 | Index_id | 0x43 | CRC | 55 AA Return parameters: Scroll_state (scrolling state)
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0x43 | Scroll_state | CRC | 55 AA 0: scrolling1: suspended state2: idle/stop stateCmd 0xE0Input parameters: Index_id (device index ID), Screen_Rotation (screen rotation angle), Save_to_flash (whether to save to internal Flash)
Request Frame:
AA 55 | 0x05 | 0x00 | Index_id | 0xE0 | Screen_Rotation | Save_to_flash | CRC | 55 AA Return parameters: Operation_status
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0xE0 | Operation_status | CRC | 55 AA 0: Operation failed1: Operation successful0: Default display angle1: Rotate 90° clockwise2: Rotate 180° clockwise3: Rotate 270° clockwise (90° counterclockwise)0: Do not save1:SaveCmd 0xE1Input parameter: Index_id (device index ID)
Request Frame:
AA 55 | 0x03 | 0x00 | Index_id | 0xE1 | CRC | 55 AA Return parameters: Screen_Rotation (screen rotation angle)
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0xE1 | Screen_Rotation | CRC | 55 AA 0: Default display angle1: Rotate 90° clockwise2: Rotate 180° clockwise3: Rotate 270° clockwise (90° counterclockwise)Cmd 0xE2Input parameters: Index_id (device index ID), Brightness (screen brightness), Save_to_flash (whether to save to internal Flash)
Request Frame:
AA 55 | 0x05 | 0x00 | Index_id | 0xE2 | Brightness | Save_to_flash | CRC | 55 AA Return parameters: Operation_status
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0xE2 | Operation_status | CRC | 55 AA 0: Operation failed1: Operation successful0: Do not save1:SaveCmd 0xE3Input parameter: Index_id (device index ID)
Request Frame:
AA 55 | 0x03 | 0x00 | Index_id | 0xE3 | CRC | 55 AA Return parameters: Brightness (screen brightness)
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0xE3 | Brightness | CRC | 55 AA Cmd 0xE4Input parameter: Index_id (device index ID)
Request Frame:
AA 55 | 0x03 | 0x00 | Index_id | 0xE4 | CRC | 55 AA Return parameters: Operation_status
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0xE4 | Operation_status | CRC | 55 AA 0: Operation failed1: Operation successfulCmd 0xF8Input parameters: Index_id (device index ID), UID_Type
Request Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0xF8 | UID_Type | CRC | 55 AA Return parameters: Operation_status, UID
Response Frame:
AA 55 | 0x04+4/12 | 0x00 | Index_id | 0xF8 | Operation_status | UID (multi-byte) | CRC | 55 AA 0: Operation failed1: Operation successful0:4byte UID1:12byte UIDCmd 0xF9Input parameter: Index_id (device index ID)
Request Frame:
AA 55 | 0x03 | 0x00 | Index_id | 0xF9 | CRC | 55 AA Return parameters: Bootloader_version
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0xF9 | Bootloader_version | CRC | 55 AA None.
Cmd 0xFAInput parameter: Index_id (device index ID)
Request Frame:
AA 55 | 0x03 | 0x00 | Index_id | 0xFA | CRC | 55 AA Return parameters: Firmware_version
Response Frame:
AA 55 | 0x04 | 0x00 | Index_id | 0xFA | Firmware_version | CRC | 55 AA None.
Cmd 0xFBInput parameter: Index_id (device index ID)
Request Frame:
AA 55 | 0x03 | 0x00 | Index_id | 0xFB | CRC | 55 AA Return parameters: Device_type
Response Frame:
AA 55 | 0x05 | 0x00 | Index_id | 0xFB | Device_type_low | Device_type_high | CRC | 55 AA Cmd 0xFCInput parameters: none
Request Frame:
Device-initiated report,No host request frame Return parameters: none
Response Frame:
Device-initiated report,No response frame None.
Cmd 0xFDInput parameters: none
Request Frame:
AA 55 | 0x03 | 0x00 | 0xFF | 0xFD | CRC | 55 AA Return parameters: none
Response Frame:
AA 55 | 0x03 | 0x00 | 0xFF | 0xFD | CRC | 55 AA None.
Cmd 0xFEInput parameter: Send_num (default 0, used to record the number of devices)
Request Frame:
AA 55 | 0x04 | 0x00 | 0xFF | 0xFE | Send_num | CRC | 55 AA Return parameter: Receive_num (the value represents the number of devices)
Response Frame:
AA 55 | 0x04 | 0x00 | 0xFF | 0xFE | Receive_num | CRC | 55 AA None.
| value | Name | Description |
|---|---|---|
0 | Failure | Operation failed |
1 | Success | Operation successful |
Other modes, ranges, and event enumeration values are defined in the "Notes" of the corresponding instructions.
| Document version | Date | Description |
|---|---|---|
V1.0 | 2026-6-1 | Organized according to the official Chain RGB protocol |