Skip to content

Product Configuration Commands (UART)

Command Set Scope

Applicability

This page contains the UART business commands exchanged between XU316 zero-code products and the host MCU (frame format: 0x55AA header, big-endian transmission, see XU316 UART Base Protocol; startup and basic commands 0x00-0x05 belong to the base protocol).

This page is same-source maintained with the "Product Control Commands" chapter of product datasheets. Product firmwares may support different command subsets (e.g. 0xF0 is product-specific); refer to the product datasheet.

Command Overview

Command Command Description Direction Applicability Notes
0x20 Report application status XU316→MCU Sent on status change or 15s timer
0x21 Media control MCU→XU316 Converted by XU316 to HID command sent to computer
0x22 Report playback audio stream format and type XU316→MCU For displaying PCM/DSD/MQA/DOP status
0x23 Set input/output mode MCU→XU316 Mode values in datasheet section 2.1 table
0x24 Send playback volume XU316→MCU Left/right channel, 1 byte each
0x25 Send recording volume XU316→MCU Reserved command, currently not used
0x26 Switch MCLK MCU→XU316 Internal/external master clock switching
0x27 Set unmute MCU→XU316 DAC unmute delay during mode switching
0x28 Send audio format time delay MCU→XU316 Audio format switching delay configuration
0x29 Report USB connection status XU316→MCU Proactively reported on USB connect/disconnect
0x30 Set Mute pin inversion MCU→XU316 Adapts hardware with inverted Mute polarity
0x31 Get current audio format MCU→XU316 Queries current audio stream format and type
0xF0 DAC configuration selection MCU→XU316 Product-specific, not supported by all products
0xF1 Get firmware version MCU→XU316 Queries XU316 firmware version (3-byte BCD major version)
0xF3 Query complete version number MCU→XU316 Returns complete ASCII version string (model_vMajor.Minor.Rev_bBuild)
0xEE HID data passthrough XU316→MCU HID passes data to MCU via XU316 (e.g. MCU OTA)

Usage Prerequisites

The above commands can only be used after device startup is complete (after XU316 sends the 0x05 startup complete command and receives the response). All commands must follow the base protocol frame format (frame header 0x55AA, big-endian transmission, checksum = sum of all bytes from frame header modulo 256); each command requires acknowledgment from the recipient, with a default timeout of 300ms and up to 4 retries.

Command Details

Report Application Status (0x20)

XU316 Sends

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x00
Command:       1 byte  - 0x20
Data Length:   1 byte  - N
Data:          N bytes - Application runtime parameters, see section 4.1-Application Runtime Parameters
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

MCU Returns

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x03
Command:       1 byte  - 0x20
Data Length:   1 byte  - 0x00
Data:          0 bytes
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

  • This command is used by XU316 to report current application status to MCU
  • Typically sent when status changes, such as volume change, mode switch, etc.
  • MCU can update UI display or adjust related functions based on this info

Command Example

55 AA 03 20 00 22

Field Breakdown

Byte Segment Length Example Description
Frame Header 2 bytes 55 AA Fixed frame header indicating start of a protocol frame
Version 1 byte 03 Indicates this frame is an acknowledgment returned by MCU to XU316
Command 1 byte 20 Acknowledges “Report Application Status”
Data Length 1 byte 00 Pure acknowledgment frame with no data
Checksum 1 byte 22 Sum of all bytes from 55 to 00, modulo 256

Media Control (0x21)

MCU Sends

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x03
Command:       1 byte  - 0x21
Data Length:   1 byte  - 0x01 (1 byte)
Data:          1 byte  - Media control command
              0x00 Volume Up / Vol Up
              0x01 Volume Down / Vol Down
              0x02 Play/Pause / PLAY/PAUSE
              0x03 Next Track / NEXT
              0x04 Previous Track / PREV
              0x05 Fast Forward / FORWARD
              0x06 Rewind / REWIND
              0x07 Mute / MUTE
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

XU316 Returns

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x00
Command:       1 byte  - 0x21
Data Length:   1 byte  - 0x00
Data:          0 bytes
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

  • This command is used by MCU to send media control commands to XU316
  • After receiving command, XU316 will convert to corresponding HID command and send to computer
  • Suitable for implementing remote control or physical button control of media playback
