blob: 239c2a8efe11fdba540e53259bbfe72c0d3269e4 [file] [log] [blame]
Piotr Pryga02859032020-10-26 06:23:02 -07001# Zephyr Bluetooth Controller configuration options
2
3# Copyright (c) 2020 Nordic Semiconductor ASA
4# SPDX-License-Identifier: Apache-2.0
5
Piotr Pryga622299b2023-05-19 19:12:13 +02006# BT_CTLR_DF_SUPPORT is a wrapper for all DF features. It is referenced by Host
7# to enable its DF related Kconfigs when build together with the Controller.
8# It is required to enable it when Controller supports any DF related feature
9# but particular features are selected individually.
Piotr Pryga02859032020-10-26 06:23:02 -070010config BT_CTLR_DF_SUPPORT
11 bool
Piotr Pryga622299b2023-05-19 19:12:13 +020012
13if BT_CTLR_DF_SUPPORT
Piotr Pryga02859032020-10-26 06:23:02 -070014
15config BT_CTLR_DF_CTE_TX_SUPPORT
16 bool
17
Piotr Prygaf3e04892020-11-18 23:08:57 -080018config BT_CTLR_DF_CTE_RX_SUPPORT
19 bool
20
21config BT_CTLR_DF_CTE_RX_SAMPLE_1US_SUPPORT
22 bool
23
Piotr Pryga02859032020-10-26 06:23:02 -070024config BT_CTLR_DF_ANT_SWITCH_2US_SUPPORT
25 bool
26
27config BT_CTLR_DF_ANT_SWITCH_1US_SUPPORT
28 bool
29
Piotr Prygae03f9c32021-09-04 14:13:47 +020030config BT_CTLR_CTEINLINE_SUPPORT
31 bool
32
Piotr Pryga622299b2023-05-19 19:12:13 +020033endif # BT_CTLR_DF_SUPPORT
34
Piotr Pryga02859032020-10-26 06:23:02 -070035menuconfig BT_CTLR_DF
Piotr Prygaf3d460f2022-05-25 10:58:14 +020036 bool "LE Direction Finding"
Rubin Gerritsenb25a2fa2022-04-21 13:47:28 +020037 depends on BT_CTLR_DF_CTE_TX_SUPPORT || BT_CTLR_DF_CTE_RX_SUPPORT
Piotr Pryga02859032020-10-26 06:23:02 -070038 help
39 Enable support for Bluetooth 5.1 Direction Finding
40
41if BT_CTLR_DF
42
43# Basic controller functionalities required for implementation of
44# Bluetooth v5.1 Direction Finding
45
46config BT_CTLR_DF_CTE_TX
Gerard Marull-Paretas95fb0de2022-03-09 12:05:12 +010047 bool "Transmission of Constant Tone Extension"
Piotr Pryga02859032020-10-26 06:23:02 -070048 depends on BT_CTLR_DF_CTE_TX_SUPPORT
49 default y
50 help
51 Enable support for transmission of Constant Tone Extension in
52 controller.
53
Piotr Prygaf3e04892020-11-18 23:08:57 -080054config BT_CTLR_DF_CTE_RX_SAMPLE_1US
Gerard Marull-Paretas95fb0de2022-03-09 12:05:12 +010055 bool "Reception of CTE with 1us sampling slots"
Piotr Prygaf3e04892020-11-18 23:08:57 -080056 depends on BT_CTLR_DF_CTE_RX_SAMPLE_1US_SUPPORT
57 default y
58 help
59 Enable reception of Constant Tone Extension. Process IQ sampling
60 during CTE reception with 1us sampling slots.
61 This sampling mode is optional for Direction Finding according to
62 Bluetooth v5.1.
63
Piotr Pryga307ac642020-11-20 05:16:05 -080064config BT_CTLR_DF_ANT_SWITCH_1US
Gerard Marull-Paretas95fb0de2022-03-09 12:05:12 +010065 bool "Support for 1us antenna switch slots"
Piotr Pryga02859032020-10-26 06:23:02 -070066 depends on BT_CTLR_DF_ANT_SWITCH_1US_SUPPORT
67 default y
68 help
69 Enable support for 1us antenna switching slots. This antenna switching
70 mode is optional for Direction Finding according to Bluetooth v5.1.
71
72# Features related with Direction Finding
73# BT Core spec 5.1, Vol 6, Part B, sec. 4.6 Feature Support
74
75config BT_CTLR_DF_ANT_SWITCH_TX
Gerard Marull-Paretas95fb0de2022-03-09 12:05:12 +010076 bool "Antenna switching during CTE transmission (AoD) feature"
Piotr Pryga02859032020-10-26 06:23:02 -070077 depends on BT_CTLR_DF_CTE_TX && BT_CTLR_DF_ANT_SWITCH_2US_SUPPORT
78 default y
79 help
80 Enable support for antenna switching during CTE transmission.
81 Also known as Angle of Departure mode.
82
Piotr Prygaf3e04892020-11-18 23:08:57 -080083config BT_CTLR_DF_ANT_SWITCH_RX
Gerard Marull-Paretas95fb0de2022-03-09 12:05:12 +010084 bool "Antenna switching during CTE reception (AoA) feature"
Piotr Pryga9b3c9412021-02-11 05:42:39 -080085 depends on BT_CTLR_DF_CTE_RX && BT_CTLR_DF_ANT_SWITCH_2US_SUPPORT
Piotr Prygaca877662021-04-17 19:50:29 +020086 default y
Piotr Prygaf3e04892020-11-18 23:08:57 -080087 help
88 Enable support for antenna switching during CTE reception.
89 Also known as Angle of Arrival mode.
90
91config BT_CTLR_DF_CTE_RX
Gerard Marull-Paretas95fb0de2022-03-09 12:05:12 +010092 bool "Reception of Constant Tone Extension feature"
Piotr Prygaf3e04892020-11-18 23:08:57 -080093 depends on BT_CTLR_DF_CTE_RX_SUPPORT
Piotr Pryga57890292021-10-31 00:40:25 +020094 select BT_CTLR_CONN_RSSI if BT_CONN
Piotr Prygaf3e04892020-11-18 23:08:57 -080095 default y
96 help
97 Enable support for reception of Constant Tone Extension in controller.
98
Piotr Pryga2aa3fbb2021-05-12 11:10:07 +020099config BT_CTLR_DF_CONN_CTE_REQ
Gerard Marull-Paretas95fb0de2022-03-09 12:05:12 +0100100 bool "Connection CTE Request feature"
Piotr Prygac5812ba2022-01-04 07:56:02 +0100101 depends on BT_CTLR_DF_CONN_CTE_RX
Piotr Pryga2aa3fbb2021-05-12 11:10:07 +0200102 help
103 Enable support for Bluetooth v5.1 Connection CTE Request feature
104 in controller.
105
Piotr Pryga02859032020-10-26 06:23:02 -0700106config BT_CTLR_DF_CONN_CTE_RSP
Gerard Marull-Paretas95fb0de2022-03-09 12:05:12 +0100107 bool "Connection CTE Response feature"
Piotr Pryga1ff9baf2021-12-09 13:02:03 +0100108 depends on BT_CTLR_DF_CONN_CTE_TX
Piotr Pryga02859032020-10-26 06:23:02 -0700109 help
110 Enable support for Bluetooth v5.1 Connection CTE Response feature
111 in controller.
112
Piotr Pryga307ac642020-11-20 05:16:05 -0800113config BT_CTLR_DF_ADV_CTE_TX
Gerard Marull-Paretas95fb0de2022-03-09 12:05:12 +0100114 bool "Connectionless CTE Transmitter feature"
Piotr Pryga307ac642020-11-20 05:16:05 -0800115 depends on BT_CTLR_DF_CTE_TX && BT_CTLR_ADV_PERIODIC
Rubin Gerritsenb5135362022-04-21 14:00:58 +0200116 select BT_CTLR_ADV_EXT_PDU_EXTRA_DATA_MEMORY if BT_LL_SW_SPLIT
Piotr Pryga307ac642020-11-20 05:16:05 -0800117 default y
118 help
119 Enable support for Bluetooth v5.1 Connectionless CTE Transmitter
120 feature in controller.
121
Piotr Pryga68704c82021-04-09 07:52:52 +0200122config BT_CTLR_DF_SCAN_CTE_RX
Gerard Marull-Paretas95fb0de2022-03-09 12:05:12 +0100123 bool "Connectionless CTE Receiver"
Piotr Pryga68704c82021-04-09 07:52:52 +0200124 depends on BT_CTLR_DF_CTE_RX && BT_CTLR_SYNC_PERIODIC
125 default y
126 help
127 Enable support for Bluetooth v5.1 connectionless CTE reception
128 in controller.
129
Piotr Pryga1ff9baf2021-12-09 13:02:03 +0100130config BT_CTLR_DF_CONN_CTE_TX
Gerard Marull-Paretas95fb0de2022-03-09 12:05:12 +0100131 bool "Connection based CTE Transmitter"
Piotr Pryga1ff9baf2021-12-09 13:02:03 +0100132 depends on BT_CTLR_DF_CTE_TX && BT_CONN
133 default y
134 help
135 Enable transmission of Constant Tone Extension in
136 direction finding connected mode.
137
Piotr Prygac5812ba2022-01-04 07:56:02 +0100138config BT_CTLR_DF_CONN_CTE_RX
Gerard Marull-Paretas95fb0de2022-03-09 12:05:12 +0100139 bool "Connection based CTE Receiver"
Piotr Pryga57890292021-10-31 00:40:25 +0200140 depends on BT_CTLR_DF_CTE_RX && BT_CONN
141 default y
142 help
Piotr Prygac5812ba2022-01-04 07:56:02 +0100143 Enable reception and sampling of Constant Tone Extension in direction
144 finding connected mode.
Piotr Pryga57890292021-10-31 00:40:25 +0200145
Rubin Gerritsenaec53072022-04-21 13:59:11 +0200146if BT_LL_SW_SPLIT
147
Piotr Prygae884c022021-04-09 11:28:44 +0200148config BT_CTLR_DF_SAMPLE_CTE_FOR_PDU_WITH_BAD_CRC
Gerard Marull-Paretas95fb0de2022-03-09 12:05:12 +0100149 bool "Sampling of CTE for PDUs with bad CRC"
Piotr Prygae884c022021-04-09 11:28:44 +0200150 depends on BT_CTLR_DF_SCAN_CTE_RX
151 default y
152 help
153 Enable support for sampling of CTE for PDUs that have bad CRC.
154
Piotr Pryga307ac642020-11-20 05:16:05 -0800155# Customization setting to manage memory usage footprint
156
157config BT_CTLR_DF_MAX_ANT_SW_PATTERN_LEN
158 int "Maximum length of antenna switch pattern"
Piotr Pryga0a497fc2022-05-06 14:00:05 +0200159 range 2 38 if SOC_COMPATIBLE_NRF
Piotr Pryga307ac642020-11-20 05:16:05 -0800160 range 2 75 if !SOC_COMPATIBLE_NRF
161 default 12
162 help
Piotr Prygaf3e04892020-11-18 23:08:57 -0800163 Defines maximum length of antenna switch pattern that controller
164 is able to store. For nRF5x-based controllers, the hardware imposes
Piotr Pryga0a497fc2022-05-06 14:00:05 +0200165 the value is within range 2 to 38, where last value is maximum.
Piotr Prygaf3e04892020-11-18 23:08:57 -0800166 For general use cases Bluetooth Core 5.1 spec. required the value
167 to be within range 2 up to 75.
Piotr Pryga307ac642020-11-20 05:16:05 -0800168
Piotr Pryga64cb4bb2021-02-12 05:21:43 -0800169config BT_CTLR_DF_INIT_ANT_SEL_GPIOS
Gerard Marull-Paretas95fb0de2022-03-09 12:05:12 +0100170 bool "Initialization of GPIOs responsible for antenna switching"
Piotr Pryga64cb4bb2021-02-12 05:21:43 -0800171 depends on BT_CTLR_DF_ANT_SWITCH_TX || BT_CTLR_DF_ANT_SWITCH_RX
172 default y
173 help
174 Enable implicit initialization of GPIOs responsible for antenna
175 switching during Radio initialization.
176 If this feature is not enabled, the Radio initialization procedure will
177 not initialize GPIOs pins selected to drive antenna switching.
178 In such case application is responsible for appropriate GPIOs
179 initialization.
180
Piotr Prygaf01b77f2021-06-14 15:15:59 +0200181config BT_CTLR_DF_PER_ADV_CTE_NUM_MAX
182 int "Maximum number of transmitted PDUs with Constant Tone Extension in connectionless mode"
183 depends on BT_CTLR_DF_ADV_CTE_TX && BT_CTLR_ADV_PDU_LINK
184 range 1 16
185 default 1
186 help
187 Maximum supported number of PDUs, that have Constant Tone Extension, transmitted in single
188 periodic advertising chain. The range is taken from BT Core spec 5.1, Vol 4 Part E
189 section 7.8.82 HCI_LE_Set_Connectionless_IQ_Sampling_Enable Max_Sampled_CTEs parameter.
190
Andrzej Kaczmarekf3532022021-08-25 13:54:23 +0200191config BT_CTLR_DF_PER_SCAN_CTE_NUM_MAX
192 int "Maximum number of received PDUs with Constant Tone Extension in connectionless mode"
193 depends on BT_CTLR_DF_SCAN_CTE_RX
194 range 1 16
195 default 16
196 help
197 Maximum supported number of PDUs, that have Constant Tone Extension, received in single
198 periodic advertising chain. The range is taken from BT Core spec 5.1, Vol 4 Part E
199 section 7.8.82 HCI_LE_Set_Connectionless_IQ_Sampling_Enable Max_Sampled_CTEs parameter.
200
Piotr Pryga008fd882022-02-25 10:36:38 +0100201config BT_CTLR_DF_SWITCH_OFFSET
202 int "Antenna switch offset relative to end of CRC"
203 depends on SOC_COMPATIBLE_NRF
204 range -2048 2047
205 default 0
206 help
207 Offset of start of antenna switching after end of the CRC. It is a signed value in number
208 of 16M cycles. Decreasing the offset value beyond the trigger of the AoA/AoD procedure
209 will have no effect.
210
211config BT_CTLR_DF_SAMPLE_OFFSET_PHY_1M_SAMPLING_1US
212 int "CTE sampling offset relative for PHY 1M and 1US samples spacing"
213 depends on SOC_COMPATIBLE_NRF
214 range -2048 2047
215 default 1
216 help
217 Offset of sampling start from beginning of sampling slot. The value is a signed number
Nazar Kazakovf483b1b2022-03-16 21:07:43 +0000218 of 16M cycles relative. It is used when PHY is set to PHY 1M and sampling slot duration
Piotr Pryga008fd882022-02-25 10:36:38 +0100219 is 1 us. Decreasing the offset beyond the trigger of the AoA/AoD procedure will have
220 no effect.
221
222config BT_CTLR_DF_SAMPLE_OFFSET_PHY_2M_SAMPLING_1US
223 int "CTE sampling offset relative for PHY 1M and 1US samples spacing"
224 depends on SOC_COMPATIBLE_NRF
225 range -2048 2047
226 default 15
227 help
228 Offset of sampling start from beginning of sampling slot. The value is a signed number
Nazar Kazakovf483b1b2022-03-16 21:07:43 +0000229 of 16M cycles relative. It is used when PHY is set to PHY 1M and sampling slot duration
Piotr Pryga008fd882022-02-25 10:36:38 +0100230 is 1 us. Decreasing the offset beyond the trigger of the AoA/AoD procedure will have
231 no effect.
232
233
234config BT_CTLR_DF_SAMPLE_OFFSET_PHY_1M_SAMPLING_2US
235 int "CTE sampling offset relative for PHY 1M and 2US samples spacing"
236 depends on SOC_COMPATIBLE_NRF
237 range -2048 2047
238 default 6
239 help
240 Offset of sampling start from beginning of sampling slot. The value is a signed number
Nazar Kazakovf483b1b2022-03-16 21:07:43 +0000241 of 16M cycles relative. It is used when PHY is set to PHY 1M and sampling slot duration
Piotr Pryga008fd882022-02-25 10:36:38 +0100242 is 2 us. Decreasing the offset beyond the trigger of the AoA/AoD procedure will have
243 no effect.
244
245config BT_CTLR_DF_SAMPLE_OFFSET_PHY_2M_SAMPLING_2US
246 int "CTE sampling offset relative for PHY 1M and 2US samples spacing"
247 depends on SOC_COMPATIBLE_NRF
248 range -2048 2047
249 default 20
250 help
251 Offset of sampling start from beginning of sampling slot. The value is a signed number
Nazar Kazakovf483b1b2022-03-16 21:07:43 +0000252 of 16M cycles relative. It is used when PHY is set to PHY 1M and sampling slot duration
Piotr Pryga008fd882022-02-25 10:36:38 +0100253 is 2 us. Decreasing the offset beyond the trigger of the AoA/AoD procedure will have
254 no effect.
255
Piotr Pryga2e1e8af2021-03-31 08:10:19 +0200256config BT_CTLR_DF_DEBUG_ENABLE
257 bool "Bluetooth Direction Finding debug support enable"
258 help
259 This option enables debug support for the Direction Finding
260 implementation in controller.
261
Piotr Pryga23dd3692021-10-26 14:06:37 +0200262config BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE
263 bool
Piotr Pryga9a117bd2021-12-22 23:29:55 +0100264 depends on BT_CTLR_DF_CTE_RX && BT_CONN && (SOC_NRF52811 || SOC_NRF52820 || SOC_NRF52833 || SOC_NRF5340_CPUNET)
Piotr Pryga23dd3692021-10-26 14:06:37 +0200265 default y
266 help
Piotr Pryga9a117bd2021-12-22 23:29:55 +0100267 SOCs nRF52811, nRF52820, nRF52833, nRF5340 generate PHYEND event delayed when
Piotr Pryga23dd3692021-10-26 14:06:37 +0200268 CTEINLINECTRLEN is enabled and received PDU does not have CTEInfo field. The option
269 enables workaround for the delay to maintain inter frame spacing (IFS) for connection
270 events.
271
Piotr Prygadffbcb82022-08-02 12:06:23 +0200272choice
273 prompt "IQ samples 12 bit to 8 bit conversion approach"
274 default BT_CTLR_DF_IQ_SAMPLES_CONVERT_2_BITS_SHIFT if !SOC_NRF5340_CPUNET
275 default BT_CTLR_DF_IQ_SAMPLES_CONVERT_USE_8_LSB if SOC_NRF5340_CPUNET
276
277config BT_CTLR_DF_IQ_SAMPLES_CONVERT_4_BITS_SHIFT
278 bool "Conversion of IQ samples to 8 bits wide by 4 bits shift"
279 depends on BT_CTLR_DF_SCAN_CTE_RX || BT_CTLR_DF_CONN_CTE_RX
280 help
281 IQ samples provided by the Radio Direction Finding Extension are 12 bit wide. The
282 Bluetooth 5.3 Core Specification defines IQ samples to be 8 bits wide: Vol 4, Part E
283 sections 7.7.65.21 and 7.7.65.22. This config enables conversion of 12 bit IQ samples to
284 8 bits by ordinary right shift operation by 4 bits. That means there is loss in accuracy
285 since only the 8 MSB are used.
286
287config BT_CTLR_DF_IQ_SAMPLES_CONVERT_2_BITS_SHIFT
288 bool "Conversion of IQ samples to 8 bits wide by 2 bits shift"
289 depends on BT_CTLR_DF_SCAN_CTE_RX || BT_CTLR_DF_CONN_CTE_RX
290 help
291 IQ samples provided by the Radio Direction Finding Extension are 12 bit wide. The
292 Bluetooth 5.3 Core Specification defines IQ samples to be 8 bits wide: Vol 4, Part E
293 sections 7.7.65.21 and 7.7.65.22. This config enables conversion of 12 bit IQ samples to
294 8 bits by ordinary right shift operation by 2 bits and a cast to int8_t. That means there
295 is a loss in accuracy. This conversion may be used only if you are sure samples will not
296 saturate.
297
298config BT_CTLR_DF_IQ_SAMPLES_CONVERT_USE_8_LSB
299 bool "Conversion of IQ samples to 8 bits wide by use of 8 LSB"
300 depends on SOC_NRF5340_CPUNET && (BT_CTLR_DF_SCAN_CTE_RX || BT_CTLR_DF_CONN_CTE_RX)
301 help
302 IQ samples provided by the Radio Direction Finding Extension are 12 bit wide. The
303 Bluetooth 5.3 Core Specification defines IQ samples to be 8 bits wide: Vol 4, Part E
304 sections 7.7.65.21 and 7.7.65.22. This config enables conversion of 12 bit IQ samples to
305 8 bits by use of 8 least significant bits. This conversion may be used only if you are
306 sure actual samples are not greater than 8 bits. This prevents additional accuracy loss
307 due to shifting operation.
308
309endchoice
310
Piotr Prygad8d8ef72022-07-21 14:52:18 +0200311# Vendor specifici extensions configuration
312
313config BT_CTLR_DF_VS_CL_IQ_REPORT_16_BITS_IQ_SAMPLES
314 bool "Use 16 bits signed integer IQ samples in connectionless IQ reports"
Johan Hedberg18c23da2024-05-10 15:37:11 +0300315 depends on BT_CTLR_DF_SCAN_CTE_RX && BT_HCI_VS
Piotr Prygad8d8ef72022-07-21 14:52:18 +0200316 help
317 Direction Finging connectionless IQ reports provide a set of IQ samples collected during
318 sampling of CTE. Bluetooth 5.3 Core Specification defines IQ samples to be 8 bits signed
319 integer, see Vol 4, Part E section 7.7.65.21. This option enables a vendor specific
Pisit Sawangvonganan9b305d52024-02-21 00:24:09 +0700320 extension to HCI layer, so that connectionless IQ reports store samples in 16 bit signed
Piotr Prygad8d8ef72022-07-21 14:52:18 +0200321 integer format.
322
323config BT_CTLR_DF_VS_CONN_IQ_REPORT_16_BITS_IQ_SAMPLES
324 bool "Use 16 bits signed integer IQ samples in connection IQ reports"
Johan Hedberg18c23da2024-05-10 15:37:11 +0300325 depends on BT_CTLR_DF_CONN_CTE_RX && BT_HCI_VS
Piotr Prygad8d8ef72022-07-21 14:52:18 +0200326 help
327 Direction Finging connection IQ reports provide a set of IQ samples collected during
328 sampling of CTE. Bluetooth 5.3 Core Specification defines IQ samples to be 8 bits signed
329 integer, see Vol 4, Part E section 7.7.65.22. This option enables a vendor specific
Pisit Sawangvonganan9b305d52024-02-21 00:24:09 +0700330 extension to HCI layer, so that connection IQ reports store samples in 16 bit signed
Piotr Prygad8d8ef72022-07-21 14:52:18 +0200331 integer format.
332
Rubin Gerritsenaec53072022-04-21 13:59:11 +0200333endif # BT_LL_SW_SPLIT
334
Piotr Pryga307ac642020-11-20 05:16:05 -0800335endif # BT_CTLR_DF