1choice BTDM_CTRL_MODE 2 prompt "Bluetooth controller mode (BR/EDR/BLE/DUALMODE)" 3 help 4 Specify the bluetooth controller mode (BR/EDR, BLE or dual mode). 5 6 config BTDM_CTRL_MODE_BLE_ONLY 7 bool "BLE Only" 8 9 config BTDM_CTRL_MODE_BR_EDR_ONLY 10 bool "BR/EDR Only" 11 12 config BTDM_CTRL_MODE_BTDM 13 bool "Bluetooth Dual Mode" 14 15endchoice 16 17config BTDM_CTRL_BLE_MAX_CONN 18 int "BLE Max Connections" 19 depends on BTDM_CTRL_MODE_BLE_ONLY || BTDM_CTRL_MODE_BTDM 20 default 3 21 range 1 9 22 help 23 BLE maximum connections of bluetooth controller. 24 Each connection uses 1KB static DRAM whenever the BT controller is enabled. 25 26config BTDM_CTRL_BR_EDR_MAX_ACL_CONN 27 int "BR/EDR ACL Max Connections" 28 depends on BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM 29 default 2 30 range 1 7 31 help 32 BR/EDR ACL maximum connections of bluetooth controller. 33 Each connection uses 1.2 KB DRAM whenever the BT controller is enabled. 34 35config BTDM_CTRL_BR_EDR_MAX_SYNC_CONN 36 int "BR/EDR Sync(SCO/eSCO) Max Connections" 37 depends on BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM 38 default 0 39 range 0 3 40 help 41 BR/EDR Synchronize maximum connections of bluetooth controller. 42 Each connection uses 2 KB DRAM whenever the BT controller is enabled. 43 44 45 46choice BTDM_CTRL_BR_EDR_SCO_DATA_PATH 47 prompt "BR/EDR Sync(SCO/eSCO) default data path" 48 depends on BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM 49 default BTDM_CTRL_BR_EDR_SCO_DATA_PATH_PCM 50 help 51 SCO data path, i.e. HCI or PCM. 52 SCO data can be sent/received through HCI synchronous packets, or the data 53 can be routed to on-chip PCM module on ESP32. PCM input/output signals can 54 be "matrixed" to GPIOs. The default data path can also be set using API 55 "esp_bredr_sco_datapath_set" 56 57 config BTDM_CTRL_BR_EDR_SCO_DATA_PATH_HCI 58 bool "HCI" 59 config BTDM_CTRL_BR_EDR_SCO_DATA_PATH_PCM 60 bool "PCM" 61endchoice 62 63config BTDM_CTRL_BR_EDR_SCO_DATA_PATH_EFF 64 int 65 default 0 if BTDM_CTRL_BR_EDR_SCO_DATA_PATH_HCI 66 default 1 if BTDM_CTRL_BR_EDR_SCO_DATA_PATH_PCM 67 default 0 68 69menuconfig BTDM_CTRL_PCM_ROLE_EDGE_CONFIG 70 bool "PCM Signal Config (Role and Polar)" 71 depends on BTDM_CTRL_BR_EDR_SCO_DATA_PATH_PCM 72 default y 73 74choice BTDM_CTRL_PCM_ROLE 75 prompt "PCM Role" 76 depends on BTDM_CTRL_PCM_ROLE_EDGE_CONFIG 77 help 78 PCM role can be configured as PCM master or PCM slave 79 80 config BTDM_CTRL_PCM_ROLE_MASTER 81 bool "PCM Master" 82 config BTDM_CTRL_PCM_ROLE_SLAVE 83 bool "PCM Slave" 84endchoice 85 86choice BTDM_CTRL_PCM_POLAR 87 prompt "PCM Polar" 88 depends on BTDM_CTRL_PCM_ROLE_EDGE_CONFIG 89 help 90 PCM polarity can be configured as Falling Edge or Rising Edge 91 92 config BTDM_CTRL_PCM_POLAR_FALLING_EDGE 93 bool "Falling Edge" 94 config BTDM_CTRL_PCM_POLAR_RISING_EDGE 95 bool "Rising Edge" 96endchoice 97 98config BTDM_CTRL_PCM_ROLE_EFF 99 int 100 default 0 if BTDM_CTRL_PCM_ROLE_MASTER 101 default 1 if BTDM_CTRL_PCM_ROLE_SLAVE 102 default 0 103 104config BTDM_CTRL_PCM_POLAR_EFF 105 int 106 default 0 if BTDM_CTRL_PCM_POLAR_FALLING_EDGE 107 default 1 if BTDM_CTRL_PCM_POLAR_RISING_EDGE 108 default 0 109 110config BTDM_CTRL_AUTO_LATENCY 111 bool "Auto latency" 112 depends on BTDM_CTRL_MODE_BTDM 113 default n 114 help 115 BLE auto latency, used to enhance classic BT performance 116 while classic BT and BLE are enabled at the same time. 117 118config BTDM_CTRL_AUTO_LATENCY_EFF 119 bool 120 default BTDM_CTRL_AUTO_LATENCY if BTDM_CTRL_MODE_BTDM 121 default n 122 123config BTDM_CTRL_LEGACY_AUTH_VENDOR_EVT 124 bool "Legacy Authentication Vendor Specific Event Enable" 125 depends on BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM 126 default y 127 help 128 To protect from BIAS attack during Legacy authentication, 129 Legacy authentication Vendor specific event should be enabled 130 131config BTDM_CTRL_LEGACY_AUTH_VENDOR_EVT_EFF 132 bool 133 default BTDM_CTRL_LEGACY_AUTH_VENDOR_EVT if BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM 134 default 0 135 136 137config BTDM_CTRL_BLE_MAX_CONN_EFF 138 int 139 default BTDM_CTRL_BLE_MAX_CONN if BTDM_CTRL_MODE_BLE_ONLY || BTDM_CTRL_MODE_BTDM 140 default 0 141 142config BTDM_CTRL_BR_EDR_MAX_ACL_CONN_EFF 143 int 144 default BTDM_CTRL_BR_EDR_MAX_ACL_CONN if BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM 145 default 0 146 147config BTDM_CTRL_BR_EDR_MAX_SYNC_CONN_EFF 148 int 149 default BTDM_CTRL_BR_EDR_MAX_SYNC_CONN if BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM 150 default 0 151 152choice BTDM_CTRL_PINNED_TO_CORE_CHOICE 153 prompt "The cpu core which bluetooth controller run" 154 depends on !FREERTOS_UNICORE 155 help 156 Specify the cpu core to run bluetooth controller. 157 Can not specify no-affinity. 158 159 config BTDM_CTRL_PINNED_TO_CORE_0 160 bool "Core 0 (PRO CPU)" 161 config BTDM_CTRL_PINNED_TO_CORE_1 162 bool "Core 1 (APP CPU)" 163 depends on !FREERTOS_UNICORE 164endchoice 165 166config BTDM_CTRL_PINNED_TO_CORE 167 int 168 default 0 if BTDM_CTRL_PINNED_TO_CORE_0 169 default 1 if BTDM_CTRL_PINNED_TO_CORE_1 170 default 0 171 172choice BTDM_CTRL_HCI_MODE_CHOICE 173 prompt "HCI mode" 174 help 175 Specify HCI mode as VHCI or UART(H4) 176 177 config BTDM_CTRL_HCI_MODE_VHCI 178 bool "VHCI" 179 help 180 Normal option. Mostly, choose this VHCI when bluetooth host run on ESP32, too. 181 182 config BTDM_CTRL_HCI_MODE_UART_H4 183 bool "UART(H4)" 184 help 185 If use external bluetooth host which run on other hardware and use UART as the HCI interface, 186 choose this option. 187endchoice 188 189menu "HCI UART(H4) Options" 190 visible if BTDM_CTRL_HCI_MODE_UART_H4 191 192 config BTDM_CTRL_HCI_UART_NO 193 int "UART Number for HCI" 194 depends on BTDM_CTRL_HCI_MODE_UART_H4 195 range 1 2 196 default 1 197 help 198 Uart number for HCI. The available uart is UART1 and UART2. 199 200 config BTDM_CTRL_HCI_UART_BAUDRATE 201 int "UART Baudrate for HCI" 202 depends on BTDM_CTRL_HCI_MODE_UART_H4 203 range 115200 921600 204 default 921600 205 help 206 UART Baudrate for HCI. Please use standard baudrate. 207 208 config BTDM_CTRL_HCI_UART_FLOW_CTRL_EN 209 bool "Enable UART flow control" 210 depends on BTDM_CTRL_HCI_MODE_UART_H4 211 default y 212 213endmenu 214 215menu "MODEM SLEEP Options" 216 config BTDM_CTRL_MODEM_SLEEP 217 bool "Bluetooth modem sleep" 218 default y 219 help 220 Enable/disable bluetooth controller low power mode. 221 222 choice BTDM_CTRL_MODEM_SLEEP_MODE 223 prompt "Bluetooth Modem sleep mode" 224 depends on BTDM_CTRL_MODEM_SLEEP 225 help 226 To select which strategy to use for modem sleep 227 228 config BTDM_CTRL_MODEM_SLEEP_MODE_ORIG 229 bool "ORIG Mode(sleep with low power clock)" 230 help 231 ORIG mode is a bluetooth sleep mode that can be used for dual mode controller. In this mode, 232 bluetooth controller sleeps between BR/EDR frames and BLE events. A low power clock is used to 233 maintain bluetooth reference clock. 234 235 config BTDM_CTRL_MODEM_SLEEP_MODE_EVED 236 bool "EVED Mode(For internal test only)" 237 help 238 EVED mode is for BLE only and is only for internal test. Do not use it for production. this 239 mode is not compatible with DFS nor light sleep 240 endchoice 241 242 choice BTDM_CTRL_LOW_POWER_CLOCK 243 prompt "Bluetooth low power clock" 244 depends on BTDM_CTRL_MODEM_SLEEP_MODE_ORIG 245 help 246 Select the low power clock source for bluetooth controller. Bluetooth low power clock is 247 the clock source to maintain time in sleep mode. 248 249 - "Main crystal" option provides good accuracy and can support Dynamic Frequency Scaling 250 to be used with Bluetooth modem sleep. Light sleep is not supported. 251 - "External 32kHz crystal" option allows user to use a 32.768kHz crystal as Bluetooth low 252 power clock. This option is allowed as long as External 32kHz crystal is configured as 253 the system RTC clock source. This option provides good accuracy and supports Bluetooth 254 modem sleep to be used alongside Dynamic Frequency Scaling or light sleep. 255 256 config BTDM_CTRL_LPCLK_SEL_MAIN_XTAL 257 bool "Main crystal" 258 help 259 Main crystal can be used as low power clock for bluetooth modem sleep. If this option is 260 selected, bluetooth modem sleep can work under Dynamic Frequency Scaling(DFS) enabled, but 261 cannot work when light sleep is enabled. Main crystal has a good performance in accuracy as 262 the bluetooth low power clock source. 263 264 config BTDM_CTRL_LPCLK_SEL_EXT_32K_XTAL 265 bool "External 32kHz crystal/oscillator" 266 depends on RTC_CLK_SRC_EXT_CRYS || RTC_CLK_SRC_EXT_OSC 267 help 268 External 32kHz crystal/oscillator has a nominal frequency of 32.768kHz and provides good frequency 269 stability. If used as Bluetooth low power clock, External 32kHz can support Bluetooth 270 modem sleep to be used with both DFS and light sleep. 271 endchoice 272 273endmenu 274 275choice BTDM_BLE_SLEEP_CLOCK_ACCURACY 276 prompt "BLE Sleep Clock Accuracy" 277 depends on BTDM_CTRL_MODE_BLE_ONLY || BTDM_CTRL_MODE_BTDM 278 default BTDM_BLE_DEFAULT_SCA_250PPM 279 help 280 BLE Sleep Clock Accuracy(SCA) for the local device is used to estimate window widening in BLE 281 connection events. With a lower level of clock accuracy(e.g. 500ppm over 250ppm), the slave 282 needs a larger RX window to synchronize with master in each anchor point, thus resulting in an 283 increase of power consumption but a higher level of robustness in keeping connected. According 284 to the requirements of Bluetooth Core specification 4.2, the worst-case accuracy of Classic 285 Bluetooth low power oscialltor(LPO) is +/-250ppm in STANDBY and in low power modes such as 286 sniff. For BLE the worst-case SCA is +/-500ppm. 287 288 - "151ppm to 250ppm" option is the default value for Bluetooth Dual mode 289 - "251ppm to 500ppm" option can be used in BLE only mode when using external 32kHz crystal as 290 low power clock. This option is provided in case that BLE sleep clock has a lower level of 291 accuracy, or other error sources contribute to the inaccurate timing during sleep. 292 293 config BTDM_BLE_DEFAULT_SCA_500PPM 294 bool "251ppm to 500ppm" 295 depends on BTDM_CTRL_LPCLK_SEL_EXT_32K_XTAL && BTDM_CTRL_MODE_BLE_ONLY 296 config BTDM_BLE_DEFAULT_SCA_250PPM 297 bool "151ppm to 250ppm" 298endchoice 299config BTDM_BLE_SLEEP_CLOCK_ACCURACY_INDEX_EFF 300 int 301 default 0 if BTDM_BLE_DEFAULT_SCA_500PPM 302 default 1 if BTDM_BLE_DEFAULT_SCA_250PPM 303 default 1 304 305config BTDM_BLE_SCAN_DUPL 306 bool "BLE Scan Duplicate Options" 307 depends on (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY) 308 default y 309 help 310 This select enables parameters setting of BLE scan duplicate. 311 312choice BTDM_SCAN_DUPL_TYPE 313 prompt "Scan Duplicate Type" 314 default BTDM_SCAN_DUPL_TYPE_DEVICE 315 depends on BTDM_BLE_SCAN_DUPL 316 help 317 Scan duplicate have three ways. one is "Scan Duplicate By Device Address", This way is to use 318 advertiser address filtering. The adv packet of the same address is only allowed to be reported once. 319 Another way is "Scan Duplicate By Device Address And Advertising Data". This way is to use advertising 320 data and device address filtering. All different adv packets with the same address are allowed to be 321 reported. The last way is "Scan Duplicate By Advertising Data". This way is to use advertising data 322 filtering. All same advertising data only allow to be reported once even though they are from 323 different devices. 324 325 config BTDM_SCAN_DUPL_TYPE_DEVICE 326 bool "Scan Duplicate By Device Address" 327 help 328 This way is to use advertiser address filtering. The adv packet of the same address is only 329 allowed to be reported once 330 331 config BTDM_SCAN_DUPL_TYPE_DATA 332 bool "Scan Duplicate By Advertising Data" 333 help 334 This way is to use advertising data filtering. All same advertising data only allow to be reported 335 once even though they are from different devices. 336 337 config BTDM_SCAN_DUPL_TYPE_DATA_DEVICE 338 bool "Scan Duplicate By Device Address And Advertising Data" 339 help 340 This way is to use advertising data and device address filtering. All different adv packets with 341 the same address are allowed to be reported. 342endchoice 343 344config BTDM_SCAN_DUPL_TYPE 345 int 346 depends on BTDM_BLE_SCAN_DUPL 347 default 0 if BTDM_SCAN_DUPL_TYPE_DEVICE 348 default 1 if BTDM_SCAN_DUPL_TYPE_DATA 349 default 2 if BTDM_SCAN_DUPL_TYPE_DATA_DEVICE 350 default 0 351 352config BTDM_SCAN_DUPL_CACHE_SIZE 353 int "Maximum number of devices in scan duplicate filter" 354 depends on BTDM_BLE_SCAN_DUPL 355 range 10 1000 356 default 100 357 help 358 Maximum number of devices which can be recorded in scan duplicate filter. 359 When the maximum amount of device in the filter is reached, the oldest device will be refreshed. 360 361config BTDM_SCAN_DUPL_CACHE_REFRESH_PERIOD 362 int "Duplicate scan list refresh period (seconds)" 363 depends on BTDM_BLE_SCAN_DUPL 364 range 0 1000 365 default 0 366 help 367 If the period value is non-zero, the controller will periodically clear the device information 368 stored in the scan duuplicate filter. If it is 0, the scan duuplicate filter will not be cleared 369 until the scanning is disabled. Duplicate advertisements for this period should not be sent to the 370 Host in advertising report events. 371 There are two scenarios where the ADV packet will be repeatedly reported: 372 1. The duplicate scan cache is full, the controller will delete the oldest device information and 373 add new device information. 374 2. When the refresh period is up, the controller will clear all device information and start filtering 375 again. 376 377config BTDM_BLE_MESH_SCAN_DUPL_EN 378 bool "Special duplicate scan mechanism for BLE Mesh scan" 379 depends on BTDM_BLE_SCAN_DUPL 380 default n 381 help 382 This enables the BLE scan duplicate for special BLE Mesh scan. 383 384config BTDM_MESH_DUPL_SCAN_CACHE_SIZE 385 int "Maximum number of Mesh adv packets in scan duplicate filter" 386 depends on BTDM_BLE_MESH_SCAN_DUPL_EN 387 range 10 1000 388 default 100 389 help 390 Maximum number of adv packets which can be recorded in duplicate scan cache for BLE Mesh. 391 When the maximum amount of device in the filter is reached, the cache will be refreshed. 392 393config BTDM_CTRL_FULL_SCAN_SUPPORTED 394 bool "BLE full scan feature supported" 395 depends on BTDM_CTRL_MODE_BLE_ONLY || BTDM_CTRL_MODE_BTDM 396 default y 397 help 398 The full scan function is mainly used to provide BLE scan performance. 399 This is required for scenes with high scan performance requirements, such as BLE Mesh scenes. 400 401config BTDM_CTRL_SCAN_BACKOFF_UPPERLIMITMAX 402 bool "Disable active scan backoff" 403 default n 404 help 405 Disable active scan backoff. The bluetooth spec requires that scanners should run a backoff procedure to 406 minimize collision of scan request PDUs from nultiple scanners. If scan backoff is disabled, in active 407 scanning, scan request PDU will be sent every time when HW receives scannable ADV PDU. 408 409config BTDM_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS 410 bool "Enable enhanced Access Address check in CONNECT_IND" 411 default n 412 help 413 Enabling this option will add stricter verification of the Access Address in the CONNECT_IND PDU. 414 This improves security by ensuring that only connection requests with valid Access Addresses are accepted. 415 If disabled, only basic checks are applied, improving compatibility. 416 417 418config BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP 419 bool "BLE adv report flow control supported" 420 depends on (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY) 421 default y 422 help 423 The function is mainly used to enable flow control for advertising reports. When it is enabled, 424 advertising reports will be discarded by the controller if the number of unprocessed advertising 425 reports exceeds the size of BLE adv report flow control. 426 427config BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM 428 int "BLE adv report flow control number" 429 depends on BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP 430 range 50 1000 431 default 100 432 help 433 The number of unprocessed advertising report that Bluedroid can save.If you set 434 `BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM` to a small value, this may cause adv packets lost. 435 If you set `BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM` to a large value, Bluedroid may cache a 436 lot of adv packets and this may cause system memory run out. For example, if you set 437 it to 50, the maximum memory consumed by host is 35 * 50 bytes. Please set 438 `BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM` according to your system free memory and handle adv 439 packets as fast as possible, otherwise it will cause adv packets lost. 440 441config BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD 442 int "BLE adv lost event threshold value" 443 depends on BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP 444 range 1 1000 445 default 20 446 help 447 When adv report flow control is enabled, The ADV lost event will be generated when the number 448 of ADV packets lost in the controller reaches this threshold. It is better to set a larger value. 449 If you set `BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD` to a small value or printf every adv lost event, it 450 may cause adv packets lost more. 451 452menu "BLE disconnect when instant passed" 453 config BTDM_BLE_LLCP_CONN_UPDATE 454 bool "BLE ACL connection update procedure" 455 depends on (BTDM_CTRL_MODE_BLE_ONLY || BTDM_CTRL_MODE_BTDM) 456 default n 457 help 458 If this option is enabled, Controller will terminate the connection 459 when instant passed during connection update procedure. 460 461 config BTDM_BLE_LLCP_CHAN_MAP_UPDATE 462 bool "BLE ACL channel map update procedure" 463 depends on (BTDM_CTRL_MODE_BLE_ONLY || BTDM_CTRL_MODE_BTDM) 464 default n 465 help 466 If this option is enabled, Controller will terminate the connection 467 when instant passed in channel map update procedure. 468endmenu 469 470config BTDM_BLE_CHAN_ASS_EN 471 bool "Enable channel assessment" 472 depends on (BTDM_CTRL_MODE_BLE_ONLY || BTDM_CTRL_MODE_BTDM) 473 default y 474 help 475 If this option is enabled, The Controller will records the communication quality 476 for each channel and then start a timer to check and update the channel map every 4 seconds. 477 478config BTDM_BLE_PING_EN 479 bool "Enable LE Ping procedure" 480 depends on (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY) 481 default y 482 help 483 If this option is disabled, The Controller will not start the LE authenticated payload timer. 484 This option is used for some compatibility problems related to LE ping procedure. 485 486config BTDM_BLE_VS_QA_SUPPORT 487 bool "BLE vendor HCI QA support" 488 depends on (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY) 489 default n 490 help 491 This enables BLE vendor HCI command and event for QA. 492 493config BTDM_RESERVE_DRAM 494 hex 495 default 0xdb5c if BT_ENABLED 496 default 0 497 498config BTDM_CTRL_HLI 499 bool "High level interrupt" 500 depends on BT_ENABLED 501 default y 502 help 503 Using Level 4 interrupt for Bluetooth. 504