depend(0x00090000);

config(SUB, "系统配置", "系统的相关配置");
config(CHECK, "POWKEY 10s复位系统", "是否长按POWKEY 10s复位系统，用于防止系统死机", POWKEY_10S_RESET, 1);
config(LISTVAL, "自动休眠时间", "设置自动休眠时间", SYS_SLEEP_TIME, SHORT, 30, 21, ("不休眠", 0), ("10秒钟后", 10), ("20秒钟后", 20), ("30秒钟后", 30), ("45秒钟后", 45), ("1分钟后", 60), ("2分钟后", 120), ("3分钟后", 180), ("4分钟后", 240), ("5分钟后", 300), ("6分钟后", 360), ("7分钟后", 420), ("8分钟后", 480), ("9分钟后", 540), ("10分钟后", 600), ("15分钟后", 900), ("20分钟后", 1200), ("25分钟后", 1500), ("30分钟后", 1800), ("45分钟后", 2700), ("1小时后", 3600));
config(LISTVAL, "自动关机时间", "设置自动关机时间", SYS_OFF_TIME, 	SHORT, 300, 18, ("不关机", 0), ("30秒钟后", 30), ("1分钟后", 60),  ("2分钟后", 120), ("3分钟后", 180), ("4分钟后", 240), ("5分钟后", 300), ("6分钟后", 360), ("7分钟后", 420), ("8分钟后", 480), ("9分钟后", 540), ("10分钟后", 600), ("15分钟后", 900), ("20分钟后", 1200), ("25分钟后", 1500), ("30分钟后", 1800), ("45分钟后", 2700), ("1小时后", 3600));
config(LIST, "低电关机电压", "选择低电关机电压，需要开启电池电量检测", LPWR_OFF_VBAT, 11, "不关机", "2.8V", "2.9V", "3.0V", "3.1V", "3.2V", "3.3V", "3.4V", "3.5V", "3.6V", "3.7V", 2);
config(LIST, "OSC基础电容", "同时配置26M晶振OSCI与OSCO负载电容", OSC_BOTH_CAP, 2, "0PF", "6PF", 0);
config(BYTE, "OSCI电容(0.25PF)", "独立配置26M晶振OSCI负载电容，单位0.25PF。OSCI电容大小：n * 0.25PF + 基础电容", OSCI_CAP, 0, 63, 23);
config(BYTE, "OSCO电容(0.25PF)", "独立配置26M晶振OSCO负载电容，单位0.25PF。OSCO电容大小：n * 0.25PF + 基础电容", OSCO_CAP, 0, 63, 23);
config(LISTVAL, "软开机长按时间选择", "长按PWRKEY多长时间后软开机", PWRON_PRESS_TIME,  BIT, 3, 3, 8, ("0.1秒", 0), ("0.5秒", 1), ("1秒", 2), ("1.5秒", 3), ("2秒", 4), ("2.5秒", 5), ("3秒", 6), ("3.5秒", 7));
config(LISTVAL, "软关机长按时间选择", "长按PWRKEY多长时间后软关机", PWROFF_PRESS_TIME, BIT, 3, 3, 8, ("1.5秒", 0), ("2秒", 1), ("2.5秒", 2), ("3秒", 3), ("3.5秒", 4), ("4秒", 5), ("4.5秒", 6), ("5秒", 7));

config(SUB, "电源配置", "电源的相关配置");
config(CHECK, "BUCK MODE", "是否设置为BUCK MODE", BUCK_MODE_EN, 0);
config(CHECK, "关闭BUCK限流", "是否关闭BUCK MODE限流, 仅在BUCK MODE打开时有效", BUCK_LIMIT_DIS, 0);
config(CHECK, "VDDBT省电容", "是否VDDBT省电容，只能LDO模式才能省电容", VDDBT_CAPLESS_EN, 1, BUCK_MODE_EN);
config(LISTVAL, "VDDIO电压", "选择VDDIO电压, VDDAUD与VDDIO短接可能需要调VDDIO电压。", VDDIO_SEL, BIT, 4, 9, 12, ("None", 0), ("2.7V", 3), ("2.8V", 4), ("2.9V", 5), ("3.0V", 6), ("3.1V", 7), ("3.2V", 8), ("3.3V", 9), ("3.4V", 10), ("3.5V", 11), ("3.6V", 12), ("3.7V", 13));
config(LEVEL, 0x00);
config(LISTVAL, "VDDBT电压", "选择VDDBT电压, None表示使用trim值(1.2V)", VDDBT_SEL, BIT, 5, 0, 8, ("None", 0), ("1.1V", 8), ("1.15V", 9), ("1.2V", 10), ("1.25V", 11), ("1.3V", 12), ("1.35V", 13), ("1.4V", 14));
config(LEVEL, 0x03);

