Kconfig.in 16 KB

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