CI130X UART Protocol V1¶
1. Overview of Serial Command Format¶
Note: For non-single-byte data in this protocol, the low byte comes first, followed by the high byte.
| Name | Length (bytes) | Model description |
|---|---|---|
| Head | 2 | Frame ID header, fixed as 0xA5 0xFA |
| ID | 1 | Product ID, default is 0, can also be customized |
| Cmd | 1 | Instruction code, 0x00-0x7F for voice chip sending operation, 0x80-0xF0 for voice chip receiving operation |
| Data | 2 | The content of the command, usually the ID of the command word |
| CheckSum | 1 | Sum of Header + ID + cmd + Data |
| End | 1 | End of frame flag |
2. Voice Module Receiving Data Protocol Example¶
Taking our smart Airconditioner demo as an example, after the voice module recognizes the command word, the protocol sent to the MCU is as follows:
| Command word | Head | ID | Cmd | Data low | Data high | CheckSum | End |
|---|---|---|---|---|---|---|---|
| Hello Jenny | 0xA5 0xFA | 0x00 | 0x81 | 0x01 | 0x00 | 0x… | 0xFB |
| Open Air Conditioner | 0xA5 0xFA | 0x00 | 0x81 | 0x02 | 0x00 | 0x… | 0xFB |
| Close Air Conditioner | 0xA5 0xFA | 0x00 | 0x81 | 0x03 | 0x00 | 0x… | 0xFB |
| ...... | 0xA5 0xFA | 0x00 | 0x81 | … | 0x00 | 0x… | 0xFB |
| Disable voice | 0xA5 0xFA | 0x00 | 0x81 | 0x55 | 0x00 | 0x… | 0xFB |
| Exit Recognition | 0xA5 0xFA | 0x00 | 0x82 | 0x01 | 0x00 | 0x… | 0xFB |
3. Voice Module Sending Data Protocol Example¶
The voice module receives the protocol sent by the MCU as follows:
| Function | Head | Reserved | Cmd | Data Low | Reserved | CheckSum | End |
|---|---|---|---|---|---|---|---|
| Turn on echo | 0xA5 0xFA | 0x00 | 0x01 | 0x01 | 0x00 | 0x… | 0xFB |
| Turn off echo | 0xA5 0xFA | 0x00 | 0x01 | 0x00 | 0x00 | 0x… | 0xFB |
| Open verification | 0xA5 0xFA | 0x00 | 0x02 | 0x01 | 0x00 | 0x… | 0xFB |
| Close verification | 0xA5 0xFA | 0x00 | 0x02 | 0x00 | 0x00 | 0x… | 0xFB |
| Sound with broadcast ID 1 | 0xA5 0xFA | 0x00 | 0x03 | 0x01 | 0x00 | 0x… | 0xFB |
| Broadcast the voice with ID XX | 0xA5 0xFA | 0x00 | 0x3 | 0xxx | 0x00 | 0x… | 0xFB |
| Restart voice module | 0xA5 0xFA | 0x00 | 0x04 | 0x01 | 0x00 | 0x… | 0xFB |
| Exit wake-up state | 0xA5 0xFA | 0x00 | 0x05 | 0x01 | 0x00 | 0x… | 0xFB |
| Turn on playback | 0xA5 0xFA | 0x00 | 0x06 | 0x01 | 0x00 | 0x… | 0xFB |
| Turn off playback | 0xA5 0xFA | 0x00 | 0x06 | 0x00 | 0x00 | 0x… | 0xFB |
| Set the volume to 1 | 0xA5 0xFA | 0x00 | 0x07 | 0x01 | 0x00 | 0x… | 0xFB |
| Set the volume to 7 | 0xA5 0xFA | 0x00 | 0x07 | 0x07 | 0x00 | 0x… | 0xFB |
| Get version system | 0xA5 0xFA | 0x00 | 0x08 | 0x01 | 0x00 | 0x… | 0xFB |
Note:
-
Echo means that the voice module sends the received instruction as it is;
-
Checksum and sound playback are turned on by default;
-
The maximum volume is 7 levels.