config(SUB, "蓝牙配置", "蓝牙的相关配置");
config(TEXT, "蓝牙名称", "手机上可以看到的蓝牙名称", BT_NAME, 32, "Geehy");
config(MAC, "蓝牙地址", "蓝牙的MAC地址", BT_ADDR, 6, 41:42:00:00:00:00, 41:42:FF:FF:FF:FF, 41:42:00:00:00:01);
config(LISTVAL, "长按几秒开机进配对", "是否支持长按N秒开机直接进入配对状态", BT_PWRKEY_NSEC_DISCOVER, BIT, 3, 0, 8, ("不支持", 0), ("2秒", 1), ("3秒", 2), ("4秒", 3), ("5秒", 4), ("6秒", 5), ("7秒", 6), ("8秒", 7));
config(CHECK, "连接两部手机功能", "是否支持连接两部手机功能（打开<TWS功能>后无效）", BT_2ACL_EN, 0);
config(CHECK, "SPP功能", "是否支持蓝牙SPP的功能", BT_SPP_EN, 1);
config(CHECK, "HID功能", "是否支持蓝牙HID的功能", BT_HID_EN, 0);
config(CHECK, "按键HID连接/断开功能", "是否支持蓝牙HID服务，按键手动连接/断开", BT_HID_MANU_EN, 0, BT_HID_EN);
config(CHECK, "HID默认不连接", "HID服务默认不连接，需要按键手动连接", BT_HID_DISCON_DEFAULT_EN, 0, BT_HID_EN);
config(LEVEL, 0x00);
config(CHECK, "HID独立自拍器模式", "是否支持独立自拍器模式功能", FUNC_BTHID_EN, 0);
config(TEXT, "HID蓝牙名称", "手机上可以看到的独立自拍器模式蓝牙名称", BTHID_NAME, 32, "BT-Photo", FUNC_BTHID_EN);
config(LEVEL, 0x03);
config(CHECK, "BLE功能", "是否支持BLE功能", BLE_EN, 1);
config(TEXT, "BLE名称", "手机上可以看到的BLE蓝牙名称", LE_NAME, 32, "Geehy", BLE_EN);
config(CHECK, "快速测试使能", "快速测试使能", QTEST_EN, 0);
config(LIST, "耳机拿起后状态", "设置耳机拿起后的状态,以测试盒设置为准",  QTEST_PICKUP_STATUS, 4, "不操作", "拿起关机", "拿起复位", "断开蓝牙连接后关机" 0,QTEST_EN);
config(U32, "快测配对ID选择", "测试盒可根据ID选择是否可进行快速配对", QTEST_TWS_PAIR_ID, 0, 0x7fffffff,  0x38383930,  QTEST_EN);

config(SUB, "RF参数", "蓝牙RF参数");
config(BIT, "预置RF参数功率", "使用预置的RF参数，每级可降低0.5dbm发射功率", BT_RF_PWRDEC, 6, 0, 24, 0);
config(CHECK, "自定义RF参数", "选用自定义RF参数后，预置RF参数无效", BT_RF_PARAM_EN, 0);
config(LEVEL, 0x00);
config(BYTE, "GL_PA_GAIN",    "PA_GAIN, 参考值3",         RF_PA_GAIN,    0,  3,  3, BT_RF_PARAM_EN);
config(LEVEL, 0x03);
config(BYTE, "GL_MIX_GAIN",   "MIX_GAIN, 参考值3~5",      RF_MIX_GAIN,   0,  7,  4, BT_RF_PARAM_EN);
config(BYTE, "GL_DIG_GAIN",   "DIG_GAIN, 参考值30~59",    RF_DIG_GAIN,   24,59, 59, BT_RF_PARAM_EN);
config(BYTE, "GL_PA_CAP",     "PA_CAP, 参考值12~14",      RF_PA_CAP,     0, 15, 14, BT_RF_PARAM_EN);
config(BYTE, "GL_MIX_CAP",    "MIX_CAP, 参考值7~9",       RF_MIX_CAP,    0, 15,  8, BT_RF_PARAM_EN);
config(LEVEL, 0x00);
config(BYTE, "GL_TX_DBM",     "Cable实测dbm值",           RF_TXDBM,      0, 12,  6, BT_RF_PARAM_EN);
config(BYTE, "GL_UDF0",       "UDF(保留使用)",            RF_UDF0,       0,  0,  0, BT_RF_PARAM_EN);
config(BYTE, "GL_UDF1",       "UDF(保留使用)",            RF_UDF1,       0,  0,  0, BT_RF_PARAM_EN);
config(LEVEL, 0x03);
config(LISTVAL, "降低回连功率", "是否降低回连手机或TWS的功率", BT_RF_PAGE_PWRDEC, BIT, 3, 1, 4, ("不降低", 0), ("降低3dbm", 1), ("降低6dbm", 2), ("降低9dbm", 3));
config(LISTVAL, "降低组队功率", "是否降低TWS搜索组队的功率", BLE_RF_PAGE_PWRDEC, BIT, 3, 0, 4, ("不降低", 0), ("降低3dbm", 1), ("降低6dbm", 2), ("降低9dbm", 3));
config(BYTE, "设置组队范围RSSI(-dbm)", "该值越小(-90dbm最小),组队范围约大", BLE_PAGE_RSSI_THR, 20, 90, 90);

