cun
This commit is contained in:
31
apps/xtell_hide/include/app_action.h
Normal file
31
apps/xtell_hide/include/app_action.h
Normal file
@ -0,0 +1,31 @@
|
||||
#ifndef APP_ACTION_H
|
||||
#define APP_ACTION_H
|
||||
|
||||
|
||||
#define ACTION_EARPHONE_MAIN 0x0001
|
||||
#define ACTION_A2DP_START 0x0002
|
||||
#define ACTION_ESCO_START 0x0003
|
||||
#define ACTION_BY_KEY_MODE 0x0004
|
||||
|
||||
#define ACTION_IDLE_MAIN 0x0010
|
||||
#define ACTION_IDLE_POWER_OFF 0x0011
|
||||
|
||||
#define ACTION_MUSIC_MAIN 0x0020
|
||||
#define ACTION_MUSIC_TWS_RX 0x0021
|
||||
|
||||
#define ACTION_PC_MAIN 0x0030
|
||||
|
||||
#define ACTION_AUX_MAIN 0x0040
|
||||
|
||||
#define APP_NAME_BT "earphone"
|
||||
#define APP_NAME_IDLE "idle"
|
||||
#define APP_NAME_PC "pc"
|
||||
#define APP_NAME_MUSIC "music"
|
||||
#define APP_NAME_AUX "aux"
|
||||
|
||||
extern void task_switch(const char *name, int action);
|
||||
#define task_switch_to_bt() task_switch(APP_NAME_BT, ACTION_EARPHONE_MAIN)
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
12
apps/xtell_hide/include/app_ancbox.h
Normal file
12
apps/xtell_hide/include/app_ancbox.h
Normal file
@ -0,0 +1,12 @@
|
||||
#ifndef _APP_ANCBOX_H_
|
||||
#define _APP_ANCBOX_H_
|
||||
|
||||
#include "typedef.h"
|
||||
#include "system/event.h"
|
||||
|
||||
extern int app_ancbox_event_handler(struct ancbox_event *anc_dev);
|
||||
extern u8 ancbox_get_status(void);
|
||||
extern void ancbox_clear_status(void);
|
||||
|
||||
#endif //_APP_CHARGESTORE_H_
|
||||
|
||||
13
apps/xtell_hide/include/app_anctool.h
Normal file
13
apps/xtell_hide/include/app_anctool.h
Normal file
@ -0,0 +1,13 @@
|
||||
#ifndef _APP_ANCTOOL_H_
|
||||
#define _APP_ANCTOOL_H_
|
||||
|
||||
#include "typedef.h"
|
||||
#include "anctool.h"
|
||||
|
||||
u8 app_anctool_spp_rx_data(u8 *packet, u16 size);
|
||||
void app_anctool_spp_connect(void);
|
||||
void app_anctool_spp_disconnect(void);
|
||||
u8 get_app_anctool_spp_connected_flag();
|
||||
|
||||
#endif //_APP_CHARGESTORE_H_
|
||||
|
||||
17
apps/xtell_hide/include/app_charge.h
Normal file
17
apps/xtell_hide/include/app_charge.h
Normal file
@ -0,0 +1,17 @@
|
||||
#ifndef _APP_CHARGE_H_
|
||||
#define _APP_CHARGE_H_
|
||||
|
||||
#include "typedef.h"
|
||||
#include "system/event.h"
|
||||
|
||||
extern void charge_close_deal(void);
|
||||
extern void charge_start_deal(void);
|
||||
extern void ldo5v_keep_deal(void);
|
||||
extern void charge_full_deal(void);
|
||||
extern void charge_ldo5v_in_deal(void);
|
||||
extern void charge_ldo5v_off_deal(void);
|
||||
extern u8 get_charge_full_flag(void);
|
||||
|
||||
extern int app_charge_event_handler(struct device_event *dev);
|
||||
|
||||
#endif //_APP_CHARGE_H_
|
||||
78
apps/xtell_hide/include/app_chargestore.h
Normal file
78
apps/xtell_hide/include/app_chargestore.h
Normal file
@ -0,0 +1,78 @@
|
||||
#ifndef _APP_CHARGESTORE_H_
|
||||
#define _APP_CHARGESTORE_H_
|
||||
|
||||
#include "typedef.h"
|
||||
#include "system/event.h"
|
||||
|
||||
//LDOIN升级口命令定义
|
||||
#define CMD_TWS_CHANNEL_SET 0x01
|
||||
#define CMD_TWS_REMOTE_ADDR 0x02
|
||||
#define CMD_TWS_ADDR_DELETE 0x03
|
||||
#define CMD_BOX_TWS_CHANNEL_SEL 0x04//测试盒获取地址
|
||||
#define CMD_BOX_TWS_REMOTE_ADDR 0x05//测试盒交换地址
|
||||
#define CMD_POWER_LEVEL_OPEN 0x06//开盖充电舱报告/获取电量
|
||||
#define CMD_POWER_LEVEL_CLOSE 0x07//合盖充电舱报告/获取电量
|
||||
#define CMD_RESTORE_SYS 0x08//恢复出厂设置
|
||||
#define CMD_ENTER_DUT 0x09//进入测试模式
|
||||
#define CMD_EX_FIRST_READ_INFO 0x0A//F95读取数据首包信息
|
||||
#define CMD_EX_CONTINUE_READ_INFO 0x0B//F95读取数据后续包信息
|
||||
#define CMD_EX_FIRST_WRITE_INFO 0x0C//F95写入数据首包信息
|
||||
#define CMD_EX_CONTINUE_WRITE_INFO 0x0D//F95写入数据后续包信息
|
||||
#define CMD_EX_INFO_COMPLETE 0x0E//F95完成信息交换
|
||||
#define CMD_TWS_SET_CHANNEL 0x0F//F95设置左右声道信息
|
||||
#define CMD_BOX_UPDATE 0x20//测试盒升级
|
||||
#define CMD_BOX_MODULE 0x21//测试盒一级命令
|
||||
|
||||
#define CMD_SHUT_DOWN 0x80//充电舱关机,充满电关机,或者是低电关机
|
||||
#define CMD_CLOSE_CID 0x81//充电舱盒盖
|
||||
#define CMD_ANC_MODULE 0x90//ANC一级命令
|
||||
#define CMD_FAIL 0xfe//失败
|
||||
#define CMD_UNDEFINE 0xff//未知命令回复
|
||||
|
||||
enum {
|
||||
TWS_CHANNEL_LEFT = 1, //左耳
|
||||
TWS_CHANNEL_RIGHT, //右耳
|
||||
};
|
||||
|
||||
enum {
|
||||
TWS_DEL_TWS_ADDR = 1, //删除对箱地址
|
||||
TWS_DEL_PHONE_ADDR,//删除手机地址
|
||||
TWS_DEL_ALL_ADDR,//删除手机与对箱地址
|
||||
};
|
||||
|
||||
struct _CHARGE_STORE_INFO {
|
||||
u8 tws_local_addr[6];
|
||||
u8 tws_remote_addr[6];
|
||||
u8 tws_mac_addr[6];
|
||||
u32 search_aa;
|
||||
u32 pair_aa;
|
||||
u8 local_channel;
|
||||
u16 device_ind;
|
||||
u16 reserved_data;
|
||||
} _GNU_PACKED_;
|
||||
typedef struct _CHARGE_STORE_INFO CHARGE_STORE_INFO;
|
||||
|
||||
extern void chargestore_set_tws_channel_info(u8 channel);
|
||||
extern bool chargestore_set_tws_remote_info(u8 *data, u8 len);
|
||||
extern u16 chargestore_get_tws_remote_info(u8 *data);
|
||||
extern u8 chargestore_get_power_level(void);
|
||||
extern u8 chargestore_get_power_status(void);
|
||||
extern u8 chargestore_get_cover_status(void);
|
||||
extern u8 chargestore_get_sibling_power_level(void);
|
||||
extern void chargestore_set_bt_init_ok(u8 flag);
|
||||
extern int app_chargestore_event_handler(struct chargestore_event *chargestore_dev);
|
||||
extern u8 chargestore_get_earphone_online(void);
|
||||
extern u8 chargestore_get_earphone_pos(void);
|
||||
extern int chargestore_sync_chg_level(void);
|
||||
extern void chargestore_set_power_level(u8 power);
|
||||
extern void chargestore_set_sibling_chg_lev(u8 chg_lev);
|
||||
extern void chargestore_set_phone_disconnect(void);
|
||||
extern void chargestore_set_phone_connect(void);
|
||||
extern u8 chargestore_check_going_to_poweroff(void);
|
||||
extern void chargestore_shutdown_reset(void);
|
||||
extern void testbox_set_testbox_tws_paired(u8 flag);
|
||||
extern u8 testbox_get_testbox_tws_paired(void);
|
||||
extern u8 testbox_get_touch_trim_en(u8 *sec);
|
||||
extern u8 testbox_get_softpwroff_after_paired(void);
|
||||
|
||||
#endif //_APP_CHARGESTORE_H_
|
||||
555
apps/xtell_hide/include/app_config.h
Normal file
555
apps/xtell_hide/include/app_config.h
Normal file
@ -0,0 +1,555 @@
|
||||
#ifndef APP_CONFIG_H
|
||||
#define APP_CONFIG_H
|
||||
|
||||
/*
|
||||
* 系统打印总开关
|
||||
*/
|
||||
|
||||
#define LIB_DEBUG 1 //1 //xtelllog 1是打开库打印
|
||||
#define CONFIG_DEBUG_LIB(x) (x & LIB_DEBUG)
|
||||
|
||||
#define CONFIG_DEBUG_ENABLE //xtelllog 注释就关闭log
|
||||
|
||||
#ifndef CONFIG_DEBUG_ENABLE
|
||||
//#define CONFIG_DEBUG_LITE_ENABLE //轻量级打印开关, 默认关闭
|
||||
#endif
|
||||
|
||||
|
||||
//*********************************************************************************//
|
||||
// AI配置 //
|
||||
//*********************************************************************************//
|
||||
#define CONFIG_APP_BT_ENABLE
|
||||
|
||||
#ifdef CONFIG_APP_BT_ENABLE
|
||||
#define TRANS_DATA_EN 0
|
||||
#define RCSP_BTMATE_EN 0
|
||||
#define RCSP_ADV_EN 1
|
||||
#define AI_APP_PROTOCOL 0
|
||||
#define LL_SYNC_EN 0
|
||||
#define TUYA_DEMO_EN 0
|
||||
#else
|
||||
#define TRANS_DATA_EN 1
|
||||
#define RCSP_BTMATE_EN 0
|
||||
#define RCSP_ADV_EN 0
|
||||
#define AI_APP_PROTOCOL 0
|
||||
#define LL_SYNC_EN 0
|
||||
#define TUYA_DEMO_EN 0
|
||||
#endif
|
||||
|
||||
|
||||
#include "board_config.h"
|
||||
#ifdef TCFG_AUDIO_CVP_NS_MODE
|
||||
#if (TCFG_AUDIO_CVP_NS_MODE==CVP_DNS_MODE) || (TCFG_KWS_VOICE_RECOGNITION_ENABLE == 1)||(TCFG_AUDIO_ANC_ENABLE==1&&TCFG_AUDIO_DUAL_MIC_ENABLE==1)
|
||||
#undef CONFIG_MOVABLE_ENABLE
|
||||
#define CONFIG_MOVABLE_ENABLE //省ram空间,将部分ram空间的代码挪到flash
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(TCFG_CVP_DEVELOP_ENABLE) && (TCFG_CVP_DEVELOP_ENABLE == 1)
|
||||
#undef CONFIG_MOVABLE_ENABLE
|
||||
#define CONFIG_MOVABLE_ENABLE //省ram空间,将部分ram空间的代码挪到flash
|
||||
#endif
|
||||
|
||||
#if CONFIG_UPDATE_WITH_MD5_CHECK_EN
|
||||
#define UPDATE_MD5_ENABLE 1
|
||||
#else
|
||||
#define UPDATE_MD5_ENABLE 0
|
||||
#endif
|
||||
|
||||
|
||||
//升级需要打开CONFIG_APP_OTA_ENABLE,同时单双备份的配置也在board_xxx_global_cfg里配置,需要注意只有JL_RCSP才支持单备份,其余升级都是只支持双备份升级
|
||||
//支持TWS同步升级,OTA_TWS_SAME_TIME_NEW宏需要配置为1,旧的流程已不再支持
|
||||
#if (RCSP_ADV_EN) //rcsp需要打开ble
|
||||
#define JL_EARPHONE_APP_EN 1
|
||||
// #define CONFIG_CHARGESTORE_REMAP_ENABLE //充电仓重映射接收函数使能
|
||||
#if CONFIG_APP_OTA_ENABLE
|
||||
#define RCSP_UPDATE_EN 1 //是否支持rcsp升级
|
||||
#if CONFIG_DOUBLE_BANK_ENABLE //双备份才能打开同步升级流程
|
||||
#define OTA_TWS_SAME_TIME_ENABLE 1 //是否支持TWS同步升级
|
||||
#define OTA_TWS_SAME_TIME_NEW 1 //使用新的tws ota流程
|
||||
#else
|
||||
#define OTA_TWS_SAME_TIME_ENABLE 1//0 xtellota //是否支持TWS同步升级
|
||||
#define OTA_TWS_SAME_TIME_NEW 1//0 //使用新的tws ota流程
|
||||
#endif //CONFIG_DOUBLE_BANK_ENABLE
|
||||
#else
|
||||
#define RCSP_UPDATE_EN 0 //是否支持rcsp升级
|
||||
#define OTA_TWS_SAME_TIME_ENABLE 0 //是否支持TWS同步升级
|
||||
#define OTA_TWS_SAME_TIME_NEW 0 //使用新的tws ota流程
|
||||
#endif
|
||||
#undef TCFG_USER_BLE_ENABLE
|
||||
#define TCFG_USER_BLE_ENABLE 1 //BLE功能使能
|
||||
#elif (AI_APP_PROTOCOL)
|
||||
#define BT_MIC_EN 0
|
||||
#define OTA_TWS_SAME_TIME_ENABLE 0 //是否支持TWS同步升级
|
||||
#elif (LL_SYNC_EN)
|
||||
#define JL_EARPHONE_APP_EN 0
|
||||
#define OTA_TWS_SAME_TIME_ENABLE 1
|
||||
#define OTA_TWS_SAME_TIME_NEW 1 //使用新的tws ota流程
|
||||
#elif (TUYA_DEMO_EN)
|
||||
#define JL_EARPHONE_APP_EN 0
|
||||
#define OTA_TWS_SAME_TIME_ENABLE 0
|
||||
#define OTA_TWS_SAME_TIME_NEW 0 //使用新的tws ota流程
|
||||
#else
|
||||
#define JL_EARPHONE_APP_EN 0
|
||||
#define OTA_TWS_SAME_TIME_ENABLE 0
|
||||
#define OTA_TWS_SAME_TIME_NEW 0 //使用新的tws ota流程
|
||||
#endif
|
||||
|
||||
#define CONFIG_MEDIA_LIB_USE_MALLOC 1
|
||||
|
||||
|
||||
|
||||
#include "usb_std_class_def.h"
|
||||
|
||||
#undef USB_MALLOC_ENABLE
|
||||
#define USB_MALLOC_ENABLE 1
|
||||
///USB 配置重定义
|
||||
// #undef USB_DEVICE_CLASS_CONFIG
|
||||
// #define USB_DEVICE_CLASS_CONFIG (AUDIO_CLASS)
|
||||
/////要确保 上面 undef 后在include usb
|
||||
#include "usb_common_def.h"
|
||||
|
||||
#define USB_PC_NO_APP_MODE 0
|
||||
|
||||
#if ((TCFG_CHARGESTORE_ENABLE || TCFG_TEST_BOX_ENABLE || TCFG_ANC_BOX_ENABLE) \
|
||||
&& TCFG_CHARGESTORE_PORT == IO_PORT_DP)
|
||||
#undef TCFG_OTG_MODE
|
||||
#define TCFG_OTG_MODE (TCFG_OTG_MODE_HOST|TCFG_OTG_MODE_SLAVE|TCFG_OTG_MODE_CHARGE|OTG_DET_DM_ONLY)
|
||||
#endif
|
||||
|
||||
|
||||
#include "btcontroller_mode.h"
|
||||
|
||||
#include "user_cfg_id.h"
|
||||
|
||||
#ifndef __LD__
|
||||
#include "bt_profile_cfg.h"
|
||||
#endif
|
||||
|
||||
|
||||
// #ifdef CONFIG_APP_BT_ENABLE
|
||||
// #if(APP_ONLINE_DEBUG)
|
||||
// #error "they can not enable at the same time,just select one!!!"
|
||||
// #endif
|
||||
// #endif
|
||||
|
||||
|
||||
#ifdef CONFIG_SDFILE_ENABLE
|
||||
|
||||
#define SDFILE_DEV "sdfile"
|
||||
#define SDFILE_MOUNT_PATH "mnt/sdfile"
|
||||
|
||||
#if (USE_SDFILE_NEW)
|
||||
#define SDFILE_APP_ROOT_PATH SDFILE_MOUNT_PATH"/app/" //app分区
|
||||
#define SDFILE_RES_ROOT_PATH SDFILE_MOUNT_PATH"/res/" //资源文件分区
|
||||
#else
|
||||
#define SDFILE_RES_ROOT_PATH SDFILE_MOUNT_PATH"/C/"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#define STYLE_JL_WTACH (1)//彩屏demo
|
||||
#define STYLE_JL_SOUNDBOX (2)//点阵屏demo
|
||||
#define STYLE_JL_CHARGE (3)//点阵屏充电仓
|
||||
#define STYLE_JL_LED7 (4)//led7
|
||||
#define STYLE_UI_SIMPLE (5)//没有ui框架
|
||||
|
||||
|
||||
//*********************************************************************************//
|
||||
// 测试模式配置 //
|
||||
//*********************************************************************************//
|
||||
#if (CONFIG_BT_MODE != BT_NORMAL)
|
||||
#undef TCFG_BD_NUM
|
||||
#define TCFG_BD_NUM 1
|
||||
|
||||
#undef TCFG_USER_TWS_ENABLE
|
||||
#define TCFG_USER_TWS_ENABLE 0 //tws功能使能
|
||||
|
||||
#undef TCFG_USER_BLE_ENABLE
|
||||
#define TCFG_USER_BLE_ENABLE 1 //BLE功能使能
|
||||
|
||||
#undef TCFG_AUTO_SHUT_DOWN_TIME
|
||||
#define TCFG_AUTO_SHUT_DOWN_TIME 0
|
||||
|
||||
#undef TCFG_SYS_LVD_EN
|
||||
#define TCFG_SYS_LVD_EN 0
|
||||
|
||||
#undef TCFG_LOWPOWER_LOWPOWER_SEL
|
||||
#define TCFG_LOWPOWER_LOWPOWER_SEL 0
|
||||
|
||||
#undef TCFG_AUDIO_DAC_LDO_VOLT
|
||||
#define TCFG_AUDIO_DAC_LDO_VOLT DUT_AUDIO_DAC_LDO_VOLT
|
||||
|
||||
#undef TCFG_LOWPOWER_POWER_SEL
|
||||
#define TCFG_LOWPOWER_POWER_SEL PWR_LDO15
|
||||
|
||||
#undef TCFG_PWMLED_ENABLE
|
||||
#define TCFG_PWMLED_ENABLE DISABLE_THIS_MOUDLE
|
||||
|
||||
#undef TCFG_ADKEY_ENABLE
|
||||
#define TCFG_ADKEY_ENABLE DISABLE_THIS_MOUDLE
|
||||
|
||||
#undef TCFG_IOKEY_ENABLE
|
||||
#define TCFG_IOKEY_ENABLE DISABLE_THIS_MOUDLE
|
||||
|
||||
#undef TCFG_TEST_BOX_ENABLE
|
||||
#define TCFG_TEST_BOX_ENABLE 0
|
||||
|
||||
#undef TCFG_AUTO_SHUT_DOWN_TIME
|
||||
#define TCFG_AUTO_SHUT_DOWN_TIME 0
|
||||
|
||||
#undef TCFG_POWER_ON_NEED_KEY
|
||||
#define TCFG_POWER_ON_NEED_KEY 0
|
||||
|
||||
/* #undef TCFG_UART0_ENABLE
|
||||
#define TCFG_UART0_ENABLE DISABLE_THIS_MOUDLE */
|
||||
dzfghsdfhgsfgh
|
||||
#endif //(CONFIG_BT_MODE != BT_NORMAL)
|
||||
|
||||
|
||||
#if TCFG_USER_TWS_ENABLE
|
||||
|
||||
#define CONFIG_TWS_COMMON_ADDR_AUTO 0 /* 自动生成TWS配对后的MAC地址 */
|
||||
#define CONFIG_TWS_COMMON_ADDR_USED_LEFT 1 /* 使用左耳的MAC地址作为TWS配对后的地址
|
||||
可配合烧写器MAC地址自增功能一起使用
|
||||
多台交叉配对会出现MAC地址相同情况 */
|
||||
#define CONFIG_TWS_COMMON_ADDR_SELECT CONFIG_TWS_COMMON_ADDR_AUTO
|
||||
|
||||
//*********************************************************************************//
|
||||
// 对耳配置方式配置 //
|
||||
//*********************************************************************************//
|
||||
#define CONFIG_TWS_CONNECT_SIBLING_TIMEOUT 4 /* 开机或超时断开后对耳互连超时时间,单位s */
|
||||
// #define CONFIG_TWS_REMOVE_PAIR_ENABLE [> 不连手机的情况下双击按键删除配对信息 <]
|
||||
#define CONFIG_TWS_POWEROFF_SAME_TIME 1 /*按键关机时两个耳机同时关机*/
|
||||
|
||||
#define ONE_KEY_CTL_DIFF_FUNC 1 /*通过左右耳实现一个按键控制两个功能*/
|
||||
#define CONFIG_TWS_SCO_ONLY_MASTER 0 /*通话的时候只有主机出声音*/
|
||||
|
||||
/* 配对方式选择 */
|
||||
#define CONFIG_TWS_PAIR_BY_CLICK 0 /* 按键发起配对 */
|
||||
#define CONFIG_TWS_PAIR_BY_AUTO 1 /* 开机自动配对 */
|
||||
#define CONFIG_TWS_PAIR_BY_FAST_CONN 2 /* 开机快速连接,连接速度比自动配对快,不支持取消配对操作 */
|
||||
#define CONFIG_TWS_PAIR_MODE CONFIG_TWS_PAIR_BY_AUTO
|
||||
|
||||
|
||||
/* 声道确定方式选择 */
|
||||
#define CONFIG_TWS_MASTER_AS_LEFT 0 //主机作为左耳
|
||||
#define CONFIG_TWS_AS_LEFT_CHANNEL 1 //固定左耳
|
||||
#define CONFIG_TWS_AS_RIGHT_CHANNEL 2 //固定右耳
|
||||
#define CONFIG_TWS_LEFT_START_PAIR 3 //双击发起配对的耳机做左耳
|
||||
#define CONFIG_TWS_RIGHT_START_PAIR 4 //双击发起配对的耳机做右耳
|
||||
#define CONFIG_TWS_EXTERN_UP_AS_LEFT 5 //外部有上拉电阻作为左耳
|
||||
#define CONFIG_TWS_EXTERN_DOWN_AS_LEFT 6 //外部有下拉电阻作为左耳
|
||||
#define CONFIG_TWS_SECECT_BY_CHARGESTORE 7 //充电仓决定左右耳
|
||||
#define CONFIG_TWS_CHANNEL_SELECT CONFIG_TWS_LEFT_START_PAIR //配对方式选择
|
||||
|
||||
#define CONFIG_TWS_CHANNEL_CHECK_IO IO_PORTA_07 //上下拉电阻检测引脚
|
||||
|
||||
|
||||
#if CONFIG_TWS_PAIR_MODE != CONFIG_TWS_PAIR_BY_CLICK
|
||||
#if (CONFIG_TWS_CHANNEL_SELECT == CONFIG_TWS_LEFT_START_PAIR) ||\
|
||||
(CONFIG_TWS_CHANNEL_SELECT == CONFIG_TWS_RIGHT_START_PAIR)
|
||||
#undef CONFIG_TWS_CHANNEL_SELECT
|
||||
#define CONFIG_TWS_CHANNEL_SELECT CONFIG_TWS_MASTER_AS_LEFT
|
||||
#endif
|
||||
|
||||
#if CONFIG_TWS_PAIR_MODE == CONFIG_TWS_PAIR_BY_AUTO
|
||||
#define CONFIG_TWS_AUTO_PAIR_WITHOUT_UNPAIR /* 不取消配对也可以配对新的耳机 */
|
||||
#endif
|
||||
|
||||
#if CONFIG_TWS_PAIR_MODE == CONFIG_TWS_PAIR_BY_FAST_CONN
|
||||
#undef CONFIG_TWS_REMOVE_PAIR_ENABLE
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#define CONFIG_A2DP_GAME_MODE_ENABLE 0 //游戏模式
|
||||
#define CONFIG_A2DP_GAME_MODE_DELAY_TIME 35 //游戏模式延时ms
|
||||
|
||||
//*********************************************************************************//
|
||||
// 低延时游戏模式脚步声、枪声增强,需使能蓝牙音乐10段eq以及蓝牙音乐drc
|
||||
// 用户开关宏AUDIO_GAME_EFFECT_CONFIG(开关蓝牙低延时模式的游戏音效)
|
||||
// 低延时eq效果文件使用eq_game_eff.bin,调试时需保存成该文件,并在批处理-res后添加
|
||||
// 非低延时eq效果文件使用eq_cfg_hw.bin,也需在批处理-res后添加
|
||||
//*********************************************************************************//
|
||||
#if CONFIG_A2DP_GAME_MODE_ENABLE
|
||||
#define AUDIO_GAME_EFFECT_CONFIG 1 //低延时游戏模式脚步声、枪声增强 1:使能、0:关闭
|
||||
#else
|
||||
#define AUDIO_GAME_EFFECT_CONFIG 0 //低延时游戏模式脚步声、枪声增强 1:使能、0:关闭
|
||||
#endif
|
||||
/***********************************非用户配置区***********************************/
|
||||
//以下宏定义,是游戏音效使能后,需要开启的宏定义,已配好,用户不用修改
|
||||
#if AUDIO_GAME_EFFECT_CONFIG
|
||||
#if (TCFG_EQ_ENABLE == 0)
|
||||
#undef TCFG_EQ_ENABLE
|
||||
#define TCFG_EQ_ENABLE 1
|
||||
#endif/* (TCFG_EQ_ENABLE == 0) */
|
||||
#if (TCFG_BT_MUSIC_EQ_ENABLE == 0)
|
||||
#undef TCFG_BT_MUSIC_EQ_ENABLE
|
||||
#define TCFG_BT_MUSIC_EQ_ENABLE 1
|
||||
#endif/*(TCFG_BT_MUSIC_EQ_ENABLE == 0)*/
|
||||
#if (TCFG_DRC_ENABLE == 0)
|
||||
#undef TCFG_DRC_ENABLE
|
||||
#define TCFG_DRC_ENABLE 1
|
||||
#endif/* (TCFG_DRC_ENABLE == 0) */
|
||||
#if (TCFG_BT_MUSIC_DRC_ENABLE == 0)
|
||||
#undef TCFG_BT_MUSIC_DRC_ENABLE
|
||||
#define TCFG_BT_MUSIC_DRC_ENABLE 1
|
||||
#endif/* (TCFG_BT_MUSIC_DRC_ENABLE == 0) */
|
||||
#if (EQ_SECTION_MAX < 10)
|
||||
#undef EQ_SECTION_MAX
|
||||
#define EQ_SECTION_MAX 10
|
||||
#endif/* (EQ_SECTION_MAX < 10) */
|
||||
#if (TCFG_USE_EQ_FILE == 0)
|
||||
#undef TCFG_USE_EQ_FILE
|
||||
#define TCFG_USE_EQ_FILE 1
|
||||
#endif/* TCFG_USE_EQ_FILE */
|
||||
#endif/* AUDIO_GAME_EFFECT_CONFIG */
|
||||
/**********************************************************************************/
|
||||
|
||||
|
||||
|
||||
#if CONFIG_TWS_PAIR_MODE == CONFIG_TWS_PAIR_BY_CLICK
|
||||
#define CONFIG_TWS_BY_CLICK_PAIR_WITHOUT_PAIR /*双击按键可以配对已配对过的样机,即交叉配对 */
|
||||
#ifdef CONFIG_TWS_BY_CLICK_PAIR_WITHOUT_PAIR
|
||||
#define CONFIG_TWS_AUTO_PAIR_WITHOUT_UNPAIR /* 不取消配对也可以配对新的耳机 */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#if TCFG_CHARGESTORE_ENABLE
|
||||
#undef CONFIG_TWS_CHANNEL_SELECT
|
||||
#define CONFIG_TWS_CHANNEL_SELECT CONFIG_TWS_SECECT_BY_CHARGESTORE //充电仓区分左右
|
||||
#endif //TCFG_CHARGESTORE_ENABLE
|
||||
|
||||
#if TCFG_TEST_BOX_ENABLE && (!TCFG_CHARGESTORE_ENABLE)
|
||||
#define CONFIG_TWS_SECECT_CHARGESTORE_PRIO 1 //测试盒配置左右耳优先
|
||||
#else
|
||||
#define CONFIG_TWS_SECECT_CHARGESTORE_PRIO 0
|
||||
#endif //TCFG_TEST_BOX_ENABLE
|
||||
|
||||
//*********************************************************************************//
|
||||
// 对耳电量显示方式 //
|
||||
//*********************************************************************************//
|
||||
|
||||
#if BT_SUPPORT_DISPLAY_BAT
|
||||
#define CONFIG_DISPLAY_TWS_BAT_LOWER 1 //对耳手机端电量显示,显示低电量耳机的电量
|
||||
#define CONFIG_DISPLAY_TWS_BAT_HIGHER 2 //对耳手机端电量显示,显示高电量耳机的电量
|
||||
#define CONFIG_DISPLAY_TWS_BAT_LEFT 3 //对耳手机端电量显示,显示左耳的电量
|
||||
#define CONFIG_DISPLAY_TWS_BAT_RIGHT 4 //对耳手机端电量显示,显示右耳的电量
|
||||
|
||||
#define CONFIG_DISPLAY_TWS_BAT_TYPE CONFIG_DISPLAY_TWS_BAT_LOWER
|
||||
#endif //BT_SUPPORT_DISPLAY_BAT
|
||||
|
||||
#define CONFIG_DISPLAY_DETAIL_BAT 0 //BLE广播显示具体的电量
|
||||
#define CONFIG_NO_DISPLAY_BUTTON_ICON 1 //BLE广播不显示按键界面,智能充电仓置1
|
||||
|
||||
#endif //TCFG_USER_TWS_ENABLE
|
||||
|
||||
#ifndef CONFIG_BT_RX_BUFF_SIZE
|
||||
#define CONFIG_BT_RX_BUFF_SIZE (14 * 1024)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_APP_BT_ENABLE
|
||||
#if TCFG_BT_SUPPORT_AAC || TCFG_BT_SUPPORT_LDAC
|
||||
#define CONFIG_BT_TX_BUFF_SIZE (5 * 1024)
|
||||
#else
|
||||
#define CONFIG_BT_TX_BUFF_SIZE (4 * 1024)
|
||||
#endif
|
||||
#else
|
||||
#if TCFG_BT_SUPPORT_AAC || TCFG_BT_SUPPORT_LDAC
|
||||
#define CONFIG_BT_TX_BUFF_SIZE (4 * 1024)
|
||||
#else
|
||||
#define CONFIG_BT_TX_BUFF_SIZE (3 * 1024)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef CONFIG_NEW_BREDR_ENABLE
|
||||
|
||||
#if TCFG_USER_TWS_ENABLE
|
||||
|
||||
#ifdef CONFIG_LOCAL_TWS_ENABLE
|
||||
#define CONFIG_TWS_BULK_POOL_SIZE (4 * 1024)
|
||||
#else
|
||||
#define CONFIG_TWS_BULK_POOL_SIZE (2 * 1024)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#if (CONFIG_BT_MODE != BT_NORMAL)
|
||||
////bqb 如果测试3M tx buf 最好加大一点
|
||||
#undef CONFIG_BT_TX_BUFF_SIZE
|
||||
#define CONFIG_BT_TX_BUFF_SIZE (6 * 1024)
|
||||
|
||||
#endif
|
||||
|
||||
//*********************************************************************************//
|
||||
// 电源切换配置 //
|
||||
//*********************************************************************************//
|
||||
|
||||
#define PHONE_CALL_USE_LDO15 CONFIG_PHONE_CALL_USE_LDO15
|
||||
|
||||
//*********************************************************************************//
|
||||
// 时钟切换配置 //
|
||||
//*********************************************************************************//
|
||||
#define BT_NORMAL_HZ CONFIG_BT_NORMAL_HZ
|
||||
#define BT_CONNECT_HZ CONFIG_BT_CONNECT_HZ
|
||||
|
||||
#define BT_A2DP_HZ CONFIG_BT_A2DP_HZ
|
||||
|
||||
#define BT_CALL_HZ CONFIG_BT_CALL_HZ
|
||||
#define BT_CALL_ADVANCE_HZ CONFIG_BT_CALL_ADVANCE_HZ
|
||||
#define BT_CALL_16k_HZ CONFIG_BT_CALL_16k_HZ
|
||||
#define BT_CALL_16k_ADVANCE_HZ CONFIG_BT_CALL_16k_ADVANCE_HZ
|
||||
|
||||
|
||||
#define MUSIC_DEC_FASTEST_CLOCK CONFIG_MUSIC_DEC_FASTEST_CLOCK
|
||||
#define MUSIC_DEC_FAST_CLOCK CONFIG_MUSIC_DEC_FAST_CLOCK
|
||||
#define MUSIC_DEC_CLOCK CONFIG_MUSIC_DEC_CLOCK
|
||||
#define MUSIC_DEC_IDLE_CLOCK CONFIG_MUSIC_IDLE_CLOCK
|
||||
#define MUSIC_FSCAN_CLOCK CONFIG_MUSIC_FSCAN_CLOCK
|
||||
#define LINEIN_CLOCK CONFIG_LINEIN_CLOCK
|
||||
#define FM_CLOCK CONFIG_FM_CLOCK
|
||||
#define FM_EMITTER_CLOCK CONFIG_FM_EMITTER_CLOCK
|
||||
#define PC_CLOCK CONFIG_PC_CLOCK
|
||||
#define RECODRD_CLOCK CONFIG_RECORD_CLOCK
|
||||
#define SPDIF_CLOCK CONFIG_SPDIF_CLOCK
|
||||
|
||||
////////////////////////
|
||||
#if TCFG_BT_SUPPORT_AAC || TCFG_BT_SUPPORT_LDAC
|
||||
#define BT_A2DP_STEREO_EQ_HZ 48 * 1000000L
|
||||
#else
|
||||
#define BT_A2DP_STEREO_EQ_HZ 32 * 1000000L
|
||||
#endif
|
||||
#define BT_A2DP_AAC_HZ 48 * 1000000L
|
||||
#define BT_A2DP_TWS_AAC_HZ 64 * 1000000L
|
||||
#define BT_A2DP_MONO_EQ_HZ 32 * 1000000L
|
||||
#define BT_A2DP_ONLINE_EQ_HZ 48 * 1000000L
|
||||
|
||||
#define BT_CALL_SIMPLEX_HZ 96 * 1000000L
|
||||
#ifdef CONFIG_ANS_V2
|
||||
//#define BT_CALL_16k_HZ 96 * 1000000L
|
||||
//#define BT_CALL_16k_ADVANCE_HZ 120 * 1000000L
|
||||
#else
|
||||
//#define BT_CALL_16k_HZ 80 * 1000000L
|
||||
//#define BT_CALL_16k_ADVANCE_HZ 96 * 1000000L
|
||||
#endif
|
||||
#define BT_CALL_16k_SIMPLEX_HZ 120 * 1000000L
|
||||
////////////////////////
|
||||
|
||||
#ifdef CONFIG_FPGA_ENABLE
|
||||
|
||||
// #undef TCFG_CLOCK_OSC_HZ
|
||||
// #define TCFG_CLOCK_OSC_HZ 12000000
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CONFIG_CPU_BR26
|
||||
#undef BT_CALL_16k_HZ
|
||||
#undef BT_CALL_16k_ADVANCE_HZ
|
||||
#define BT_CALL_16k_HZ 96 * 1000000L
|
||||
#define BT_CALL_16k_ADVANCE_HZ 96 * 1000000L
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_BR23
|
||||
#undef BT_A2DP_STEREO_EQ_HZ
|
||||
#define BT_A2DP_STEREO_EQ_HZ 48 * 1000000L
|
||||
#undef BT_A2DP_MONO_EQ_HZ
|
||||
#define BT_A2DP_MONO_EQ_HZ 48 * 1000000L
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CPU_BR25
|
||||
#undef BT_A2DP_STEREO_EQ_HZ
|
||||
#define BT_A2DP_STEREO_EQ_HZ 48 * 1000000L
|
||||
#undef BT_A2DP_MONO_EQ_HZ
|
||||
#define BT_A2DP_MONO_EQ_HZ 48 * 1000000L
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FPGA_ENABLE
|
||||
|
||||
// #undef TCFG_CLOCK_OSC_HZ
|
||||
// #define TCFG_CLOCK_OSC_HZ 12000000
|
||||
|
||||
#undef TCFG_MC_BIAS_AUTO_ADJUST
|
||||
#define TCFG_MC_BIAS_AUTO_ADJUST MC_BIAS_ADJUST_DISABLE
|
||||
|
||||
#endif
|
||||
//*********************************************************************************//
|
||||
// 低功耗配置 //
|
||||
//*********************************************************************************//
|
||||
#if TCFG_IRKEY_ENABLE
|
||||
#undef TCFG_LOWPOWER_LOWPOWER_SEL
|
||||
#define TCFG_LOWPOWER_LOWPOWER_SEL 0 //开红外不进入低功耗
|
||||
#endif /* #if TCFG_IRKEY_ENABLE */
|
||||
|
||||
//*********************************************************************************//
|
||||
// LED使用 16SLOT TIMER 同步 //
|
||||
//*********************************************************************************//
|
||||
//LED模块使用slot timer同步使用注意点:
|
||||
// 1.soundbox不开该功能, 原因: 默认打开osc时钟, 使用原来的osc流程同步即可
|
||||
// 2.带sd卡earphone不开该功能, 一般为单耳, 不需要同步, 使用原来的流程(lrc)
|
||||
// 3.一般用在tws应用中, 而且默认关闭osc;
|
||||
#if TCFG_USER_TWS_ENABLE
|
||||
#define TCFG_PWMLED_USE_SLOT_TIME ENABLE_THIS_MOUDLE
|
||||
#endif
|
||||
|
||||
//*********************************************************************************//
|
||||
// 升级配置 //
|
||||
//*********************************************************************************//
|
||||
//升级LED显示使能
|
||||
#define UPDATE_LED_REMIND
|
||||
//升级提示音使能
|
||||
#define UPDATE_VOICE_REMIND
|
||||
|
||||
#ifndef CONFIG_UPDATE_JUMP_TO_MASK
|
||||
#define CONFIG_UPDATE_JUMP_TO_MASK 0
|
||||
#endif
|
||||
|
||||
#if CONFIG_UPDATE_JUMP_TO_MASK
|
||||
//升级IO保持使能
|
||||
#define DEV_UPDATE_SUPPORT_JUMP //目前只有br23\br25支持
|
||||
#endif
|
||||
|
||||
|
||||
#if TCFG_APP_MUSIC_EN
|
||||
#define CONFIG_SD_UPDATE_ENABLE
|
||||
#define CONFIG_USB_UPDATE_ENABLE
|
||||
#endif
|
||||
//*********************************************************************************//
|
||||
// Audio配置 //
|
||||
//*********************************************************************************//
|
||||
|
||||
#if TCFG_AUDIO_ANC_ENABLE
|
||||
#if ((defined VOL_TYPE_ANALOG) && (SYS_VOL_TYPE == VOL_TYPE_ANALOG)) || \
|
||||
((defined VOL_TYPE_AD) && (SYS_VOL_TYPE == VOL_TYPE_AD))
|
||||
#error "ANC can not use VOL_TYPE_ANALOG and VOL_TYPE_AD!!!"
|
||||
#endif/*(SYS_VOL_TYPE = VOL_TYPE_ANALOG) || (SYS_VOL_TYPE = VOL_TYPE_AD)*/
|
||||
#endif/*TCFG_AUDIO_ANC_ENABLE*/
|
||||
|
||||
/*通话语音处理算法放在.data段*/
|
||||
#ifndef TCFG_AUDIO_CVP_CODE_AT_RAM
|
||||
#define TCFG_AUDIO_CVP_CODE_AT_RAM 1
|
||||
#endif/*TCFG_AUDIO_CVP_CODE_AT_RAM*/
|
||||
|
||||
/*AAC解码算法放在.data段*/
|
||||
#ifndef TCFG_AUDIO_AAC_CODE_AT_RAM
|
||||
#define TCFG_AUDIO_AAC_CODE_AT_RAM 1
|
||||
#endif/*TCFG_AUDIO_AAC_CODE_AT_RAM*/
|
||||
|
||||
#if (TCFG_AUDIO_DUAL_MIC_ENABLE && TCFG_AUDIO_TRIPLE_MIC_ENABLE)
|
||||
#error "TCFG_AUDIO_DUAL_MIC_ENABLE and TCFG_AUDIO_TRIPLE_MIC_ENABLE can not enable together !!!"
|
||||
#endif
|
||||
|
||||
//*********************************************************************************//
|
||||
// 充电中按键清除手机配对信息配置 //
|
||||
//*********************************************************************************//
|
||||
|
||||
#define CHARGING_CLEAN_PHONE_INFO 0
|
||||
|
||||
|
||||
#define PC_MODE_DETECTION
|
||||
|
||||
#endif
|
||||
90
apps/xtell_hide/include/app_main.h
Normal file
90
apps/xtell_hide/include/app_main.h
Normal file
@ -0,0 +1,90 @@
|
||||
#ifndef APP_MAIN_H
|
||||
#define APP_MAIN_H
|
||||
|
||||
typedef struct {
|
||||
float talk;
|
||||
float ff;
|
||||
float fb;
|
||||
} audio_mic_cmp_t;
|
||||
|
||||
typedef struct _APP_VAR {
|
||||
s8 bt_volume;
|
||||
s8 dev_volume;
|
||||
s8 music_volume;
|
||||
s8 call_volume;
|
||||
s8 wtone_volume;
|
||||
u8 opid_play_vol_sync;
|
||||
u8 aec_dac_gain;
|
||||
u8 aec_mic_gain;
|
||||
u8 aec_mic1_gain;
|
||||
u8 aec_mic2_gain;
|
||||
u8 aec_mic3_gain;
|
||||
u8 rf_power;
|
||||
u8 goto_poweroff_flag;
|
||||
u8 goto_poweroff_cnt;
|
||||
u8 play_poweron_tone;
|
||||
u8 remote_dev_company;
|
||||
u8 siri_stu;
|
||||
u8 cycle_mode;
|
||||
u8 have_mass_storage;
|
||||
int auto_stop_page_scan_timer; //用于1拖2时,有一台连接上后,超过三分钟自动关闭Page Scan
|
||||
volatile int auto_shut_down_timer;
|
||||
volatile int wait_exit_timer;
|
||||
u16 auto_off_time;
|
||||
u16 warning_tone_v;
|
||||
u16 poweroff_tone_v;
|
||||
u16 phone_dly_discon_time;
|
||||
u8 usb_mic_gain;
|
||||
int wait_timer_do;
|
||||
u32 start_time;
|
||||
float audio_mic_array_diff_cmp;//麦克风阵列补偿值
|
||||
u8 audio_mic_array_trim_en; //麦克风阵列校准
|
||||
audio_mic_cmp_t audio_mic_cmp;
|
||||
float enc_degradation;//default:1,range[0:1]
|
||||
/*3麦通话配置使用:选择第几个mic*/
|
||||
u8 talk_mic_ch; //主MIC通道选择
|
||||
u8 talk_ref_mic_ch; //副MIC通道选择
|
||||
u8 talk_fb_mic_ch; //FB通道选择
|
||||
} APP_VAR;
|
||||
|
||||
typedef struct _BT_USER_PRIV_VAR {
|
||||
//phone
|
||||
u8 phone_ring_flag: 1;
|
||||
u8 phone_num_flag: 1;
|
||||
u8 phone_income_flag: 1;
|
||||
u8 phone_call_dec_begin: 1;
|
||||
u8 phone_con_sync_num_ring: 1;
|
||||
u8 phone_con_sync_ring: 1;
|
||||
// u8 reserved: 2;
|
||||
u8 emitter_or_receiver: 2;
|
||||
u8 get_phone_num_timecnt;
|
||||
|
||||
u8 inband_ringtone;
|
||||
u8 phone_vol;
|
||||
u16 phone_timer_id;
|
||||
u8 last_call_type;
|
||||
u8 income_phone_num[30];
|
||||
u8 income_phone_len;
|
||||
s32 auto_connection_counter;
|
||||
int auto_connection_timer;
|
||||
u8 auto_connection_addr[6];
|
||||
int tws_con_timer;
|
||||
u8 tws_start_con_cnt;
|
||||
u8 tws_conn_state;
|
||||
bool search_tws_ing;
|
||||
int sniff_timer;
|
||||
bool fast_test_mode;
|
||||
} BT_USER_PRIV_VAR;
|
||||
|
||||
#define BT_EMITTER_EN 1
|
||||
#define BT_RECEIVER_EN 2
|
||||
|
||||
typedef struct _BT_USER_COMM_VAR {
|
||||
} BT_USER_COMM_VAR;
|
||||
|
||||
extern APP_VAR app_var;
|
||||
extern BT_USER_PRIV_VAR bt_user_priv_var;
|
||||
|
||||
#define earphone (&bt_user_priv_var)
|
||||
|
||||
#endif
|
||||
8
apps/xtell_hide/include/app_music.h
Normal file
8
apps/xtell_hide/include/app_music.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef CONFIG_APP_MUSIC_H
|
||||
#define CONFIG_APP_MUSIC_H
|
||||
|
||||
void app_music_exit();
|
||||
int music_app_check(void);
|
||||
|
||||
#endif
|
||||
|
||||
13
apps/xtell_hide/include/app_online_cfg.h
Normal file
13
apps/xtell_hide/include/app_online_cfg.h
Normal file
@ -0,0 +1,13 @@
|
||||
#ifndef ONLINE_CONFIG_H
|
||||
#define ONLINE_CONFIG_H
|
||||
|
||||
#define DEVICE_EVENT_FROM_CI_UART (('C' << 24) | ('I' << 16) | ('U' << 8) | '\0')
|
||||
#define DEVICE_EVENT_FROM_CI_TWS (('C' << 24) | ('I' << 16) | ('T' << 8) | '\0')
|
||||
|
||||
#define CI_UART 0
|
||||
#define CI_TWS 1
|
||||
|
||||
void ci_data_rx_handler(u8 type);
|
||||
u32 eq_cfg_sync(u8 priority);
|
||||
#endif
|
||||
|
||||
39
apps/xtell_hide/include/app_power_manage.h
Normal file
39
apps/xtell_hide/include/app_power_manage.h
Normal file
@ -0,0 +1,39 @@
|
||||
#ifndef APP_POWER_MANAGE_H
|
||||
#define APP_POWER_MANAGE_H
|
||||
|
||||
#include "typedef.h"
|
||||
#include "system/event.h"
|
||||
|
||||
#define LOW_POWER_SHUTDOWN 300 //低电直接关机电压-拔出不开机-开盖不开机
|
||||
#define LOW_POWER_OFF_VAL 330 //低电关机电压
|
||||
#define LOW_POWER_WARN_VAL 340 //低电提醒电压
|
||||
#define LOW_POWER_WARN_TIME (60 * 1000) //低电提醒时间
|
||||
|
||||
#define DEVICE_EVENT_FROM_POWER (('P' << 24) | ('O' << 16) | ('W' << 8) | '\0')
|
||||
|
||||
enum {
|
||||
POWER_EVENT_POWER_NORMAL,
|
||||
POWER_EVENT_POWER_WARNING,
|
||||
POWER_EVENT_POWER_LOW,
|
||||
POWER_EVENT_POWER_CHANGE,
|
||||
POWER_EVENT_SYNC_TWS_VBAT_LEVEL,
|
||||
POWER_EVENT_POWER_CHARGE,
|
||||
};
|
||||
|
||||
int app_power_event_handler(struct device_event *dev);
|
||||
void check_power_on_voltage(void);
|
||||
u16 get_vbat_level(void);
|
||||
u8 get_vbat_percent(void);
|
||||
void vbat_check_init(void);
|
||||
void vbat_timer_update(u32 msec);
|
||||
void vbat_timer_delete(void);
|
||||
void tws_sync_bat_level(void);
|
||||
u8 get_tws_sibling_bat_level(void);
|
||||
u8 get_tws_sibling_bat_persent(void);
|
||||
bool get_vbat_need_shutdown(void);
|
||||
u8 get_self_battery_level(void);
|
||||
|
||||
void app_power_set_tws_sibling_bat_level(u8 vbat, u8 percent);
|
||||
|
||||
#endif
|
||||
|
||||
6
apps/xtell_hide/include/app_sd_music.h
Normal file
6
apps/xtell_hide/include/app_sd_music.h
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef CONFIG_APP_SD_MUSIC_H
|
||||
#define CONFIG_APP_SD_MUSIC_H
|
||||
|
||||
int music_app_check(void);//music 在线检测 切换模式判断使用
|
||||
|
||||
#endif
|
||||
31
apps/xtell_hide/include/app_task.h
Normal file
31
apps/xtell_hide/include/app_task.h
Normal file
@ -0,0 +1,31 @@
|
||||
#ifndef APP_TASK_H
|
||||
#define APP_TASK_H
|
||||
|
||||
#include "typedef.h"
|
||||
#define NULL_VALUE 0
|
||||
|
||||
enum {
|
||||
APP_BT_TASK,
|
||||
#if TCFG_APP_MUSIC_EN
|
||||
APP_MUSIC_TASK,
|
||||
#endif
|
||||
#if TCFG_PC_ENABLE
|
||||
APP_PC_TASK,
|
||||
#endif
|
||||
#if TCFG_APP_AUX_EN
|
||||
APP_AUX_TASK,
|
||||
#endif
|
||||
};
|
||||
|
||||
extern u8 app_curr_task;
|
||||
extern u8 app_next_task;
|
||||
extern u8 app_prev_task;
|
||||
|
||||
int app_task_switch_check(u8 app_task);
|
||||
int app_core_back_to_prev_app_over_check(void);
|
||||
int app_task_switch_to(u8 app_task, int priv);
|
||||
void app_task_switch_next(void);
|
||||
void app_task_switch_prev(void);
|
||||
u8 app_get_curr_task(void);
|
||||
|
||||
#endif
|
||||
18
apps/xtell_hide/include/app_testbox.h
Normal file
18
apps/xtell_hide/include/app_testbox.h
Normal file
@ -0,0 +1,18 @@
|
||||
#ifndef _APP_TESTBOX_H_
|
||||
#define _APP_TESTBOX_H_
|
||||
|
||||
#include "typedef.h"
|
||||
#include "system/event.h"
|
||||
|
||||
extern void testbox_set_bt_init_ok(u8 flag);
|
||||
extern u8 testbox_get_status(void);
|
||||
extern void testbox_clear_status(void);
|
||||
extern u8 testbox_get_ex_enter_dut_flag(void);
|
||||
extern u8 testbox_get_ex_enter_storage_mode_flag(void);
|
||||
extern u8 testbox_get_connect_status(void);
|
||||
extern void testbox_clear_connect_status(void);
|
||||
extern u8 testbox_get_keep_tws_conn_flag(void);
|
||||
extern int app_testbox_event_handler(struct testbox_event *testbox_dev);
|
||||
|
||||
|
||||
#endif //_APP_TESTBOX_H_
|
||||
50
apps/xtell_hide/include/app_umidigi_chargestore.h
Normal file
50
apps/xtell_hide/include/app_umidigi_chargestore.h
Normal file
@ -0,0 +1,50 @@
|
||||
#ifndef _APP_UMIDIGI_CHARGESTORE_H_
|
||||
#define _APP_UMIDIGI_CHARGESTORE_H_
|
||||
|
||||
#include "typedef.h"
|
||||
#include "system/event.h"
|
||||
#include "board_config.h"
|
||||
|
||||
/*******************************UMIDIGI充电舱数据包格式*****************************/
|
||||
/*
|
||||
* |<--1bit-->||<-------4bits----->||<--------------8bits------------>||<--1bit-->||<--1bits-->|
|
||||
* |<-start-->||<-------CMD------->||<--------------DATA------------->|| crc_odd ||<--stop--->|
|
||||
* | 14 || 13 | 12 | 11 | 10 || 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 || 1 || 0 |
|
||||
*/
|
||||
|
||||
/*充电舱发送的命令列表*/
|
||||
#define CMD_RESERVED_0 0x00 //reserved
|
||||
#define CMD_FACTORY_RESET 0x01 //恢复出厂设置
|
||||
#define CMD_RESERVED_2 0x02 //reserved
|
||||
#define CMD_OPEN_CASE 0x03 //充电舱开盖
|
||||
#define CMD_CLOSE_CASE 0x04 //充电舱关盖
|
||||
#define CMD_ENTER_PAIRING_MODE 0x06 //进入配对模式
|
||||
#define CMD_DUT_MODE_CMD 0x08 //进入DUT模式
|
||||
#define CMD_USB_STATE 0x0A //USB状态
|
||||
#define CMD_RESERVED_B 0x0B //reserved(RTK internal use)
|
||||
#define CMD_SEND_CASE_BATTERY 0x0D //发送充电舱电量
|
||||
|
||||
/*message中的CMD与DATA位置,用于从一个完整的数据包中截取CMD和DATA*/
|
||||
/*CMD_IN_MESSAGE = 0xf000*/
|
||||
#define CMD_IN_MESSAGE (BIT(13) | BIT(12) | BIT(11) | BIT(10))
|
||||
/*DATA_IN_MESSAGE = 0x0ff0*/
|
||||
#define DATA_IN_MESSAGE (BIT(9) | BIT(8) | BIT(7) | BIT(6) | BIT(5) | BIT(4) | BIT(3) | BIT(2))
|
||||
|
||||
void app_umidigi_chargetore_message_deal(u16 message);
|
||||
|
||||
extern u8 umidigi_chargestore_get_power_level(void); //获取充电舱电池电量
|
||||
extern u8 umidigi_chargestore_get_power_status(void); //获取充电舱充电状态
|
||||
extern u8 umidigi_chargestore_get_cover_status(void); //获取充电舱合盖或开盖状态
|
||||
extern u8 umidigi_chargestore_get_earphone_online(void); //获取合盖状态时耳机在仓数量
|
||||
extern void umidigi_chargestore_set_bt_init_ok(u8 flag); //获取蓝牙初始化成功标志位
|
||||
extern u8 umidigi_chargestore_check_going_to_poweroff(void); //获取允许poweroff标志位
|
||||
extern void umidigi_chargestore_set_phone_disconnect(void);
|
||||
extern void umidigi_chargestore_set_phone_connect(void);
|
||||
extern void umidigi_chargestore_set_sibling_chg_lev(u8 chg_lev);//设置对耳同步的充电舱电量
|
||||
extern void umidigi_chargestore_set_power_level(u8 power); //设置充电舱电池电量
|
||||
extern int umidigi_chargestore_sync_chg_level(void);
|
||||
|
||||
extern int app_umidigi_chargestore_event_handler(struct umidigi_chargestore_event *umidigi_chargestore_dev);
|
||||
|
||||
#endif
|
||||
|
||||
69
apps/xtell_hide/include/audio_enc_mpt_self.h
Normal file
69
apps/xtell_hide/include/audio_enc_mpt_self.h
Normal file
@ -0,0 +1,69 @@
|
||||
|
||||
#ifndef __AUDIO_ENC_MPT_FRE_RESPONE_H_
|
||||
#define __AUDIO_ENC_MPT_FRE_RESPONE_H_
|
||||
|
||||
#include "asm/cpu.h"
|
||||
|
||||
/********************用户配置****************************/
|
||||
|
||||
//计算长度 输入单位s16/输出单位float
|
||||
#define AUDIO_ENC_MPT_FRERES_POINT 1024
|
||||
|
||||
/********************非用户配置****************************/
|
||||
|
||||
//MIC频响测试通道ID u16
|
||||
#define AUDIO_ENC_MPT_FF_MIC 0X01 //测试TWS FFMIC or 头戴式LFF MIC
|
||||
#define AUDIO_ENC_MPT_FB_MIC 0X02 //测试TWS FBMIC or 头戴式LFB MIC
|
||||
#define AUDIO_ENC_MPT_RFF_MIC 0X04 //测试头戴式RFF MIC
|
||||
#define AUDIO_ENC_MPT_RFB_MIC 0X08 //测试头戴式RFB MIC
|
||||
#define AUDIO_ENC_MPT_CVP_OUT 0X10 //测试通话算法输出
|
||||
#define AUDIO_ENC_MPT_TALK_MIC 0X20 //测试通话TALK 主MIC
|
||||
#define AUDIO_ENC_MPT_SLAVE_MIC 0X40 //测试通话TALK 副MIC
|
||||
#define AUDIO_ENC_MPT_TALK_FB_MIC 0X80 //测试通话TALK FBMIC
|
||||
|
||||
//常见通道组合
|
||||
//FF+TALK+算法输出频响测试,默认关闭DNS, 外部喇叭发声
|
||||
#define AUDIO_ENC_MPT_CH_TWS_CVP_ENC (AUDIO_ENC_MPT_SLAVE_MIC | AUDIO_ENC_MPT_TALK_MIC | AUDIO_ENC_MPT_CVP_OUT)
|
||||
|
||||
//FF回声/气密性+FB频响测试,耳机喇叭发声
|
||||
#define AUDIO_ENC_MPT_CH_TWS_FF_FB (AUDIO_ENC_MPT_FF_MIC | AUDIO_ENC_MPT_FB_MIC)
|
||||
|
||||
|
||||
#define AUDIO_ENC_MPT_FRERES_ASYNC 1 //是否异步处理, 异步算不过来要加时钟提醒
|
||||
|
||||
enum {
|
||||
ENC_FRE_RES_STATE_START = 0,
|
||||
ENC_FRE_RES_STATE_RUN,
|
||||
ENC_FRE_RES_STATE_STOP,
|
||||
};
|
||||
|
||||
enum {
|
||||
ENC_FRE_RESPONE_MSG_RUN = 0xA1,
|
||||
};
|
||||
|
||||
//更新目标通道输入buf、len
|
||||
void audio_enc_mpt_fre_response_inbuf(u16 id, s16 *buf, int len);
|
||||
|
||||
//音频测试频响计算运行
|
||||
void audio_enc_mpt_fre_response_post_run(u16 id);
|
||||
|
||||
//音频测试频响计算启动, ch 对应目标的通道
|
||||
void audio_enc_mpt_fre_response_start(u16 ch);
|
||||
|
||||
//音频测试频响计算停止
|
||||
void audio_enc_mpt_fre_response_stop(void);
|
||||
|
||||
//工具获取数据文件
|
||||
int audio_enc_mpt_fre_response_file_get(u8 **buf);
|
||||
|
||||
//数据获取结束,释放内存
|
||||
void audio_enc_mpt_fre_response_release(void);
|
||||
|
||||
//音频测试MIC频响开启, ch 对应目标的通道
|
||||
void audio_enc_mpt_fre_response_open(u16 ch);
|
||||
|
||||
//音频测试MIC频响关闭
|
||||
void audio_enc_mpt_fre_response_close(void);
|
||||
|
||||
#endif /*__AUDIO_ENC_MPT_FRE_RESPONE_H_*/
|
||||
|
||||
43
apps/xtell_hide/include/bt_background.h
Normal file
43
apps/xtell_hide/include/bt_background.h
Normal file
@ -0,0 +1,43 @@
|
||||
#ifndef BT_BACKGROUND_H
|
||||
#define BT_BACKGROUND_H
|
||||
|
||||
|
||||
#include "generic/typedef.h"
|
||||
|
||||
bool bt_in_background();
|
||||
|
||||
|
||||
void bt_switch_to_foreground(int action, bool exit_curr_app);
|
||||
|
||||
|
||||
int bt_switch_to_background();
|
||||
|
||||
|
||||
void bt_stop_a2dp_slience_detect();
|
||||
|
||||
|
||||
void bt_start_a2dp_slience_detect(int ingore_packet_num);
|
||||
|
||||
|
||||
int bt_background_event_probe_handler(struct bt_event *bt);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
48
apps/xtell_hide/include/bt_ble.h
Normal file
48
apps/xtell_hide/include/bt_ble.h
Normal file
@ -0,0 +1,48 @@
|
||||
#ifndef APP_BT_BLE_H
|
||||
#define APP_BT_BLE_H
|
||||
|
||||
#include "typedef.h"
|
||||
|
||||
// #define ADV_RSP_PACKET_MAX 31
|
||||
#define ADV_RAND_MAX 7
|
||||
|
||||
// typedef struct {
|
||||
// u16 pid; //厂家id,默认用杰理的id (0x5d6)
|
||||
// u8 private_data[17];//厂家自定义数据内容
|
||||
|
||||
// } manufacturer_data_t;
|
||||
|
||||
enum {
|
||||
ICON_TYPE_INQUIRY = 0,
|
||||
ICON_TYPE_CONNECTED,
|
||||
ICON_TYPE_RECONNECT,
|
||||
ICON_TYPE_PRE_DEV,
|
||||
};
|
||||
|
||||
|
||||
enum {
|
||||
ADV_ST_NULL,
|
||||
ADV_ST_PRE1,
|
||||
ADV_ST_PRE2,
|
||||
ADV_ST_INQUIRY,
|
||||
ADV_ST_CONN,
|
||||
ADV_ST_RECONN,
|
||||
ADV_ST_DISMISS,
|
||||
ADV_ST_FAST_DISMISS,
|
||||
ADV_ST_END,
|
||||
};
|
||||
|
||||
extern void bt_ble_icon_set(u8 *info, u8 len);
|
||||
extern u8 bt_ble_get_adv_enable(void);
|
||||
extern void bt_ble_icon_open(u8 type);
|
||||
extern void bt_ble_icon_close(u8 dismiss_flag);
|
||||
extern void bt_ble_icon_set_comm_address(u8 *addr);
|
||||
extern void bt_ble_icon_reset(void);
|
||||
extern void bt_ble_set_control_en(u8 en);
|
||||
extern void bt_ble_icon_slave_en(u8 en);
|
||||
extern u8 bt_ble_icon_get_adv_state(void);
|
||||
extern void bt_ble_icon_role_switch(u8 role);
|
||||
extern void bt_ble_icon_state_sniff(u8 state);
|
||||
|
||||
#endif
|
||||
|
||||
26
apps/xtell_hide/include/bt_emitter.h
Normal file
26
apps/xtell_hide/include/bt_emitter.h
Normal file
@ -0,0 +1,26 @@
|
||||
#ifndef _BT_EMITTER_H
|
||||
#define _BT_EMITTER_H
|
||||
|
||||
|
||||
extern void bt_search_device(void);
|
||||
extern void emitter_search_noname(u8 status, u8 *addr, u8 *name);
|
||||
extern u8 bt_emitter_stu_set(u8 *addr, u8 on);
|
||||
extern u8 bt_emitter_stu_get(void);
|
||||
extern int bt_emitter_mic_open(void);
|
||||
extern void bt_emitter_mic_close(void);
|
||||
extern int bt_emitter_iis_open(void);
|
||||
extern void bt_emitter_iis_close(void);
|
||||
extern void emitter_media_source(u8 *addr, u8 source, u8 en);
|
||||
extern u8 emitter_search_result(char *name, u8 name_len, u8 *addr, u32 dev_class, char rssi);
|
||||
extern void emitter_search_stop(u8 result);
|
||||
extern void emitter_media_source(u8 *addr, u8 source, u8 en);
|
||||
extern void bt_emitter_receiver_sw();
|
||||
extern u8 bt_emitter_pp(u8 pp);
|
||||
extern void emitter_or_receiver_switch(u8 flag);
|
||||
extern u8 bt_emitter_role_get();
|
||||
extern void bt_emitter_start_search_device();
|
||||
extern void bt_emitter_stop_search_device();
|
||||
extern void emitter_open(u8 source);
|
||||
extern void emitter_close(u8 source);
|
||||
|
||||
#endif
|
||||
194
apps/xtell_hide/include/bt_tws.h
Normal file
194
apps/xtell_hide/include/bt_tws.h
Normal file
@ -0,0 +1,194 @@
|
||||
#ifndef APP_BT_TWS_H
|
||||
#define APP_BT_TWS_H
|
||||
|
||||
#include "classic/tws_api.h"
|
||||
#include "classic/tws_event.h"
|
||||
#include "system/includes.h"
|
||||
|
||||
#define TWS_FUNC_ID_VOL_SYNC TWS_FUNC_ID('V', 'O', 'L', 'S')
|
||||
#define TWS_FUNC_ID_VBAT_SYNC TWS_FUNC_ID('V', 'B', 'A', 'T')
|
||||
#define TWS_FUNC_ID_CHARGE_SYNC TWS_FUNC_ID('C', 'H', 'G', 'S')
|
||||
#define TWS_FUNC_ID_BOX_SYNC TWS_FUNC_ID('B', 'O', 'X', 'S')
|
||||
#define TWS_FUNC_ID_AI_DMA_RAND TWS_FUNC_ID('A', 'I', 'D', 'M')
|
||||
#define TWS_FUNC_ID_AI_SPEECH_STOP TWS_FUNC_ID('A', 'I', 'S', 'T')
|
||||
#define TWS_FUNC_ID_APP_MODE TWS_FUNC_ID('M', 'O', 'D', 'E')
|
||||
#define TWS_FUNC_ID_AI_SYNC TWS_FUNC_ID('A', 'I', 'P', 'A')
|
||||
#define TWS_FUNC_ID_EAR_DETECT_SYNC TWS_FUNC_ID('E', 'D', 'E', 'T')
|
||||
#define TWS_FUNC_ID_LL_SYNC_STATE TWS_FUNC_ID('L', 'L', 'S', 'S')
|
||||
#define TWS_FUNC_ID_TUYA_STATE TWS_FUNC_ID('T', 'U', 'Y', 'A')
|
||||
|
||||
enum {
|
||||
DEBUG_LINK_PAGE_STATE = 0,
|
||||
DEBUG_LINK_INQUIRY_STATE,
|
||||
DEBUG_LINK_PAGE_SCAN_STATE,
|
||||
DEBUG_LINK_INQUIRY_SCAN_STATE,
|
||||
DEBUG_LINK_CONNECTION_STATE,
|
||||
DEBUG_LINK_PAGE_TWS_STATE,
|
||||
DEBUG_LINK_PAGE_SCAN_TWS_STATE,
|
||||
};
|
||||
enum {
|
||||
BT_TWS_STATUS_INIT_OK = 1,
|
||||
BT_TWS_STATUS_SEARCH_START,
|
||||
BT_TWS_STATUS_SEARCH_TIMEOUT,
|
||||
BT_TWS_STATUS_PHONE_CONN,
|
||||
BT_TWS_STATUS_PHONE_DISCONN,
|
||||
};
|
||||
|
||||
enum {
|
||||
SYNC_TONE_TWS_CONNECTED = 1,
|
||||
SYNC_TONE_PHONE_CONNECTED,
|
||||
SYNC_TONE_PHONE_DISCONNECTED,
|
||||
SYNC_TONE_PHONE_NUM,
|
||||
SYNC_TONE_PHONE_RING,
|
||||
SYNC_TONE_PHONE_NUM_RING,
|
||||
SYNC_TONE_MAX_VOL,
|
||||
SYNC_TONE_POWER_OFF,
|
||||
SYNC_TONE_ANC_ON,
|
||||
SYNC_TONE_ANC_OFF,
|
||||
SYNC_TONE_ANC_TRANS,
|
||||
SYNC_TONE_EARDET_IN,
|
||||
SYNC_TONE_VOICE_RECOGNIZE,
|
||||
SYNC_TONE_HEARING_AID_OPEN,
|
||||
SYNC_TONE_DHA_FITTING_CLOSE,
|
||||
SYNC_TONE_ICSD_ADT_SUSPEND,
|
||||
SYNC_TONE_ICSD_ADT_VOICE_STATE,
|
||||
SYNC_TONE_ICSD_ADT_OPEN,
|
||||
};
|
||||
|
||||
enum {
|
||||
SYNC_LED_STA_TWS_CONN,
|
||||
SYNC_LED_STA_PHONE_CONN,
|
||||
SYNC_LED_STA_PHONE_DISCONN,
|
||||
};
|
||||
|
||||
enum {
|
||||
SYNC_CMD_SHUT_DOWN_TIME,
|
||||
SYNC_CMD_POWER_OFF_TOGETHER,
|
||||
SYNC_CMD_LOW_LATENCY_ENABLE,
|
||||
SYNC_CMD_LOW_LATENCY_DISABLE,
|
||||
SYNC_CMD_EARPHONE_CHAREG_START,
|
||||
SYNC_CMD_IRSENSOR_EVENT_NEAR,
|
||||
SYNC_CMD_IRSENSOR_EVENT_FAR,
|
||||
#if(USE_DMA_TONE)
|
||||
SYNC_CMD_CUT_TWS_TONE, //断开对耳提示音
|
||||
SYNC_CMD_START_SPEECH_TONE,//AI键提示音
|
||||
SYNC_CMD_DMA_CONNECTED_ALL_FINISH_TONE, //AI连接成功
|
||||
SYNC_CMD_NEED_BT_TONE, //需要连接蓝牙
|
||||
SYNC_CMD_PLEASE_OPEN_XIAODU_TONE,//请打开小度
|
||||
#endif
|
||||
#if(RCSP_ADV_EN)
|
||||
SYNC_CMD_SYNC_ADV_SETTING,
|
||||
SYNC_CMD_ADV_COMMON_SETTING_SYNC,
|
||||
SYNC_CMD_APP_RESET_LED_UI,
|
||||
SYNC_CMD_MUSIC_INFO,
|
||||
SYNC_CMD_RCSP_AUTH_RES,
|
||||
SYNC_CMD_MUSIC_PLAYER_STATE,
|
||||
SYNC_CMD_MUSIC_PLAYER_TIEM_EN,
|
||||
#endif
|
||||
SYNC_CMD_OPUS_CLOSE,
|
||||
};
|
||||
|
||||
enum {
|
||||
TWS_SYNC_VOL = 0,
|
||||
TWS_SYNC_VBAT,
|
||||
TWS_SYNC_CHG,
|
||||
TWS_SYNC_CALL_VOL,
|
||||
TWS_SYNC_PBG_INFO,
|
||||
TWS_SYNC_ADSP_UART_CMD,
|
||||
TWS_APP_DATA_SEND,
|
||||
TWS_AI_DMA_RAND,
|
||||
TWS_DATA_SEND,
|
||||
|
||||
TWS_UPDATE_START,
|
||||
TWS_UPDATE_RESULT_EXCHANGE,
|
||||
TWS_UPDATE_RESULT_EXCHANGE_RES,
|
||||
TWS_UPDATE_OVER,
|
||||
TWS_UPDATE_OVER_CONFIRM,
|
||||
TWS_UPDATE_OVER_CONFIRM_REQ,
|
||||
TWS_UPDATE_OVER_CONFIRM_RES,
|
||||
TWS_UPDATE_VERIFY,
|
||||
|
||||
TWS_AI_A2DP_DROP_FRAME_CTL,
|
||||
};
|
||||
struct tws_sync_info_t {
|
||||
u8 type;
|
||||
union {
|
||||
s8 volume_lev;
|
||||
u16 vbat_lev;
|
||||
u8 chg_lev;
|
||||
u8 adsp_cmd[2];
|
||||
u8 conn_type;
|
||||
u8 data[9];
|
||||
u8 data_large[32];
|
||||
} u;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct tws_sync_big_info_t {
|
||||
u8 type;
|
||||
u8 sub_type;
|
||||
union {
|
||||
u8 pbg_info[36];
|
||||
} u;
|
||||
};
|
||||
|
||||
|
||||
typedef struct time_stamp_bt_name {
|
||||
u8 bt_name[32];
|
||||
u32 time_stamp;
|
||||
} tws_time_stamp_bt_name;
|
||||
|
||||
|
||||
#define TWS_WAIT_CONN_TIMEOUT (400)
|
||||
|
||||
#define TWS_SYNC_TIME_DO 400
|
||||
// #define TWS_CON_SUPER_TIMEOUT 8000
|
||||
#define TWS_CON_SEARCH_TIMEOUT 0x07//(n*1.28s)
|
||||
|
||||
|
||||
char bt_tws_get_local_channel();
|
||||
|
||||
int bt_tws_connction_status_event_handler(struct bt_event *evt);
|
||||
|
||||
int bt_tws_poweron();
|
||||
|
||||
int bt_tws_poweroff();
|
||||
|
||||
int bt_tws_start_search_sibling();
|
||||
|
||||
void bt_tws_hci_event_connect();
|
||||
|
||||
bool get_tws_phone_connect_state(void);
|
||||
|
||||
int bt_tws_phone_connected();
|
||||
|
||||
void bt_tws_phone_page_timeout();
|
||||
|
||||
void bt_tws_phone_connect_timeout();
|
||||
|
||||
void bt_tws_phone_disconnected();
|
||||
|
||||
int bt_tws_sync_phone_num(void *priv);
|
||||
|
||||
int bt_tws_sync_led_status();
|
||||
|
||||
int get_bt_tws_connect_status();
|
||||
u8 get_bt_tws_discon_dly_state();
|
||||
|
||||
void bt_tws_sync_volume();
|
||||
|
||||
u8 tws_network_audio_was_started(void);
|
||||
|
||||
void tws_network_local_audio_start(void);
|
||||
|
||||
u32 bt_tws_future_slot_time(u32 msecs);
|
||||
|
||||
void bt_tws_play_tone_at_same_time(int tone_name, int msec);
|
||||
void bt_tws_led_state_sync(int led_state, int msec);
|
||||
bool get_tws_sibling_connect_state(void);
|
||||
|
||||
void tws_cancle_all_noconn();
|
||||
void tws_sniff_controle_check_enable(void);
|
||||
void tws_sniff_controle_check_disable(void);
|
||||
#endif
|
||||
41
apps/xtell_hide/include/default_event_handler.h
Normal file
41
apps/xtell_hide/include/default_event_handler.h
Normal file
@ -0,0 +1,41 @@
|
||||
#ifndef DEFAULT_EVENT_HANDLER_H
|
||||
#define DEFAULT_EVENT_HANDLER_H
|
||||
|
||||
|
||||
#include "system/includes.h"
|
||||
|
||||
|
||||
void default_event_handler(struct sys_event *event);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
272
apps/xtell_hide/include/earphone.h
Normal file
272
apps/xtell_hide/include/earphone.h
Normal file
@ -0,0 +1,272 @@
|
||||
#ifndef EARPHONE_H
|
||||
#define EARPHONE_H
|
||||
|
||||
#include "system/includes.h"
|
||||
///搜索完整结束的事件
|
||||
#define HCI_EVENT_INQUIRY_COMPLETE 0x01
|
||||
///连接完成的事件
|
||||
#define HCI_EVENT_CONNECTION_COMPLETE 0x03
|
||||
///断开的事件,会有一些错误码区分不同情况的断开
|
||||
#define HCI_EVENT_DISCONNECTION_COMPLETE 0x05
|
||||
///连接中请求pin code的事件,给这个事件上来目前是做了一个确认的操作
|
||||
#define HCI_EVENT_PIN_CODE_REQUEST 0x16
|
||||
///连接设备发起了简易配对加密的连接
|
||||
#define HCI_EVENT_IO_CAPABILITY_REQUEST 0x31
|
||||
///这个事件上来目前是做了一个连接确认的操作
|
||||
#define HCI_EVENT_USER_CONFIRMATION_REQUEST 0x33
|
||||
///这个事件是需要输入6个数字的连接消息,一般在键盘应用才会有
|
||||
#define HCI_EVENT_USER_PASSKEY_REQUEST 0x34
|
||||
///<可用于显示输入passkey位置 value 0:start 1:enrer 2:earse 3:clear 4:complete
|
||||
#define HCI_EVENT_USER_PRESSKEY_NOTIFICATION 0x3B
|
||||
///杰理自定义的事件,上电回连的时候读不到VM的地址。
|
||||
#define HCI_EVENT_VENDOR_NO_RECONN_ADDR 0xF8
|
||||
///杰理自定义的事件,有测试盒连接的时候会有这个事件
|
||||
#define HCI_EVENT_VENDOR_REMOTE_TEST 0xFE
|
||||
///杰理自定义的事件,可以认为是断开之后协议栈资源释放完成的事件
|
||||
#define BTSTACK_EVENT_HCI_CONNECTIONS_DELETE 0x6D
|
||||
|
||||
|
||||
#define ERROR_CODE_SUCCESS 0x00
|
||||
///<回连超时退出消息
|
||||
#define ERROR_CODE_PAGE_TIMEOUT 0x04
|
||||
///<连接过程中linkkey错误
|
||||
#define ERROR_CODE_AUTHENTICATION_FAILURE 0x05
|
||||
///<连接过程中linkkey丢失,手机删除了linkkey,回连就会出现一次
|
||||
#define ERROR_CODE_PIN_OR_KEY_MISSING 0x06
|
||||
///<连接超时,一般拿远就会断开有这个消息
|
||||
#define ERROR_CODE_CONNECTION_TIMEOUT 0x08
|
||||
///<连接个数超出了资源允许
|
||||
#define ERROR_CODE_SYNCHRONOUS_CONNECTION_LIMIT_TO_A_DEVICE_EXCEEDED 0x0A
|
||||
///<回连的时候发现设备还没释放我们这个地址,一般直接断电开机回连会出现
|
||||
#define ERROR_CODE_ACL_CONNECTION_ALREADY_EXISTS 0x0B
|
||||
///<需要回连的设备资源不够。有些手机连了一个设备之后就会用这个拒绝。或者其它的资源原因
|
||||
#define ERROR_CODE_CONNECTION_REJECTED_DUE_TO_LIMITED_RESOURCES 0x0D
|
||||
///<有些可能只允许指定地址连接的,可能会用这个去拒绝连接。或者我们设备的地址全0或者有问题
|
||||
#define ERROR_CODE_CONNECTION_REJECTED_DUE_TO_UNACCEPTABLE_BD_ADDR 0x0F
|
||||
///<连接的时间太长了,手机要断开了。这种容易复现可以联系我们分析
|
||||
#define ERROR_CODE_CONNECTION_ACCEPT_TIMEOUT_EXCEEDED 0x10
|
||||
///<经常用的连接断开消息。就认为断开就行
|
||||
#define ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION 0x13
|
||||
///<正常的断开消息,本地L2CAP资源释放之后就会发这个值上来了
|
||||
#define ERROR_CODE_CONNECTION_TERMINATED_BY_LOCAL_HOST 0x16
|
||||
///<回连的时候发现设备两次role switch失败了,发断开在重新连接
|
||||
#define ERROR_CODE_ROLE_SWITCH_FAILED 0x35
|
||||
///杰理自定义,在回连的过程中使用page cancel命令主动取消成功会有这个命令
|
||||
#define CUSTOM_BB_AUTO_CANCEL_PAGE 0xFD //// app cancle page
|
||||
///杰理自定义,库里面有些功能需要停止page的时候会有。比如page的时候来了电话
|
||||
#define BB_CANCEL_PAGE 0xFE //// bb cancle page
|
||||
|
||||
|
||||
#if (TCFG_USER_BLE_ENABLE && (CONFIG_BT_MODE == BT_NORMAL))
|
||||
|
||||
#if RCSP_ADV_EN
|
||||
|
||||
int rcsp_earphone_state_init();
|
||||
int rcsp_earphone_state_set_page_scan_enable();
|
||||
int rcsp_earphone_state_get_connect_mac_addr();
|
||||
int rcsp_earphone_state_cancel_page_scan();
|
||||
int rcsp_earphone_state_enter_soft_poweroff();
|
||||
int rcsp_earphone_state_tws_init(int paired);
|
||||
int rcsp_earphone_state_tws_connected(int first_pair, u8 *comm_addr);
|
||||
int rcsp_sys_event_handler_specific(struct sys_event *event);
|
||||
|
||||
#define EARPHONE_STATE_INIT() rcsp_earphone_state_init()
|
||||
#define EARPHONE_STATE_SET_PAGE_SCAN_ENABLE() rcsp_earphone_state_set_page_scan_enable()
|
||||
#define EARPHONE_STATE_GET_CONNECT_MAC_ADDR() rcsp_earphone_state_get_connect_mac_addr()
|
||||
#define EARPHONE_STATE_CANCEL_PAGE_SCAN() rcsp_earphone_state_cancel_page_scan()
|
||||
#define EARPHONE_STATE_ENTER_SOFT_POWEROFF() rcsp_earphone_state_enter_soft_poweroff()
|
||||
#define EARPHONE_STATE_TWS_INIT(a) rcsp_earphone_state_tws_init(a)
|
||||
#define EARPHONE_STATE_TWS_CONNECTED(a, b) rcsp_earphone_state_tws_connected(a,b)
|
||||
#define SYS_EVENT_HANDLER_SPECIFIC(a) rcsp_sys_event_handler_specific(a)
|
||||
#define SYS_EVENT_REMAP(a) 0
|
||||
#define EARPHONE_STATE_SNIFF(a)
|
||||
#define EARPHONE_STATE_ROLE_SWITCH(a)
|
||||
|
||||
#elif TRANS_DATA_EN
|
||||
|
||||
int trans_data_earphone_state_init();
|
||||
int trans_data_earphone_state_set_page_scan_enable();
|
||||
int trans_data_earphone_state_get_connect_mac_addr();
|
||||
int trans_data_earphone_state_cancel_page_scan();
|
||||
int trans_data_earphone_state_enter_soft_poweroff();
|
||||
int trans_data_earphone_state_tws_init(int paired);
|
||||
int trans_data_earphone_state_tws_connected(int first_pair, u8 *comm_addr);
|
||||
int trans_data_sys_event_handler_specific(struct sys_event *event);
|
||||
|
||||
#define EARPHONE_STATE_INIT() trans_data_earphone_state_init()
|
||||
#define EARPHONE_STATE_SET_PAGE_SCAN_ENABLE() trans_data_earphone_state_set_page_scan_enable()
|
||||
#define EARPHONE_STATE_GET_CONNECT_MAC_ADDR() trans_data_earphone_state_get_connect_mac_addr()
|
||||
#define EARPHONE_STATE_CANCEL_PAGE_SCAN() trans_data_earphone_state_cancel_page_scan()
|
||||
#define EARPHONE_STATE_ENTER_SOFT_POWEROFF() trans_data_earphone_state_enter_soft_poweroff()
|
||||
#define EARPHONE_STATE_TWS_INIT(a) trans_data_earphone_state_tws_init(a)
|
||||
#define EARPHONE_STATE_TWS_CONNECTED(a, b) trans_data_earphone_state_tws_connected(a,b)
|
||||
#define SYS_EVENT_HANDLER_SPECIFIC(a) trans_data_sys_event_handler_specific(a)
|
||||
#define SYS_EVENT_REMAP(a) 0
|
||||
#define EARPHONE_STATE_SNIFF(a)
|
||||
#define EARPHONE_STATE_ROLE_SWITCH(a)
|
||||
|
||||
#elif BLE_HID_EN
|
||||
|
||||
int ble_hid_earphone_state_init();
|
||||
int ble_hid_earphone_state_set_page_scan_enable();
|
||||
int ble_hid_earphone_state_get_connect_mac_addr();
|
||||
int ble_hid_earphone_state_cancel_page_scan();
|
||||
int ble_hid_earphone_state_enter_soft_poweroff();
|
||||
int ble_hid_earphone_state_tws_init(int paired);
|
||||
int ble_hid_earphone_state_tws_connected(int first_pair, u8 *comm_addr);
|
||||
int ble_hid_sys_event_handler_specific(struct sys_event *event);
|
||||
|
||||
#define EARPHONE_STATE_INIT() ble_hid_earphone_state_init()
|
||||
#define EARPHONE_STATE_SET_PAGE_SCAN_ENABLE() ble_hid_earphone_state_set_page_scan_enable()
|
||||
#define EARPHONE_STATE_GET_CONNECT_MAC_ADDR() ble_hid_earphone_state_get_connect_mac_addr()
|
||||
#define EARPHONE_STATE_CANCEL_PAGE_SCAN() ble_hid_earphone_state_cancel_page_scan()
|
||||
#define EARPHONE_STATE_ENTER_SOFT_POWEROFF() ble_hid_earphone_state_enter_soft_poweroff()
|
||||
#define EARPHONE_STATE_TWS_INIT(a) ble_hid_earphone_state_tws_init(a)
|
||||
#define EARPHONE_STATE_TWS_CONNECTED(a, b) ble_hid_earphone_state_tws_connected(a,b)
|
||||
#define SYS_EVENT_HANDLER_SPECIFIC(a) ble_hid_sys_event_handler_specific(a)
|
||||
#define SYS_EVENT_REMAP(a) 0
|
||||
#define EARPHONE_STATE_SNIFF(a)
|
||||
#define EARPHONE_STATE_ROLE_SWITCH(a)
|
||||
|
||||
|
||||
|
||||
#elif LL_SYNC_EN
|
||||
|
||||
int ll_sync_earphone_state_init();
|
||||
int ll_sync_earphone_state_set_page_scan_enable();
|
||||
int ll_sync_earphone_state_get_connect_mac_addr();
|
||||
int ll_sync_earphone_state_cancel_page_scan();
|
||||
int ll_sync_earphone_state_enter_soft_poweroff();
|
||||
int ll_sync_earphone_state_tws_init(int paired);
|
||||
int ll_sync_earphone_state_tws_connected(int first_pair, u8 *comm_addr);
|
||||
int ll_sync_sys_event_handler_specific(struct sys_event *event);
|
||||
|
||||
#define EARPHONE_STATE_INIT() ll_sync_earphone_state_init()
|
||||
#define EARPHONE_STATE_SET_PAGE_SCAN_ENABLE() ll_sync_earphone_state_set_page_scan_enable()
|
||||
#define EARPHONE_STATE_GET_CONNECT_MAC_ADDR() ll_sync_earphone_state_get_connect_mac_addr()
|
||||
#define EARPHONE_STATE_CANCEL_PAGE_SCAN() ll_sync_earphone_state_cancel_page_scan()
|
||||
#define EARPHONE_STATE_ENTER_SOFT_POWEROFF() ll_sync_earphone_state_enter_soft_poweroff()
|
||||
#define EARPHONE_STATE_TWS_INIT(a) ll_sync_earphone_state_tws_init(a)
|
||||
#define EARPHONE_STATE_TWS_CONNECTED(a, b) ll_sync_earphone_state_tws_connected(a,b)
|
||||
#define SYS_EVENT_HANDLER_SPECIFIC(a) ll_sync_sys_event_handler_specific(a)
|
||||
#define SYS_EVENT_REMAP(a) 0
|
||||
#define EARPHONE_STATE_SNIFF(a)
|
||||
#define EARPHONE_STATE_ROLE_SWITCH(a)
|
||||
|
||||
#elif TUYA_DEMO_EN
|
||||
int tuya_earphone_state_init();
|
||||
int tuya_earphone_state_set_page_scan_enable();
|
||||
int tuya_earphone_state_get_connect_mac_addr();
|
||||
int tuya_earphone_state_cancel_page_scan();
|
||||
int tuya_earphone_state_enter_soft_poweroff();
|
||||
int tuya_earphone_state_tws_init(int paired);
|
||||
int tuya_earphone_state_tws_connected(int first_pair, u8 *comm_addr);
|
||||
int tuya_sys_event_handler_specific(struct sys_event *event);
|
||||
|
||||
#define EARPHONE_STATE_INIT() tuya_earphone_state_init()
|
||||
#define EARPHONE_STATE_SET_PAGE_SCAN_ENABLE() tuya_earphone_state_set_page_scan_enable()
|
||||
#define EARPHONE_STATE_GET_CONNECT_MAC_ADDR() tuya_earphone_state_get_connect_mac_addr()
|
||||
#define EARPHONE_STATE_CANCEL_PAGE_SCAN() tuya_earphone_state_cancel_page_scan()
|
||||
#define EARPHONE_STATE_ENTER_SOFT_POWEROFF() tuya_earphone_state_enter_soft_poweroff()
|
||||
#define EARPHONE_STATE_TWS_INIT(a) tuya_earphone_state_tws_init(a)
|
||||
#define EARPHONE_STATE_TWS_CONNECTED(a, b) tuya_earphone_state_tws_connected(a,b)
|
||||
#define SYS_EVENT_HANDLER_SPECIFIC(a) tuya_sys_event_handler_specific(a)
|
||||
#define SYS_EVENT_REMAP(a) 0
|
||||
#define EARPHONE_STATE_SNIFF(a)
|
||||
#define EARPHONE_STATE_ROLE_SWITCH(a)
|
||||
|
||||
|
||||
#elif (AI_APP_PROTOCOL | LE_AUDIO_EN)
|
||||
|
||||
int app_protocol_sys_event_handler(struct sys_event *event);
|
||||
#define EARPHONE_STATE_INIT() do { } while(0)
|
||||
#define EARPHONE_STATE_SET_PAGE_SCAN_ENABLE() do { } while(0)
|
||||
#define EARPHONE_STATE_GET_CONNECT_MAC_ADDR() do { } while(0)
|
||||
#define EARPHONE_STATE_CANCEL_PAGE_SCAN() do { } while(0)
|
||||
#define EARPHONE_STATE_ENTER_SOFT_POWEROFF() do { } while(0)
|
||||
#define EARPHONE_STATE_TWS_INIT(a) do { } while(0)
|
||||
#define EARPHONE_STATE_TWS_CONNECTED(a, b) do { } while(0)
|
||||
#define SYS_EVENT_HANDLER_SPECIFIC(a) app_protocol_sys_event_handler(a)
|
||||
#define SYS_EVENT_REMAP(a) 0
|
||||
#define EARPHONE_STATE_SNIFF(a)
|
||||
#define EARPHONE_STATE_ROLE_SWITCH(a)
|
||||
|
||||
#elif TCFG_WIRELESS_MIC_ENABLE
|
||||
#define EARPHONE_STATE_INIT() do { } while(0)
|
||||
#define EARPHONE_STATE_SET_PAGE_SCAN_ENABLE() do { } while(0)
|
||||
#define EARPHONE_STATE_GET_CONNECT_MAC_ADDR() do { } while(0)
|
||||
#define EARPHONE_STATE_CANCEL_PAGE_SCAN() do { } while(0)
|
||||
#define EARPHONE_STATE_ENTER_SOFT_POWEROFF() do { } while(0)
|
||||
#define EARPHONE_STATE_TWS_INIT(a) do { } while(0)
|
||||
#define EARPHONE_STATE_TWS_CONNECTED(a, b) do { } while(0)
|
||||
#define SYS_EVENT_HANDLER_SPECIFIC(a) do { } while(0)
|
||||
#define SYS_EVENT_REMAP(a) 0
|
||||
#define EARPHONE_STATE_SNIFF(a)
|
||||
#define EARPHONE_STATE_ROLE_SWITCH(a)
|
||||
|
||||
#else
|
||||
int adv_earphone_state_init();
|
||||
int adv_earphone_state_set_page_scan_enable();
|
||||
int adv_earphone_state_get_connect_mac_addr();
|
||||
int adv_earphone_state_cancel_page_scan();
|
||||
int adv_earphone_state_enter_soft_poweroff();
|
||||
int adv_earphone_state_tws_init(int paired);
|
||||
int adv_earphone_state_tws_connected(int first_pair, u8 *comm_addr);
|
||||
int adv_sys_event_handler_specific(struct sys_event *event);
|
||||
int adv_earphone_state_sniff(u8 state);
|
||||
int adv_earphone_state_role_switch(u8 role);
|
||||
|
||||
#define EARPHONE_STATE_INIT() adv_earphone_state_init()
|
||||
#define EARPHONE_STATE_SET_PAGE_SCAN_ENABLE() adv_earphone_state_set_page_scan_enable()
|
||||
#define EARPHONE_STATE_GET_CONNECT_MAC_ADDR() adv_earphone_state_get_connect_mac_addr()
|
||||
#define EARPHONE_STATE_CANCEL_PAGE_SCAN() adv_earphone_state_cancel_page_scan()
|
||||
#define EARPHONE_STATE_ENTER_SOFT_POWEROFF() adv_earphone_state_enter_soft_poweroff()
|
||||
#define EARPHONE_STATE_TWS_INIT(a) adv_earphone_state_tws_init(a)
|
||||
#define EARPHONE_STATE_TWS_CONNECTED(a, b) adv_earphone_state_tws_connected(a,b)
|
||||
#define SYS_EVENT_HANDLER_SPECIFIC(a) adv_sys_event_handler_specific(a)
|
||||
#define SYS_EVENT_REMAP(a) 0
|
||||
#define EARPHONE_STATE_SNIFF(a) adv_earphone_state_sniff(a)
|
||||
#define EARPHONE_STATE_ROLE_SWITCH(a) adv_earphone_state_role_switch(a)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#else
|
||||
|
||||
#define EARPHONE_STATE_INIT() do { } while(0)
|
||||
#define EARPHONE_STATE_SET_PAGE_SCAN_ENABLE() do { } while(0)
|
||||
#define EARPHONE_STATE_GET_CONNECT_MAC_ADDR() do { } while(0)
|
||||
#define EARPHONE_STATE_CANCEL_PAGE_SCAN() do { } while(0)
|
||||
#define EARPHONE_STATE_ENTER_SOFT_POWEROFF() do { } while(0)
|
||||
#define EARPHONE_STATE_TWS_INIT(a) do { } while(0)
|
||||
#define EARPHONE_STATE_TWS_CONNECTED(a, b) do { } while(0)
|
||||
#define SYS_EVENT_HANDLER_SPECIFIC(a) do { } while(0)
|
||||
#define SYS_EVENT_REMAP(a) 0
|
||||
#define EARPHONE_STATE_SNIFF(a)
|
||||
#define EARPHONE_STATE_ROLE_SWITCH(a)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
extern void sys_auto_shut_down_enable(void);
|
||||
|
||||
extern void sys_auto_shut_down_disable(void);
|
||||
|
||||
extern int bt_in_background_event_handler(struct sys_event *event);
|
||||
|
||||
extern u8 bt_app_exit_check(void);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
100
apps/xtell_hide/include/key_event_deal.h
Normal file
100
apps/xtell_hide/include/key_event_deal.h
Normal file
@ -0,0 +1,100 @@
|
||||
#ifndef __KEY_EVENT_DEAL_H__
|
||||
#define __KEY_EVENT_DEAL_H__
|
||||
|
||||
#include "typedef.h"
|
||||
#include "bt_profile_cfg.h"
|
||||
#include "system/event.h"
|
||||
|
||||
enum {
|
||||
KEY_POWER_ON = KEY_EVENT_MAX,
|
||||
KEY_POWEROFF,
|
||||
KEY_POWEROFF_HOLD,
|
||||
KEY_MUSIC_PP,
|
||||
KEY_MUSIC_PREV,
|
||||
KEY_MUSIC_NEXT,
|
||||
KEY_VOL_UP,
|
||||
KEY_VOL_DOWN,
|
||||
KEY_CALL_LAST_NO,
|
||||
KEY_CALL_HANG_UP,
|
||||
KEY_CALL_ANSWER,
|
||||
KEY_CALL_ANSWER_UP,
|
||||
KEY_OPEN_SIRI,
|
||||
KEY_HID_CONTROL,
|
||||
KEY_LOW_LANTECY,
|
||||
KEY_MODE_SWITCH,
|
||||
|
||||
KEY_EQ_MODE,
|
||||
KEY_THIRD_CLICK,
|
||||
|
||||
KEY_MUSIC_FF,
|
||||
KEY_MUSIC_FR,
|
||||
KEY_MUSIC_PLAYER_START,
|
||||
KEY_MUSIC_PLAYER_END,
|
||||
KEY_MUSIC_PLAYER_DEC_ERR,
|
||||
KEY_MUSIC_DEVICE_TONE_END,
|
||||
KEY_MUSIC_PLAYER_QUIT,
|
||||
KEY_MUSIC_PLAYER_AUTO_NEXT,
|
||||
KEY_MUSIC_PLAYER_PLAY_FIRST,
|
||||
KEY_MUSIC_PLAYER_PLAY_LAST,
|
||||
KEY_MUSIC_CHANGE_REPEAT,
|
||||
KEY_MUSIC_CHANGE_DEV,
|
||||
KEY_MUSIC_AUTO_NEXT_DEV,
|
||||
KEY_MUSIC_CHANGE_DEV_REPEAT,
|
||||
KEY_MUSIC_SET_PITCH,
|
||||
KEY_MUSIC_SET_SPEED,
|
||||
KEY_MUSIC_PLAYE_BY_DEV_FILENUM,
|
||||
KEY_MUSIC_PLAYE_BY_DEV_SCLUST,
|
||||
KEY_MUSIC_PLAYE_BY_DEV_PATH,
|
||||
KEY_MUSIC_DELETE_FILE,
|
||||
KEY_MUSIC_PLAYE_NEXT_FOLDER,
|
||||
KEY_MUSIC_PLAYE_PREV_FOLDER,
|
||||
KEY_MUSIC_PLAYE_REC_FOLDER_SWITCH,
|
||||
KEY_MUSIC_PLAYER_AB_REPEAT_SWITCH,
|
||||
|
||||
KEY_SEND_SPEECH_START,
|
||||
KEY_SEND_SPEECH_STOP,
|
||||
#if (BT_FOR_APP_EN)
|
||||
KEY_AI_DEC_SUSPEND,
|
||||
KEY_AI_DEC_RESUME,
|
||||
|
||||
#endif
|
||||
|
||||
KEY_EARTCH_ENABLE,
|
||||
KEY_EARTCH_DISABLE,
|
||||
KEY_ANC_SWITCH,
|
||||
KEY_ANC_EAR_ADAPTIVE,
|
||||
KEY_ANC_COEFF_SWITCH,
|
||||
KEY_MUSIC_EFF, //播歌音效切换
|
||||
KEY_PHONE_PITCH,//通话上行 变声切换
|
||||
KEY_HEARING_AID_TOGGLE,//辅听功能开关
|
||||
|
||||
MSG_HALF_SECOND,
|
||||
KEY_CLEAN_PHONE_INFO,
|
||||
KEY_CLEAN_PHONE_INFO_HOLD,
|
||||
KEY_CLEAN_PHONE_INFO_UP,
|
||||
|
||||
KEY_SPATIAL_EFFECT_MODE_SWITCH, /*切换空间音频模式*/
|
||||
KEY_SPEAK_TO_CHAT_SWITCH, /*智能免摘开关*/
|
||||
KEY_WIND_NOISE_DET_SWITCH, /*风噪检测开关*/
|
||||
KEY_WIDE_AREA_TAP_SWITCH, /*广域点击开关*/
|
||||
KEY_ANC_MULT_SCENE_SWITCH, /*多滤波器切换demo*/
|
||||
KEY_NULL = 0xFF,
|
||||
};
|
||||
|
||||
enum {
|
||||
ONE_KEY_CTL_NEXT_PREV = 1,
|
||||
ONE_KEY_CTL_VOL_UP_DOWN,
|
||||
};
|
||||
|
||||
enum {
|
||||
EARTCH_STATE_IN,
|
||||
EARTCH_STATE_OUT,
|
||||
EARTCH_STATE_TRIM_OK,
|
||||
EARTCH_STATE_TRIM_ERR,
|
||||
};
|
||||
|
||||
extern void volume_up(u8 inc);
|
||||
extern void volume_down(u8 inc);
|
||||
extern int app_earphone_key_event_handler(struct sys_event *);
|
||||
|
||||
#endif
|
||||
31
apps/xtell_hide/include/pbg_user.h
Normal file
31
apps/xtell_hide/include/pbg_user.h
Normal file
@ -0,0 +1,31 @@
|
||||
#ifndef PBG_USER_H_
|
||||
#define PBG_USER_H_
|
||||
|
||||
#include "typedef.h"
|
||||
#include "key_event_deal.h"
|
||||
|
||||
enum {
|
||||
PBG_POS_IN_EAR = 0, //入耳
|
||||
PBG_POS_OUT_BOX, //出仓
|
||||
PBG_POS_IN_BOX, //在仓
|
||||
PBG_POS_NOT_EXIST, //不在线
|
||||
PBG_POS_KEEP_NOW = 0x0f, //维持,不改变
|
||||
PBG_POS_MAX, //
|
||||
};
|
||||
|
||||
|
||||
#define BD_ADDR_LEN 6
|
||||
typedef uint8_t bd_addr_t[BD_ADDR_LEN];
|
||||
|
||||
void pbg_user_set_tws_state(u8 conn_flag);
|
||||
void pbg_user_recieve_sync_info(u8 *sync_info);
|
||||
void pbg_user_mic_fixed_deal(u8 mode);
|
||||
void pbg_user_event_deal(struct pbg_event *evt);
|
||||
bool pbg_user_key_vaild(u8 *key_msg, struct sys_event *event);
|
||||
void pbg_user_ear_pos_sync(u8 left, u8 right);
|
||||
void pbg_user_battery_level_sync(u8 *dev_bat);
|
||||
int pbg_user_is_connected(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
157
apps/xtell_hide/include/tone_player.h
Normal file
157
apps/xtell_hide/include/tone_player.h
Normal file
@ -0,0 +1,157 @@
|
||||
#ifndef TONE_PLAYER_H
|
||||
#define TONE_PLAYER_H
|
||||
|
||||
#include "app_config.h"
|
||||
#include "tone_player_api.h"
|
||||
|
||||
#define TONE_NUM_0 SDFILE_RES_ROOT_PATH"tone/0.*"
|
||||
#define TONE_NUM_1 SDFILE_RES_ROOT_PATH"tone/1.*"
|
||||
#define TONE_NUM_2 SDFILE_RES_ROOT_PATH"tone/2.*"
|
||||
#define TONE_NUM_3 SDFILE_RES_ROOT_PATH"tone/3.*"
|
||||
#define TONE_NUM_4 SDFILE_RES_ROOT_PATH"tone/4.*"
|
||||
#define TONE_NUM_5 SDFILE_RES_ROOT_PATH"tone/5.*"
|
||||
#define TONE_NUM_6 SDFILE_RES_ROOT_PATH"tone/6.*"
|
||||
#define TONE_NUM_7 SDFILE_RES_ROOT_PATH"tone/7.*"
|
||||
#define TONE_NUM_8 SDFILE_RES_ROOT_PATH"tone/8.*"
|
||||
#define TONE_NUM_9 SDFILE_RES_ROOT_PATH"tone/9.*"
|
||||
#define TONE_BT_MODE SDFILE_RES_ROOT_PATH"tone/bt.*"
|
||||
#define TONE_BT_CONN SDFILE_RES_ROOT_PATH"tone/bt_conn.*"
|
||||
#define TONE_BT_DISCONN SDFILE_RES_ROOT_PATH"tone/bt_dconn.*"
|
||||
#define TONE_TWS_CONN SDFILE_RES_ROOT_PATH"tone/tws_conn.*"
|
||||
#define TONE_TWS_DISCONN SDFILE_RES_ROOT_PATH"tone/tws_dconn.*"
|
||||
#define TONE_LOW_POWER SDFILE_RES_ROOT_PATH"tone/low_power.*"
|
||||
#define TONE_POWER_OFF SDFILE_RES_ROOT_PATH"tone/power_off.*"
|
||||
#define TONE_POWER_ON SDFILE_RES_ROOT_PATH"tone/power_on.*"
|
||||
#define TONE_RING SDFILE_RES_ROOT_PATH"tone/ring.*"
|
||||
#define TONE_MAX_VOL SDFILE_RES_ROOT_PATH"tone/vol_max.*"
|
||||
#define TONE_ANC_OFF SDFILE_RES_ROOT_PATH"tone/anc_off.*"
|
||||
#define TONE_ANC_ON SDFILE_RES_ROOT_PATH"tone/anc_on.*"
|
||||
#define TONE_TRANSPARENCY SDFILE_RES_ROOT_PATH"tone/anc_trans.*"
|
||||
#define TONE_ANC_ADAPTIVE SDFILE_RES_ROOT_PATH"tone/adaptive.*"
|
||||
#define TONE_ANC_ADAPTIVE_COEFF SDFILE_RES_ROOT_PATH"tone/adap_coeff.*"
|
||||
#define TONE_ANC_NORMAL_COEFF SDFILE_RES_ROOT_PATH"tone/nor_coeff.*"
|
||||
#define TONE_EAR_CHECK SDFILE_RES_ROOT_PATH"tone/ear_check.*"
|
||||
#define TONE_MUSIC_MODE SDFILE_RES_ROOT_PATH"tone/music.*"
|
||||
#define TONE_PC_MODE SDFILE_RES_ROOT_PATH"tone/pc.*"
|
||||
#define TONE_SPKCHAT_OFF SDFILE_RES_ROOT_PATH"tone/spkchat_off.*"
|
||||
#define TONE_SPKCHAT_ON SDFILE_RES_ROOT_PATH"tone/spkchat_on.*"
|
||||
#define TONE_WCLICK_OFF SDFILE_RES_ROOT_PATH"tone/wclick_off.*"
|
||||
#define TONE_WCLICK_ON SDFILE_RES_ROOT_PATH"tone/wclick_on.*"
|
||||
#define TONE_WINDDET_OFF SDFILE_RES_ROOT_PATH"tone/winddet_off.*"
|
||||
#define TONE_WINDDET_ON SDFILE_RES_ROOT_PATH"tone/winddet_on.*"
|
||||
|
||||
|
||||
#define SINE_WTONE_NORAML 0
|
||||
#define SINE_WTONE_TWS_CONNECT 1
|
||||
#define SINE_WTONE_TWS_DISCONNECT 2
|
||||
#define SINE_WTONE_LOW_POWER 4
|
||||
#define SINE_WTONE_RING 5
|
||||
#define SINE_WTONE_MAX_VOLUME 6
|
||||
#define SINE_WTONE_ADSP 7
|
||||
#define SINE_WTONE_LOW_LATENRY_IN 8
|
||||
#define SINE_WTONE_LOW_LATENRY_OUT 9
|
||||
#define SINE_WTONE_ANC_ADAPTIVE_1 10
|
||||
#define SINE_WTONE_ANC_ADAPTIVE_2 11
|
||||
|
||||
#if CONFIG_USE_DEFAULT_SINE
|
||||
#undef TONE_TWS_CONN
|
||||
#define TONE_TWS_CONN DEFAULT_SINE_TONE(SINE_WTONE_TWS_CONNECT)
|
||||
#undef TONE_TWS_DISCONN
|
||||
#define TONE_TWS_DISCONN DEFAULT_SINE_TONE(SINE_WTONE_TWS_DISCONNECT)
|
||||
|
||||
#undef TONE_MAX_VOL
|
||||
#define TONE_MAX_VOL DEFAULT_SINE_TONE(SINE_WTONE_MAX_VOLUME)
|
||||
|
||||
#undef TONE_NORMAL
|
||||
#define TONE_NORMAL DEFAULT_SINE_TONE(SINE_WTONE_NORAML)
|
||||
#if BT_PHONE_NUMBER
|
||||
|
||||
#else
|
||||
#undef TONE_RING
|
||||
#define TONE_RING DEFAULT_SINE_TONE(SINE_WTONE_RING)
|
||||
#endif
|
||||
|
||||
#undef TONE_LOW_POWER
|
||||
#define TONE_LOW_POWER DEFAULT_SINE_TONE(SINE_WTONE_LOW_POWER)
|
||||
#endif
|
||||
|
||||
#define TONE_SIN_NORMAL DEFAULT_SINE_TONE(SINE_WTONE_NORAML)
|
||||
|
||||
#define TONE_LOW_LATENCY_IN DEFAULT_SINE_TONE(SINE_WTONE_LOW_LATENRY_IN)
|
||||
#define TONE_LOW_LATENCY_OUT DEFAULT_SINE_TONE(SINE_WTONE_LOW_LATENRY_OUT)
|
||||
|
||||
#define TONE_ANC_ADAPTIVE_LVL1 DEFAULT_SINE_TONE(SINE_WTONE_ANC_ADAPTIVE_1)
|
||||
#define TONE_ANC_ADAPTIVE_LVL2 DEFAULT_SINE_TONE(SINE_WTONE_ANC_ADAPTIVE_2)
|
||||
|
||||
|
||||
enum {
|
||||
IDEX_TONE_NUM_0,
|
||||
IDEX_TONE_NUM_1,
|
||||
IDEX_TONE_NUM_2,
|
||||
IDEX_TONE_NUM_3,
|
||||
IDEX_TONE_NUM_4,
|
||||
IDEX_TONE_NUM_5,
|
||||
IDEX_TONE_NUM_6,
|
||||
IDEX_TONE_NUM_7,
|
||||
IDEX_TONE_NUM_8,
|
||||
IDEX_TONE_NUM_9,
|
||||
IDEX_TONE_BT_MODE,
|
||||
IDEX_TONE_BT_CONN,
|
||||
IDEX_TONE_BT_DISCONN,
|
||||
IDEX_TONE_TWS_CONN,
|
||||
IDEX_TONE_TWS_DISCONN,
|
||||
IDEX_TONE_LOW_POWER,
|
||||
IDEX_TONE_POWER_OFF,
|
||||
IDEX_TONE_POWER_ON,
|
||||
IDEX_TONE_RING,
|
||||
IDEX_TONE_MAX_VOL,
|
||||
IDEX_TONE_NORMAL,
|
||||
IDEX_TONE_ANC_OFF,
|
||||
IDEX_TONE_ANC_ON,
|
||||
IDEX_TONE_TRANSPARCNCY,
|
||||
IDEX_TONE_ANC_ADAPTIVE,
|
||||
IDEX_TONE_ANC_ADAPTIVE_COEFF,
|
||||
IDEX_TONE_ANC_NORMAL_COEFF,
|
||||
|
||||
|
||||
IDEX_TONE_NONE = 0xFF,
|
||||
};
|
||||
|
||||
|
||||
|
||||
int tone_play_init(void);
|
||||
int tone_play_index(u8 index, u8 preemption);
|
||||
int tone_play_index_with_callback(u8 index, u8 preemption, void (*user_evt_handler)(void *priv), void *priv);
|
||||
int tone_play_index_no_tws(u8 index, u8 preemption);
|
||||
/*
|
||||
*@brief:提示音比较,确认目标提示音和正在播放的提示音是否一致
|
||||
*@return: 0 匹配
|
||||
* 非0 不匹配或者当前没有提示音播放
|
||||
*@note:通过提示音索引比较
|
||||
*/
|
||||
int tone_name_cmp_by_index(u8 index);
|
||||
|
||||
|
||||
// 按键提示音初始化
|
||||
int audio_key_tone_init(void);
|
||||
// 注销按键提示音播放
|
||||
void audio_key_tone_destroy(void);
|
||||
|
||||
// 播放正弦波数组
|
||||
int audio_key_tone_play_sin(struct audio_sin_param *sin, u8 sin_num, u8 preemption);
|
||||
// 播放文件
|
||||
int audio_key_tone_play_name(const char *name, u8 preemption);
|
||||
// 按序号播放文件 // 使用key_tone_index[]数组
|
||||
int audio_key_tone_play_index(u8 index, u8 preemption);
|
||||
// 按键提示音播放 // 默认播放数组中第一个
|
||||
void audio_key_tone_play(void);
|
||||
|
||||
// 检测按键提示音是否在播放
|
||||
int audio_key_tone_is_play(void);
|
||||
|
||||
// 设置按键提示音的音量
|
||||
void audio_key_tone_digvol_set(u8 volume);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
39
apps/xtell_hide/include/ui_manage.h
Normal file
39
apps/xtell_hide/include/ui_manage.h
Normal file
@ -0,0 +1,39 @@
|
||||
#ifndef __UI_MANAGE_H_
|
||||
#define __UI_MANAGE_H_
|
||||
|
||||
#include "typedef.h"
|
||||
|
||||
typedef enum {
|
||||
STATUS_NULL = 0,
|
||||
STATUS_POWERON,
|
||||
STATUS_POWEROFF,
|
||||
STATUS_POWERON_LOWPOWER,
|
||||
STATUS_BT_INIT_OK,
|
||||
STATUS_BT_CONN,
|
||||
STATUS_BT_SLAVE_CONN_MASTER,
|
||||
STATUS_BT_MASTER_CONN_ONE,
|
||||
STATUS_BT_DISCONN,
|
||||
STATUS_BT_TWS_CONN,
|
||||
STATUS_BT_TWS_DISCONN,
|
||||
STATUS_PHONE_INCOME,
|
||||
STATUS_PHONE_OUT,
|
||||
STATUS_PHONE_ACTIV,
|
||||
STATUS_CHARGE_START,
|
||||
STATUS_CHARGE_FULL,
|
||||
STATUS_CHARGE_CLOSE,
|
||||
STATUS_CHARGE_ERR,
|
||||
STATUS_LOWPOWER,
|
||||
STATUS_CHARGE_LDO5V_OFF,
|
||||
STATUS_EXIT_LOWPOWER,
|
||||
STATUS_NORMAL_POWER,
|
||||
STATUS_POWER_NULL,
|
||||
} UI_STATUS;
|
||||
|
||||
|
||||
int ui_manage_init(void);
|
||||
void ui_update_status(u8 status);
|
||||
u8 get_ui_busy_status();
|
||||
void led_module_enter_sniff_mode();
|
||||
void led_module_exit_sniff_mode();
|
||||
|
||||
#endif
|
||||
68
apps/xtell_hide/include/user_cfg_id.h
Normal file
68
apps/xtell_hide/include/user_cfg_id.h
Normal file
@ -0,0 +1,68 @@
|
||||
#ifndef _USER_CFG_ID_H_
|
||||
#define _USER_CFG_ID_H_
|
||||
|
||||
//=================================================================================//
|
||||
// 与APP CASE相关配置项[1 ~ 60] //
|
||||
//=================================================================================//
|
||||
|
||||
#define CFG_EARTCH_ENABLE_ID 1
|
||||
#define CFG_PBG_MODE_INFO 2
|
||||
#define CFG_CHARGESTORE_TWS_CHANNEL 3
|
||||
#define CFG_SYS_VOL 4
|
||||
|
||||
#define CFG_MIC_ARRAY_DIFF_CMP_VALUE 5//麦克风阵列算法前补偿值
|
||||
#define CFG_MIC_ARRAY_TRIM_EN 6//麦克风补偿使能
|
||||
#define CFG_DMS_MALFUNC_STATE_ID 7//dms故障麦克风检测默认使用哪个mic的参数id
|
||||
#define CFG_MIC_TARGET_DIFF_CMP 8//目标MIC补偿值
|
||||
|
||||
|
||||
|
||||
#define CFG_DHA_FITTING_ID 26 //辅听验配保存参数的id
|
||||
#define CFG_REMOTE_DN_00 27
|
||||
|
||||
#define CFG_IMU_GYRO_OFFEST_ID 28 //空间音频imu陀螺仪偏置
|
||||
#define CFG_IMU_ACC_OFFEST_ID 29 //空间音频imu加速度偏置
|
||||
|
||||
#define VM_LP_TOUCH_KEY0_ALOG_CFG 30
|
||||
#define VM_LP_TOUCH_KEY1_ALOG_CFG 31
|
||||
#define VM_LP_TOUCH_KEY2_ALOG_CFG 32
|
||||
#define VM_LP_TOUCH_KEY3_ALOG_CFG 33
|
||||
#define VM_LP_TOUCH_KEY4_ALOG_CFG 34
|
||||
|
||||
#define VM_UPDATE_FLAG 35
|
||||
#define VM_DMA_RAND 36
|
||||
#define VM_DMA_RAND 37
|
||||
#define VM_GMA_ALI_PARA 38
|
||||
#define CFG_BCS_MAP_WEIGHT 39
|
||||
#define CFG_RCSP_ADV_HIGH_LOW_VOL 40
|
||||
#define CFG_RCSP_ADV_EQ_MODE_SETTING 41
|
||||
#define CFG_RCSP_ADV_EQ_DATA_SETTING 42
|
||||
#define ADV_SEQ_RAND 43
|
||||
#define CFG_RCSP_ADV_TIME_STAMP 44
|
||||
#define CFG_RCSP_ADV_WORK_SETTING 45
|
||||
#define CFG_RCSP_ADV_MIC_SETTING 46
|
||||
#define CFG_RCSP_ADV_LED_SETTING 47
|
||||
#define CFG_RCSP_ADV_KEY_SETTING 48
|
||||
|
||||
#define CFG_USB_BREAKPOINT0 49
|
||||
#define CFG_SD0_BREAKPOINT0 50
|
||||
#define CFG_SD1_BREAKPOINT0 51
|
||||
|
||||
#define CFG_HAVE_MASS_STORAGE 52
|
||||
#define CFG_MUSIC_MODE 53
|
||||
|
||||
#define LP_KEY_EARTCH_TRIM_VALUE 54
|
||||
|
||||
#define CFG_RCSP_ADV_ANC_VOICE 55
|
||||
#define CFG_RCSP_ADV_ANC_VOICE_MODE 56
|
||||
#define CFG_RCSP_ADV_ANC_VOICE_KEY 57
|
||||
|
||||
|
||||
#define CFG_SPK_EQ_SEG_SAVE 58
|
||||
#define CFG_SPK_EQ_GLOBAL_GAIN_SAVE 59
|
||||
|
||||
#define CFG_ANC_ADAPTIVE_DATA_ID 60//保存ANC自适应参数id
|
||||
|
||||
#define CFG_REMOTE_DN_00 63
|
||||
|
||||
#endif /* #ifndef _USER_CFG_ID_H_ */
|
||||
9
apps/xtell_hide/include/vol_sync.h
Normal file
9
apps/xtell_hide/include/vol_sync.h
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef __VOL_SYNC_H__
|
||||
#define __VOL_SYNC_H__
|
||||
|
||||
void vol_sys_tab_init(void);
|
||||
void set_music_device_volume(int volume);
|
||||
int phone_get_device_vol(void);
|
||||
void opid_play_vol_sync_fun(u8 *vol, u8 mode);
|
||||
|
||||
#endif
|
||||
104
apps/xtell_hide/include/wireless_mic/bt_edr_fun.h
Normal file
104
apps/xtell_hide/include/wireless_mic/bt_edr_fun.h
Normal file
@ -0,0 +1,104 @@
|
||||
#ifndef __BT_EDR_FUN_H__
|
||||
#define __BT_EDR_FUN_H__
|
||||
|
||||
#include "adapter_odev_bt.h"
|
||||
#include "app_main.h"
|
||||
|
||||
/*配置通话时前面丢掉的数据包包数*/
|
||||
#define ESCO_DUMP_PACKET_ADJUST 1 /*配置使能*/
|
||||
#define ESCO_DUMP_PACKET_DEFAULT 0
|
||||
#define ESCO_DUMP_PACKET_CALL 120 /*0~0xFF*/
|
||||
|
||||
#if(TCFG_UI_ENABLE && TCFG_SPI_LCD_ENABLE)//点阵屏断开蓝牙连接时可选择不跳回蓝牙模式
|
||||
#define BACKGROUND_GOBACK 0 //后台链接是否跳回蓝牙 1:跳回
|
||||
#else
|
||||
#define BACKGROUND_GOBACK 1
|
||||
#endif
|
||||
|
||||
#define TIMEOUT_CONN_TIME 60 //超时断开之后回连的时间s
|
||||
#define POWERON_AUTO_CONN_TIME 12 //开机去回连的时间
|
||||
|
||||
#define PHONE_CALL_FORCE_POWEROFF 0 //通话时候强制关机
|
||||
|
||||
#define SBC_FILTER_TIME_MS 1000 //后台音频过滤时间ms
|
||||
#define SBC_ZERO_TIME_MS 500 //静音多长时间认为已经退出
|
||||
#define NO_SBC_TIME_MS 200 //无音频时间ms
|
||||
|
||||
#define SNIFF_CNT_TIME 5/////<空闲5S之后进入sniff模式
|
||||
#define SNIFF_MAX_INTERVALSLOT 800
|
||||
#define SNIFF_MIN_INTERVALSLOT 100
|
||||
#define SNIFF_ATTEMPT_SLOT 4
|
||||
#define SNIFF_TIMEOUT_SLOT 1
|
||||
|
||||
enum {
|
||||
BT_AS_IDEV = 0,
|
||||
BT_AS_ODEV,
|
||||
};
|
||||
|
||||
void set_bt_dev_role(u8 role);
|
||||
|
||||
struct app_bt_opr {
|
||||
u8 init_ok : 1; // 1-初始化完成
|
||||
u8 call_flag : 1; // 1-由于蓝牙打电话命令切回蓝牙模式
|
||||
u8 exit_flag : 1; // 1-可以退出蓝牙标志
|
||||
u8 exiting : 1; // 1-正在退出蓝牙模式
|
||||
u8 wait_exit : 1; // 1-等退出蓝牙模式
|
||||
u8 a2dp_decoder_type: 3; // 从后台返回时记录解码格式用
|
||||
u8 cmd_flag ; // 1-由于蓝牙命令切回蓝牙模式
|
||||
u8 init_start ; //蓝牙协议栈初始化开始 ,但未初始化不一定已经完成,要判断initok完成的标志
|
||||
u8 ignore_discon_tone; // 1-退出蓝牙模式, 不响应discon提示音
|
||||
u8 sbc_packet_valid_cnt; // 有效sbc包计数
|
||||
u8 sbc_packet_valid_cnt_max;// 最大有效sbc包计数
|
||||
u8 sbc_packet_lose_cnt; // sbc丢失的包数
|
||||
u8 sbc_packet_step; // 0-正常;1-退出中;2-后台
|
||||
u32 tws_local_back_role : 4;
|
||||
u32 tws_local_to_bt_mode : 1;
|
||||
u32 a2dp_start_flag : 1;
|
||||
u32 bt_back_flag : 4;
|
||||
u32 replay_tone_flag : 1;
|
||||
u8 esco_dump_packet;
|
||||
u8 last_connecting_addr[6];
|
||||
|
||||
u32 sbc_packet_filter_to; // 过滤超时
|
||||
u32 no_sbc_packet_to; // 无声超时
|
||||
u32 init_ok_time; // 初始化完成时间
|
||||
u32 auto_exit_limit_time; // 自动退出时间限制
|
||||
u8 bt_direct_init;
|
||||
u8 bt_close_bredr;
|
||||
u8 hid_mode;
|
||||
u8 force_poweroff;
|
||||
u8 call_back_flag; //BIT(0):hfp_status BIT(1):esco_status
|
||||
|
||||
int timer;
|
||||
int tmr_cnt;
|
||||
int back_mode_systime;
|
||||
int max_tone_timer_hdl;
|
||||
int exit_sniff_timer ;
|
||||
|
||||
u32 sco_info;
|
||||
};
|
||||
extern struct app_bt_opr app_bt_hdl;
|
||||
extern BT_USER_PRIV_VAR bt_user_priv_var;
|
||||
|
||||
void bt_init();
|
||||
void bt_close(void);
|
||||
|
||||
void sys_auto_shut_down_enable(void);
|
||||
void sys_auto_shut_down_disable(void);
|
||||
|
||||
u8 get_bt_init_status();
|
||||
void bt_set_led_status(u8 status);
|
||||
void sys_auto_sniff_controle(u8 enable, u8 *addr);
|
||||
|
||||
void bt_wait_phone_connect_control(u8 enable);
|
||||
int bt_wait_connect_and_phone_connect_switch(void *p);
|
||||
|
||||
u8 is_call_now();
|
||||
|
||||
//bt status
|
||||
int bt_connction_status_event_handler(struct bt_event *bt, struct _odev_bt *odev_bt);
|
||||
|
||||
//hci event
|
||||
int bt_hci_event_handler(struct bt_event *bt, struct _odev_bt *odev_bt);
|
||||
|
||||
#endif //__BT_EDR_FUN_H__
|
||||
12
apps/xtell_hide/include/wireless_mic/wireless_mic_test.h
Normal file
12
apps/xtell_hide/include/wireless_mic/wireless_mic_test.h
Normal file
@ -0,0 +1,12 @@
|
||||
#ifndef _WIRELESS_MIC_TEST_
|
||||
#define _WIRELESS_MIC_TEST_
|
||||
|
||||
#include "system/includes.h"
|
||||
|
||||
// struct adapter_media {
|
||||
|
||||
// };
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user