| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- /*****************************************************************************
- * Module : Config
- * File : config.h
- * Function : SDK配置文件
- *****************************************************************************/
- #ifndef USER_CONFIG_H
- #define USER_CONFIG_H
- #include "config_define.h"
- /*****************************************************************************
- * Module : Function选择相关配置
- *****************************************************************************/
- #define FUNC_BT_EN 0 //是否打开蓝牙功能
- #define FUNC_LE_FCC_EN 0 //是否打开蓝牙FCC测试功能, 使用单线串口通信,默认: PB3, 1500000
- #define FUNC_LE_BQB_RF_EN 0 //是否打开蓝牙BQB测试功能, 使用串口通信,默认: RX:PA0, TX:PA1, 9600
- #define FUNC_WIRELESS_EN 1 //是否打开2.4G私有协议功能
- #define FUNC_USBD_EN 0 //是否打开USBDevice模式
- #define FUNC_IODM_EN 0 //是否打开小牛测控功能, 使用单线串口通信,默认: VUSB, 115200
- #define FUNC_IDLE_EN 0 //是否打开IDLE功能
- /*****************************************************************************
- * Module : 系统功能选择配置
- *****************************************************************************/
- #define SYS_CLK_SEL SYS_160M //选择系统时钟
- #define BUCK_MODE_EN 0 //是否BUCK MODE, 0:LDO MODE 1:BUCK MODE
- #define VUSB_2_VDDIO_EN 0 //是否使能VUSB到VDDIO的电源通路(系统只有VUSB供电的方案需要使能)
- #define WK0_10S_RESET 0 //WK pin 10秒复位功能
- #define SOFT_POWER_ON_OFF 0 //是否使用软开关机功能
- #define SYS_SLEEP_LEVEL SLEEP_DISABLE //休眠等级设置,0为不使能休眠功能
- #define SYS_SLEEP_TIME 0 //自动休眠时间(秒), 0为不自动休眠
- #define SYS_OFF_TIME 0 //自动关机时间(秒), 0为不自动关机
- #define SYS_PWRUP_TIME 0 //长按开机时间(毫秒), 0为立即开机
- #define BSP_UART_DEBUG_EN PRINTF_PB3 //串口打印调试使能[Baud=1500000]
- #define BSP_ADKEY_EN 0 //AD按键使能[Default: PB0]
- #define BSP_IOKEY_EN 0 //IO按鍵使能[WK0:PP;]
- #define BSP_CHARGE_EN 0 //充电功能使能
- #define BSP_VBAT_DETECT_EN 0 //电量检测功能使能
- #define BSP_SDADC_EN 0 //SDADC音频采集使能
- #define BSP_MOUSE_SENSEN_EN 0 //鼠标传感器使能
- #define BSP_MOUSE_TEST 0 //光标轨迹测试
- /*****************************************************************************
- * Module : FLASH配置
- *****************************************************************************/
- #define FLASH_SIZE FSIZE_256K //芯片内置flash空间大小
- #define FLASH_RESERVE_SIZE CM_SIZE //程序保留区空间大小
- #define FLASH_CODE_SIZE (FLASH_SIZE-FLASH_RESERVE_SIZE) //程序使用空间大小
- #define FLASH_ERASE_4K 1 //是否支持4K擦除
- #define FLASH_DUAL_READ 1 //是否支持2线模式
- #define FLASH_QUAD_READ 0 //是否支持4线模式
- #define SPIFLASH_SPEED_UP_EN 1 //SPI FLASH提速。
- #define COMM_EX_SIZE 0 //拓展comm区 Unit(byte) Aligned(512)
- #define CM_SIZE 0x2000 //参数区大小,至少8k(需4K对齐)
- #define CM_START (FLASH_SIZE - CM_SIZE) //参数区默认放在flash最后面
- /*****************************************************************************
- * Module : FOTA功能配置
- *****************************************************************************/
- #define AB_FOT_EN 0 //FOTA升级使能
- #define AB_FOT_TYPE AB_FOT_TYPE_PACK //FOTA升级方式选择
- #define AB_FOT_CHANNEL AB_FOT_CHANNEL_USB //FOTA升级通信通道选择
- #if (FLASH_SIZE == FSIZE_256K)
- #define FOT_PACK_START 0x23000
- #define FOT_PACK_SIZE 0x19000
- #elif (FLASH_SIZE == FSIZE_512K)
- #define FOT_PACK_START 0x4B000
- #define FOT_PACK_SIZE 0x32000
- #endif
- /*****************************************************************************
- * Module : 蓝牙功能配置
- *****************************************************************************/
- #define LE_FCC_TEST_EN 0 //BLE FCC测试模式,上电直接进FCC TEST, 使用串口通信,默认PB3
- #define LE_BQB_RF_EN 0 //BLE BQB测试模式,上电直接进BQB RF TEST, 使用串口通信,默认RX:PA0, TX:PA1
- #define LE_CHECK_PEER_TYPE 0 //通过查询ANCS Service判断设备类型
- /*****************************************************************************
- * Module : usb device 配置
- *****************************************************************************/
- #define USB_HID_EN 0
- #define USB_SPEAKER_EN 0
- #define USB_MIC_EN 0
- #define USB_VENDOR_EN 0
- #define USB_AUDIO_EN (USB_SPEAKER_EN || USB_MIC_EN )
- #define USB_EN (USB_HID_EN || USB_AUDIO_EN || USB_VENDOR_EN) //USB功能使能
- /*****************************************************************************
- * Module : VDDIO配置
- *****************************************************************************/
- #define PMU_VDDIO_LEVEL PMU_VDDIO_2V4 //VDDIO电压,电压越低语音底噪越小
- /*****************************************************************************
- * Module : MIC配置
- *****************************************************************************/
- #define MIC_BIAS_EN 0 //MIC BIAS使能,PB1输出
- #define MIC_BIAS_LEVEL MIC_BIAS_1V8 //MIC BIAS电压,电压越低语音底噪越小
- #define MIC_BIAS_RES MIC_BIAS_RES_0K //MIC BIAS电阻
- #define MIC_ANA_GAIN MIC_ANA_GAIN_5 //MIC 模拟增益,6dB一挡
- /*****************************************************************************
- * Module : 语音解码配置
- *****************************************************************************/
- #define AUDIO_DEC_ADPCM_EN 0 //adpcm解码使能
- #define AUDIO_DEC_MSBC_EN 0 //msbc解码使能
- #define AUDIO_DEC_SBC_EN 0 //sbc解码使能
- #define AUDIO_OUT_LOCAL_DEBUG 0 //本地sddac调试: SDADC->(adpcm enc/dec)->SDDAC
- #if (AUDIO_DEC_ADPCM_EN)
- #define AUDIO_MIC_PACKET_SIZE 68 //无线传输编码单包字节长度
- #elif (AUDIO_DEC_MSBC_EN)
- #define AUDIO_MIC_PACKET_SIZE 57
- #elif (AUDIO_DEC_SBC_EN)
- #define AUDIO_MIC_PACKET_SIZE 60
- #else
- #define AUDIO_MIC_PACKET_SIZE 32
- #endif
- /*****************************************************************************
- * Module : wirelesss收发端配置
- *****************************************************************************/
- #define WIRELESS_PACKET_LEN_AUDIO AUDIO_MIC_PACKET_SIZE //无线传输音频数据长度
- #define WIRELESS_PACKET_LEN_HID 5 //无线传输hid信息长度
- #define WIRELESS_TRANSMIT_EN 1 //1: 发射端, 0: 接收端
- /*****************************************************************************
- * Module : 语音降噪功能配置
- *****************************************************************************/
- #define AINS3_EN 0 //AINS3降噪算法使能 ram:5K, flash:8K, clock:120M以上
- #define AINS3_PART_LEN 64 // !!!!!! 只支持 60 和 64 个样点处理一次, msbc 60, adpcm 64
- #define AINS3_NT 0 //0~20,降噪等级,越大降噪越强
- #define AINS3_PRIOR_OPT_IDX 6 //0~20,先验信噪比门限,越小人声越多
- #define AINS4_EN 0 //AINS4降噪算法使能 ram:11K, flash:20K, clock:120M以上
- #define AINS4_PART_LEN 64 // !!!!!! 只支持 60 和 64 个样点处理一次, msbc 60, adpcm 64
- #define AINS4_NR_SUPPRESS 10 //0~20,降噪等级,越大降噪越强
- #define AINS4_PRIOR_OPT_IDX 3 //0~20,先验信噪比门限,越小人声越多
- /*****************************************************************************
- * Module : 版本号管理
- *****************************************************************************/
- #define SW_VERSION "V1.0.1" //只能使用数字0-9,ota需要转码
- #include "config_extra.h"
- #endif
|