Control Code Function USB HID Usage
0x00 Volume Up Increase system volume
0x01 Volume Down Decrease system volume
0x02 Play/Pause Control media playback state
0x03 Next Track Switch to next song
0x04 Previous Track Switch to previous song
0x05 Fast Forward Fast forward in current track
0x06 Rewind Rewind in current track
0x07 Mute Toggle system mute state

Command Example

55 AA 03 21 01 02 26

Field Breakdown

Byte Segment Length Example Description
Frame Header 2 bytes 55 AA Fixed frame header indicating start of a protocol frame
Version 1 byte 03 Indicates this frame is a command sent by MCU to XU316
Command 1 byte 21 Current command is “Media Control”
Data Length 1 byte 01 One data byte follows
Control code 1 byte 02 Indicates “Play/Pause”
Checksum 1 byte 26 Sum of all bytes from 55 to control code, modulo 256

Report Playback Audio Stream Format and Type (0x22)

XU316 Sends

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x00
Command:       1 byte  - 0x22
Data Length:   1 byte  - 0x02 (2 bytes)
Data:          2 bytes - Audio stream format and type, see audio stream format and type field
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

MCU Returns

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x03
Command:       1 byte  - 0x22
Data Length:   1 byte  - 0x00
Data:          0 bytes
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

  • This command is used by XU316 to report current audio stream format and type to MCU
  • Typically sent when playback starts or format changes
  • MCU can update display based on this info, such as showing PCM/DSD/MQA/DOP status

Command Example

55 AA 03 22 00 24

Field Breakdown

Byte Segment Length Example Description
Frame Header 2 bytes 55 AA Fixed frame header indicating start of a protocol frame
Version 1 byte 03 Indicates this frame is an acknowledgment returned by MCU to XU316
Command 1 byte 22 Acknowledges “Report Playback Audio Stream Format and Type”
Data Length 1 byte 00 Pure acknowledgment frame with no data
Checksum 1 byte 24 Sum of all bytes from 55 to 00, modulo 256

Set Input/Output Mode (0x23)

MCU Sends

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x03
Command:       1 byte  - 0x23
Data Length:   1 byte  - 0x05 (5 bytes)
Data:          5 bytes - Input/output mode, see input/output mode field
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

XU316 Returns

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x00
Command:       1 byte  - 0x23
Data Length:   1 byte  - 0x00
Data:          0 bytes
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

  • This command is used by MCU to request XU316 switch to specific input/output mode
  • Typically triggered by user operation, such as pressing mode selection button
  • XU316 may need to restart to load new mode firmware

Command Example

55 AA 03 23 05 02 00 00 00 00 2C

Field Breakdown

Byte Segment Length Example Description
Frame Header 2 bytes 55 AA Fixed frame header indicating start of a protocol frame
Version 1 byte 03 Indicates this frame is a command sent by MCU to XU316
Command 1 byte 23 Current command is “Set Input/Output Mode”
Data Length 1 byte 05 5 mode bytes follow
Input/output mode 5 bytes 02 00 00 00 00 Example target mode data; definitions depend on product specification
Checksum 1 byte 2C Sum of all bytes from 55 to the last mode byte, modulo 256

Send Playback Volume (0x24)

XU316 Sends

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x00
Command:       1 byte  - 0x24
Data Length:   1 byte  - 0x02 (2 bytes)
Data:          2 bytes
              Byte 1: Left channel (0xFF Mute, 0-0dB, -127: -127dB)
              Byte 2: Right channel (0xFF Mute, 0-0dB, -127: -127dB)
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

MCU Returns

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x03
Command:       1 byte  - 0x24
Data Length:   1 byte  - 0x00
Data:          0 bytes
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

  • This command is used by XU316 to report current playback volume to MCU

Command Example

55 AA 03 24 00 26

Field Breakdown

Byte Segment Length Example Description
Frame Header 2 bytes 55 AA Fixed frame header indicating start of a protocol frame
Version 1 byte 03 Indicates this frame is an acknowledgment returned by MCU to XU316
Command 1 byte 24 Acknowledges “Send Playback Volume”
Data Length 1 byte 00 Pure acknowledgment frame with no data
Checksum 1 byte 26 Sum of all bytes from 55 to 00, modulo 256

