Zephyr API Documentation
3.0.0
A Scalable Open Source RTOS
3.0.0
Toggle main menu visibility
Main Page
Related Pages
Modules
Data Structures
Data Structures
Data Structure Index
Data Fields
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
Files
File List
Globals
All
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Macros
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
lc3.h
Go to the documentation of this file.
1
5
/*
6
* Copyright (c) 2020 Intel Corporation
7
* Copyright (c) 2022 Nordic Semiconductor ASA
8
*
9
* SPDX-License-Identifier: Apache-2.0
10
*/
11
#ifndef ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_LC3_H_
12
#define ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_LC3_H_
13
21
#ifdef __cplusplus
22
extern
"C"
{
23
#endif
24
28
#define BT_CODEC_LC3_ID 0x06
29
30
/* TODO: Remove base once LTV types are defined */
31
#define BT_CODEC_LC3_CAP_BASE 0x01
32
36
#define BT_CODEC_LC3_FREQ (BT_CODEC_LC3_CAP_BASE)
40
#define BT_CODEC_LC3_FREQ_8KHZ BIT(0)
44
#define BT_CODEC_LC3_FREQ_11KHZ BIT(1)
48
#define BT_CODEC_LC3_FREQ_16KHZ BIT(2)
52
#define BT_CODEC_LC3_FREQ_22KHZ BIT(3)
56
#define BT_CODEC_LC3_FREQ_24KHZ BIT(4)
60
#define BT_CODEC_LC3_FREQ_32KHZ BIT(5)
64
#define BT_CODEC_LC3_FREQ_44KHZ BIT(6)
68
#define BT_CODEC_LC3_FREQ_48KHZ BIT(7)
72
#define BT_CODEC_LC3_FREQ_ANY (BT_CODEC_LC3_FREQ_8KHZ | \
73
BT_CODEC_LC3_FREQ_16KHZ | \
74
BT_CODEC_LC3_FREQ_24KHZ | \
75
BT_CODEC_LC3_FREQ_32KHZ | \
76
BT_CODEC_LC3_FREQ_44KHZ | \
77
BT_CODEC_LC3_FREQ_48KHZ)
78
82
#define BT_CODEC_LC3_DURATION (BT_CODEC_LC3_CAP_BASE + 1)
86
#define BT_CODEC_LC3_DURATION_7_5 BIT(0)
90
#define BT_CODEC_LC3_DURATION_10 BIT(1)
94
#define BT_CODEC_LC3_DURATION_ANY (BT_CODEC_LC3_DURATION_7_5 | \
95
BT_CODEC_LC3_DURATION_10)
99
#define BT_CODEC_LC3_DURATION_PREFER_7_5 BIT(4)
103
#define BT_CODEC_LC3_DURATION_PREFER_10 BIT(5)
104
105
109
#define BT_CODEC_LC3_CHAN_COUNT (BT_CODEC_LC3_CAP_BASE + 2)
113
#define BT_CODEC_LC3_CHAN_COUNT_SUPPORT BIT(0)
114
118
#define BT_CODEC_LC3_FRAME_LEN (BT_CODEC_LC3_CAP_BASE + 3)
119
123
#define BT_CODEC_LC3_FRAME_COUNT (BT_CODEC_LC3_CAP_BASE + 4)
124
125
/* TODO: Remove base once LTV types are defined */
126
#define BT_CODEC_LC3_CONFIG_BASE 0x01
127
128
struct
bt_codec_lc3_frame_len
{
129
uint16_t
min
;
130
uint16_t
max
;
131
};
132
136
#define BT_CODEC_CONFIG_LC3_FREQ (BT_CODEC_LC3_CONFIG_BASE)
140
#define BT_CODEC_CONFIG_LC3_FREQ_8KHZ 0x01
144
#define BT_CODEC_CONFIG_LC3_FREQ_11KHZ 0x02
148
#define BT_CODEC_CONFIG_LC3_FREQ_16KHZ 0x03
152
#define BT_CODEC_CONFIG_LC3_FREQ_22KHZ 0x04
156
#define BT_CODEC_CONFIG_LC3_FREQ_24KHZ 0x05
160
#define BT_CODEC_CONFIG_LC3_FREQ_32KHZ 0x06
164
#define BT_CODEC_CONFIG_LC3_FREQ_44KHZ 0x07
168
#define BT_CODEC_CONFIG_LC3_FREQ_48KHZ 0x08
169
173
#define BT_CODEC_CONFIG_LC3_DURATION (BT_CODEC_LC3_CONFIG_BASE + 1)
177
#define BT_CODEC_CONFIG_LC3_DURATION_7_5 0x00
181
#define BT_CODEC_CONFIG_LC3_DURATION_10 0x01
182
186
#define BT_CODEC_CONFIG_LC3_CHAN_ALLOC (BT_CODEC_LC3_CONFIG_BASE + 2)
187
191
#define BT_CODEC_CONFIG_LC3_FRAME_LEN (BT_CODEC_LC3_CONFIG_BASE + 3)
192
196
#define BT_CODEC_LC3_DATA(_freq, _duration, _chan_count, _len_min, _len_max) \
197
{ \
198
BT_CODEC_DATA(BT_CODEC_LC3_FREQ, _freq, _freq >> 8), \
199
BT_CODEC_DATA(BT_CODEC_LC3_DURATION, _duration), \
200
BT_CODEC_DATA(BT_CODEC_LC3_CHAN_COUNT, _chan_count), \
201
BT_CODEC_DATA(BT_CODEC_LC3_FRAME_LEN, _len_min, _len_min >> 8, \
202
_len_max, _len_max >> 8,) \
203
}
204
208
#define BT_CODEC_LC3_META(_prefer_context, _context) \
209
{ \
210
BT_CODEC_DATA(BT_CODEC_META_PREFER_CONTEXT, _prefer_context & 0xff, \
211
_prefer_context >> 8), \
212
BT_CODEC_DATA(BT_CODEC_META_CONTEXT, _context & 0xff, _context >> 8) \
213
}
214
218
#define BT_CODEC_LC3(_freq, _duration, _chan_count, _len_min, _len_max, \
219
_frames, _prefer_context, _context) \
220
BT_CODEC(BT_CODEC_LC3_ID, 0x0000, 0x0000, \
221
BT_CODEC_LC3_DATA(_freq, _duration, _chan_count, _len_min, \
222
_len_max), \
223
BT_CODEC_LC3_META(_prefer_context, _context))
224
228
#define BT_CODEC_LC3_CONFIG_DATA(_freq, _duration, _loc, _len) \
229
{ \
230
BT_CODEC_DATA(BT_CODEC_CONFIG_LC3_FREQ, _freq), \
231
BT_CODEC_DATA(BT_CODEC_CONFIG_LC3_DURATION, _duration), \
232
BT_CODEC_DATA(BT_CODEC_CONFIG_LC3_CHAN_ALLOC, _loc, _loc >> 8, \
233
_loc >> 16, _loc >> 24), \
234
BT_CODEC_DATA(BT_CODEC_CONFIG_LC3_FRAME_LEN, _len, _len >> 8) \
235
}
236
240
#define BT_CODEC_LC3_CONFIG_META(_context) \
241
{ \
242
BT_CODEC_DATA(BT_CODEC_META_CONTEXT, _context, _context >> 8), \
243
}
244
248
#define BT_CODEC_LC3_CONFIG_N(_freq, _duration, _loc, _len, _context) \
249
BT_CODEC(BT_CODEC_LC3_ID, 0x0000, 0x0000, \
250
BT_CODEC_LC3_CONFIG_DATA(_freq, _duration, _loc, _len), \
251
BT_CODEC_LC3_CONFIG_META(_context))
252
256
#define BT_CODEC_LC3_CONFIG(_freq, _duration, _len, _context) \
257
BT_CODEC_LC3_CONFIG_N(_freq, _duration, 0x000000000, _len, _context)
258
262
#define BT_CODEC_LC3_CONFIG_8_1 \
263
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_8KHZ, \
264
BT_CODEC_CONFIG_LC3_DURATION_7_5, 26u, \
265
BT_CODEC_META_CONTEXT_VOICE)
269
#define BT_CODEC_LC3_CONFIG_8_2 \
270
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_8KHZ, \
271
BT_CODEC_CONFIG_LC3_DURATION_10, 30u, \
272
BT_CODEC_META_CONTEXT_VOICE)
276
#define BT_CODEC_LC3_CONFIG_16_1 \
277
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_16KHZ, \
278
BT_CODEC_CONFIG_LC3_DURATION_7_5, 30u, \
279
BT_CODEC_META_CONTEXT_VOICE)
283
#define BT_CODEC_LC3_CONFIG_16_2 \
284
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_16KHZ, \
285
BT_CODEC_CONFIG_LC3_DURATION_10, 40u, \
286
BT_CODEC_META_CONTEXT_VOICE)
287
291
#define BT_CODEC_LC3_CONFIG_24_1 \
292
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_24KHZ, \
293
BT_CODEC_CONFIG_LC3_DURATION_7_5, 45u, \
294
BT_CODEC_META_CONTEXT_VOICE)
298
#define BT_CODEC_LC3_CONFIG_24_2 \
299
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_24KHZ, \
300
BT_CODEC_CONFIG_LC3_DURATION_10, 60u, \
301
BT_CODEC_META_CONTEXT_VOICE)
305
#define BT_CODEC_LC3_CONFIG_32_1 \
306
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_32KHZ, \
307
BT_CODEC_CONFIG_LC3_DURATION_7_5, 60u, \
308
BT_CODEC_META_CONTEXT_VOICE)
312
#define BT_CODEC_LC3_CONFIG_32_2 \
313
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_32KHZ, \
314
BT_CODEC_CONFIG_LC3_DURATION_10, 80u, \
315
BT_CODEC_META_CONTEXT_VOICE)
319
#define BT_CODEC_LC3_CONFIG_441_1 \
320
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_44KHZ, \
321
BT_CODEC_CONFIG_LC3_DURATION_7_5, 98u, \
322
BT_CODEC_META_CONTEXT_MEDIA)
326
#define BT_CODEC_LC3_CONFIG_441_2 \
327
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_44KHZ, \
328
BT_CODEC_CONFIG_LC3_DURATION_10, 130u, \
329
BT_CODEC_META_CONTEXT_MEDIA)
333
#define BT_CODEC_LC3_CONFIG_48_1 \
334
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_48KHZ, \
335
BT_CODEC_CONFIG_LC3_DURATION_7_5, 75u, \
336
BT_CODEC_META_CONTEXT_MEDIA)
340
#define BT_CODEC_LC3_CONFIG_48_2 \
341
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_48KHZ, \
342
BT_CODEC_CONFIG_LC3_DURATION_10, 100u, \
343
BT_CODEC_META_CONTEXT_MEDIA)
347
#define BT_CODEC_LC3_CONFIG_48_3 \
348
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_48KHZ, \
349
BT_CODEC_LC3_DURATION_7_5, 90u, \
350
BT_CODEC_META_CONTEXT_MEDIA)
354
#define BT_CODEC_LC3_CONFIG_48_4 \
355
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_48KHZ, \
356
BT_CODEC_CONFIG_LC3_DURATION_10, 120u, \
357
BT_CODEC_META_CONTEXT_MEDIA)
361
#define BT_CODEC_LC3_CONFIG_48_5 \
362
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_48KHZ, \
363
BT_CODEC_CONFIG_LC3_DURATION_7_5, 117u, \
364
BT_CODEC_META_CONTEXT_MEDIA)
368
#define BT_CODEC_LC3_CONFIG_48_6 \
369
BT_CODEC_LC3_CONFIG(BT_CODEC_CONFIG_LC3_FREQ_48KHZ, \
370
BT_CODEC_CONFIG_LC3_DURATION_10, 155u, \
371
BT_CODEC_META_CONTEXT_MEDIA)
375
#define BT_CODEC_LC3_QOS_7_5(_dir, _framing, _sdu, _rtn, _latency, _pd) \
376
BT_CODEC_QOS(_dir, 7500u, _framing, BT_CODEC_QOS_2M, _sdu, _rtn, \
377
_latency, _pd)
381
#define BT_CODEC_LC3_QOS_7_5_IN_UNFRAMED(_sdu, _rtn, _latency, _pd) \
382
BT_CODEC_QOS_IN_UNFRAMED(7500u, _sdu, _rtn, _latency, _pd)
386
#define BT_CODEC_LC3_QOS_7_5_OUT_UNFRAMED(_sdu, _rtn, _latency, _pd) \
387
BT_CODEC_QOS_OUT_UNFRAMED(7500u, _sdu, _rtn, _latency, _pd)
391
#define BT_CODEC_LC3_QOS_7_5_INOUT_UNFRAMED(_sdu, _rtn, _latency, _pd) \
392
BT_CODEC_QOS_INOUT_UNFRAMED(7500u, _sdu, _rtn, _latency, _pd)
396
#define BT_CODEC_LC3_QOS_10(_dir, _framing, _sdu, _rtn, _latency, _pd) \
397
BT_CODEC_QOS(_dir, 10000u, _framing, BT_CODEC_QOS_2M, _sdu, _rtn, \
398
_latency, _pd)
402
#define BT_CODEC_LC3_QOS_10_IN_UNFRAMED(_sdu, _rtn, _latency, _pd) \
403
BT_CODEC_QOS_IN_UNFRAMED(10000u, _sdu, _rtn, _latency, _pd)
407
#define BT_CODEC_LC3_QOS_10_OUT_UNFRAMED(_sdu, _rtn, _latency, _pd) \
408
BT_CODEC_QOS_OUT_UNFRAMED(10000u, _sdu, _rtn, _latency, _pd)
412
#define BT_CODEC_LC3_QOS_10_INOUT_UNFRAMED(_sdu, _rtn, _latency, _pd) \
413
BT_CODEC_QOS_INOUT_UNFRAMED(10000u, _sdu, _rtn, _latency, _pd)
414
415
#ifdef __cplusplus
416
}
417
#endif
418
423
#endif
/* ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_LC3_H_ */
uint16_t
__UINT16_TYPE__ uint16_t
Definition:
stdint.h:59
bt_codec_lc3_frame_len
Definition:
lc3.h:128
bt_codec_lc3_frame_len::max
uint16_t max
Definition:
lc3.h:130
bt_codec_lc3_frame_len::min
uint16_t min
Definition:
lc3.h:129
include
bluetooth
audio
lc3.h
Generated on Mon Feb 21 2022 22:43:01 for Zephyr API Documentation by
1.9.2