update
This commit is contained in:
PhatenIoT-yan
2025-12-31 18:12:27 +08:00
parent 00f42eab80
commit 78b9a5eae4
237 changed files with 10825 additions and 3401 deletions

View File

@@ -0,0 +1,225 @@
---
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
Based on UART (Universal Asynchronous Receiver/Transmitter) protocol.
| 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`) |
| Command | 1 | Indicates frame function (e.g., `0x30`) |
| Data Length | 1 | Length N of subsequent data |
| Data | N | Specific data content |
| Checksum | 1 | Sum of all bytes from frame header, modulo 256 (Sum % 256) |
**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 |
| :--- | :--- | :--- | :--- |
| **0x30** | SET_EQ_MODE | Host→Device | Switch current EQ mode |
| **0x31** | GET_EQ_MODE | Host→Device | Get current EQ mode information (mode number, gain, name) |
| **0x32** | SET_MODE_GAIN_AND_NAME | Host→Device | Set overall gain and name for specified mode |
| **0x33** | SET_EQ_PARAMS | Host→Device | Send single filter parameters (Freq, Q, Gain, etc.) |
| **0x34** | GET_EQ_PARAMS | Host→Device | Read single filter parameters |
| **0x35** | RESET_EQ_PARAMS | Host→Device | Reset EQ parameters (restore presets) |
---
## 3. Basic Function Command Details
### 3.1 Switch EQ Mode (0x30)
**Host Sends**
| Byte Position | Length | Content | Description |
| :--- | :--- | :--- | :--- |
| Frame Header | 2 | `0x55 0xAA` | Fixed frame header |
| Version | 1 | `0x00` | Protocol version |
| Command | 1 | `0x30` | Command code |
| Length | 1 | `0x01` | Data length |
| Data | 1 | `Mode` | Mode value<br>0-5: Preset modes<br>6-8: User modes<br>9: Bypass |
| Checksum | 1 | `Sum` | Checksum |
**Device Processing**
* Directly sets the currently running EQ mode.
* Does not involve parameter transmission or calculation.
---
### 3.2 Get Current EQ Mode Information (0x31)
**Host Sends**
| Byte Position | Length | Content | Description |
| :--- | :--- | :--- | :--- |
| Frame Header | 2 | `0x55 0xAA` | Fixed frame header |
| Version | 1 | `0x00` | Protocol version |
| Command | 1 | `0x31` | Command code |
| Length | 1 | `0x00` | No data |
| Checksum | 1 | `Sum` | Checksum |
**Device Returns (Response)**
| Byte Position | Length | Content | Description |
| :--- | :--- | :--- | :--- |
| Frame Header | 2 | `0x55 0xAA` | Fixed frame header |
| Version | 1 | `0x00` | Protocol version |
| Command | 1 | `0x31` | Command code |
| Length | 1 | `0x15` | Data length (21 bytes) |
| Data | 1 | `Mode` | Current mode value |
| | 4 | `Gain` | Overall gain (int32, little endian, range 0~-50dB) |
| | 16 | `Name` | Mode name (UTF-8 string) |
| Checksum | 1 | `Sum` | Checksum |
---
### 3.3 Set Mode Overall Gain and Name (0x32)
**Host Sends**
| Byte Position | Length | Content | Description |
| :--- | :--- | :--- | :--- |
| Frame Header | 2 | `0x55 0xAA` | Fixed frame header |
| Version | 1 | `0x00` | Protocol version |
| Command | 1 | `0x32` | Command code |
| Length | 1 | `0x15` | Data length (21 bytes) |
| Data | 1 | `Mode` | Target mode value (0-9) |
| | 4 | `Gain` | Overall gain (int32, little endian) |
| | 16 | `Name` | Mode name (UTF-8 string) |
| Checksum | 1 | `Sum` | Checksum |
**Device Processing**
* Sets gain and name for specified mode, automatically applied to all sample rates.
---
### 3.4 Send EQ Parameters (0x33)
**Host Sends**
| Byte Position | Length | Content | Description |
| :--- | :--- | :--- | :--- |
| Frame Header | 2 | `0x55 0xAA` | Fixed frame header |
| Version | 1 | `0x00` | Protocol version |
| Command | 1 | `0x33` | Command code |
| Length | 1 | `0x15` | Data length (21 bytes) |
| Data | 1 | `Mode` | Mode value (0-9) |
| | 1 | `Band` | Filter index (0-7) |
| | 1 | `Type` | Filter type (see table below) |
| | 4 | `Freq` | Center frequency Hz (float, little endian) |
| | 4 | `Q` | Q value (float, little endian) |
| | 4 | `BW` | Bandwidth Hz (float, little endian) |
| | 4 | `Gain` | Gain dB (float, little endian) |
| Checksum | 1 | `Sum` | Checksum |
**Filter Type Codes**
| Code | Type | Code | Type |
| :--- | :--- | :--- | :--- |
| 0x00 | Bypass | 0x06 | Band Reject |
| 0x01 | All Pass | 0x07 | Notch |
| 0x02 | Peak | 0x08 | Constant Q |
| 0x03 | Low Pass | 0x09 | Low Shelf |
| 0x04 | High Pass | 0x0A | High Shelf |
| 0x05 | Band Pass | | |
---
### 3.5 Read EQ Parameters (0x34)
**Host Sends**
| Byte Position | Length | Content | Description |
| :--- | :--- | :--- | :--- |
| Frame Header | 2 | `0x55 0xAA` | Fixed frame header |
| Version | 1 | `0x00` | Protocol version |
| Command | 1 | `0x34` | Command code |
| Length | 1 | `0x02` | Data length |
| Data | 1 | `Mode` | Mode value (0-9) |
| | 1 | `Band` | Filter index (0-7) |
| Checksum | 1 | `Sum` | Checksum |
**Device Returns (Response)**
| Byte Position | Length | Content | Description |
| :--- | :--- | :--- | :--- |
| Frame Header | 2 | `0x55 0xAA` | Fixed frame header |
| Version | 1 | `0x00` | Protocol version |
| Command | 1 | `0x34` | Command code |
| Length | 1 | `0x15` | Data length (21 bytes) |
| Data | 1 | `Mode` | Mode value |
| | 1 | `Band` | Filter index |
| | 1 | `Type` | Filter type |
| | 4 | `Freq` | Center frequency (float, little endian) |
| | 4 | `Q` | Q value (float, little endian) |
| | 4 | `BW` | Bandwidth (float, little endian) |
| | 4 | `Gain` | Gain (float, little endian) |
| Checksum | 1 | `Sum` | Checksum |
---
### 3.6 Reset EQ Parameters (0x35)
**Host Sends**
| Byte Position | Length | Content | Description |
| :--- | :--- | :--- | :--- |
| Frame Header | 2 | `0x55 0xAA` | Fixed frame header |
| Version | 1 | `0x00` | Protocol version |
| Command | 1 | `0x35` | Command code |
| Length | 1 | `0x01` | Data length |
| Data | 1 | `Mode` | Mode number (0-9)<br>`0xFF` indicates reset all modes |
| Checksum | 1 | `Sum` | Checksum |
**Device Returns (Response)**
| Byte Position | Length | Content | Description |
| :--- | :--- | :--- | :--- |
| Frame Header | 2 | `0x55 0xAA` | Fixed frame header |
| Version | 1 | `0x00` | Protocol version |
| Command | 1 | `0x35` | Command code |
| Length | 1 | `0x01` | Data length |
| Data | 1 | `Status` | Status code (0x00=success, 0x01=failure) |
| Checksum | 1 | `Sum` | Checksum |
## Consultation and Feedback
<details>
<summary>Click to expand consultation and feedback form</summary>
--8<-- "common/customer_form.md"
</details>