Kconfig 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. menu "Bluetooth"
  2. config BT_ENABLED
  3. bool "Bluetooth"
  4. help
  5. Select this option to enable Bluetooth and show the submenu with Bluetooth configuration choices.
  6. menu "Bluetooth controller"
  7. visible if BT_ENABLED
  8. choice BTDM_CTRL_MODE
  9. prompt "Bluetooth controller mode (BR/EDR/BLE/DUALMODE)"
  10. depends on BT_ENABLED
  11. help
  12. Specify the bluetooth controller mode (BR/EDR, BLE or dual mode).
  13. config BTDM_CTRL_MODE_BLE_ONLY
  14. bool "BLE Only"
  15. config BTDM_CTRL_MODE_BR_EDR_ONLY
  16. bool "BR/EDR Only"
  17. config BTDM_CTRL_MODE_BTDM
  18. bool "Bluetooth Dual Mode"
  19. endchoice
  20. config BTDM_CTRL_BLE_MAX_CONN
  21. int "BLE Max Connections"
  22. depends on BTDM_CTRL_MODE_BLE_ONLY || BTDM_CTRL_MODE_BTDM
  23. default 3
  24. range 1 9
  25. help
  26. BLE maximum connections of bluetooth controller.
  27. Each connection uses 1KB static DRAM whenever the BT controller is enabled.
  28. config BTDM_CTRL_BR_EDR_MAX_ACL_CONN
  29. int "BR/EDR ACL Max Connections"
  30. depends on BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM
  31. default 2
  32. range 1 7
  33. help
  34. BR/EDR ACL maximum connections of bluetooth controller.
  35. Each connection uses 1.2KB static DRAM whenever the BT controller is enabled.
  36. config BTDM_CTRL_BR_EDR_MAX_SYNC_CONN
  37. int "BR/EDR Sync(SCO/eSCO) Max Connections"
  38. depends on BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM
  39. default 0
  40. range 0 3
  41. help
  42. BR/EDR Synchronize maximum connections of bluetooth controller.
  43. Each connection uses 2KB static DRAM whenever the BT controller is enabled.
  44. choice BTDM_CTRL_BR_EDR_SCO_DATA_PATH
  45. prompt "BR/EDR Sync(SCO/eSCO) default data path"
  46. depends on BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM
  47. default BTDM_CTRL_BR_EDR_SCO_DATA_PATH_PCM
  48. help
  49. SCO data path, i.e. HCI or PCM.
  50. SCO data can be sent/received through HCI synchronous packets, or the data
  51. can be routed to on-chip PCM module on ESP32. PCM input/output signals can
  52. be "matrixed" to GPIOs. The default data path can also be set using API
  53. "esp_bredr_sco_datapath_set"
  54. config BTDM_CTRL_BR_EDR_SCO_DATA_PATH_HCI
  55. bool "HCI"
  56. config BTDM_CTRL_BR_EDR_SCO_DATA_PATH_PCM
  57. bool "PCM"
  58. endchoice
  59. config BTDM_CTRL_BR_EDR_SCO_DATA_PATH_EFF
  60. int
  61. default 0 if BTDM_CTRL_BR_EDR_SCO_DATA_PATH_HCI
  62. default 1 if BTDM_CTRL_BR_EDR_SCO_DATA_PATH_PCM
  63. default 0
  64. config BTDM_CTRL_AUTO_LATENCY
  65. bool "Auto latency"
  66. depends on BTDM_CTRL_MODE_BTDM
  67. default n
  68. help
  69. BLE auto latency, used to enhance classic BT performance
  70. while classic BT and BLE are enabled at the same time.
  71. config BTDM_CTRL_AUTO_LATENCY_EFF
  72. bool
  73. default BTDM_CTRL_AUTO_LATENCY if BTDM_CTRL_MODE_BTDM
  74. default n
  75. config BTDM_CTRL_BLE_MAX_CONN_EFF
  76. int
  77. default BTDM_CTRL_BLE_MAX_CONN if BTDM_CTRL_MODE_BLE_ONLY || BTDM_CTRL_MODE_BTDM
  78. default 0
  79. config BTDM_CTRL_BR_EDR_MAX_ACL_CONN_EFF
  80. int
  81. default BTDM_CTRL_BR_EDR_MAX_ACL_CONN if BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM
  82. default 0
  83. config BTDM_CTRL_BR_EDR_MAX_SYNC_CONN_EFF
  84. int
  85. default BTDM_CTRL_BR_EDR_MAX_SYNC_CONN if BTDM_CTRL_MODE_BR_EDR_ONLY || BTDM_CTRL_MODE_BTDM
  86. default 0
  87. choice BTDM_CTRL_PINNED_TO_CORE_CHOICE
  88. prompt "The cpu core which bluetooth controller run"
  89. depends on BT_ENABLED && !FREERTOS_UNICORE
  90. help
  91. Specify the cpu core to run bluetooth controller.
  92. Can not specify no-affinity.
  93. config BTDM_CTRL_PINNED_TO_CORE_0
  94. bool "Core 0 (PRO CPU)"
  95. config BTDM_CTRL_PINNED_TO_CORE_1
  96. bool "Core 1 (APP CPU)"
  97. depends on !FREERTOS_UNICORE
  98. endchoice
  99. config BTDM_CTRL_PINNED_TO_CORE
  100. int
  101. default 0 if BTDM_CTRL_PINNED_TO_CORE_0
  102. default 1 if BTDM_CTRL_PINNED_TO_CORE_1
  103. default 0
  104. choice BTDM_CTRL_HCI_MODE_CHOICE
  105. prompt "HCI mode"
  106. depends on BT_ENABLED
  107. help
  108. Speicify HCI mode as VHCI or UART(H4)
  109. config BTDM_CTRL_HCI_MODE_VHCI
  110. bool "VHCI"
  111. help
  112. Normal option. Mostly, choose this VHCI when bluetooth host run on ESP32, too.
  113. config BTDM_CTRL_HCI_MODE_UART_H4
  114. bool "UART(H4)"
  115. help
  116. If use external bluetooth host which run on other hardware and use UART as the HCI interface,
  117. choose this option.
  118. endchoice
  119. menu "HCI UART(H4) Options"
  120. visible if BTDM_CTRL_HCI_MODE_UART_H4
  121. config BT_HCI_UART_NO
  122. int "UART Number for HCI"
  123. depends on BTDM_CTRL_HCI_MODE_UART_H4
  124. range 1 2
  125. default 1
  126. help
  127. Uart number for HCI. The available uart is UART1 and UART2.
  128. config BT_HCI_UART_BAUDRATE
  129. int "UART Baudrate for HCI"
  130. depends on BTDM_CTRL_HCI_MODE_UART_H4
  131. range 115200 921600
  132. default 921600
  133. help
  134. UART Baudrate for HCI. Please use standard baudrate.
  135. endmenu
  136. menu "MODEM SLEEP Options"
  137. visible if BT_ENABLED
  138. config BTDM_MODEM_SLEEP
  139. bool "Bluetooth modem sleep"
  140. depends on BT_ENABLED
  141. default y
  142. help
  143. Enable/disable bluetooth controller low power mode.
  144. choice BTDM_MODEM_SLEEP_MODE
  145. prompt "Bluetooth Modem sleep mode"
  146. depends on BTDM_MODEM_SLEEP
  147. help
  148. To select which strategy to use for modem sleep
  149. config BTDM_MODEM_SLEEP_MODE_ORIG
  150. bool "ORIG Mode(sleep with low power clock)"
  151. help
  152. ORIG mode is a bluetooth sleep mode that can be used for dual mode controller. In this mode,
  153. bluetooth controller sleeps between BR/EDR frames and BLE events. A low power clock is used to
  154. maintain bluetooth reference clock.
  155. config BTDM_MODEM_SLEEP_MODE_EVED
  156. bool "EVED Mode(For internal test only)"
  157. help
  158. EVED mode is for BLE only and is only for internal test. Do not use it for production. this
  159. mode is not compatible with DFS nor light sleep
  160. endchoice
  161. choice BTDM_LOW_POWER_CLOCK
  162. prompt "Bluetooth low power clock"
  163. depends on BTDM_MODEM_SLEEP_MODE_ORIG
  164. help
  165. Select the low power clock source for bluetooth controller. Bluetooth low power clock is
  166. the clock source to maintain time in sleep mode.
  167. - "Main crystal" option provides good accuracy and can support Dynamic Frequency Scaling
  168. to be used with Bluetooth modem sleep. Light sleep is not supported.
  169. - "External 32kHz crystal" option allows user to use a 32.768kHz crystal as Bluetooth low
  170. power clock. This option is allowed as long as External 32kHz crystal is configured as
  171. the system RTC clock source. This option provides good accuracy and supports Bluetooth
  172. modem sleep to be used alongside Dynamic Frequency Scaling or light sleep.
  173. config BTDM_LPCLK_SEL_MAIN_XTAL
  174. bool "Main crystal"
  175. help
  176. Main crystal can be used as low power clock for bluetooth modem sleep. If this option is
  177. selected, bluetooth modem sleep can work under Dynamic Frequency Scaling(DFS) enabled, but
  178. cannot work when light sleep is enabled. Main crystal has a good performance in accuracy as
  179. the bluetooth low power clock source.
  180. config BTDM_LPCLK_SEL_EXT_32K_XTAL
  181. bool "External 32kHz crystal"
  182. depends on ESP32_RTC_CLK_SRC_EXT_CRYS
  183. help
  184. External 32kHz crystal has a nominal frequency of 32.768kHz and provides good frequency
  185. stability. If used as Bluetooth low power clock, External 32kHz can support Bluetooth
  186. modem sleep to be used with both DFS and light sleep.
  187. endchoice
  188. endmenu
  189. choice BTDM_BLE_SLEEP_CLOCK_ACCURACY
  190. prompt "BLE Sleep Clock Accuracy"
  191. depends on BTDM_CTRL_MODE_BLE_ONLY || BTDM_CTRL_MODE_BTDM
  192. default BTDM_BLE_DEFAULT_SCA_250PPM
  193. help
  194. BLE Sleep Clock Accuracy(SCA) for the local device is used to estimate window widening in BLE
  195. connection events. With a lower level of clock accuracy(e.g. 500ppm over 250ppm), the slave
  196. needs a larger RX window to synchronize with master in each anchor point, thus resulting in an
  197. increase of power consumption but a higher level of robustness in keeping connected. According
  198. to the requirements of Bluetooth Core specification 4.2, the worst-case accuracy of Classic
  199. Bluetooth low power oscialltor(LPO) is +/-250ppm in STANDBY and in low power modes such as
  200. sniff. For BLE the worst-case SCA is +/-500ppm.
  201. - "151ppm to 250ppm" option is the default value for Bluetooth Dual mode
  202. - "251ppm to 500ppm" option can be used in BLE only mode when using external 32kHz crystal as
  203. low power clock. This option is provided in case that BLE sleep clock has a lower level of
  204. accuracy, or other error sources contribute to the inaccurate timing during sleep.
  205. config BTDM_BLE_DEFAULT_SCA_500PPM
  206. bool "251ppm to 500ppm"
  207. depends on BTDM_LPCLK_SEL_EXT_32K_XTAL && BTDM_CTRL_MODE_BLE_ONLY
  208. config BTDM_BLE_DEFAULT_SCA_250PPM
  209. bool "151ppm to 250ppm"
  210. endchoice
  211. config BTDM_BLE_SLEEP_CLOCK_ACCURACY_INDEX_EFF
  212. int
  213. default 0 if BTDM_BLE_DEFAULT_SCA_500PPM
  214. default 1 if BTDM_BLE_DEFAULT_SCA_250PPM
  215. default 1
  216. config BTDM_BLE_SCAN_DUPL
  217. bool "BLE Scan Duplicate Options"
  218. depends on (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY)
  219. default y
  220. help
  221. This select enables parameters setting of BLE scan duplicate.
  222. choice BTDM_SCAN_DUPL_TYPE
  223. prompt "Scan Duplicate Type"
  224. default BTDM_SCAN_DUPL_TYPE_DEVICE
  225. depends on BTDM_BLE_SCAN_DUPL
  226. help
  227. Scan duplicate have three ways. one is "Scan Duplicate By Device Address", This way is to use
  228. advertiser address filtering. The adv packet of the same address is only allowed to be reported once.
  229. Another way is "Scan Duplicate By Device Address And Advertising Data". This way is to use advertising
  230. data and device address filtering. All different adv packets with the same address are allowed to be
  231. reported. The last way is "Scan Duplicate By Advertising Data". This way is to use advertising data
  232. filtering. All same advertising data only allow to be reported once even though they are from
  233. different devices.
  234. config BTDM_SCAN_DUPL_TYPE_DEVICE
  235. bool "Scan Duplicate By Device Address"
  236. help
  237. This way is to use advertiser address filtering. The adv packet of the same address is only
  238. allowed to be reported once
  239. config BTDM_SCAN_DUPL_TYPE_DATA
  240. bool "Scan Duplicate By Advertising Data"
  241. help
  242. This way is to use advertising data filtering. All same advertising data only allow to be reported
  243. once even though they are from different devices.
  244. config BTDM_SCAN_DUPL_TYPE_DATA_DEVICE
  245. bool "Scan Duplicate By Device Address And Advertising Data"
  246. help
  247. This way is to use advertising data and device address filtering. All different adv packets with
  248. the same address are allowed to be reported.
  249. endchoice
  250. config BTDM_SCAN_DUPL_TYPE
  251. int
  252. depends on BTDM_BLE_SCAN_DUPL
  253. default 0 if BTDM_SCAN_DUPL_TYPE_DEVICE
  254. default 1 if BTDM_SCAN_DUPL_TYPE_DATA
  255. default 2 if BTDM_SCAN_DUPL_TYPE_DATA_DEVICE
  256. default 0
  257. config BTDM_SCAN_DUPL_CACHE_SIZE
  258. int "Maximum number of devices in scan duplicate filter"
  259. depends on BTDM_BLE_SCAN_DUPL
  260. range 10 1000
  261. default 200
  262. help
  263. Maximum number of devices which can be recorded in scan duplicate filter.
  264. When the maximum amount of device in the filter is reached, the cache will be refreshed.
  265. config BTDM_BLE_MESH_SCAN_DUPL_EN
  266. bool "Special duplicate scan mechanism for BLE Mesh scan"
  267. depends on BTDM_BLE_SCAN_DUPL
  268. default n
  269. help
  270. This enables the BLE scan duplicate for special BLE Mesh scan.
  271. config BTDM_MESH_DUPL_SCAN_CACHE_SIZE
  272. int "Maximum number of Mesh adv packets in scan duplicate filter"
  273. depends on BTDM_BLE_MESH_SCAN_DUPL_EN
  274. range 10 1000
  275. default 200
  276. help
  277. Maximum number of adv packets which can be recorded in duplicate scan cache for BLE Mesh.
  278. When the maximum amount of device in the filter is reached, the cache will be refreshed.
  279. config BTDM_CTRL_FULL_SCAN_SUPPORTED
  280. bool "BLE full scan feature supported"
  281. depends on BTDM_CTRL_MODE_BLE_ONLY || BTDM_CTRL_MODE_BTDM
  282. default y
  283. help
  284. The full scan function is mainly used to provide BLE scan performance.
  285. This is required for scenes with high scan performance requirements, such as BLE Mesh scenes.
  286. config BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP
  287. bool "BLE adv report flow control supported"
  288. depends on (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY)
  289. default y
  290. help
  291. The function is mainly used to enable flow control for advertising reports. When it is enabled,
  292. advertising reports will be discarded by the controller if the number of unprocessed advertising
  293. reports exceeds the size of BLE adv report flow control.
  294. config BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM
  295. int "BLE adv report flow control number"
  296. depends on BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP
  297. range 50 1000
  298. default 100
  299. help
  300. The number of unprocessed advertising report that Bluedroid can save.If you set
  301. `BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM` to a small value, this may cause adv packets lost.
  302. If you set `BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM` to a large value, Bluedroid may cache a
  303. lot of adv packets and this may cause system memory run out. For example, if you set
  304. it to 50, the maximum memory consumed by host is 35 * 50 bytes. Please set
  305. `BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM` according to your system free memory and handle adv
  306. packets as fast as possible, otherwise it will cause adv packets lost.
  307. config BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD
  308. int "BLE adv lost event threshold value"
  309. depends on BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP
  310. range 1 1000
  311. default 20
  312. help
  313. When adv report flow control is enabled, The ADV lost event will be generated when the number
  314. of ADV packets lost in the controller reaches this threshold. It is better to set a larger value.
  315. If you set `BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD` to a small value or printf every adv lost event, it
  316. may cause adv packets lost more.
  317. menuconfig BTDM_COEX_BT_OPTIONS
  318. bool "Coexistence Bluetooth Side Options"
  319. depends on ESP32_WIFI_SW_COEXIST_ENABLE
  320. default n
  321. help
  322. Options of Bluetooth Side of WiFi and bluetooth coexistence.
  323. config BTDM_COEX_BLE_ADV_HIGH_PRIORITY
  324. bool "Improve BLE ADV priority for WiFi & BLE coexistence"
  325. depends on BTDM_COEX_BT_OPTIONS
  326. default n
  327. help
  328. Improve BLE ADV coexistence priority to make it better performance.
  329. For example, BLE mesh need to enable this option to improve BLE adv performance.
  330. endmenu
  331. choice BT_HOST
  332. prompt "Bluetooth Host"
  333. depends on BT_ENABLED && BTDM_CTRL_HCI_MODE_VHCI
  334. default BT_BLUEDROID_ENABLED
  335. help
  336. This helps to choose Bluetooth host stack
  337. config BT_BLUEDROID_ENABLED
  338. bool "Bluedroid - Dual-mode"
  339. help
  340. This option is recommended for classic Bluetooth or for dual-mode
  341. usecases
  342. config BT_NIMBLE_ENABLED
  343. bool "NimBLE - BLE only"
  344. help
  345. This option is recommended for BLE only usecases to save on memory
  346. config BT_CONTROLLER_ONLY
  347. bool "Controller Only"
  348. help
  349. This option is recommended when you want to communicate directly with the
  350. controller (without any host) or when you are using any other host stack
  351. not supported by Espressif (not mentioned here).
  352. endchoice
  353. menu "Bluedroid Options"
  354. visible if BT_BLUEDROID_ENABLED
  355. source "$IDF_PATH/components/bt/host/bluedroid/Kconfig.in"
  356. endmenu
  357. menu "NimBLE Options"
  358. visible if BT_NIMBLE_ENABLED
  359. source "$IDF_PATH/components/bt/host/nimble/Kconfig.in"
  360. endmenu
  361. endmenu
  362. menuconfig BLE_MESH
  363. bool "ESP BLE Mesh Support"
  364. help
  365. This option enables ESP BLE Mesh support. The specific features that are
  366. available may depend on other features that have been enabled in the
  367. stack, such as Bluetooth Support, Bluedroid Support & GATT support.
  368. source "$IDF_PATH/components/bt/esp_ble_mesh/Kconfig.in"