1 /** @file
2  *  @brief Header for Bluetooth GMAP 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_GMAP_LC3_PRESET_
10 #define ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_GMAP_LC3_PRESET_
11 
12 #include <zephyr/bluetooth/audio/bap_lc3_preset.h>
13 
14 /* GMAP LC3 unicast presets defined by table 3.16 in the GMAP v1.0 specification */
15 
16 /**
17  *  @brief Helper to declare LC3 32_1_gr codec configuration
18  *
19  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
20  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
21  */
22 #define BT_GMAP_LC3_PRESET_32_1_GR(_loc, _stream_context)                                          \
23 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_32_1(_loc, _stream_context),                   \
24 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(60U, 1U, 15U, 10000U))
25 
26 /**
27  *  @brief Helper to declare LC3 32_2_gr codec configuration
28  *
29  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
30  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
31  */
32 #define BT_GMAP_LC3_PRESET_32_2_GR(_loc, _stream_context)                                          \
33 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_32_2(_loc, _stream_context),                   \
34 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(80U, 1U, 20U, 10000U))
35 
36 /**
37  *  @brief Helper to declare LC3 48_1_gr codec configuration
38  *
39  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
40  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
41  */
42 #define BT_GMAP_LC3_PRESET_48_1_GR(_loc, _stream_context)                                          \
43 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_1(_loc, _stream_context),                   \
44 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(75U, 1U, 15U, 10000U))
45 
46 /**
47  *  @brief Helper to declare LC3 48_2_gr codec configuration
48  *
49  *  Mandatory to support as both unicast client and server
50  *
51  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
52  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
53  */
54 #define BT_GMAP_LC3_PRESET_48_2_GR(_loc, _stream_context)                                          \
55 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_2(_loc, _stream_context),                   \
56 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(100U, 1U, 20U, 10000U))
57 
58 /**
59  *  @brief Helper to declare LC3 48_3_gr codec configuration
60  *
61  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
62  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
63  */
64 #define BT_GMAP_LC3_PRESET_48_3_GR(_loc, _stream_context)                                          \
65 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_3(_loc, _stream_context),                   \
66 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(90U, 1U, 15U, 10000U))
67 
68 /**
69  *  @brief Helper to declare LC3 48_4_gr codec configuration
70  *
71  *  Mandatory to support as unicast server
72  *
73  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
74  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
75  */
76 #define BT_GMAP_LC3_PRESET_48_4_GR(_loc, _stream_context)                                          \
77 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_4(_loc, _stream_context),                   \
78 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(120U, 1U, 20U, 10000U))
79 
80 /**
81  *  @brief Helper to declare LC3 16_1_gs codec configuration
82  *
83  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
84  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
85  */
86 #define BT_GMAP_LC3_PRESET_16_1_GS(_loc, _stream_context)                                          \
87 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_16_1(_loc, _stream_context),                   \
88 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(30U, 1U, 15U, 60000U))
89 
90 /**
91  *  @brief Helper to declare LC3 16_2_gs codec configuration
92  *
93  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
94  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
95  */
96 #define BT_GMAP_LC3_PRESET_16_2_GS(_loc, _stream_context)                                          \
97 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_16_2(_loc, _stream_context),                   \
98 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(40U, 1U, 20U, 60000U))
99 
100 /**
101  *  @brief Helper to declare LC3 32_1_gs codec configuration
102  *
103  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
104  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
105  */
106 #define BT_GMAP_LC3_PRESET_32_1_GS(_loc, _stream_context)                                          \
107 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_32_1(_loc, _stream_context),                   \
108 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(60U, 1U, 15U, 60000U))
109 
110 /**
111  *  @brief Helper to declare LC3 32_2_gs codec configuration
112  *
113  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
114  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
115  */
116 #define BT_GMAP_LC3_PRESET_32_2_GS(_loc, _stream_context)                                          \
117 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_32_2(_loc, _stream_context),                   \
118 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(80U, 1U, 20U, 60000U))
119 
120 /**
121  *  @brief Helper to declare LC3 48_1_gs codec configuration
122  *
123  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
124  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
125  */
126 #define BT_GMAP_LC3_PRESET_48_1_GS(_loc, _stream_context)                                          \
127 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_1(_loc, _stream_context),                   \
128 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(75U, 1U, 15U, 60000U))
129 
130 /**
131  *  @brief Helper to declare LC3 48_2_gs codec configuration
132  *
133  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
134  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
135  */
136 #define BT_GMAP_LC3_PRESET_48_2_GS(_loc, _stream_context)                                          \
137 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_2(_loc, _stream_context),                   \
138 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(100U, 1U, 20U, 60000U))
139 
140 /* GMAP LC3 broadcast presets defined by table 3.22 in the GMAP v1.0 specification */
141 
142 /**
143  *  @brief Helper to declare LC3 48_1_g codec configuration
144  *
145  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
146  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
147  */
148 #define BT_GMAP_LC3_PRESET_48_1_G(_loc, _stream_context)                                           \
149 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_1(_loc, _stream_context),                   \
150 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(75U, 1U, 8U, 10000U))
151 
152 /**
153  *  @brief Helper to declare LC3 48_2_g codec configuration
154  *
155  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
156  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
157  */
158 #define BT_GMAP_LC3_PRESET_48_2_G(_loc, _stream_context)                                           \
159 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_2(_loc, _stream_context),                   \
160 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(100U, 1U, 10U, 10000U))
161 
162 /**
163  *  @brief Helper to declare LC3 48_3_g codec configuration
164  *
165  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
166  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
167  */
168 #define BT_GMAP_LC3_PRESET_48_3_G(_loc, _stream_context)                                           \
169 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_3(_loc, _stream_context),                   \
170 			  BT_AUDIO_CODEC_LC3_QOS_7_5_UNFRAMED(90U, 1U, 8U, 10000U))
171 
172 /**
173  *  @brief Helper to declare LC3 48_4_g codec configuration
174  *
175  *  @param _loc             Audio channel location bitfield (@ref bt_audio_location)
176  *  @param _stream_context  Stream context (``BT_AUDIO_CONTEXT_*``)
177  */
178 #define BT_GMAP_LC3_PRESET_48_4_G(_loc, _stream_context)                                           \
179 	BT_BAP_LC3_PRESET(BT_AUDIO_CODEC_LC3_CONFIG_48_4(_loc, _stream_context),                   \
180 			  BT_AUDIO_CODEC_LC3_QOS_10_UNFRAMED(120U, 1U, 10U, 10000U))
181 
182 #endif /* ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_GMAP_LC3_PRESET_ */
183