Send Recording Volume (0x25)

XU316 Sends

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x00
Command:       1 byte  - 0x25
Data Length:   1 byte  - 0x01 (1 byte)
Data:          1 byte  - 0xFF Mute, 0-0dB -127: -127dB
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

MCU Returns

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x03
Command:       1 byte  - 0x25
Data Length:   1 byte  - 0x00
Data:          0 bytes
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

  • This command is used by XU316 to report current microphone recording volume to MCU
  • Reserved command, currently not used

Command Example

55 AA 03 25 00 27

Field Breakdown

Byte Segment Length Example Description
Frame Header 2 bytes 55 AA Fixed frame header indicating start of a protocol frame
Version 1 byte 03 Indicates this frame is an acknowledgment returned by MCU to XU316
Command 1 byte 25 Acknowledges “Send Recording Volume”
Data Length 1 byte 00 Pure acknowledgment frame with no data
Checksum 1 byte 27 Sum of all bytes from 55 to 00, modulo 256

Switch MCLK (0x26)

MCU Sends

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x03
Command:       1 byte  - 0x26
Data Length:   1 byte  - 1
Data:          1 byte  - 0: Internal MCLK, 1: External MCLK
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

XU316 Returns

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x00
Command:       1 byte  - 0x26
Data Length:   1 byte  - 0
Data:          0 bytes
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

  • This command is used by XU316 to control switching master clock source
  • Can switch between using internal clock or external clock
  • Important for certain audio application scenarios requiring precise synchronization

Command Example

55 AA 03 26 01 01 2A

Field Breakdown

Byte Segment Length Example Description
Frame Header 2 bytes 55 AA Fixed frame header indicating start of a protocol frame
Version 1 byte 03 Indicates this frame is a command sent by MCU to XU316
Command 1 byte 26 Current command is “Switch MCLK”
Data Length 1 byte 01 One data byte follows
Data 1 byte 01 Switch to external MCLK; if 00, switch to internal MCLK
Checksum 1 byte 2A Sum of all bytes from 55 to last data byte, modulo 256

Set Unmute (0x27)

MCU Sends

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x03
Command:       1 byte  - 0x27
Data Length:   1 byte  - 2
Data:          2 bytes -
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

XU316 Returns

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x00
Command:       1 byte  - 0x27
Data Length:   1 byte  - 0
Data:          0 bytes
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

  • DAC unmute time delay during mode switching, unit is milliseconds

Send Audio Format Time Delay (0x28)

MCU Sends

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x03
Command:       1 byte  - 0x28
Data Length:   1 byte  - 2
Data:          2 bytes -
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

XU316 Returns

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x00
Command:       1 byte  - 0x28
Data Length:   1 byte  - 0
Data:          0 bytes
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

  • Send audio format time delay

Report USB Connection Status (0x29)

XU316 Sends

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x00
Command:       1 byte  - 0x29
Data Length:   1 byte  - 0x01 (1 byte)
Data:          1 byte  - USB connection status
                           0x00 USB disconnected / not connected
                           0x01 USB connected
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

MCU Returns

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x03
Command:       1 byte  - 0x29
Data Length:   1 byte  - 0x00
Data:          0 bytes
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

  • This command is used by XU316 to report the current USB connection status to the MCU
  • When the USB connection status changes (connect or disconnect), XU316 proactively sends this command
  • The MCU can use this information to update the UI or adjust related functions

Command Example

55 AA 03 29 00 2B

Field Breakdown

Byte Segment Length Example Description
Frame Header 2 bytes 55 AA Fixed frame header indicating start of a protocol frame
Version 1 byte 03 Indicates this frame is an acknowledgment returned by MCU to XU316
Command 1 byte 29 Acknowledges “Report USB Connection Status”
Data Length 1 byte 00 Pure acknowledgment frame with no data
Checksum 1 byte 2B Sum of all bytes from 55 to 00, modulo 256

Set Mute Pin Inversion (0x30)

