Implement MCU support for Xreal Air 2 Ultra

This commit is contained in:
Jacki 2024-12-22 12:47:16 +01:00
parent 3225fcc575
commit 9526491fe8
No known key found for this signature in database
GPG key ID: B404184796354C5E
4 changed files with 134 additions and 5 deletions

View file

@ -75,6 +75,7 @@
#define DEVICE_MCU_MSG_W_BOOT_UPDATE_FINISH 0x1105
#define DEVICE_MCU_MSG_P_START_HEARTBEAT 0x6c02
#define DEVICE_MCU_MSG_P_DISPLAY_TOGGLED 0x6C04
#define DEVICE_MCU_MSG_P_BUTTON_PRESSED 0x6C05
#define DEVICE_MCU_MSG_P_END_HEARTBEAT 0x6c12
#define DEVICE_MCU_MSG_P_ASYNC_TEXT_LOG 0x6c09
@ -101,6 +102,17 @@
#define DEVICE_MCU_BUTTON_VIRT_BRIGHTNESS_DOWN 0x7
#define DEVICE_MCU_BUTTON_VIRT_UP 0x8
#define DEVICE_MCU_BUTTON_VIRT_DOWN 0x9
#define DEVICE_MCU_BUTTON_VIRT_MODE_2D 0xA
#define DEVICE_MCU_BUTTON_VIRT_MODE_3D 0xB
#define DEVICE_MCU_BUTTON_VIRT_BLEND_CYCLE 0xC
#define DEVICE_MCU_BUTTON_VIRT_CONTROL_TOGGLE 0xF
#define DEVICE_MCU_BLEND_STATE_LOW 0x0
#define DEVICE_MCU_BLEND_STATE_MEDIUM 0x2
#define DEVICE_MCU_BLEND_STATE_FULL 0x3
#define DEVICE_MCU_CONTROL_MODE_BRIGHTNESS 0x0
#define DEVICE_MCU_CONTROL_MODE_VOLUME 0x1
#ifdef __cplusplus
extern "C" {
@ -141,6 +153,12 @@ enum device_mcu_event_t {
DEVICE_MCU_EVENT_BRIGHTNESS_UP = 3,
DEVICE_MCU_EVENT_BRIGHTNESS_DOWN = 4,
DEVICE_MCU_EVENT_MESSAGE = 5,
DEVICE_MCU_EVENT_DISPLAY_MODE_2D = 6,
DEVICE_MCU_EVENT_DISPLAY_MODE_3D = 7,
DEVICE_MCU_EVENT_BLEND_CYCLE = 8,
DEVICE_MCU_EVENT_CONTROL_TOGGLE = 9,
DEVICE_MCU_EVENT_VOLUME_UP = 10,
DEVICE_MCU_EVENT_VOLUME_DOWN = 11,
};
typedef enum device_mcu_error_t device_mcu_error_type;
@ -167,6 +185,8 @@ struct device_mcu_t {
bool active;
uint8_t brightness;
uint8_t disp_mode;
uint8_t blend_state;
uint8_t control_mode;
device_mcu_event_callback callback;
};