Kconfig 20 KB

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