[Feature]Upload Modem source code

Change-Id: Id4294f30faced84d3e6fd6d5e61e1111bf287a37
diff --git a/mcu/driver/audio/src/v1/VoLTETone.c b/mcu/driver/audio/src/v1/VoLTETone.c
new file mode 100644
index 0000000..3b97e99
--- /dev/null
+++ b/mcu/driver/audio/src/v1/VoLTETone.c
@@ -0,0 +1,309 @@
+
+#include "kal_public_api.h"
+#include "kal_general_types.h"
+
+#include "kal_trace.h"
+#include "l1sp_trc.h"
+
+#include "l1audio.h"
+#include "drv_sap.h"
+#include "speech_def.h"
+#include "bgSnd.h"
+//#include "afe_def.h" // for output device setting
+//#include "sp_drv.h"
+
+
+
+#include "audio_msgid.h"
+#include "sp_drv.h"
+
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+   
+typedef struct{
+   uint32 id;   
+   bool   is_used;   
+}VOLTE_TONE_T;
+VOLTE_TONE_T volte_tone;
+
+extern kal_spinlockid MCUTONESpinLockID;
+
+extern void DTMF_MCU_DataRequestCallback();
+extern void DTMF_MCU_GetReadBuffer(kal_int16 **pBuf_16b, kal_uint32 *uDataWord);
+extern kal_bool DTMF_MCU_IsPlaying();
+extern void DTMF_MCU_ReadDataDone(kal_uint32 uDataWord);
+extern void EXT_BGSND_Hisr(BGSND_PROCESS_TYPE type);
+
+
+
+uint32 VolteToneGetID()
+{
+   return(volte_tone.id);
+}
+
+void VolteToneSetID(uint32 u32val)
+{
+   volte_tone.id = u32val;
+}
+
+bool VolteToneGetUsed()
+{
+   return(volte_tone.is_used);
+}
+
+void VolteToneSetUsed(bool bval)
+{
+   volte_tone.is_used = bval;
+}
+
+void SP4G_PSR_Tone_init()
+{
+   
+}
+//tone
+void SP4G_PSR_DL_Tone_Play(const L1SP_Tones *pToneList)
+{
+   ilm_PSR_DL_TONE_t *local_para;
+
+   MD_TRC_SP4G_PSR_DL_TONE_PLAY_ENTER(); 
+
+   //TONE_Play(pToneList, DSP_TONE);
+   local_para = (ilm_PSR_DL_TONE_t *) construct_local_para( sizeof(ilm_PSR_DL_TONE_t), TD_CTRL/*TD_RESET*/ );
+   local_para->pToneList = (L1SP_Tones *)pToneList;
+   msg_send6(MOD_LTECSR, MOD_MED, AUDIO_SAP, MSG_ID_AUDIO_M2M_VOLTE_DL_TONE_PLAY, (local_para_struct *)local_para, NULL);
+
+   MD_TRC_SP4G_PSR_DL_TONE_PLAY_LEAVE(); 
+}
+
+void SP4G_PSR_DL_Tone_Stop( void )
+{
+   MD_TRC_SP4G_PSR_DL_TONE_STOP_ENTER();    
+   //TONE_Stop(DSP_TONE);
+   msg_send6(MOD_LTECSR, MOD_MED, AUDIO_SAP, MSG_ID_AUDIO_M2M_VOLTE_DL_TONE_STOP, NULL, NULL);
+   MD_TRC_SP4G_PSR_DL_TONE_STOP_LEAVE();    
+}
+
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+
+void volte_Tone_bgSnd_closeHandler(void);//BGSND HISR to MED  ToDO
+void volte_BGSND_ULHdr(void);
+//TONE
+void SP4G_PSR_UL_Tone_Play(const L1SP_Tones *pToneList )
+{ 
+   ilm_PSR_DL_TONE_t *local_para;
+
+   MD_TRC_SP4G_PSR_UL_TONE_PLAY_ENTER(); 
+   /*if( !volte_tone.is_used ){    
+      TONE_Play(pToneList, MCU_TONE);
+      volte_tone.id = EXT_BGSND_Start(volte_Tone_bgSnd_closeHandler, NULL, volte_BGSND_ULHdr, 7, 7);
+      volte_tone.is_used = true;      
+   }else{
+      MD_TRC_SP4G_PSR_UL_TONE_PLAY_SKIP();       
+   }*/
+   local_para = (ilm_PSR_DL_TONE_t *) construct_local_para( sizeof(ilm_PSR_DL_TONE_t), TD_CTRL/*TD_RESET*/ );
+   local_para->pToneList = (L1SP_Tones *)pToneList;
+   msg_send6(MOD_LTECSR, MOD_MED, AUDIO_SAP, MSG_ID_AUDIO_M2M_VOLTE_UL_TONE_PLAY, (local_para_struct *)local_para, NULL);
+
+   MD_TRC_SP4G_PSR_UL_TONE_PLAY_LEAVE();     
+}
+
+void SP4G_PSR_UL_Tone_Stop( void )
+{   
+   MD_TRC_SP4G_PSR_UL_TONE_STOP_ENTER();   
+   /*if( volte_tone.is_used ){  
+      EXT_BGSND_Flush(volte_tone.id); 
+      TONE_Stop(MCU_TONE);      
+   }else{
+      MD_TRC_SP4G_PSR_UL_TONE_STOP_SKIP();        
+   }*/
+   msg_send6(MOD_LTECSR, MOD_MED, AUDIO_SAP, MSG_ID_AUDIO_M2M_VOLTE_UL_TONE_STOP, NULL, NULL);
+   MD_TRC_SP4G_PSR_UL_TONE_STOP_LEAVE();       
+}
+
+void volte_Tone_bgSnd_closeHandler(void)//BGSND HISR to MED  ToDO
+{
+   MD_TRC_VOLTE_BGSND_CLOSEHANDLER_ENTER();    
+   ASSERT( volte_tone.is_used );
+	msg_send4(MOD_L1SP, MOD_MED, AUDIO_SAP, MSG_ID_AUDIO_M2M_VOLTE_TONE_BGSND_CLOSE);
+   MD_TRC_VOLTE_BGSND_CLOSEHANDLER_LEAVE();  	
+}
+
+void volte_Tone_BgSndClose(void)//trigger by MED
+{
+   MD_TRC_VOLTE_BGSNDCLOSE_LEAVE();    
+   ASSERT( volte_tone.is_used );
+	EXT_BGSND_Close(volte_tone.id);	
+	volte_tone.is_used = false;
+   MD_TRC_VOLTE_BGSNDCLOSE_LEAVE(); 	
+}
+
+//#############################################
+//KT
+void volte_KT_bgSnd_closeHandler(void);//BGSND HISR to MED  ToDO
+
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
+
+#if 0
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+/* under construction !*/
+#endif
\ No newline at end of file