Files
AudioMixer/protocol.h
T
2026-09-07 16:53:18 +03:00

47 lines
1.3 KiB
C

#pragma once
/* Shared HID mixer protocol (firmware + host) */
#define AUSIO_USB_VID 0x2E8Au
#define AUSIO_USB_PID 0xA541u
#define AUSIO_REPORT_ID_INPUT 1
#define AUSIO_REPORT_ID_OUTPUT 2
#define AUSIO_INPUT_SIZE 8 /* including report id */
#define AUSIO_OUTPUT_SIZE 64 /* including report id */
#define AUSIO_FLAG_E1_SW 0x01u
#define AUSIO_FLAG_E2_SW 0x02u
#define AUSIO_NAME_CHARS 12
/* vol + peak + name[12] (name zero-padded, no extra NUL byte) */
#define AUSIO_SLOT_SIZE (1 + 1 + AUSIO_NAME_CHARS)
#define AUSIO_MAX_VISIBLE 4
/* report_id + count + selected + master_vol + page + n_vis + master_peak */
#define AUSIO_HDR_SIZE 7
#if (AUSIO_HDR_SIZE + AUSIO_MAX_VISIBLE * AUSIO_SLOT_SIZE) > AUSIO_OUTPUT_SIZE
#error protocol packing overflow
#endif
/*
* Input report (device -> host), 8 bytes:
* [0] report_id = 1
* [1] enc1_delta int8
* [2] enc2_delta int8
* [3] flags
* [4] pot 0..100
* [5..7] reserved
*
* Output report (host -> device), 64 bytes:
* [0] report_id = 2
* [1] session_count
* [2] selected_index
* [3] master_vol 0..100
* [4] page_start
* [5] n_visible (0..4)
* [6] master_peak 0..100
* [7..] slots: { uint8 vol; uint8 peak; char name[12]; } * n_visible
*/