Zephyr API Documentation
4.0.0-rc3
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
lc3.h
Go to the documentation of this file.
1
6
/*
7
* Copyright (c) 2020 Intel Corporation
8
* Copyright (c) 2022-2024 Nordic Semiconductor ASA
9
*
10
* SPDX-License-Identifier: Apache-2.0
11
*/
12
#ifndef ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_LC3_H_
13
#define ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_LC3_H_
14
26
#include <
zephyr/sys/util_macro.h
>
27
#include <
zephyr/bluetooth/byteorder.h
>
28
#include <
zephyr/bluetooth/hci_types.h
>
29
30
#ifdef __cplusplus
31
extern
"C"
{
32
#endif
33
52
#define BT_AUDIO_CODEC_CAP_LC3_DATA(_freq, _duration, _chan_count, _len_min, _len_max, \
53
_max_frames_per_sdu) \
54
{ \
55
BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CAP_TYPE_FREQ, BT_BYTES_LIST_LE16(_freq)), \
56
BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CAP_TYPE_DURATION, (_duration)), \
57
BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CAP_TYPE_CHAN_COUNT, (_chan_count)), \
58
BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CAP_TYPE_FRAME_LEN, \
59
BT_BYTES_LIST_LE16(_len_min), \
60
BT_BYTES_LIST_LE16(_len_max)), \
61
COND_CODE_1(_max_frames_per_sdu, (), \
62
(BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CAP_TYPE_FRAME_COUNT, \
63
(_max_frames_per_sdu)))) \
64
}
65
71
#define BT_AUDIO_CODEC_CAP_LC3_META(_prefer_context) \
72
{ \
73
BT_AUDIO_CODEC_DATA(BT_AUDIO_METADATA_TYPE_PREF_CONTEXT, \
74
BT_BYTES_LIST_LE16(_prefer_context)) \
75
}
76
88
#define BT_AUDIO_CODEC_CAP_LC3(_freq, _duration, _chan_count, _len_min, _len_max, \
89
_max_frames_per_sdu, _prefer_context) \
90
BT_AUDIO_CODEC_CAP(BT_HCI_CODING_FORMAT_LC3, 0x0000, 0x0000, \
91
BT_AUDIO_CODEC_CAP_LC3_DATA(_freq, _duration, _chan_count, _len_min, \
92
_len_max, _max_frames_per_sdu), \
93
BT_AUDIO_CODEC_CAP_LC3_META(_prefer_context))
94
105
#define BT_AUDIO_CODEC_CFG_LC3_DATA(_freq, _duration, _loc, _len, _frames_per_sdu) \
106
{ \
107
BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CFG_FREQ, (_freq)), \
108
BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CFG_DURATION, (_duration)), \
109
BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CFG_CHAN_ALLOC, BT_BYTES_LIST_LE32(_loc)), \
110
BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CFG_FRAME_LEN, BT_BYTES_LIST_LE16(_len)), \
111
COND_CODE_1(_frames_per_sdu, (), \
112
(BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CFG_FRAME_BLKS_PER_SDU, \
113
(_frames_per_sdu)))) \
114
}
115
117
#define BT_AUDIO_CODEC_CFG_LC3_META(_stream_context) \
118
{ \
119
BT_AUDIO_CODEC_DATA(BT_AUDIO_METADATA_TYPE_STREAM_CONTEXT, \
120
BT_BYTES_LIST_LE16(_stream_context)) \
121
}
122
133
#define BT_AUDIO_CODEC_LC3_CONFIG(_freq, _duration, _loc, _len, _frames_per_sdu, _stream_context) \
134
BT_AUDIO_CODEC_CFG( \
135
BT_HCI_CODING_FORMAT_LC3, 0x0000, 0x0000, \
136
BT_AUDIO_CODEC_CFG_LC3_DATA(_freq, _duration, _loc, _len, _frames_per_sdu), \
137
BT_AUDIO_CODEC_CFG_LC3_META(_stream_context))
138
139
#ifdef __cplusplus
140
}
141
#endif
142
147
#endif
/* ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_LC3_H_ */
byteorder.h
Bluetooth byteorder API.
hci_types.h
util_macro.h
Macro utilities.
zephyr
bluetooth
audio
lc3.h
Generated on Thu Nov 14 2024 03:06:25 for Zephyr API Documentation by
1.12.0