8254bc7d50
- 在 CMakeLists.txt 中添加 ui_Screen3.c 源文件以支持新屏幕 - 新增 ui_events.c 和 ui_events.h,定义音量控制按钮的点击事件处理函数 - 实现 ui_Screen3.c,构建第三屏幕的 UI 组件和事件回调 - 更新 ui.c 以初始化和加载第三屏幕 - 修改 ble_hid.c 和 ble_hid.h,添加消费者控制功能以支持音量调节 - 更新相关头文件,确保新屏幕与现有结构兼容
36 lines
972 B
C
36 lines
972 B
C
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#define HID_MOD_LCTRL 0x01
|
|
#define HID_MOD_LSHIFT 0x02
|
|
#define HID_MOD_LALT 0x04
|
|
#define HID_MOD_LGUI 0x08
|
|
|
|
#define HID_KEY_C 0x06
|
|
#define HID_KEY_V 0x19
|
|
#define HID_KEY_X 0x1B
|
|
#define HID_KEY_F5 0x3E
|
|
|
|
#define HID_CONSUMER_VOLUME_UP 0x00E9
|
|
#define HID_CONSUMER_VOLUME_DOWN 0x00EA
|
|
#define HID_CONSUMER_MUTE 0x00E2
|
|
#define HID_CONSUMER_PLAY_PAUSE 0x00CD
|
|
#define HID_CONSUMER_SCAN_NEXT 0x00B5
|
|
#define HID_CONSUMER_SCAN_PREVIOUS 0x00B6
|
|
|
|
typedef void (*ble_hid_status_cb_t)(bool connected);
|
|
|
|
int ble_hid_init(ble_hid_status_cb_t status_cb);
|
|
bool ble_hid_ready(void);
|
|
|
|
int ble_hid_key_press(uint8_t modifier, uint8_t keycode);
|
|
int ble_hid_key_release(void);
|
|
int ble_hid_send_combo(uint8_t modifier, uint8_t keycode);
|
|
int ble_hid_send_consumer(uint16_t usage);
|
|
|
|
#if defined(BOARD_BLE_ENABLED) && BOARD_BLE_ENABLED
|
|
void ble_hid_on_input_notify(bool enabled);
|
|
#endif
|