Zephyr Project API
3.7.0
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
22
#include <
zephyr/sys/util_macro.h
>
23
#include <
zephyr/bluetooth/byteorder.h
>
24
#include <
zephyr/bluetooth/hci_types.h
>
25
26
#ifdef __cplusplus
27
extern
"C"
{
28
#endif
29
48
#define BT_AUDIO_CODEC_CAP_LC3_DATA(_freq, _duration, _chan_count, _len_min, _len_max, \
49
_max_frames_per_sdu) \
50
{ \
51
BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CAP_TYPE_FREQ, BT_BYTES_LIST_LE16(_freq)), \
52
BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CAP_TYPE_DURATION, (_duration)), \
53
BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CAP_TYPE_CHAN_COUNT, (_chan_count)), \
54
BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CAP_TYPE_FRAME_LEN, \
55
BT_BYTES_LIST_LE16(_len_min), \
56
BT_BYTES_LIST_LE16(_len_max)), \
57
COND_CODE_1(_max_frames_per_sdu, (), \
58
(BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CAP_TYPE_FRAME_COUNT, \
59
(_max_frames_per_sdu)))) \
60
}
61
67
#define BT_AUDIO_CODEC_CAP_LC3_META(_prefer_context) \
68
{ \
69
BT_AUDIO_CODEC_DATA(BT_AUDIO_METADATA_TYPE_PREF_CONTEXT, \
70
BT_BYTES_LIST_LE16(_prefer_context)) \
71
}
72
84
#define BT_AUDIO_CODEC_CAP_LC3(_freq, _duration, _chan_count, _len_min, _len_max, \
85
_max_frames_per_sdu, _prefer_context) \
86
BT_AUDIO_CODEC_CAP(BT_HCI_CODING_FORMAT_LC3, 0x0000, 0x0000, \
87
BT_AUDIO_CODEC_CAP_LC3_DATA(_freq, _duration, _chan_count, _len_min, \
88
_len_max, _max_frames_per_sdu), \
89
BT_AUDIO_CODEC_CAP_LC3_META(_prefer_context))
90
101
#define BT_AUDIO_CODEC_CFG_LC3_DATA(_freq, _duration, _loc, _len, _frames_per_sdu) \
102
{ \
103
BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CFG_FREQ, (_freq)), \
104
BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CFG_DURATION, (_duration)), \
105
BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CFG_CHAN_ALLOC, BT_BYTES_LIST_LE32(_loc)), \
106
BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CFG_FRAME_LEN, BT_BYTES_LIST_LE16(_len)), \
107
COND_CODE_1(_frames_per_sdu, (), \
108
(BT_AUDIO_CODEC_DATA(BT_AUDIO_CODEC_CFG_FRAME_BLKS_PER_SDU, \
109
(_frames_per_sdu)))) \
110
}
111
113
#define BT_AUDIO_CODEC_CFG_LC3_META(_stream_context) \
114
{ \
115
BT_AUDIO_CODEC_DATA(BT_AUDIO_METADATA_TYPE_STREAM_CONTEXT, \
116
BT_BYTES_LIST_LE16(_stream_context)) \
117
}
118
129
#define BT_AUDIO_CODEC_LC3_CONFIG(_freq, _duration, _loc, _len, _frames_per_sdu, _stream_context) \
130
BT_AUDIO_CODEC_CFG( \
131
BT_HCI_CODING_FORMAT_LC3, 0x0000, 0x0000, \
132
BT_AUDIO_CODEC_CFG_LC3_DATA(_freq, _duration, _loc, _len, _frames_per_sdu), \
133
BT_AUDIO_CODEC_CFG_LC3_META(_stream_context))
134
135
#ifdef __cplusplus
136
}
137
#endif
138
143
#endif
/* ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_LC3_H_ */
byteorder.h
Bluetooth byteorder API.
hci_types.h
util_macro.h
Macro utilities.
include
zephyr
bluetooth
audio
lc3.h
Generated on Sun Sep 15 2024 17:01:29 for Zephyr Project API by
1.9.8