mcu_ab568x/userboot240328/app/platform/bsp/bsp_bt/hid.c
2025-05-30 18:03:10 +08:00

44 lines
1.0 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "include.h"
#include "api.h"
#include "func.h"
uint8_t cfg_hid_type = BT_HID_TYPE;
#if BT_HID_MENU_EN
void bsp_bt_hid_tog_conn(void)
{
if (xcfg_cb.bt_hid_menu_en) {
bsp_bt_chkclr_warning(BT_WARN_HID_CON|BT_WARN_HID_DISCON);
bt_cb.hid_menu_flag = 2; //按键连接/断开HID置上标志用于播放提示音
if (bt_hid_is_connected()) {
bt_hid_disconnect();
} else {
bt_hid_connect();
}
}
}
#endif
void bsp_bt_hid_photo(void)
{
bt_hid_key(HID_KEY_ENTER); //enter key, android 4.0以上
delay_5ms(10);
bt_hid_consumer(HID_KEY_VOL_UP); //consumer key vol_up, ios
}
//点击左边屏幕中心位置
void bsp_bt_hid_screen_left(void)
{
bt_hid_touch_screen(0);
delay_5ms(10);
bt_hid_touch_screen(1);
}
//点击右边屏幕中心位置
void bsp_bt_hid_screen_right(void)
{
bt_hid_touch_screen(0x11);
delay_5ms(10);
bt_hid_touch_screen(0x10);
}