1 /** @file
2  *  @brief Header for Bluetooth BAP LC3 presets.
3  *
4  * Copyright (c) 2023 Nordic Semiconductor ASA
5  *
6  * SPDX-License-Identifier: Apache-2.0
7  */
8 
9 #ifndef ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_BAP_LC3_PRESET_
10 #define ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_BAP_LC3_PRESET_
11 
12 #include <zephyr/bluetooth/audio/audio.h>
13 
14 /** Struct to hold a BAP defined LC3 preset */
15 struct bt_bap_lc3_preset {
16 	/** The LC3 Codec */
17 	struct bt_audio_codec_cfg codec_cfg;
18 	/** The BAP spec defined QoS values */
19 	struct bt_audio_codec_qos qos;
20 };
21 
22 /** Helper to declare an LC3 preset structure */
23 #define BT_BAP_LC3_PRESET(_codec, _qos)                                                            \
24 	{                                                                                          \
25 		.codec_cfg = _codec, .qos = _qos,                                                  \
26 	}
27 
28 /* LC3 Unicast presets defined by table 5.2 in the BAP v1.0 specification */
29 
30 /**
31  *  @brief Helper to declare LC3 Unicast 8_1_1 codec configuration
32  *
33  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
34  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
35  */
36 #define BT_BAP_LC3_UNICAST_PRESET_8_1_1(_loc, _stream_context)                                     \
37 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_8_1(_loc, _stream_context),                    \
38 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(26u, 2u, 8u, 40000u))
39 
40 /**
41  *  @brief Helper to declare LC3 Unicast 8_2_1 codec configuration
42  *
43  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
44  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
45  */
46 #define BT_BAP_LC3_UNICAST_PRESET_8_2_1(_loc, _stream_context)                                     \
47 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_8_2(_loc, _stream_context),                    \
48 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(30u, 2u, 10u, 40000u))
49 
50 /**
51  *  @brief Helper to declare LC3 Unicast 16_1_1 codec configuration
52  *
53  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
54  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
55  */
56 #define BT_BAP_LC3_UNICAST_PRESET_16_1_1(_loc, _stream_context)                                    \
57 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_16_1(_loc, _stream_context),                   \
58 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(30u, 2u, 8u, 40000u))
59 
60 /**
61  *  @brief Helper to declare LC3 Unicast 16_2_1 codec configuration
62  *
63  *  Mandatory to support as both unicast client and server
64  *
65  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
66  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
67  */
68 #define BT_BAP_LC3_UNICAST_PRESET_16_2_1(_loc, _stream_context)                                    \
69 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_16_2(_loc, _stream_context),                   \
70 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(40u, 2u, 10u, 40000u))
71 
72 /**
73  *  @brief Helper to declare LC3 Unicast 24_1_1 codec configuration
74  *
75  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
76  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
77  */
78 #define BT_BAP_LC3_UNICAST_PRESET_24_1_1(_loc, _stream_context)                                    \
79 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_24_1(_loc, _stream_context),                   \
80 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(45u, 2u, 8u, 40000u))
81 
82 /**
83  *  @brief Helper to declare LC3 Unicast 24_2_1 codec configuration
84  *
85  *  Mandatory to support as unicast server
86  *
87  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
88  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
89  */
90 #define BT_BAP_LC3_UNICAST_PRESET_24_2_1(_loc, _stream_context)                                    \
91 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_24_2(_loc, _stream_context),                   \
92 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(60u, 2u, 10u, 40000u))
93 
94 /**
95  *  @brief Helper to declare LC3 Unicast 32_1_1 codec configuration
96  *
97  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
98  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
99  */
100 #define BT_BAP_LC3_UNICAST_PRESET_32_1_1(_loc, _stream_context)                                    \
101 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_32_1(_loc, _stream_context),                   \
102 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(60u, 2u, 8u, 40000u))
103 
104 /**
105  *  @brief Helper to declare LC3 Unicast 32_2_1 codec configuration
106  *
107  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
108  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
109  */
110 #define BT_BAP_LC3_UNICAST_PRESET_32_2_1(_loc, _stream_context)                                    \
111 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_32_2(_loc, _stream_context),                   \
112 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(80u, 2u, 10u, 40000u))
113 
114 /**
115  *  @brief Helper to declare LC3 Unicast 441_1_1 codec configuration
116  *
117  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
118  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
119  */
120 #define BT_BAP_LC3_UNICAST_PRESET_441_1_1(_loc, _stream_context)                                   \
121 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_441_1(_loc, _stream_context),                  \
122 			  BT_AUDIO_CODEC_QOS(8163u, BT_AUDIO_CODEC_QOS_FRAMING_FRAMED,             \
123 					     BT_AUDIO_CODEC_QOS_2M, 97u, 5u, 24u, 40000u))
124 
125 /**
126  *  @brief Helper to declare LC3 Unicast 441_2_1 codec configuration
127  *
128  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
129  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
130  */
131 #define BT_BAP_LC3_UNICAST_PRESET_441_2_1(_loc, _stream_context)                                   \
132 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_441_2(_loc, _stream_context),                  \
133 			  BT_AUDIO_CODEC_QOS(10884u, BT_AUDIO_CODEC_QOS_FRAMING_FRAMED,            \
134 					     BT_AUDIO_CODEC_QOS_2M, 130u, 5u, 31u, 40000u))
135 
136 /**
137  *  @brief Helper to declare LC3 Unicast 48_1_1 codec configuration
138  *
139  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
140  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
141  */
142 #define BT_BAP_LC3_UNICAST_PRESET_48_1_1(_loc, _stream_context)                                    \
143 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_1(_loc, _stream_context),                   \
144 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(75u, 5u, 15u, 40000u))
145 
146 /**
147  *  @brief Helper to declare LC3 Unicast 48_2_1 codec configuration
148  *
149  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
150  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
151  */
152 #define BT_BAP_LC3_UNICAST_PRESET_48_2_1(_loc, _stream_context)                                    \
153 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_2(_loc, _stream_context),                   \
154 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(100u, 5u, 20u, 40000u))
155 
156 /**
157  *  @brief Helper to declare LC3 Unicast 48_3_1 codec configuration
158  *
159  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
160  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
161  */
162 #define BT_BAP_LC3_UNICAST_PRESET_48_3_1(_loc, _stream_context)                                    \
163 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_3(_loc, _stream_context),                   \
164 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(90u, 5u, 15u, 40000u))
165 
166 /**
167  *  @brief Helper to declare LC3 Unicast 48_4_1 codec configuration
168  *
169  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
170  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
171  */
172 #define BT_BAP_LC3_UNICAST_PRESET_48_4_1(_loc, _stream_context)                                    \
173 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_4(_loc, _stream_context),                   \
174 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(120u, 5u, 20u, 40000u))
175 
176 /**
177  *  @brief Helper to declare LC3 Unicast 8_5_1 codec configuration
178  *
179  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
180  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
181  */
182 #define BT_BAP_LC3_UNICAST_PRESET_48_5_1(_loc, _stream_context)                                    \
183 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_5(_loc, _stream_context),                   \
184 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(117u, 5u, 15u, 40000u))
185 
186 /**
187  *  @brief Helper to declare LC3 Unicast 48_6_1 codec configuration
188  *
189  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
190  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
191  */
192 #define BT_BAP_LC3_UNICAST_PRESET_48_6_1(_loc, _stream_context)                                    \
193 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_6(_loc, _stream_context),                   \
194 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(155u, 5u, 20u, 40000u))
195 
196 /**
197  *  @brief Helper to declare LC3 Unicast 8_1_2 codec configuration
198  *
199  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
200  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
201  */
202 /* Following presets are for unicast high reliability audio data */
203 #define BT_BAP_LC3_UNICAST_PRESET_8_1_2(_loc, _stream_context)                                     \
204 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_8_1(_loc, _stream_context),                    \
205 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(26u, 13u, 75u, 40000u))
206 
207 /**
208  *  @brief Helper to declare LC3 Unicast 8_2_2 codec configuration
209  *
210  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
211  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
212  */
213 #define BT_BAP_LC3_UNICAST_PRESET_8_2_2(_loc, _stream_context)                                     \
214 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_8_2(_loc, _stream_context),                    \
215 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(30u, 13u, 95u, 40000u))
216 
217 /**
218  *  @brief Helper to declare LC3 Unicast 16_1_2 codec configuration
219  *
220  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
221  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
222  */
223 #define BT_BAP_LC3_UNICAST_PRESET_16_1_2(_loc, _stream_context)                                    \
224 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_16_1(_loc, _stream_context),                   \
225 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(30u, 13u, 75u, 40000u))
226 
227 /**
228  *  @brief Helper to declare LC3 Unicast 16_2_2 codec configuration
229  *
230  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
231  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
232  */
233 #define BT_BAP_LC3_UNICAST_PRESET_16_2_2(_loc, _stream_context)                                    \
234 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_16_2(_loc, _stream_context),                   \
235 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(40u, 13u, 95u, 40000u))
236 
237 /**
238  *  @brief Helper to declare LC3 Unicast 24_1_2 codec configuration
239  *
240  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
241  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
242  */
243 #define BT_BAP_LC3_UNICAST_PRESET_24_1_2(_loc, _stream_context)                                    \
244 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_24_1(_loc, _stream_context),                   \
245 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(45u, 13u, 75u, 40000u))
246 
247 /**
248  *  @brief Helper to declare LC3 Unicast 24_2_2 codec configuration
249  *
250  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
251  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
252  */
253 #define BT_BAP_LC3_UNICAST_PRESET_24_2_2(_loc, _stream_context)                                    \
254 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_24_2(_loc, _stream_context),                   \
255 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(60u, 13u, 95u, 40000u))
256 
257 /**
258  *  @brief Helper to declare LC3 Unicast 32_1_2 codec configuration
259  *
260  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
261  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
262  */
263 #define BT_BAP_LC3_UNICAST_PRESET_32_1_2(_loc, _stream_context)                                    \
264 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_32_1(_loc, _stream_context),                   \
265 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(60u, 13u, 75u, 40000u))
266 
267 /**
268  *  @brief Helper to declare LC3 Unicast 32_2_2 codec configuration
269  *
270  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
271  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
272  */
273 #define BT_BAP_LC3_UNICAST_PRESET_32_2_2(_loc, _stream_context)                                    \
274 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_32_2(_loc, _stream_context),                   \
275 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(80u, 13u, 95u, 40000u))
276 
277 /**
278  *  @brief Helper to declare LC3 Unicast 441_1_2 codec configuration
279  *
280  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
281  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
282  */
283 #define BT_BAP_LC3_UNICAST_PRESET_441_1_2(_loc, _stream_context)                                   \
284 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_441_1(_loc, _stream_context),                  \
285 			  BT_AUDIO_CODEC_QOS(8163u, BT_AUDIO_CODEC_QOS_FRAMING_FRAMED,             \
286 					     BT_AUDIO_CODEC_QOS_2M, 97u, 13u, 80u, 40000u))
287 
288 /**
289  *  @brief Helper to declare LC3 Unicast 441_2_2 codec configuration
290  *
291  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
292  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
293  */
294 #define BT_BAP_LC3_UNICAST_PRESET_441_2_2(_loc, _stream_context)                                   \
295 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_441_2(_loc, _stream_context),                  \
296 			  BT_AUDIO_CODEC_QOS(10884u, BT_AUDIO_CODEC_QOS_FRAMING_FRAMED,            \
297 					     BT_AUDIO_CODEC_QOS_2M, 130u, 13u, 85u, 40000u))
298 
299 /**
300  *  @brief Helper to declare LC3 Unicast 48_1_2 codec configuration
301  *
302  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
303  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
304  */
305 #define BT_BAP_LC3_UNICAST_PRESET_48_1_2(_loc, _stream_context)                                    \
306 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_1(_loc, _stream_context),                   \
307 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(75u, 13u, 75u, 40000u))
308 
309 /**
310  *  @brief Helper to declare LC3 Unicast 48_2_2 codec configuration
311  *
312  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
313  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
314  */
315 #define BT_BAP_LC3_UNICAST_PRESET_48_2_2(_loc, _stream_context)                                    \
316 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_2(_loc, _stream_context),                   \
317 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(100u, 13u, 95u, 40000u))
318 
319 /**
320  *  @brief Helper to declare LC3 Unicast 48_3_2 codec configuration
321  *
322  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
323  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
324  */
325 #define BT_BAP_LC3_UNICAST_PRESET_48_3_2(_loc, _stream_context)                                    \
326 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_3(_loc, _stream_context),                   \
327 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(90u, 13u, 75u, 40000u))
328 
329 /**
330  *  @brief Helper to declare LC3 Unicast 48_4_2 codec configuration
331  *
332  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
333  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
334  */
335 #define BT_BAP_LC3_UNICAST_PRESET_48_4_2(_loc, _stream_context)                                    \
336 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_4(_loc, _stream_context),                   \
337 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(120u, 13u, 100u, 40000u))
338 
339 /**
340  *  @brief Helper to declare LC3 Unicast 48_5_2 codec configuration
341  *
342  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
343  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
344  */
345 #define BT_BAP_LC3_UNICAST_PRESET_48_5_2(_loc, _stream_context)                                    \
346 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_5(_loc, _stream_context),                   \
347 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(117u, 13u, 75u, 40000u))
348 
349 /**
350  *  @brief Helper to declare LC3 Unicast 48_6_2 codec configuration
351  *
352  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
353  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
354  */
355 #define BT_BAP_LC3_UNICAST_PRESET_48_6_2(_loc, _stream_context)                                    \
356 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_6(_loc, _stream_context),                   \
357 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(155u, 13u, 100u, 40000u))
358 
359 /**
360  *  @brief Helper to declare LC3 Broadcast 8_1_1 codec configuration
361  *
362  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
363  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
364  */
365 /* LC3 Broadcast presets defined by table 6.4 in the BAP v1.0 specification */
366 #define BT_BAP_LC3_BROADCAST_PRESET_8_1_1(_loc, _stream_context)                                   \
367 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_8_1(_loc, _stream_context),                    \
368 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(26u, 2u, 8u, 40000u))
369 
370 /**
371  *  @brief Helper to declare LC3 Broadcast 8_2_1 codec configuration
372  *
373  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
374  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
375  */
376 #define BT_BAP_LC3_BROADCAST_PRESET_8_2_1(_loc, _stream_context)                                   \
377 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_8_2(_loc, _stream_context),                    \
378 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(30u, 2u, 10u, 40000u))
379 
380 /**
381  *  @brief Helper to declare LC3 Broadcast 16_1_1 codec configuration
382  *
383  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
384  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
385  */
386 #define BT_BAP_LC3_BROADCAST_PRESET_16_1_1(_loc, _stream_context)                                  \
387 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_16_1(_loc, _stream_context),                   \
388 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(30u, 2u, 8u, 40000u))
389 
390 /**
391  *  @brief Helper to declare LC3 Broadcast 16_2_1 codec configuration
392  *
393  *  Mandatory to support as both broadcast source and sink
394  *
395  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
396  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
397  */
398 #define BT_BAP_LC3_BROADCAST_PRESET_16_2_1(_loc, _stream_context)                                  \
399 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_16_2(_loc, _stream_context),                   \
400 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(40u, 2u, 10u, 40000u))
401 
402 /**
403  *  @brief Helper to declare LC3 Broadcast 24_1_1 codec configuration
404  *
405  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
406  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
407  */
408 #define BT_BAP_LC3_BROADCAST_PRESET_24_1_1(_loc, _stream_context)                                  \
409 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_24_1(_loc, _stream_context),                   \
410 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(45u, 2u, 8u, 40000u))
411 
412 /**
413  *  @brief Helper to declare LC3 Broadcast 24_2_1 codec configuration
414  *
415  *  Mandatory to support as broadcast sink
416  *
417  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
418  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
419  */
420 #define BT_BAP_LC3_BROADCAST_PRESET_24_2_1(_loc, _stream_context)                                  \
421 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_24_2(_loc, _stream_context),                   \
422 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(60u, 2u, 10u, 40000u))
423 
424 /**
425  *  @brief Helper to declare LC3 Broadcast 32_1_1 codec configuration
426  *
427  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
428  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
429  */
430 #define BT_BAP_LC3_BROADCAST_PRESET_32_1_1(_loc, _stream_context)                                  \
431 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_32_1(_loc, _stream_context),                   \
432 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(60u, 2u, 8u, 40000u))
433 
434 /**
435  *  @brief Helper to declare LC3 Broadcast 32_2_1 codec configuration
436  *
437  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
438  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
439  */
440 #define BT_BAP_LC3_BROADCAST_PRESET_32_2_1(_loc, _stream_context)                                  \
441 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_32_2(_loc, _stream_context),                   \
442 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(80u, 2u, 10u, 40000u))
443 
444 /**
445  *  @brief Helper to declare LC3 Broadcast 441_1_1 codec configuration
446  *
447  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
448  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
449  */
450 #define BT_BAP_LC3_BROADCAST_PRESET_441_1_1(_loc, _stream_context)                                 \
451 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_441_1(_loc, _stream_context),                  \
452 			  BT_AUDIO_CODEC_QOS(8163u, BT_AUDIO_CODEC_QOS_FRAMING_FRAMED,             \
453 					     BT_AUDIO_CODEC_QOS_2M, 97u, 4u, 24u, 40000u))
454 
455 /**
456  *  @brief Helper to declare LC3 Broadcast 441_2_1 codec configuration
457  *
458  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
459  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
460  */
461 #define BT_BAP_LC3_BROADCAST_PRESET_441_2_1(_loc, _stream_context)                                 \
462 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_441_2(_loc, _stream_context),                  \
463 			  BT_AUDIO_CODEC_QOS(10884u, BT_AUDIO_CODEC_QOS_FRAMING_FRAMED,            \
464 					     BT_AUDIO_CODEC_QOS_2M, 130u, 4u, 31u, 40000u))
465 
466 /**
467  *  @brief Helper to declare LC3 Broadcast 48_1_1 codec configuration
468  *
469  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
470  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
471  */
472 #define BT_BAP_LC3_BROADCAST_PRESET_48_1_1(_loc, _stream_context)                                  \
473 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_1(_loc, _stream_context),                   \
474 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(75u, 4u, 15u, 40000u))
475 
476 /**
477  *  @brief Helper to declare LC3 Broadcast 48_2_1 codec configuration
478  *
479  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
480  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
481  */
482 #define BT_BAP_LC3_BROADCAST_PRESET_48_2_1(_loc, _stream_context)                                  \
483 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_2(_loc, _stream_context),                   \
484 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(100u, 4u, 20u, 40000u))
485 
486 /**
487  *  @brief Helper to declare LC3 Broadcast 48_3_1 codec configuration
488  *
489  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
490  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
491  */
492 #define BT_BAP_LC3_BROADCAST_PRESET_48_3_1(_loc, _stream_context)                                  \
493 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_3(_loc, _stream_context),                   \
494 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(90u, 4u, 15u, 40000u))
495 
496 /**
497  *  @brief Helper to declare LC3 Broadcast 48_4_1 codec configuration
498  *
499  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
500  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
501  */
502 #define BT_BAP_LC3_BROADCAST_PRESET_48_4_1(_loc, _stream_context)                                  \
503 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_4(_loc, _stream_context),                   \
504 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(120u, 4u, 20u, 40000u))
505 
506 /**
507  *  @brief Helper to declare LC3 Broadcast 48_5_1 codec configuration
508  *
509  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
510  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
511  */
512 #define BT_BAP_LC3_BROADCAST_PRESET_48_5_1(_loc, _stream_context)                                  \
513 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_5(_loc, _stream_context),                   \
514 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(117u, 4u, 15u, 40000u))
515 
516 /**
517  *  @brief Helper to declare LC3 Broadcast 48_6_1 codec configuration
518  *
519  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
520  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
521  */
522 #define BT_BAP_LC3_BROADCAST_PRESET_48_6_1(_loc, _stream_context)                                  \
523 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_6(_loc, _stream_context),                   \
524 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(155u, 4u, 20u, 40000u))
525 
526 /**
527  *  @brief Helper to declare LC3 Broadcast 8_1_2 codec configuration
528  *
529  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
530  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
531  */
532 /* Following presets are for broadcast high reliability audio data */
533 #define BT_BAP_LC3_BROADCAST_PRESET_8_1_2(_loc, _stream_context)                                   \
534 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_8_1(_loc, _stream_context),                    \
535 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(26u, 4u, 45u, 40000u))
536 
537 /**
538  *  @brief Helper to declare LC3 Broadcast 8_2_2 codec configuration
539  *
540  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
541  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
542  */
543 #define BT_BAP_LC3_BROADCAST_PRESET_8_2_2(_loc, _stream_context)                                   \
544 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_8_2(_loc, _stream_context),                    \
545 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(30u, 4u, 60u, 40000u))
546 
547 /**
548  *  @brief Helper to declare LC3 Broadcast 16_1_2 codec configuration
549  *
550  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
551  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
552  */
553 #define BT_BAP_LC3_BROADCAST_PRESET_16_1_2(_loc, _stream_context)                                  \
554 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_16_1(_loc, _stream_context),                   \
555 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(30u, 4u, 45u, 40000u))
556 
557 /**
558  *  @brief Helper to declare LC3 Broadcast 16_2_2 codec configuration
559  *
560  *  Mandatory to support as both broadcast source and sink
561  *
562  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
563  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
564  */
565 #define BT_BAP_LC3_BROADCAST_PRESET_16_2_2(_loc, _stream_context)                                  \
566 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_16_2(_loc, _stream_context),                   \
567 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(40u, 4u, 60u, 40000u))
568 
569 /**
570  *  @brief Helper to declare LC3 Broadcast 24_1_2 codec configuration
571  *
572  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
573  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
574  */
575 #define BT_BAP_LC3_BROADCAST_PRESET_24_1_2(_loc, _stream_context)                                  \
576 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_24_1(_loc, _stream_context),                   \
577 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(45u, 4u, 45u, 40000u))
578 
579 /**
580  *  @brief Helper to declare LC3 Broadcast 24_2_2 codec configuration
581  *
582  *  Mandatory to support as broadcast sink
583  *
584  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
585  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
586  */
587 #define BT_BAP_LC3_BROADCAST_PRESET_24_2_2(_loc, _stream_context)                                  \
588 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_24_2(_loc, _stream_context),                   \
589 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(60u, 4u, 60u, 40000u))
590 
591 /**
592  *  @brief Helper to declare LC3 Broadcast 32_1_2 codec configuration
593  *
594  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
595  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
596  */
597 #define BT_BAP_LC3_BROADCAST_PRESET_32_1_2(_loc, _stream_context)                                  \
598 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_32_1(_loc, _stream_context),                   \
599 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(60u, 4u, 45u, 40000u))
600 
601 /**
602  *  @brief Helper to declare LC3 Broadcast 32_2_2 codec configuration
603  *
604  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
605  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
606  */
607 #define BT_BAP_LC3_BROADCAST_PRESET_32_2_2(_loc, _stream_context)                                  \
608 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_32_2(_loc, _stream_context),                   \
609 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(80u, 4u, 60u, 40000u))
610 
611 /**
612  *  @brief Helper to declare LC3 Broadcast 441_1_2 codec configuration
613  *
614  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
615  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
616  */
617 #define BT_BAP_LC3_BROADCAST_PRESET_441_1_2(_loc, _stream_context)                                 \
618 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_441_1(_loc, _stream_context),                  \
619 			  BT_AUDIO_CODEC_QOS(8163u, BT_AUDIO_CODEC_QOS_FRAMING_FRAMED,             \
620 					     BT_AUDIO_CODEC_QOS_2M, 97u, 4u, 54u, 40000u))
621 
622 /**
623  *  @brief Helper to declare LC3 Broadcast 441_2_2 codec configuration
624  *
625  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
626  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
627  */
628 #define BT_BAP_LC3_BROADCAST_PRESET_441_2_2(_loc, _stream_context)                                 \
629 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_441_2(_loc, _stream_context),                  \
630 			  BT_AUDIO_CODEC_QOS(10884u, BT_AUDIO_CODEC_QOS_FRAMING_FRAMED,            \
631 					     BT_AUDIO_CODEC_QOS_2M, 130u, 4u, 60u, 40000u))
632 
633 /**
634  *  @brief Helper to declare LC3 Broadcast 48_1_2 codec configuration
635  *
636  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
637  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
638  */
639 #define BT_BAP_LC3_BROADCAST_PRESET_48_1_2(_loc, _stream_context)                                  \
640 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_1(_loc, _stream_context),                   \
641 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(75u, 4u, 50u, 40000u))
642 
643 /**
644  *  @brief Helper to declare LC3 Broadcast 48_2_2 codec configuration
645  *
646  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
647  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
648  */
649 #define BT_BAP_LC3_BROADCAST_PRESET_48_2_2(_loc, _stream_context)                                  \
650 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_2(_loc, _stream_context),                   \
651 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(100u, 4u, 65u, 40000u))
652 
653 /**
654  *  @brief Helper to declare LC3 Broadcast 48_3_2 codec configuration
655  *
656  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
657  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
658  */
659 #define BT_BAP_LC3_BROADCAST_PRESET_48_3_2(_loc, _stream_context)                                  \
660 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_3(_loc, _stream_context),                   \
661 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(90u, 4u, 50u, 40000u))
662 
663 /**
664  *  @brief Helper to declare LC3 Broadcast 48_4_2 codec configuration
665  *
666  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
667  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
668  */
669 #define BT_BAP_LC3_BROADCAST_PRESET_48_4_2(_loc, _stream_context)                                  \
670 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_4(_loc, _stream_context),                   \
671 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(120u, 4u, 65u, 40000u))
672 
673 /**
674  *  @brief Helper to declare LC3 Broadcast 48_5_2 codec configuration
675  *
676  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
677  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
678  */
679 #define BT_BAP_LC3_BROADCAST_PRESET_48_5_2(_loc, _stream_context)                                  \
680 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_5(_loc, _stream_context),                   \
681 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(117u, 4u, 50u, 40000u))
682 
683 /**
684  *  @brief Helper to declare LC3 Broadcast 48_6_2 codec configuration
685  *
686  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
687  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
688  */
689 #define BT_BAP_LC3_BROADCAST_PRESET_48_6_2(_loc, _stream_context)                                  \
690 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_6(_loc, _stream_context),                   \
691 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(155u, 4u, 65u, 40000u))
692 
693 #endif /* ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_BAP_LC3_PRESET_ */
694