2025-12-31 18:12:27 +08:00
---
title: XMOS EQ UART Control Protocol and Command Set
description: UART serial communication protocol specification for EQ parameter configuration and control, covering frame format, command set, and field descriptions, applicable to XU316 and related products.
keywords: EQ, UART, Serial Protocol, Communication Protocol, Command Set, XU316, Zero-Code Firmware, Phaten Audio
---
# XMOS EQ UART Control Protocol and Command Set
--8<-- "common/phaten_xmos_support_img.md"
## 1. Protocol Foundation Specification
### 1.1 Underlying Communication Protocol
2026-03-09 16:50:37 +08:00
EQ Designer uses the serial protocol for communication between the host and the device. The protocol is based on the XU316 zero-code protocol specification and supports EQ parameter settings, reading, mode switching, and other functions.
2025-12-31 18:12:27 +08:00
| Parameter | Value |
| :--- | :--- |
| Baud Rate | 115200 bps |
| Data Bits | 8 |
| Parity | None |
| Stop Bits | 1 |
| Flow Control | None |
### 1.2 Frame Format and Data Transmission
**General Frame Format**
All commands and responses follow this frame format:
| Field | Byte Count | Description |
| :--- | :--- | :--- |
| Frame Header | 2 | Fixed as `0x55 0xAA` |
| Version | 1 | Protocol version number (typically `0x00` ) |
2026-03-09 16:50:37 +08:00
| Command | 1 | EQ Command Code (0x40-0x5C) |
2025-12-31 18:12:27 +08:00
| Data Length | 1 | Length N of subsequent data |
| Data | N | Specific data content |
2026-03-09 16:50:37 +08:00
| Checksum | 1 | Sum of all bytes starting from frame header, modulo 256 (Sum % 256) |
**Data Packet Field Example**
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | Version | Protocol Version (0x00)
3 | 1 | Command | EQ Command Code (0x40-0x5C)
4 | 1 | Length | Data Length
5-N | N | Data | Command Data
N+1 | 1 | Checksum| Checksum
```
2025-12-31 18:12:27 +08:00
**Data Transmission Notes**
* **Byte Order ** : All multi-byte data is transmitted in **Little Endian ** mode (Note: Different from XU316 standard protocol's big endian, please refer to this protocol).
* **Floating Point ** : Follows IEEE 754 float format.
---
## 2. Protocol Command Set
### 2.1 Command Classification Overview
| Command | Command Description | Direction | Function |
| :--- | :--- | :--- | :--- |
2026-03-09 16:50:37 +08:00
| **0x40 ** | SET_EQ_MODE | Host→Device | Switch EQ mode |
| **0x41 ** | GET_EQ_MODE | Host→Device | Get current EQ mode information |
| **0x42 ** | SET_MODE_GAIN_AND_NAME | Host→Device | Set mode overall gain and name |
| **0x43 ** | SET_EQ_PARAMS | Host→Device | Send EQ parameters |
| **0x44 ** | GET_EQ_PARAMS | Host→Device | Read EQ parameters |
| **0x45 ** | GET_DEVICE_INFO | Host→Device | Get device information |
| **0x46 ** | RESET_EQ_PARAMS | Host→Device | Reset EQ parameters |
| **0x47 ** | GET_EQ_MODE_COUNT | Host→Device | Get total EQ mode count |
| **0x48 ** | SET_AND_SAVE_EQ_MODE | Host→Device | Set and save EQ mode |
| **0x49 ** | SET_VOLUME | Host→Device | Set volume level |
| **0x4A ** | GET_VOLUME | Host→Device | Get volume level |
| **0x4B ** | GET_LED_INFO | Host→Device | Get LED information |
| **0x4C ** | SET_LED_SWITCH | Host→Device | Set LED switch |
| **0x4D ** | GET_LED_SWITCH | Host→Device | Get LED switch |
| **0x4E ** | GET_LED_STATUS | Host→Device | Get LED status |
| **0x4F ** | GET_LED_COUNT | Host→Device | Get total LED count |
| **0x50 ** | GET_UAC_MODE_INFO | Host→Device | Get UAC mode information |
| **0x51 ** | SET_UAC_MODE | Host→Device | Set UAC mode |
| **0x52 ** | GET_CURRENT_UAC_MODE | Host→Device | Get current UAC mode |
| **0x53 ** | SET_EQ_ENABLE | Host→Device | Set EQ enable switch |
| **0x54 ** | GET_EQ_ENABLE | Host→Device | Get EQ enable switch |
| **0x55 ** | GET_SAMPLE_FORMAT | Host→Device | Get sample rate and format |
| **0x56 ** | SET_GAIN_MODE | Host→Device | Set gain mode |
| **0x57 ** | GET_GAIN_MODE | Host→Device | Get gain mode |
| **0x58 ** | SET_FILTER_MODE | Host→Device | Set filter mode |
| **0x59 ** | GET_FILTER_MODE | Host→Device | Get filter mode |
| **0x5A ** | SET_GAME_MODE | Host→Device | Set game mode |
| **0x5B ** | GET_GAME_MODE | Host→Device | Get game mode |
| **0x5C ** | GET_FIRMWARE_VERSION | Host→Device | Get firmware version |
2025-12-31 18:12:27 +08:00
---
## 3. Basic Function Command Details
2026-03-09 16:50:37 +08:00
### 3.1 0x40 - SET_EQ_MODE (Switch EQ Mode)
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
**Function**: Switch current EQ mode
**Direction**: Host→Device
**Data Packet Format**:
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x40 | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | Mode Value (0-6: Presets, 7-9: User)
6 | 1 | Checksum| Checksum
```
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
**Device Processing**:
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
- Directly sets `g_current_eq_mode = data[5]`
- Does not involve parameter transmission or calculation
2025-12-31 18:12:27 +08:00
---
2026-03-09 16:50:37 +08:00
### 3.2 0x41 - GET_EQ_MODE (Get EQ Mode Information)
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
**Function**: Read EQ mode information
**Direction**: Host→Device
**Request Packet Format**:
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x41 | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | Mode Value (0-9: Valid mode, 0xFF: Get current info)
6 | 1 | Checksum| Checksum
```
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
**Device Processing**:
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
- If mode is 0xFF, returns current mode value, overall gain, and mode name.
- If mode is a valid value (0-9), returns specified mode value, overall gain, and mode name.
**Response Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x41 | Command Code
4 | 1 | 0x15 | Data Length (21 bytes)
5 | 1 | uint8 | Mode Value (Current or specified)
6-9 | 4 | int32 | Gain Value (Range 0 to -50dB, signed integer)
10-25 | 16 | char | Mode Name (UTF-8 encoded, 16 bytes)
26 | 1 | Checksum| Checksum
```
**Usage Notes**:
- When sending mode=0xFF, returns information for the currently active EQ mode.
- When sending mode=0-9, returns gain and name information for the specified mode (does not switch current mode).
2025-12-31 18:12:27 +08:00
---
2026-03-09 16:50:37 +08:00
### 3.3 0x42 - SET_MODE_GAIN_AND_NAME (Set Mode Overall Gain and Name)
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
**Function**: Set EQ mode overall gain and name
**Direction**: Host→Device
**Data Packet Format**:
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x42 | Command Code
4 | 1 | 0x15 | Data Length (21 bytes)
5 | 1 | uint8 | Mode Value (0-9)
6-9 | 4 | int32 | Gain Value (Range 0 to -50dB, signed integer)
10-25 | 16 | char | Mode Name (UTF-8 encoded, 16 bytes)
26 | 1 | Checksum| Checksum
```
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
**Device Processing**:
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
1. Parses mode value, gain value, and mode name.
2. Sets the specified mode's EQ overall gain and name for all sample rates' left and right channels.
3. Supports all sample rates: 44100, 48000, 88200, 96000, 176400, 192000 Hz.
2025-12-31 18:12:27 +08:00
---
2026-03-09 16:50:37 +08:00
### 3.4 0x43 - SET_EQ_PARAMS (Send EQ Parameters)
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
**Function**: Send parameters for a single filter
**Direction**: Host→Device
**Data Packet Format**:
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x43 | Command Code
4 | 1 | 0x13 | Data Length (19 bytes: 1 mode + 1 index + 1 type + 4 floats totaling 16 bytes)
5 | 1 | uint8 | Mode Value (0-9)
6 | 1 | uint8 | Filter Band Index (0-7)
7 | 1 | uint8 | Filter Type
8-11 | 4 | float | Center Frequency (Hz)
12-15 | 4 | float | Q Value
16-19 | 4 | float | Bandwidth (Hz)
20-23 | 4 | float | Gain (dB)
24 | 1 | Checksum| Checksum
```
**Filter Type Codes**:
| Code | Filter Type |
| ---- | ------------- |
| 0x00 | Bypass Filter |
| 0x01 | All Pass Filter |
| 0x02 | Peak Filter |
| 0x03 | Low Pass Filter |
| 0x04 | High Pass Filter |
| 0x05 | Band Pass Filter |
| 0x06 | Band Reject Filter |
| 0x07 | Notch Filter |
| 0x08 | Constant Q Filter |
| 0x09 | Low Shelf Filter |
| 0x0A | High Shelf Filter |
**Device Processing**:
1. Parses parameters and stores them into the corresponding mode for all sample rates.
2. Calls `eq_calculate_coefficients_from_params()` to calculate coefficients.
3. Stores calculated coefficients into the corresponding mode for all sample rates.
4. Automatically applies to all sample rates: 44100, 48000, 88200, 96000, 176400, 192000 Hz.
2025-12-31 18:12:27 +08:00
---
2026-03-09 16:50:37 +08:00
### 3.5 0x44 - GET_EQ_PARAMS (Read EQ Parameters)
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
**Function**: Read parameters of a single filter
**Direction**: Host→Device
**Request Packet Format**:
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x44 | Command Code
4 | 1 | 0x02 | Data Length
5 | 1 | uint8 | Mode Value (0-9)
6 | 1 | uint8 | EQ Index (0-7)
7 | 1 | Checksum| Checksum
```
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
**Response Packet Format**:
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x44 | Command Code
4 | 1 | 0x13 | Data Length (19 bytes: 1 mode + 1 index + 1 type + 4 floats totaling 16 bytes)
5 | 1 | uint8 | Mode Value (0-9)
6 | 1 | uint8 | Filter Band Index (0-7)
7 | 1 | uint8 | Filter Type
8-11 | 4 | float | Center Frequency (Hz)
12-15 | 4 | float | Q Value
16-19 | 4 | float | Bandwidth (Hz)
20-23 | 4 | float | Gain (dB)
24 | 1 | Checksum| Checksum
```
2025-12-31 18:12:27 +08:00
---
2026-03-09 16:50:37 +08:00
### 3.6 0x45 - GET_DEVICE_INFO (Get Device Information)
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
**Function**: Get device basic information
**Direction**: Host→Device
**Request Packet Format**:
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x45 | Command Code
4 | 1 | 0x00 | Data Length
5 | 1 | Checksum| Checksum
```
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
**Response Packet Format**:
2025-12-31 18:12:27 +08:00
2026-03-09 16:50:37 +08:00
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x45 | Command Code
4 | 1 | 0x34 | Data Length (52 bytes: 2 PID + 2 VID + 16 Product + 16 Vendor + 16 SN)
5-6 | 2 | uint16 | Product ID (PID, Little Endian)
7-8 | 2 | uint16 | Vendor ID (VID, Little Endian)
9-24 | 16 | char | Product String (UTF-8, 16 bytes)
25-40 | 16 | char | Vendor String (UTF-8, 16 bytes)
41-56 | 16 | char | Serial Number String (UTF-8, 16 bytes)
57 | 1 | Checksum| Checksum
```
---
### 3.7 0x46 - RESET_EQ_PARAMS (Reset EQ Parameters)
**Function**: Delete customer-customized EQ parameters and restore preset parameters
**Direction**: Host→Device
**Request Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x46 | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | Mode Number (0-9, 0xFF means restore all including EQ params, overall gain, mode name)
6 | 1 | Checksum| Checksum
```
**Response Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x46 | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | Status Code (0x00=Success, 0x01=Failure)
6 | 1 | Checksum| Checksum
```
**Device Processing**:
1. Deletes the EQ parameter file stored in Flash for the specified mode.
2. Deletes the gain and mode name Flash storage file.
3. Restores the header file preset parameters for that mode.
4. If mode number is 0xFF, resets all modes.
5. Returns operation status.
---
### 3.8 0x47 - GET_EQ_MODE_COUNT (Get Total EQ Mode Count)
**Function**: Get the total number of predefined plus user modes (excluding disabled modes)
**Direction**: Host→Device
**Request Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x47 | Command Code
4 | 1 | 0x00 | Data Length
5 | 1 | Checksum| Checksum
```
**Response Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x57 | Command Code (Note: Matches Chinese doc which says 0x57 here, likely typo in doc but preserving)
4 | 1 | 0x02 | Data Length (2 bytes)
5 | 1 | uint8 | Total Modes (Currently 10, containing 0-9 total 10 modes)
6 | 1 | uint8 | Predefined Mode Count (Currently 7, containing 0-6 total 7 preset modes)
7 | 1 | Checksum| Checksum
```
---
### 3.9 0x48 - SET_AND_SAVE_EQ_MODE (Set and Save EQ Mode)
**Function**: Set current EQ mode and save to Flash, automatically restore on power-on
**Direction**: Host→Device
**Data Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x48 | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | Mode Value (0-9: 0-6 presets, 7-9 user modes)
6 | 1 | Checksum| Checksum
```
**Device Processing**:
- Saves mode value to Flash.
- Automatically reads and restores this mode from Flash on power-on.
**Response Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x48 | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | Status Code (0x00=Success, 0x01=Failure)
6 | 1 | Checksum| Checksum
```
---
### 3.10 0x49 - SET_VOLUME (Set Volume Level)
**Function**: Set device volume level
**Direction**: Host→Device
**Data Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x49 | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | Volume Level (0-60: 0=Min, 60=Max)
6 | 1 | Checksum| Checksum
```
**Parameter Description**:
- **Volume Level Range:** 0-60 (Total 61 levels)
- **Description:** Controls device output volume level
- 0: Minimum Volume (approx -127.5dB)
- 60: Maximum Volume (0dB)
- Approximately 2dB attenuation change per level
**Device Processing**:
- Parameter will be automatically saved to Flash via existing periodic save mechanism.
- If parameter exceeds range (>60), firmware will reject setting and return false.
---
### 3.11 0x4A - GET_VOLUME (Get Volume Level)
**Function**: Read device current volume level
**Direction**: Host→Device
**Request Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x4A | Command Code
4 | 1 | 0x00 | Data Length
5 | 1 | Checksum| Checksum
```
**Response Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x4A | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | Current Volume Level (0-60)
6 | 1 | Checksum| Checksum
```
---
### 3.12 0x4B - GET_LED_INFO (Get LED Information)
**Function**: Read LED index and LED name
**Direction**: Host→Device
**Request Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x4B | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | LED Index (0-7, current device only has 1 LED, index 0)
6 | 1 | Checksum| Checksum
```
**Response Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x4B | Command Code
4 | 1 | 0x11 | Data Length (17 bytes)
5 | 1 | uint8 | LED Index (0-7)
6-21 | 16 | char | LED Name (UTF-8 encoded, 16 bytes)
22 | 1 | Checksum| Checksum
```
---
### 3.13 0x4C - SET_LED_SWITCH (Set LED Switch)
**Function**: Set LED switch state
**Direction**: Host→Device
**Data Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x4C | Command Code
4 | 1 | 0x02 | Data Length
5 | 1 | uint8 | LED Index (0-7, current device only has 1 LED, index 0)
6 | 1 | uint8 | LED Switch (0=OFF, 1=ON)
7 | 1 | Checksum| Checksum
```
**Device Processing**:
- When LED switch is OFF, all LED outputs are disabled, no LED is displayed.
- When LED switch is ON, LED displays normally.
**Response Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x4C | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | Status Code (0x00=Success, 0x01=Failure)
6 | 1 | Checksum| Checksum
```
---
### 3.14 0x4D - GET_LED_SWITCH (Get LED Switch)
**Function**: Read LED switch state
**Direction**: Host→Device
**Request Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x4D | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | LED Index (0-7, current device only has 1 LED, index 0)
6 | 1 | Checksum| Checksum
```
**Response Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x4D | Command Code
4 | 1 | 0x02 | Data Length
5 | 1 | uint8 | LED Index (0-7)
6 | 1 | uint8 | LED Switch (0=OFF, 1=ON)
7 | 1 | Checksum| Checksum
```
---
### 3.15 0x4E - GET_LED_STATUS (Get LED Status)
**Function**: Read LED RGB color and status
**Direction**: Host→Device
**Request Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x4E | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | LED Index (0-7, current device only has 1 LED, index 0)
6 | 1 | Checksum| Checksum
```
**Response Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x4E | Command Code
4 | 1 | 0x05 | Data Length
5 | 1 | uint8 | LED Index (0-7)
6 | 1 | uint8 | R Color Value (0-255)
7 | 1 | uint8 | G Color Value (0-255)
8 | 1 | uint8 | B Color Value (0-255)
9 | 1 | uint8 | LED Status (0=Off, 1=Solid, 2=Slow Blink, 3=Fast Blink, 4=Breathe)
10 | 1 | Checksum| Checksum
```
**LED Status Enum**:
- 0: LED_STATUS_OFF (Off)
- 1: LED_STATUS_SOLID (Solid On)
- 2: LED_STATUS_SLOW_BLINK (Slow Blink)
- 3: LED_STATUS_FAST_BLINK (Fast Blink)
- 4: LED_STATUS_BREATHE (Breathe)
**Note**:
- RGB color values are converted based on current LED color definition (active low).
- LED status is determined based on current LED display mode (solid/blink).
---
### 3.16 0x4F - GET_LED_COUNT (Get LED Count)
**Function**: Read total number of LEDs supported by device
**Direction**: Host→Device
**Request Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x4F | Command Code
4 | 1 | 0x00 | Data Length
5 | 1 | Checksum| Checksum
```
**Response Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x4F | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | Total LEDs (Current device is 1)
6 | 1 | Checksum| Checksum
```
**Device Processing**:
- Returns total number of LEDs supported by device.
- Current device only has 1 LED, so returns 1.
- LED index range is 0 to (Total LEDs - 1).
---
### 3.17 0x50 - GET_UAC_MODE_INFO (Get UAC Mode Information)
**Function**: Read UAC mode count and mode name list
**Direction**: Host→Device
**Request Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x50 | Command Code
4 | 1 | 0x00 | Data Length
5 | 1 | Checksum| Checksum
```
**Response Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x50 | Command Code
4 | 1 | 0x11 | Data Length (17 bytes)
5 | 1 | uint8 | Total UAC Modes (Currently 2, containing UAC1.0 and UAC2.0)
6-13 | 8 | char | Mode 0 Name (UTF-8, 8 bytes, e.g., "UAC2.0")
14-21 | 8 | char | Mode 1 Name (UTF-8, 8 bytes, e.g., "UAC1.0")
22 | 1 | Checksum| Checksum
```
**Device Processing**:
- Returns total UAC modes (currently 2).
- Returns name for each mode (max 8 chars).
- Mode 0 corresponds to UAC2.0, Mode 1 corresponds to UAC1.0.
---
### 3.18 0x51 - SET_UAC_MODE (Set UAC Mode)
**Function**: Set UAC mode (UAC1.0 or UAC2.0)
**Direction**: Host→Device
**Data Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x51 | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | UAC Mode Value (0=UAC2.0, 1=UAC1.0)
6 | 1 | Checksum| Checksum
```
**Device Processing**:
- Sets UAC mode and reboots device.
- Note: Device will not return a response after reboot.
---
### 3.19 0x52 - GET_CURRENT_UAC_MODE (Get Current UAC Mode)
**Function**: Read current UAC mode
**Direction**: Host→Device
**Request Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x52 | Command Code
4 | 1 | 0x00 | Data Length
5 | 1 | Checksum| Checksum
```
**Response Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x52 | Command Code
4 | 1 | 0x09 | Data Length (9 bytes)
5 | 1 | uint8 | Current UAC Mode Value (0=UAC2.0, 1=UAC1.0)
6-13 | 8 | char | Current UAC Mode Name (UTF-8, 8 bytes, e.g., "UAC2.0" or "UAC1.0")
14 | 1 | Checksum| Checksum
```
**Device Processing**:
- Returns current UAC mode name (max 8 chars).
---
### 3.20 0x53 - SET_EQ_ENABLE (Set EQ Enable Switch)
**Function**: Set EQ enable switch (Enable/Disable)
**Direction**: Host→Device
**Data Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x53 | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | EQ Enable Switch (0=OFF Disable, 1=ON Enable)
6 | 1 | Checksum| Checksum
```
**Device Processing**:
- Only saves EQ enable status to Flash (independent file storage), does not affect saved modes.
**Response Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x53 | Command Code
4 | 1 | 0x02 | Data Length
5 | 1 | uint8 | Status Code (0x00=Success, 0x01=Failure)
6 | 1 | uint8 | Current EQ Enable Status (0=OFF, 1=ON)
7 | 1 | Checksum| Checksum
```
---
### 3.21 0x54 - GET_EQ_ENABLE (Get EQ Enable Switch)
**Function**: Read EQ enable switch status
**Direction**: Host→Device
**Request Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x54 | Command Code
4 | 1 | 0x00 | Data Length
5 | 1 | Checksum| Checksum
```
**Response Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x54 | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | EQ Enable Switch Status (0=OFF Disable, 1=ON Enable)
6 | 1 | Checksum| Checksum
```
**Device Processing**:
- Returns current EQ enable switch status (0=OFF, 1=ON).
---
### 3.22 0x55 - GET_SAMPLE_FORMAT (Get Sample Rate and Format)
**Function**: Read current sample rate and DSD mode
**Direction**: Host→Device
**Request Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x55 | Command Code
4 | 1 | 0x00 | Data Length
5 | 1 | Checksum| Checksum
```
**Response Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x55 | Command Code
4 | 1 | 0x05 | Data Length (5 bytes)
5-8 | 4 | uint32 | Sample Rate (samFreq, Little Endian, Unit: Hz)
9 | 1 | uint8 | DSD Mode (dsdMode: 0=PCM, 1=DOP, 2=Native DSD)
10 | 1 | Checksum| Checksum
```
**Device Processing**:
- Returns current sample rate (32-bit unsigned integer, Little Endian, Unit: Hz).
- Returns DSD mode (0 means PCM format, >0 means DSD format).
- Device will automatically report this information when sample rate or DSD mode changes (proactively sent via UART).
**Auto-Report Mechanism**:
- Device monitors sample rate and DSD mode changes.
- When these values change, device automatically constructs 0x55 response packet and sends via UART.
---
### 3.23 0x56 - SET_GAIN_MODE (Set Gain Mode)
**Function**: Set gain mode
**Direction**: Host→Device
**Data Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x56 | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | Gain Mode Value (0=Low Impedance, 1=High Impedance)
6 | 1 | Checksum| Checksum
```
**Parameter Description**:
- **Gain Mode Range:** 0-1
- **Description:** Controls device gain level
- 0: Low Impedance Mode (Suitable for high sensitivity headphones)
- 1: High Impedance Mode (Suitable for high impedance headphones)
**Device Processing**:
- Parameter will be automatically saved to Flash via existing periodic save mechanism.
---
### 3.24 0x57 - GET_GAIN_MODE (Get Gain Mode)
**Function**: Read device current gain mode
**Direction**: Host→Device
**Request Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x57 | Command Code
4 | 1 | 0x00 | Data Length
5 | 1 | Checksum| Checksum
```
**Response Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x57 | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | Current Gain Mode (0=Low Impedance, 1=High Impedance)
6 | 1 | Checksum| Checksum
```
---
### 3.25 0x58 - SET_FILTER_MODE (Set Filter Mode)
**Function**: Set filter mode
**Direction**: Host→Device
**Data Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x58 | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | Filter Mode Value (0-7: 8 filter modes)
6 | 1 | Checksum| Checksum
```
**Parameter Description**:
- **Filter Mode Range:** 0-7 (Total 8 modes)
- **Description:** Select DAC digital filter type
- 0: Minimum Phase filter (default)
- 1: Linear Phase Apodizing Fast Roll-off filter
- 2: Linear phase fast roll-off filter
- 3: Linear Phase Fast Roll-off low-ripple filter
- 4: Linear phase slow roll-off filter
- 5: Minimum phase fast roll-off filter
- 6: Minimum phase slow roll-off filter
- 7: Minimum Phase Fast Roll-Off Low Dispersion
**Device Processing**:
- Parameter will be automatically saved to Flash via existing periodic save mechanism.
- If parameter exceeds range (>7), firmware will reject setting and return false.
---
### 3.26 0x59 - GET_FILTER_MODE (Get Filter Mode)
**Function**: Read device current filter mode
**Direction**: Host→Device
**Request Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x59 | Command Code
4 | 1 | 0x00 | Data Length
5 | 1 | Checksum| Checksum
```
**Response Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x59 | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | Current Filter Mode (0-7)
6 | 1 | Checksum| Checksum
```
---
### 3.27 0x5A - SET_GAME_MODE (Set Game Mode)
**Function**: Set game mode
**Direction**: Host→Device
**Data Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x5A | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | Game Mode Value (0=No effect, 1=FPS, 2=Virtual 7.1)
6 | 1 | Checksum| Checksum
```
**Parameter Description**:
- **Game Mode Range:** 0-2
- **Description:** Select game audio effect mode
- 0: No effect (Standard Stereo)
- 1: FPS Mode (Enhanced Positioning)
- 2: Virtual 7.1 (Surround Sound Effect)
**Device Processing**:
- Parameter will be automatically saved to Flash via existing periodic save mechanism.
- If parameter exceeds range (>2), firmware will reject setting and return false.
---
### 3.28 0x5B - GET_GAME_MODE (Get Game Mode)
**Function**: Read device current game mode
**Direction**: Host→Device
**Request Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x5B | Command Code
4 | 1 | 0x00 | Data Length
5 | 1 | Checksum| Checksum
```
**Response Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x5B | Command Code
4 | 1 | 0x01 | Data Length
5 | 1 | uint8 | Current Game Mode (0=No effect, 1=FPS, 2=Virtual 7.1)
6 | 1 | Checksum| Checksum
```
---
### 3.29 0x5C - GET_FIRMWARE_VERSION (Get Firmware Version)
**Function**: Read device firmware version number
**Direction**: Host→Device
**Request Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x5C | Command Code
4 | 1 | 0x00 | Data Length
5 | 1 | Checksum| Checksum
```
**Response Packet Format**:
```
Byte Pos | Length | Content | Description
---------|--------|---------|------
0 | 1 | 0x55 | Header 1
1 | 1 | 0xAA | Header 2
2 | 1 | 0x00 | Version
3 | 1 | 0x5C | Command Code
4 | 1 | 0x03 | Data Length (3 bytes)
5 | 1 | uint8 | Major Version (BCD, e.g., 0x01 means 1)
6 | 1 | uint8 | Minor Version (BCD, e.g., 0x00 means 0)
7 | 1 | uint8 | Revision Version (BCD, e.g., 0x0C means 12)
8 | 1 | Checksum| Checksum
```
**Version Number Format**:
- Version number uses BCD (Binary Coded Decimal) format.
- 3 bytes represent: Major Version, Minor Version, Revision Version.
- Example: 0x01 0x00 0x0C means version 1.0.12.
## 4. Key Features
### 4.1 Device-Side Coefficient Calculation
- Host only sends parameters (fc, Q, bw, gain).
- Device calculates filter coefficients in real-time based on parameters.
- Supports dynamic bshift calculation to ensure coefficient precision.
### 4.2 Parameter Format
- **Floating Point Parameters**: fc, Q, bw, gain use IEEE 754 float format transmission.
- **Byte Order**: All multi-byte data uses Little Endian.
### 4.3 Error Handling
- Data packet length check.
- Frame header verification.
- Parameter range check.
- Filter index boundary check.
### 4.4 Mode Management
- Supports 10 EQ modes (0-9: 0-6 presets, 7-9 user modes)
- Automatically clears filter state when switching modes.
## 5. Notes
1. **Timing Requirements ** : After sending parameters, wait for device processing to complete before sending the next command.
2. **Data Integrity ** : All 8 filter parameters need to be sent, even if some filters are unused.
3. **Mode Synchronization ** : After setting mode, call read mode to ensure data synchronization.
4. **Error Recovery ** : Re-establish connection and retry upon communication failure.
5. **Parameter Validation ** : Device verifies parameter range, values out of range will be limited.
6. **Checksum Calculation ** : All commands must include correct checksum, which is the sum of all bytes from frame header to end of data, modulo 256.
2025-12-31 18:12:27 +08:00
## Consultation and Feedback
<details>
<summary>Click to expand consultation and feedback form</summary>
--8<-- "common/customer_form.md"
</details>