Kconfig.in 16 KB

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