MCU Sends

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x03
Command:       1 byte  - 0x30
Data Length:   1 byte  - 0x01
Data:          1 byte
              B0: Inversion flag
                  0x00 = Normal logic (High level unmute, Low level mute)
                  0x01 = Inverted logic (Low level unmute, High level mute)
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

XU316 Returns

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x00
Command:       1 byte  - 0x30
Data Length:   1 byte  - 0x01
Data:          1 byte
              B0: Current inversion flag status
                  0x00 = Normal logic
                  0x01 = Inverted logic
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

  1. This command is used to set inversion logic for the Mute pin output
  2. Use this command when certain hardware designs have opposite Mute polarity from default
  3. The configuration is automatically saved to Flash and persists after power-off
  4. Takes effect immediately and returns current status
  • Mute pin polarity is opposite to default in hardware design
  • Need to adapt different hardware revisions of devices

Command Example

55 AA 03 30 01 01 34

Field Breakdown

Byte Segment Length Example Description
Frame Header 2 bytes 55 AA Fixed frame header
Version 1 byte 03 Sent by MCU to XU316
Command 1 byte 30 Set Mute pin inversion
Data Length 1 byte 01 1 data byte follows
Inversion flag 1 byte 01 0x01 = inverted logic
Checksum 1 byte 34 Sum of all bytes from 55 to inversion flag, modulo 256

Get Current Audio Format (0x31)

MCU Sends

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x03
Command:       1 byte  - 0x31
Data Length:   1 byte  - 0x00
Data:          0 bytes
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

XU316 Returns

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x00
Command:       1 byte  - 0x31
Data Length:   1 byte  - 0x02 (2 bytes)
Data:          2 bytes
              Byte 0: Audio stream format, see section 4.3 Audio Stream Format
              Byte 1: Audio type, see section 4.3 Audio Type
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

  • This command is used by MCU to query current playback audio stream format and type from XU316
  • The return format is consistent with the 0x22 proactive report command
  • If the audio type is DSD and the format is AUDIO_44100, XU316 will correct it to PCM in the response
  • If no valid audio stream is present, returns 0xFF 0x00

Command Example

55 AA 03 31 00 33

Field Breakdown

Byte Segment Length Example Description
Frame Header 2 bytes 55 AA Fixed frame header indicating start of a protocol frame
Version 1 byte 03 Indicates this frame is a command sent by MCU to XU316
Command 1 byte 31 Current command is “Get Current Audio Format”
Data Length 1 byte 00 No additional data
Checksum 1 byte 33 Sum of all bytes from 55 to 00, modulo 256

Command Example

55 AA 00 31 02 03 00 35

Field Breakdown

Byte Segment Length Example Description
Frame Header 2 bytes 55 AA Fixed frame header indicating start of a protocol frame
Version 1 byte 00 Indicates this frame is returned by XU316 to MCU
Command 1 byte 31 Response for “Get Current Audio Format”
Data Length 1 byte 02 Two data bytes follow
Audio stream format 1 byte 03 Current format is AUDIO_96000 (96kHz)
Audio type 1 byte 00 Current type is PCM
Checksum 1 byte 35 Sum of all bytes from 55 to last data byte, modulo 256

DAC Configuration Selection (0xF0)

MCU Sends

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x03
Command:       1 byte  - 0xF0
Data Length:   1 byte  - 4
Data:          4 bytes
              Byte 0: 0: Enable I2C DAC configuration  1: Disable I2C DAC configuration
              Byte 1 - 3: reserved
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

XU316 Returns

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x00
Command:       1 byte  - 0xF0
Data Length:   1 byte  - 0
Data:          0 bytes
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

  • Test command for MCU to set DAC configuration selection in XU316. Let XU316 configure DAC via DAC I2C or MCU configure DAC itself
  • This command is product-specific and not supported by all products. Please refer to product specification for support details.

Command Example

55 AA 03 F0 04 00 00 00 00 F6

Field Breakdown

Byte Segment Length Example Description
Frame Header 2 bytes 55 AA Fixed frame header indicating start of a protocol frame
Version 1 byte 03 Indicates this frame is a command sent by MCU to XU316
Command 1 byte F0 Current command is “DAC Configuration Selection Command”
Data Length 1 byte 04 4 data bytes follow
Byte 0 1 byte 00 Enable XU316 to configure DAC via I2C
Byte 1-3 3 bytes 00 00 00 Reserved bytes, all set to 00 in this example
Checksum 1 byte F6 Sum of all bytes from 55 to the last data byte, modulo 256

