blob: 681def1641c168e0867ebaf0a5ea4d98c713ee69 [file] [log] [blame]
rjw6c1fd8f2022-11-30 14:33:01 +08001#ifndef SAL_H
2#define SAL_H
3#include "l1aud_common_def.h"
4#include "l1audio.h"
5
6
7void SAL_Set_Device(uint32 dev,uint16 band);
8void SAL_2G_Call_Open(uint32 enc_mod, uint32 dec_mod, uint32 sub_channel, uint32 tch_state, Sal_SRst_Type_t type);
9void SAL_2G_Handover(uint32 enc_mod, uint32 dec_mod, uint32 sub_channel, uint32 tch_state, Sal_SRst_Type_t type);
10void SAL_3G_Call_Open(uint32 enc_mod, uint32 dec_mod, uint32 dtx, uint32 delR, uint32 delW, uint32 delM, uint16 LinkMode, Sal_SRst_Type_t type);
11void SAL_4G_Call_Open_temp(uint32 enc_mod, uint32 dec_mod, uint32 dtx, uint32 delR, uint32 delW, uint32 delM, Sal_SRst_Type_t type);
12void SAL_3G_Upd_Enc_Cod(uint32 enc_mod);
13void SAL_3G_Upd_Dec_Cod(uint32 dec_mod);
14void SAL_2G_Call_Close(uint32 dsp_end);
15void SAL_3G_Call_Close(uint32 dsp_end);
16void SAL_4G_Call_Close_temp(uint32 dsp_end);
17void SAL_4G_G_Codec_Call_Close(uint32 dsp_end);
18void SAL_3G_Set_TxType(uint32 tx_type);
19void SAL_3G_Set_RxType(uint32 rx_type);
20volatile uint16* SAL_3G_GetAddr(uint16 type);
21uint16 SAL_3G_GetValue(uint16 type);
22bool SAL_3G_IsDLEmpty();
23bool SAL_3G_IsULReady();
24void SAL_3G_SetDLReady();
25void SAL_3G_SetULEmpty();
26void SAL_3G_SetULUnsync();
27void SAL_3G_SetDtx(bool on);
28void SAL_App_Open(uint32 delR, uint32 delW, uint32 delM);
29void SAL_App_Close(uint32 dsp_end);
30void SAL_Bgsnd_SetInit();
31bool SAL_Bgsnd_IsRunning();
32bool SAL_Bgsnd_IsIdle();
33void SAL_Bgsnd_SetFinal();
34void SAL_Bgsnd_Config(uint32 ulgain, uint32 dlgain, uint32 ulmix, uint32 dlmix);
35volatile uint16* SAL_Bgsnd_GetBuf_DL();
36uint32 SAL_Bgsnd_GetDataLen_DL();
37volatile uint16* SAL_Bgsnd_GetBuf_UL();
38uint32 SAL_Bgsnd_GetDataLen_UL();
39void SAL_Dsp_Sph_Init();
40volatile uint16* SAL_Sidetone_GetFltCoefAddr();
41volatile uint16* SAL_Notch_GetFltCoefAddr();
42volatile uint16* SAL_BKF_GetFltCoefAddr_NB_UL();
43volatile uint16* SAL_BKF_GetFltCoefAddr_NB_DL();
44volatile uint16* SAL_BKF_GetFltCoefAddr_WB_UL();
45volatile uint16* SAL_BKF_GetFltCoefAddr_WB_DL();
46volatile uint16* SAL_BKF_GetFltCoefAddr_SWB_UL();
47volatile uint16* SAL_BKF_GetFltCoefAddr_SWB_DL();
48void SAL_BKF_Switch(uint32 ul, uint32 dl);
49volatile uint16* SAL_SRC_GetFltCoefAddr();
50volatile uint16* SAL_SRCPlus_GetFltCoefAddr();
51volatile uint16* SAL_SRCPlusSWB_GetFltCoefAddr();
52volatile uint16* SAL_SRC_IIR_GetFltCoefAddr();
53volatile uint16* SAL_AGC_GetFltCoefAddr();
54void SAL_ENH_SetULPath(bool on);
55void SAL_ENH_SetDLPath(bool on);
56bool SAL_ENH_ParUpdPState_IsIdle();
57void SAL_ENH_ParUpdState_SetUpd();
58void SAL_ENH_ParUpdState_SetUpd_Offset(kal_uint32 Offset, kal_uint32 Len);
59bool SAL_ENH_CtrlUpdPState_IsIdle();
60void SAL_ENH_CtrlUpdState_SetUpd();
61void SAL_ENH_SetInit(uint32 enh_mod);
62void SAL_ENH_SetOff(uint32 enh_mod);
63bool SAL_ENH_IsReady(uint32 enh_mod);
64bool SAL_ENH_IsIdle(uint32 enh_mod);
65void SAL_ENH_Dynamic_Ctrl(bool on, Sal_Enh_Dynamic_t fea);
66void SAL_ENH_Gain_Set_DL(uint16 val);
67void SAL_ENH_Dynamic_State_Par_Init(void);
68void SAL_ENH_Dynamic_State_Set(Sal_Enh_Dyn_Sta_t sta);
69bool SAL_ENH_Dynamic_State_Check(Sal_Enh_Dyn_Sta_t sta);
70void SAL_ENH_Flag_Par_Set(Sal_Enh_Flag_Par_t par);
71void SAL_ENH_SetDMNR(bool on);
72void SAL_ENH_SetTDNC(bool on);
73void SAL_ENH_SetMagicConference(bool on);
74void SAL_ENH_SetMainSwitch(bool on);
75void SAL_ENH_Set3GNetworkType(uint16 type);
76volatile uint16* SAL_CommonPar_GetBuf();
77volatile uint16* SAL_ModePar_GetBuf_NB();
78volatile uint16* SAL_ModePar_GetBuf2_NB();
79volatile uint16* SAL_ModePar_GetBuf3_NB();
80volatile uint16* SAL_ModePar_GetBuf_WB();
81volatile uint16* SAL_ModePar_GetBuf2_WB();
82volatile uint16* SAL_ModePar_GetBuf3_WB();
83volatile uint16* SAL_ModePar_GetBuf_SWB();
84volatile uint16* SAL_EMP_DebugInfo_GetBuf();
85volatile uint16* SAL_DMNR_GetFltCoefAddr_NB();
86volatile uint16* SAL_DMNR_GetFltCoefAddr_WB();
87volatile uint16* SAL_DMNR_GetFltCoefAddr_SWB();
88volatile uint16* SAL_DMNR_GetFltCoefAddr_LSPK_NB();
89volatile uint16* SAL_DMNR_GetFltCoefAddr_LSPK_WB();
90volatile uint16* SAL_DMNR_GetFltCoefAddr_LSPK_SWB();
91void SAL_TST_Handler(int16 cmd);
92bool SAL_DSPINT_Resolve(uint16 iid, uint32 * sph_int);
93void SAL_PcmEx_Config(Sal_PCMEx_Config_t* cfg);
94void SAL_PcmEx_SetStateUL(Sal_PcmEx_Type_t type, Sal_PcmEx_State_t sta);
95void SAL_PcmEx_SetStateDL(Sal_PcmEx_Type_t type, Sal_PcmEx_State_t sta);
96bool SAL_PcmEx_CheckStateUL(Sal_PcmEx_Type_t type, Sal_PcmEx_State_t sta);
97bool SAL_PcmEx_CheckStateDL(Sal_PcmEx_Type_t type, Sal_PcmEx_State_t sta);
98bool SAL_PcmEx_IsCtrlClean(Sal_PcmEx_Type_t type);
99void SAL_PcmEx_SetCtrlClean(Sal_PcmEx_Type_t type);//dangerous operation
100volatile uint16* SAL_PcmEx_GetBuf(Sal_PcmEx_BufId_t id);
101volatile uint16* SAL_IIR_Coef_GetBuf(Sal_IIR_Coef_t id);
102uint16 SAL_PcmEx_GetBufLen(Sal_PcmEx_BufId_t id);
103uint16 SAL_AGC_GetSWGain(uint8 mic); // 0 -> mic1, 1 -> mic2
104bool SAL_3G_Mode();
105void SAL_VM_Config(Sal_VM_Config_t * cfg);
106void SAL_VM_GetFrame2G(Sal_VM_Frame * vmfrm);
107void SAL_VM_GetFrame3G(Sal_VM_Frame * vmfrm);
108void SAL_EPL_GetFrame(Sal_EPL_Frame * eplfrm);
109void SAL_LBK_Codec(bool on);
110uint16 SAL_Sidetone_GetAdaptiveGain();
111void SAL_Sidetone_SetGain(uint16 val);
112void SAL_Sidetone_Enable(bool ena);
113uint16 SAL_DGain_Get_DL();
114void SAL_DGain_Set_DL(uint16 val);
115uint16 SAL_DGain_Get_UL();
116void SAL_DGain_Set_UL(uint16 val);
117void SAL_AGC_SetGain(uint16 val);
118void SAL_BT_Config(Sal_BT_Config *cfg);
119bool SAL_BT_IsEnable();
120void SAL_Mute_Ctrl(Sal_Mute_Point_t ctrl, bool mute);
121bool SAL_Mute_Check(Sal_Mute_Point_t ctrl);
122void SAL_CTM_Switch(bool on);
123void SAL_CTM_SetGain(uint16 limit, uint16 update);
124uint16 SAL_CTM_GetValue(uint16 type);
125bool SAL_CTM_IsIdle();
126bool SAL_CTM_IsOff();
127void SAL_AGC1_Config(Sal_AGC_Config_t *cfg);
128void SAL_AGC2_Config(Sal_AGC_Config_t *cfg);
129void SAL_AGC3_Config(Sal_AGC_Config_t *cfg);
130void SAL_AGC4_Config(Sal_AGC_Config_t *cfg);
131void SAL_NotchFilter_Enable(bool ena, bool thirdStageIIR);
132void SAL_8K_Resync(bool ul, int16 ul_offset, bool dl, int16 dl_offset);
133void SAL_GetWarnMsg(uint16 *ulcode, uint16 *dlcode);
134void SAL_2G_SMR_Switch(bool on);
135void SAL_VOLTE_SetInfo(Sal_VOLTE_info_t info, uint16 val);
136volatile uint16* SAL_ENH_GetInternalParAddr();
137void SAL_PCM_Router_Open(Sal_PCM_Router_t *pcmrt, Sal_SRst_Type_t type);
138void SAL_PCM_Router_Close(uint32 dsp_end);
139uint16 SAL_GetDLVADFlag();
140volatile uint16* SAL_FS_GetFltCoefAddr();
141void SAL_4G_ExtCod_Call_Open(uint32 band, Sal_ExtCod_t Cod,uint32 delR, uint32 delW, uint32 delM, Sal_SRst_Type_t type);
142void SAL_4G_ExtCod_Call_Close(uint32 dsp_end);
143void SAL_C2K_Call_Open(uint16 u2SO, bool bDtx, uint16 u2DelR, uint16 u2DelW, uint16 u2DelM, Sal_SRst_Type_t type);
144void SAL_C2K_Call_Close(bool bDsp_end);
145bool SAL_C2K_IsULReady(void);
146void SAL_C2K_SetULEmpty(void);
147bool SAL_C2K_IsDLEmpty(void);
148void SAL_C2K_SetDLReady(void);
149void SAL_C2K_SetULUnsync(void);
150void SAL_C2K_SetValue(uint16 u2ValId, uint16 u2Val);
151void SAL_C2K_TTY_Switch(bool bOn);
152void SAL_C2K_SetTTYStatus(bool bUL, bool bDL);
153void SAL_C2K_COD_Feature_Switch(uint16 u2CodFea, bool bOn);
154volatile uint16* SAL_C2K_GetAddr(uint16 type);
155uint16 SAL_C2K_GetValue(uint16 type);
156void SAL_VM_GetFrameC2K(Sal_VM_Frame *vmfrm);
157void SAL_SCH_Feature_Switch(uint16 u2SchFea, bool bOn);
158void SAL_TestMode_Config(uint16 TestMode_Ctrl, uint16 TestMode_Scenario);
159void SAL_DebugMode_Config(uint16 DebugMode);
160void SAL_TestMode_AFEDVT_Config(uint16 UL_Ch, uint16 DL_Ch);
161void SAL_4G_EVS_Call_Open(uint32 enc_mod, uint32 dec_mod, uint32 dtx, uint32 delR, uint32 delW, uint32 delM, Sal_SRst_Type_t type);
162void SAL_4G_EVS_Call_Close(uint32 dsp_end);
163void SAL_EVS_Set_Enc_Par(EVS_ENCODER_PARAMETER *EncPar);
164void SAL_EVS_Set_Dec_Par(EVS_DECODER_PARAMETER *DecPar, uint16 Nth_Frm);
165bool SAL_EVS_Get_Enc_SIDFirst_Status();
166void SAL_EVS_Set_Dec_SIDFirst_Status(bool sta, uint16 Nth_Frm);
167kal_uint16 SAL_EVS_Get_Dec_BFI(uint16 Nth_Frm);
168kal_uint16 SAL_EVS_Get_Dec_HBLen(uint16 Nth_Frm);
169kal_uint16 SAL_EVS_Get_Enc_BFI();
170kal_uint16 SAL_EVS_Get_Enc_HBLen();
171bool SAL_EVS_IsDTXOn();
172kal_uint16 SAL_EVS_Get_PCMBW();
173kal_uint16 SAL_EVS_Get_Enc_MaxRate();
174kal_uint16 SAL_EVS_Get_Enc_CA_Enable();
175kal_uint16 SAL_EVS_Get_Enc_CA_RF_FEC_Indicator();
176kal_uint16 SAL_EVS_Get_Enc_CA_RF_FEC_Offset();
177kal_uint16 SAL_EVS_Get_Dec_CA_FrmMode(uint16 Nth_Frm);
178kal_uint16 SAL_EVS_Get_Codec_Mode(kal_uint16 type);
179void SAL_Sph_KeyTone_DL_On(kal_uint16 Freq1, kal_uint16 Freq_2, kal_uint16 DLGain);
180void SAL_Sph_KeyTone_DL_Off();
181void SAL_Sph_KeyTone_UL_On(kal_uint16 Freq1, kal_uint16 Freq_2, kal_uint16 ULGain);
182void SAL_Sph_KeyTone_UL_Off();
183void SAL_ENH_ExtEchoRef_Switch(bool on);
184void SAL_ENH_ExtEchoRef_DelayConfig(kal_uint16 Id, kal_uint16 RefDelay, kal_uint16 ULDelay);
185void SAL_Set_LinkStatus(kal_uint16 LinkMode, bool on);
186
187void SAL_4G_Call_Handover(uint32 enc_mod, uint32 dec_mod, uint32 dtx, uint32 delR, uint32 delW, uint32 delM, Sal_SRst_Type_t type);
188void SAL_4G_EVS_Call_Handover(uint32 enc_mod, uint32 dec_mod, uint32 dtx, uint32 delR, uint32 delW, uint32 delM, Sal_SRst_Type_t type);
189
190void SAL_Set_DevInfo(Sal_DevInfo_Int_t IntDevInfo, Sal_DevInfo_Ext_t ExtDevInfo);
191void SAL_Set_SmartPA_Config(Sal_SmartPA_Config_t SmartPACfg);
192void SAL_Standby_Call_Open(uint32 enc_mod, uint32 dec_mod, uint32 dtx, uint32 delR, uint32 delW, uint32 delM, Sal_SRst_Type_t type);
193void SAL_Standby_Call_Close(uint32 dsp_end);
194void SAL_SetCallCloseWithFSM();
195bool SAL_IsCallCloseDone();
196
197void SAL_AAMPlus_Switch(bool on);
198Sal_AAMPlus_State_t SAL_AAMPlus_Get_Enc_State();
199kal_uint16 SAL_AAMPlus_Get_Period();
200
201void SAL_ENH_OccupyParMem();
202void SAL_ENH_ReleaseParMem();
203bool SAL_ENH_IsParMemAvailable();
204void SAL_Set_AWBPlusFlag(bool on);
205
206void SAL_RampDown_SetInit(Sal_Ramp_Point_t ctrl);
207void SAL_RampUp_SetInit(Sal_Ramp_Point_t ctrl);
208bool SAL_RampDown_IsDone(Sal_Ramp_Point_t ctrl);
209bool SAL_RampUp_IsDone(Sal_Ramp_Point_t ctrl);
210void SAL_Ramp_SetFinal(Sal_Ramp_Point_t ctrl);
211Sal_Ramp_State_t SAL_Ramp_GetState(Sal_Ramp_Point_t ctrl);
212void SAL_Ramp_SetMute(Sal_Ramp_Point_t ctrl);
213void SAL_Ramp_SetUnMute(Sal_Ramp_Point_t ctrl);
214void SAL_Set_MOSTestMode(bool update, kal_uint16 MOSTestMode);
215void SAL_Set_Repeat_Flag(kal_uint16 flag);
216kal_uint16 SAL_Get_Repeat_Flag();
217void SAL_ExtAUIF_SetMemAddr(Sal_ExtAUIF_Mem_Type_t MemType, kal_uint32 StarAddr, kal_uint32 Len);
218void SAL_Set_OpenDsp(bool on);
219void SAL_Get_Delay(Sal_Delay_Type_t type, kal_uint16 offset_ul, kal_uint16 offset_dl, kal_uint16 *DelR, kal_uint16 *DelW, kal_uint16 *DelM);
220void SAL_Get_AAM_Offset(Sal_Delay_Type_t type, kal_uint16 offset_ul, kal_uint16 period_ul, kal_uint16 offset_dl, kal_uint16 period_dl, kal_uint16 *offset_AAM);
221void SAL_Get_AAM_Margin(Sal_Delay_Type_t type, kal_uint16 offset_ul, kal_uint16 period_ul, kal_uint16 offset_dl, kal_uint16 period_dl, kal_uint16 *margin_AAM_ul, kal_uint16 *margin_AAM_dl);
222void SAL_AAM_SetPar(Sal_Delay_Type_t type, kal_uint16 margin_ul_cur, kal_uint16 period_ul, kal_uint16 margin_dl_cur, kal_uint16 period_dl);
223bool SAL_AAM_CheckReset();
224
225kal_uint16 SAL_Get_DuDuPtnFlag();
226
227void SAL_4G_Set_RxType(uint32 rx_type, uint32 Nth_Frm);
228uint16 SAL_4G_GetRXValue(uint16 type, uint16 Nth_Frm);
229volatile uint16* SAL_4G_GetRXAddr(uint16 type, uint16 Nth_Frm);
230void SAL_4G_SetDLHBValid(bool bValid, uint16 Nth_Frm);
231kal_uint16 SAL_4G_GetTSSwitch();
232void SAL_4G_SetTSScale(int16 Scale, int16 MaxScale, uint16 Nth_Frm);
233kal_uint16 SAL_Get_RingBuf_RemainLen();
234kal_uint16 SAL_Get_RingBuf_TotalLen();
235kal_uint16 SAL_Get_DL_CodecMode();
236
237void SAL_Mixer2_SetInit();
238bool SAL_Mixer2_IsRunning();
239bool SAL_Mixer2_IsIdle();
240void SAL_Mixer2_SetFinal();
241void SAL_Mixer2_Config(uint32 ulgain, uint32 dlgain, uint32 ulmix, uint32 dlmix);
242volatile uint16* SAL_Mixer2_GetBuf_DL();
243uint32 SAL_Mixer2_GetDataLen_DL();
244volatile uint16* SAL_Mixer2_GetBuf_UL();
245uint32 SAL_Mixer2_GetDataLen_UL();
246
247kal_uint16 SAL_Get_VCPMode();
248void SAL_LBK_PCM_D2U(bool on);
249
250kal_uint16 SAL_Get_DMFSource();
251kal_uint16 SAL_Get_DMFRate();
252void SAL_Get_DMF_SPH_UL_Info(Sal_DMF_SPH_UL_Info_t *DMF_SPH_UL_Info);
253void SAL_Get_DMF_SPH_DL_Info(Sal_DMF_SPH_DL_Info_t *DMF_SPH_DL_Info);
254void SAL_Get_DMF_ENH_UL_Info(Sal_DMF_ENH_UL_Info_t *DMF_ENH_UL_Info);
255kal_int16 SAL_Get_DMFPwr_UL();
256kal_int16 SAL_Get_DMFPwr_DL();
257void SAL_Set_SRstType(Sal_SRst_Type_t type);
258
259void SAL_Mixer3_SetInit();
260bool SAL_Mixer3_IsRunning();
261bool SAL_Mixer3_IsIdle();
262void SAL_Mixer3_SetFinal();
263void SAL_Mixer3_Config(uint16 gain, uint16 mix);
264volatile uint16* SAL_Mixer3_GetBuf();
265void SAL_Mixer3_SetDataLen(uint16 len);
266void SAL_Set_PSRANType(uint16 type);
267
268kal_uint16 SAL_VM_Get_TS_Info(Sal_VM_TS_Info_t TS_Info_Type);
269kal_uint16 SAL_VM_Get_CodBand();
270void SAL_SVC_Set_JBMVersion(uint8 version);
271
272void SAL_DTMF_Removal_Ctrl(Sal_DTMF_Removal_Point_t ctrl, bool on);
273void SAL_UltraSound_Removal_Switch(bool on);
274
275kal_uint16 SAL_Get_Codec_Mode(kal_uint16 type);
276#endif