Files
MimiCon/main/console_output/mouse_kb_descriptors.h
T
dark98 69ebdb4331 Initial commit: MimiCon v1.0.0 - Universal Gamepad Mimic & Console Bridge
- Dual-Core Architecture: Dedicated 1000Hz USB gaming pipeline on Core 1 and BLE/Wi-Fi/Web telemetry on Core 0.
- Multi-Input BLE Host: Parsers for Xbox Wireless, Google Stadia, 8BitDo (Ultimate/Pro2/SN30), and Generic HOGP gamepads.
- Multi-Console USB Emulation: Nintendo Switch, PC DirectInput, PS3, PS4, Xbox 360 (libxsm3 cryptographic challenge-response), Original Xbox, and Couch Mouse/Keyboard.
- Onboard Web Portal & Captive Portal: Real-time SVG gamepad visualizer, stick deadzone calibration, button combo remapping, and Wi-Fi manager.
- Low-Latency Radio Management: Interactive SoftAP toggle to drop to 0-latency gaming mode.
- Dual OTA Firmware Flashing: Browser-based wireless firmware updater and automated Python OTA script.
- Strict Build Quality: Clean build under -Wall -Wextra with zero warnings or errors.
- Versioning & Licensing: Semantic Versioning v1.0.0 and GNU GPLv3 with Commercial Restrictions.
2026-10-17 20:21:09 +01:00

102 lines
4.5 KiB
C

#pragma once
#include <stdint.h>
/* Standard USB HID Composite Report Descriptor: Mouse (ID 1), Keyboard (ID 2), Media (ID 3) */
static const uint8_t mouse_kb_hid_report_descriptor[] = {
/* --- MOUSE (Report ID 1) --- */
0x05, 0x01, /* Usage Page (Generic Desktop) */
0x09, 0x02, /* Usage (Mouse) */
0xA1, 0x01, /* Collection (Application) */
0x85, 0x01, /* Report ID (1) */
0x09, 0x01, /* Usage (Pointer) */
0xA1, 0x00, /* Collection (Physical) */
/* 5 Buttons: Left, Right, Middle, Back, Forward */
0x05, 0x09, /* Usage Page (Button) */
0x19, 0x01, /* Usage Minimum (Button 1) */
0x29, 0x05, /* Usage Maximum (Button 5) */
0x15, 0x00, /* Logical Minimum (0) */
0x25, 0x01, /* Logical Maximum (1) */
0x95, 0x05, /* Report Count (5) */
0x75, 0x01, /* Report Size (1) */
0x81, 0x02, /* Input (Data, Variable, Absolute) */
/* Padding (3 bits) */
0x95, 0x01, /* Report Count (1) */
0x75, 0x03, /* Report Size (3) */
0x81, 0x03, /* Input (Constant, Variable, Absolute) */
/* X, Y Movement (-127 to 127) */
0x05, 0x01, /* Usage Page (Generic Desktop) */
0x09, 0x30, /* Usage (X) */
0x09, 0x31, /* Usage (Y) */
0x15, 0x81, /* Logical Minimum (-127) */
0x25, 0x7F, /* Logical Maximum (127) */
0x75, 0x08, /* Report Size (8) */
0x95, 0x02, /* Report Count (2) */
0x81, 0x06, /* Input (Data, Variable, Relative) */
/* Wheel (-127 to 127) */
0x09, 0x38, /* Usage (Wheel) */
0x15, 0x81, /* Logical Minimum (-127) */
0x25, 0x7F, /* Logical Maximum (127) */
0x75, 0x08, /* Report Size (8) */
0x95, 0x01, /* Report Count (1) */
0x81, 0x06, /* Input (Data, Variable, Relative) */
0xC0, /* End Collection */
0xC0, /* End Collection */
/* --- KEYBOARD (Report ID 2) --- */
0x05, 0x01, /* Usage Page (Generic Desktop) */
0x09, 0x06, /* Usage (Keyboard) */
0xA1, 0x01, /* Collection (Application) */
0x85, 0x02, /* Report ID (2) */
/* Modifiers (8 bits: Ctrl, Shift, Alt, GUI) */
0x05, 0x07, /* Usage Page (Key Codes) */
0x19, 0xE0, /* Usage Minimum (224) */
0x29, 0xE7, /* Usage Maximum (231) */
0x15, 0x00, /* Logical Minimum (0) */
0x25, 0x01, /* Logical Maximum (1) */
0x75, 0x01, /* Report Size (1) */
0x95, 0x08, /* Report Count (8) */
0x81, 0x02, /* Input (Data, Variable, Absolute) */
/* Reserved byte */
0x95, 0x01, /* Report Count (1) */
0x75, 0x08, /* Report Size (8) */
0x81, 0x03, /* Input (Constant) */
/* Key array (6 keys) */
0x95, 0x06, /* Report Count (6) */
0x75, 0x08, /* Report Size (8) */
0x15, 0x00, /* Logical Minimum (0) */
0x25, 0xFF, /* Logical Maximum (255) */
0x05, 0x07, /* Usage Page (Key Codes) */
0x19, 0x00, /* Usage Minimum (0) */
0x29, 0xFF, /* Usage Maximum (255) */
0x81, 0x00, /* Input (Data, Array) */
0xC0, /* End Collection */
/* --- CONSUMER CONTROL / MEDIA (Report ID 3) --- */
0x05, 0x0C, /* Usage Page (Consumer) */
0x09, 0x01, /* Usage (Consumer Control) */
0xA1, 0x01, /* Collection (Application) */
0x85, 0x03, /* Report ID (3) */
0x15, 0x00, /* Logical Minimum (0) */
0x26, 0xFF, 0x03, /* Logical Maximum (0x03FF) */
0x19, 0x00, /* Usage Minimum (0) */
0x2A, 0xFF, 0x03, /* Usage Maximum (0x03FF) */
0x75, 0x10, /* Report Size (16) */
0x95, 0x01, /* Report Count (1) */
0x81, 0x00, /* Input (Data, Array) */
0xC0 /* End Collection */
};
typedef struct __attribute__((packed)) {
uint8_t buttons; /* bit 0: Left, bit 1: Right, bit 2: Middle, bit 3: Back, bit 4: Forward */
int8_t x; /* Relative X displacement */
int8_t y; /* Relative Y displacement */
int8_t wheel; /* Relative wheel roll */
} mouse_report_payload_t;
typedef struct __attribute__((packed)) {
uint8_t modifier;
uint8_t reserved;
uint8_t keycodes[6];
} keyboard_report_payload_t;