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