Get Firmware Version Command (0xF1)

MCU Sends

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x03
Command:       1 byte  - 0xF1
Data Length:   1 byte  - 2
Data:          2 bytes -
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

XU316 Returns

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x00
Command:       1 byte  - 0xF1
Data Length:   1 byte  - 0
Data:          3 bytes
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

  • Get firmware version

Command Example

55 AA 03 F1 02 00 00 F5

Field Breakdown

Byte Segment Length Example Description
Frame Header 2 bytes 55 AA Fixed frame header indicating start of a protocol frame
Version 1 byte 03 Indicates this frame is a command sent by MCU to XU316
Command 1 byte F1 Current command is “Get Firmware Version Command”
Data Length 1 byte 02 Two data bytes follow
Data 2 bytes 00 00 Reserved bytes, set to 00 as placeholder in this example
Checksum 1 byte F5 Sum of all bytes from 55 to the last data byte, modulo 256

Query Complete Version Number (0xF3)

MCU Sends

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x03
Command:       1 byte  - 0xF3
Data Length:   1 byte  - 0x00
Data:          0 bytes - none
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

XU316 Returns

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x00
Command:       1 byte  - 0xF3
Data Length:   1 byte  - N (ASCII version string length, varies by model)
Data:          N bytes - complete firmware version string (all ASCII)
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

  • This command is used by MCU to query the complete firmware version number from XU316
  • Unlike the 0xF1 command (which only returns a 3-byte BCD major version J.M.N), 0xF3 returns the complete ASCII version string
  • Version string format is <model>_v<major>.<minor>.<revision>_b<build>
  • For example, user firmware returns hf87611_v8.1.0_b01, factory firmware returns hf87611_v5.5.8_b01

Command Example

55 AA 03 F3 00 F5

Field Breakdown

Byte Segment Length Example Description
Frame Header 2 bytes 55 AA Fixed frame header indicating start of a protocol frame
Version 1 byte 03 Indicates this frame is a command sent by MCU to XU316
Command 1 byte F3 Current command is “Query Complete Version Number”
Data Length 1 byte 00 No additional data
Checksum 1 byte F5 Sum of all bytes from 55 to 00, modulo 256

Command Example

55 AA 00 F3 12 68 66 38 37 36 31 31 5F 76 38 2E 31 2E 30 5F 62 30 31 C5

Field Breakdown

Byte Segment Length Example Description
Frame Header 2 bytes 55 AA Fixed frame header indicating start of a protocol frame
Version 1 byte 00 Indicates this frame is returned by XU316 to MCU
Command 1 byte F3 Response for “Query Complete Version Number”
Data Length 1 byte 12 18 data bytes follow
Version string 18 bytes 68 66 38 37 36 31 31 5F 76 38 2E 31 2E 30 5F 62 30 31 ASCII string hf87611_v8.1.0_b01
Checksum 1 byte C5 Sum of all bytes from 55 to the last data byte, modulo 256

HID Passthrough Data to MCU via XU316 (0xEE)

XU316 Sends

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x00
Command:       1 byte  - 0xEE
Data Length:   1 byte  - 0x39 (57 bytes), due to HID protocol limitation, data length must be 57 bytes
Data:          57 bytes - Due to HID protocol limitation, passthrough data must be 57 bytes
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

MCU Returns (can return multiple frames)

Frame Header:  2 bytes - 0x55aa
Version:       1 byte  - 0x03
Command:       1 byte  - 0xEE
Data Length:   1 byte  - 0x39 (57 bytes), due to HID protocol limitation, data length must be 57 bytes
Data:          57 bytes - Due to HID protocol limitation, passthrough data must be 57 bytes
Checksum:      1 byte  - Sum of all bytes from frame header, modulo 256

  • This command is used for HID to initiate passthrough data to MCU via XU316
  • Generally the passthrough data is MCU OTA data or MCU data replied to HID

Typical Business Flows

Example Notes