config(SUB, "按键配置", "选择按键及按键功能配置");
config(CHECK, "按键功能", "是否使用按键功能，使用软开关机时必须使能", USER_KEY_EN, 0);
config(CHECK, "按键多击功能", "是否使能按键多击（2/3/4/5击）功能", USER_KEY_MULTI_PRESS_EN, 1, USER_KEY_EN);
config(LISTVAL, "双击响应时间选择", "选择双击按键响应间隔时间", DOUBLE_KEY_TIME, BIT, 3, 1, 8, ("200ms", 0), ("300ms", 1), ("400ms", 2), ("500ms", 3), ("600ms", 4), ("700ms", 5), ("800ms", 6), ("900ms", 7), USER_KEY_MULTI_PRESS_EN);
config(CHECK, "PWRKEY功能", "是否使用PWRKEY", USER_PWRKEY_EN, 0, USER_KEY_EN);
config(CHECK, "IOKEY功能", "是否使用IOKEY", USER_IOKEY_EN, 0, USER_KEY_EN);
config(LISTVAL, "IOKEY按键1的IO", "IOKEY第1个按键的GPIO口选择", IOKEY_IO0, BIT, 5, 0, 21, ("None", 0), ("PA3", 4), ("PA4", 5), ("PA5", 6), ("PA6", 7), ("PA7", 8), ("PB0", 9), ("PB1", 10), ("PB2", 11), ("PB3", 12), ("PB4", 13), ("PB5/WKO", 28), ("PE0", 14), ("PE4", 18), ("PE5", 19), ("PE6", 20), ("PE7", 21), ("PF0", 22), ("PF1", 23), ("PF2", 24), ("PF3", 25), USER_IOKEY_EN);
config(LISTVAL, "IOKEY按键2的IO", "IOKEY第2个按键的GPIO口选择", IOKEY_IO1, BIT, 5, 0, 21, ("None", 0), ("PA3", 4), ("PA4", 5), ("PA5", 6), ("PA6", 7), ("PA7", 8), ("PB0", 9), ("PB1", 10), ("PB2", 11), ("PB3", 12), ("PB4", 13), ("PB5/WKO", 28), ("PE0", 14), ("PE4", 18), ("PE5", 19), ("PE6", 20), ("PE7", 21), ("PF0", 22), ("PF1", 23), ("PF2", 24), ("PF3", 25), USER_IOKEY_EN);
config(LISTVAL, "IOKEY按键3的IO", "IOKEY第3个按键的GPIO口选择", IOKEY_IO2, BIT, 5, 0, 21, ("None", 0), ("PA3", 4), ("PA4", 5), ("PA5", 6), ("PA6", 7), ("PA7", 8), ("PB0", 9), ("PB1", 10), ("PB2", 11), ("PB3", 12), ("PB4", 13), ("PB5/WKO", 28), ("PE0", 14), ("PE4", 18), ("PE5", 19), ("PE6", 20), ("PE7", 21), ("PF0", 22), ("PF1", 23), ("PF2", 24), ("PF3", 25), USER_IOKEY_EN);
config(LISTVAL, "IOKEY按键1键值", "IOKEY第1个按键键值", IOKEY_NUM0, BIT, 2, 0, 4, ("None", 0), ("KEY_POWER", 1), ("KEY_PREV", 2), ("KEY_NEXT", 3), USER_IOKEY_EN);
config(LISTVAL, "IOKEY按键2键值", "IOKEY第2个按键键值", IOKEY_NUM1, BIT, 2, 0, 4, ("None", 0), ("KEY_POWER", 1), ("KEY_PREV", 2), ("KEY_NEXT", 3), USER_IOKEY_EN);
config(LISTVAL, "IOKEY按键3键值", "IOKEY第3个按键键值", IOKEY_NUM2, BIT, 2, 0, 4, ("None", 0), ("KEY_POWER", 1), ("KEY_PREV", 2), ("KEY_NEXT", 3), USER_IOKEY_EN);

config(SUB, "LED灯配置", "选择及配置LED状态指示灯");
config(CHECK, "系统指示灯(蓝灯)", "是否使用系统状态指示灯", LED_DISP_EN, 1);
config(CHECK, "电源状态灯(红灯)", "是否使用充电/电源指示灯", LED_PWR_EN, 1);
config(CHECK, "省电阻1个IO推两个灯", "省电阻1个IO推两个灯，不能兼容升级功能", PORT_2LED_RESLESS_EN, 1, LED_DISP_EN);
config(CHECK, "电池低电闪灯", "电池低电时，红灯或蓝灯是否闪烁？", RLED_LOWBAT_EN, 0, LED_DISP_EN);
config(LISTVAL, "蓝灯IO选择", "蓝灯的GPIO口选择", BLED_IO_SEL, BIT, 5, 25, 21, ("None", 0), ("PA3", 4), ("PA4", 5), ("PA5", 6), ("PA6", 7), ("PA7", 8), ("PB0", 9), ("PB1", 10), ("PB2", 11), ("PB3", 12), ("PB4", 13), ("PB5/WKO", 28), ("PE0", 14), ("PE4", 18), ("PE5", 19), ("PE6", 20), ("PE7", 21), ("PF0", 22), ("PF1", 23), ("PF2", 24), ("PF3", 25), LED_DISP_EN);
config(LISTVAL, "红灯IO选择", "红灯的GPIO口选择", RLED_IO_SEL, BIT, 5, 25, 21, ("None", 0), ("PA3", 4), ("PA4", 5), ("PA5", 6), ("PA6", 7), ("PA7", 8), ("PB0", 9), ("PB1", 10), ("PB2", 11), ("PB3", 12), ("PB4", 13), ("PB5/WKO", 28), ("PE0", 14), ("PE4", 18), ("PE5", 19), ("PE6", 20), ("PE7", 21), ("PF0", 22), ("PF1", 23), ("PF2", 24), ("PF3", 25), LED_PWR_EN);

config(CHECK, "开机状态配置LED", "是否配置开机LED指示灯状态", LED_PWRON_CONFIG_EN, 0, LED_DISP_EN);
config(LED, "开机", "配置开机状态下的闪灯状态", LED_POWERON, 0x02, 0x01, 10, 255, 		LED_PWRON_CONFIG_EN);

config(CHECK, "关机状态配置LED", "是否配置等待关机状态指示灯", LED_PWROFF_CONFIG_EN, 0, LED_DISP_EN);
config(LED, "关机", "配置关机状态下的闪灯状态", LED_POWEROFF, 0x40, 0x15, 4, 255, 		LED_PWROFF_CONFIG_EN);

config(CHECK, "蓝牙初始化状态配置LED", "是否配置初始化状态指示灯(蓝牙开机播提示音、等待5秒按键时)", LED_BTINIT_CONFIG_EN, 0);
config(LED, "初始化", "配置蓝牙初始化状态下的闪灯状态", LED_BTINIT, 0x00, 0xaa, 10, 0, 	LED_BTINIT_CONFIG_EN);

config(CHECK, "蓝牙回连状态配置LED", "是否配置蓝牙回连状态指示灯(蓝牙未连接)", LED_RECONNECT_CONFIG_EN, 0);
config(LED, "回连", "配置回连状态下的闪灯状态", LED_RECONNECT, 0x00, 0xaa, 6, 0, 		LED_RECONNECT_CONFIG_EN);

config(CHECK, "蓝牙配对状态配置LED", "是否配置蓝牙配对状态指示灯(蓝牙未连接)", LED_BTPAIR_CONFIG_EN, 0, LED_DISP_EN);
config(LED, "配对", "配置配对状态下的闪灯状态", LED_PAIRING, 0x60, 0x03, 3, 6, 			LED_BTPAIR_CONFIG_EN);

config(CHECK, "蓝牙已连接状态配置LED", "是否配置蓝牙已连接状态指示灯", LED_BTCONN_CONFIG_EN, 0, LED_DISP_EN);
config(LED, "已连接", "配置已连接状态下的闪灯状态", LED_CONNECTED, 0x00, 0x02, 2, 86, 	LED_BTCONN_CONFIG_EN);

config(CHECK, "低电状态配置LED", "是否配置低电状态指示灯", LED_LOWBAT_CONFIG_EN, 0, RLED_LOWBAT_EN);
config(LED, "低电", "配置低电状态下的闪灯状态", LED_LOWBAT, 0xaa, 0x00, 6, 0, 			LED_LOWBAT_CONFIG_EN);

config(LEVEL, 0x000);
makecfgfile(xcfg.bin);
makecfgdef(xcfg.h);
xcopy(xcfg.h, ../../xcfg.h);
