• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  * Copyright (c) 2022 Telink Semiconductor (Shanghai) Co., Ltd. ("TELINK")
3  * All rights reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *****************************************************************************/
18 #ifndef _AUDIO_STRUCT_H_
19 #define _AUDIO_STRUCT_H_
20 
21 #if (BLC_AUDIO_PROFILE_EN)
22 
23 #if (BLC_AUDIO_ASCS_ENABLE)
24 typedef struct {
25     u8 cigID;
26     u8 cisID;
27     u8 codecId[5];
28     u8 direction;
29     u8 frequency;
30     u8 duration;
31     u16 context;  // Metadata
32     u16 frameOcts;
33     u32 location;
34 } blc_audio_aseConfig_t;
35 #endif
36 
37 typedef int (*BlcAudioEventCB)(u16 connHandle, u16 evtID, u16 dataLen, u8 *pData);
38 
39 typedef struct {
40     u8 aseID;
41     u8 reason;
42     u8 reserve;
43     u8 errorCode;  // 0-success, other-fail
44     u16 aclHandle;
45     u16 attHandle;
46 } blc_audio_aseEnableEvt_t;
47 typedef struct {
48     u8 aseID;
49     u16 aclHandle;
50     u16 cisHandle;
51     u16 attHandle;
52     u16 context;
53 } blc_audio_aseUpdateEvt_t;
54 typedef struct {
55     u8 aseID;
56     u16 aclHandle;
57     u16 cisHandle;
58     u16 attHandle;
59 } blc_audio_aseDisableEvt_t, blc_audio_aseReleaseEvt_t;
60 typedef struct {
61     u8 aseID;
62     u16 aclHandle;
63     u16 cisHandle;
64     u16 attHandle;
65 } blc_audio_aseStartEvt_t, blc_audio_aseStopEvt_t;
66 
67 typedef struct {
68     u16 aclHandle;
69     u16 attHandle;
70     u8 gainValue;
71     u8 gainMute;
72     u8 gainMode;
73     u8 gainCounter;
74 } blc_audio_aicsStateChangeEvt_t;
75 typedef struct {
76     u16 aclHandle;
77     u16 attHandle;
78     u8 status;  // 0-Inactive, 1-Active
79 } blc_audio_aicsStatusChangeEvt_t;
80 typedef struct {
81     u16 aclHandle;
82     u16 attHandle;
83     u32 dataLen;
84     u8 *pData;
85 } blc_audio_aicsDescribleChangeEvt_t;
86 
87 typedef struct {
88     u16 aclHandle;
89     u16 attHandle;
90     s16 voffset;
91     u8 counter;
92 } blc_audio_vocsStateChangeEvt_t;
93 typedef struct {
94     u16 aclHandle;
95     u16 attHandle;
96     u32 location;
97 } blc_audio_vocpLocationChangeEvt_t;
98 typedef struct {
99     u16 aclHandle;
100     u16 attHandle;
101     u32 dataLen;
102     u8 *pData;
103 } blc_audio_vocpDescribleChangeEvt_t;
104 
105 typedef struct {
106     u16 aclHandle;
107     u16 attHandle;
108     u8 mute;
109     u8 volume;
110 } blc_audio_vcpStateChangeEvt_t;
111 typedef struct {
112     u16 aclHandle;
113     u16 attHandle;
114     u8 flag;
115 } blc_audio_vcpFlagChangeEvt_t;
116 
117 typedef struct {
118     u8 numb;
119     u8 mute;
120     u8 volume;
121     u16 aclHandle;
122 } blc_audio_micVolumeChangeEvt_t;
123 
124 typedef struct {
125     u16 aclHandle;
126 } blc_audio_pacpServiceReadyEvt_t;
127 
128 typedef struct {
129     u16 aclHandle;
130     u16 ctlHandle;
131     u8 aseCount;
132 #if (BLC_AUDIO_ASCS_ENABLE)
133     u8 aseID[BLC_AUDIO_ASE_PER_HANDLE];
134     u8 aseState[BLC_AUDIO_ASE_PER_HANDLE];
135 #endif  // #if (BLC_AUDIO_ASCS_ENABLE)
136 } blc_audio_ascpServiceReadyEvt_t;
137 
138 typedef struct {
139     u16 aclHandle;
140     u16 sirkHandle;
141     u16 sizeHandle;
142     u16 lockHandle;
143     u16 rankHandle;
144     u8 size;
145     u8 lock;
146     u8 rank;
147     u8 lockCCC;
148     u8 SIRK[16];
149 } blc_audio_csipServiceReadyEvt_t;
150 
151 #if (BLC_AUDIO_MICS_ENABLE || BLC_AUDIO_VCS_ENABLE)
152 typedef struct {
153     u16 ctrlHandle;
154     u16 stateHandle;
155     u16 propeHandle;
156     u16 inputHandle;
157     u16 statusHandle;
158 
159     u8 gainStateValue;
160     u8 gainStateMute;
161     u8 gainStateMode;
162     u8 gainStateCount;
163     u8 gainPropeUnit;
164     u8 gainPropeMin;
165     u8 gainPropeMax;
166     u8 gainType;
167     u8 gainStatus;
168 } blc_audio_aicsServiceReadyEvt_t;
169 #endif
170 typedef struct {
171     u16 stateHandle;
172     u16 ctrlHandle;
173     u16 locaHandle;
174     u16 descHandle;
175     u16 voffset;
176     u8 counter;
177     u32 location;
178 } blc_audio_vocsServiceReadyEvt_t;
179 
180 typedef struct {
181     u16 aclHandle;
182     u16 muteHandle;
183 
184     u8 muteValue;
185     u8 aicsCount;
186 #if (BLC_AUDIO_VCS_AICS_ENABLE)
187     blc_audio_aicsServiceReadyEvt_t aics[BLC_AUDIO_VCS_AICS_COUNT];
188 #endif
189 } blc_audio_micpServiceReadyEvt_t;
190 typedef struct {
191     u16 aclHandle;
192     u16 muteHandle;
193     u8 muteValue;
194 } blc_audio_micpMuteChangeEvt_t;
195 
196 typedef struct {
197     u16 aclHandle;
198     u16 ctlHandle;
199     u16 statHandle;
200     u16 flagHandle;
201 
202     u8 mute;
203     u8 volume;
204     u8 counter;
205     u8 flagValue;
206     u8 aicsCount;
207     u8 vocsCount;
208 #if (BLC_AUDIO_VCS_AICS_ENABLE)
209     blc_audio_aicsServiceReadyEvt_t aics[BLC_AUDIO_VCS_AICS_COUNT];
210 #endif
211 #if (BLC_AUDIO_VOCS_ENABLE)
212     blc_audio_vocsServiceReadyEvt_t vocs[BLC_AUDIO_VCS_VOCS_COUNT];
213 #endif
214 } blc_audio_vcpServiceReadyEvt_t;
215 
216 typedef struct {
217     u16 aclHandle;
218     u16 cisHandle;
219 } blc_audio_mcpServiceReadyEvt_t;
220 typedef struct {
221     u16 aclHandle;
222     u16 attHandle;
223     u8 opcode;  // Refer to BLC_AUDIO_MCP_OPCODE_ENUM
224     u8 dataLen;
225     u8 *pData;
226 } blc_audio_mcpCtrlEvt_t;
227 typedef struct {
228     u16 aclHandle;
229     u16 attHandle;
230     u8 state;  // Refer to BLC_AUDIO_MEDIA_STATE_ENUM
231 } blc_audio_mcpStateEvt_t;
232 
233 typedef struct {
234     u16 CCIDHandle;
235     u16 inCallHandle;
236     u16 callCtrlHandle;
237     u16 provNameHandle;
238     u16 callerIDHandle;
239     u16 callStateHandle;
240     u16 bearerTechHandle;
241     u16 CCPOpcodesHandle;
242     u16 termReasonHandle;
243     u16 curCallListHandle;
244 } blc_audio_tbpServiceReadyEvt_t;
245 typedef struct {
246     u8 index;
247     u8 state;
248     u8 callFlags;
249 } blc_audio_tbpCallStateEvt_t;
250 
251 #endif  // #if (BLC_AUDIO_PROFILE_EN)
252 
253 #endif
254