The byte sequences in this section are derived from the base protocol frame format (checksum = sum of all bytes from frame header, modulo 256), for development reference; mode values in the examples are from the product datasheet section 2.1 table — each product follows its own datasheet.

Flow 1: Device Startup Handshake

After power-on, XU316 and MCU complete the startup handshake in the following order; business commands can only be used after the handshake completes:

sequenceDiagram
    participant X as XU316
    participant M as MCU
    X->>M: 0x00 Start-up (with basic info / power-on config CRC)
    M-->>X: Startup options (set 0x01/0x02 bits as needed)
    opt Update basic info
        X->>M: 0x01 Read product info
        M-->>X: 60-byte product basic info
    end
    opt Update power-on config
        X->>M: 0x02 Read power-on config
        M-->>X: 14-byte power-on config
    end
    X->>M: 0x03 Get current input/output mode
    M-->>X: 5-byte mode value (see datasheet section 2.1 table)
    X->>M: 0x04 Get current user config
    M-->>X: 14-byte user config
    X->>M: 0x05 Startup complete
    M-->>X: Acknowledgment

Complete byte formats and timing details of each command: see the "Device Startup and Initialization" chapter of "XU316 UART Base Protocol".

Flow 2: Switch Input/Output Mode (0x23)

Example: switch to S/PDIF1 input mode (mode value 0x10, 0x80, 0x65, 0x10, 0x03, from the product datasheet section 2.1 table).

MCU Sends:

55 AA 03 23 05 10 80 65 10 03 32
Byte Segment Example Description
Frame Header 55 AA Fixed frame header
Version 03 MCU→XU316 command
Command 23 Set input/output mode
Data Length 05 5 mode bytes follow
Mode data 10 80 65 10 03 Target mode value (see product datasheet section 2.1 table)
Checksum 32 Sum of all bytes from frame header, modulo 256

XU316 Returns: 55 AA 00 23 00 22 (pure acknowledgment frame)

Restart After Mode Switch

XU316 may need to restart to load the new mode firmware. After restart, the device repeats the startup handshake flow (the restart reason field in the 0x00 command is 0x01 mode switch restart); the MCU should respond again as in Flow 1.

Flow 3: Receive Playback Volume Report (0x24)

After the user adjusts volume on the computer, XU316 proactively reports the current playback volume to MCU (example: both channels at -24dB, i.e. 0xE8):

XU316 Sends:

55 AA 00 24 02 E8 E8 F5
Byte Segment Example Description
Frame Header 55 AA Fixed frame header
Version 00 XU316→MCU data
Command 24 Send playback volume
Data Length 02 2 volume bytes follow
Left channel E8 -24dB (0xFF is Mute, 0 is 0dB)
Right channel E8 -24dB
Checksum F5 Sum of all bytes from frame header, modulo 256

MCU Returns: 55 AA 03 24 00 26 (pure acknowledgment frame)

Flow 4: Media Control — Play/Pause (0x21)

MCU-side button triggers play/pause (control code 0x02); XU316 converts it to an HID command sent to the computer:

MCU Sends: 55 AA 03 21 01 02 26

XU316 Returns: 55 AA 00 21 00 20 (pure acknowledgment frame)

Other control codes (volume up/down, previous/next track, fast forward, rewind, mute) are listed in the mapping table of the 0x21 command details; the frame format is identical, only the data byte and checksum differ.

Flow 5: Query Current Audio Format (0x31)

MCU Sends: 55 AA 03 31 00 33

XU316 Returns (example: 96kHz PCM):

55 AA 00 31 02 03 00 35
Byte Segment Example Description
Audio stream format 03 AUDIO_96000 (96kHz); full table in base protocol section 4.3
Audio type 00 PCM

Flow 6: Get Firmware Version (0xF1)

MCU Sends: 55 AA 03 F1 02 00 00 F5

XU316 Returns (example: V1.2.5):

55 AA 00 F1 03 01 02 05 FB
Byte Segment Example Description
Data Length 03 3-byte version number
Version data 01 02 05 Major.Minor.Revision (V1.2.5)

Consultation and Feedback

Click to expand consultation and feedback form
×

Notice

Company Name:

Email Address:

Subject:

Message: