changeset 519:57ad8f4d5cb5

L1: audio and tm header files imported from Leonardo semi-src
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 10 Jul 2014 15:02:48 +0000
parents ffbb71ee664c
children ed6071292a5c
files gsm-fw/L1/audio_cust0/l1audio_cust.h gsm-fw/L1/audio_include/l1audio_abb.h gsm-fw/L1/audio_include/l1audio_const.h gsm-fw/L1/audio_include/l1audio_defty.h gsm-fw/L1/audio_include/l1audio_macro.h gsm-fw/L1/audio_include/l1audio_msgty.h gsm-fw/L1/audio_include/l1audio_signa.h gsm-fw/L1/audio_include/l1audio_varex.h gsm-fw/L1/tm_cust0/l1tm_cust.h gsm-fw/L1/tm_cust0/l1tm_tpu10.h gsm-fw/L1/tm_cust0/l1tm_tpu12.h gsm-fw/L1/tm_cust0/l1tm_tpu2.h gsm-fw/L1/tm_cust0/l1tm_tpu35.h gsm-fw/L1/tm_cust0/l1tm_tpu8.h gsm-fw/L1/tm_include/l1tm_defty.h gsm-fw/L1/tm_include/l1tm_msgty.h gsm-fw/L1/tm_include/l1tm_signa.h gsm-fw/L1/tm_include/l1tm_varex.h gsm-fw/L1/tm_include/l1tm_ver.h
diffstat 19 files changed, 2730 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/L1/audio_cust0/l1audio_cust.h	Thu Jul 10 15:02:48 2014 +0000
@@ -0,0 +1,149 @@
+/************* Revision Controle System Header *************
+ *                  GSM Layer 1 software
+ * L1AUDIO_CUST.H
+ *
+ *        Filename l1audio_cust.h
+ *  Copyright 2003 (C) Texas Instruments  
+ *
+ ************* Revision Controle System Header *************/
+
+#if (AUDIO_TASK == 1)
+
+  #if (OP_RIV_AUDIO == 0)
+    extern void vocoder_mute_dl (BOOL mute);
+    extern void vocoder_mute_ul (BOOL mute);
+  #endif
+  
+  #if (MELODY_E1)
+    //----------------------------------------
+    // Melody format E1 constant.
+    //----------------------------------------
+
+    // Number of oscillators (fixed value)
+    #define SC_NUMBER_OSCILLATOR         8
+
+    // Define the unit of the downloading time (fixed value)
+    #define SC_MELO_DOWNLOAD_TIME_UNIT    4   // unit = 20ms
+
+  #endif // MELODY_E1
+
+  #if (VOICE_MEMO) || (SPEECH_RECO)
+    //----------------------------------------
+    // Voice memo constant.
+    //----------------------------------------
+
+    // Word to indicate the end of the speech data (fixed value).
+    #define SC_VM_END_MASK        0xFBFF
+
+  #endif // VOICE_MEMO || SPEECH_RECO
+
+  #if (L1_VOICE_MEMO_AMR)
+    //----------------------------------------
+    // Voice memo amr constant.
+    //----------------------------------------
+
+    // Word to indicate the end of the speech data (fixed value).
+    #define SC_VM_AMR_END_MASK_SIZE        1
+    #define SC_VM_AMR_END_MASK          0xFF
+
+  #endif // L1_VOICE_MEMO_AMR
+
+  #if (SPEECH_RECO)
+    //----------------------------------------
+    // Speech recognition constant.
+    //----------------------------------------
+
+    // Error ID (fixed values)
+    #define SC_NO_ERROR         0   // No error
+    #define SC_BAD_ACQUISITION  1   // Bad acquisition of the word. The word is too long or too short
+    #define SC_TIME_OUT         2   // The DSP task to acquire the word takes to much time
+    #define SC_BAD_UPDATE       3   // Bad update of the model. The model from the database is too different
+                                    // than the model built during the acquisition.
+    #define SC_BAD_RECOGNITION  4   // This word is out of vocabulary or the best words are too close
+    #define SC_CTO_WORD         5   // A word generated by the CTO algorithm is the best word.
+    #define SC_CHECK_ERROR      6   // The best word isn't the word to update.
+
+    // Time out (fixed values)
+    #define SC_SR_AQUISITION_TIME_OUT    867  // acquisition time out in fn unit (3s).
+    #define SC_SR_UPDATE_TIME_OUT        500  // update time out in fn unit.
+    #define SC_SR_PROCESSING_TIME_OUT    500  // processing time out in fn unit.
+
+
+    // CTO algorithm parameters (tuning value)
+    #define SC_SR_MAX_WORDS_FOR_CTO  4   // Threshold to decide when the CTO algorithm is needed:
+                                         // if the number of model is less 0r equal to this value, the CTO algo. is enabled.
+
+    // model constant (fixed values)
+    #define SC_SR_MODEL_FRAME_SIZE  16      // size of the model parameters per audio frames (20 ms).
+    #define SC_SR_MODEL_API_SIZE    1041    // size of the model corrsponding to the longest possible word (1,3 second):
+                                            // 16 words frames* 1,3s/20ms + 1 = 1041
+                                            // the header word of the model gives the size of the model in model frame unit.
+    #define SC_SR_MMI_DB_MODEL_SIZE SC_SR_MODEL_API_SIZE    // maximum size of the model in the MMI database.
+
+    // speech constant (fixed values)
+    #define SC_SR_SPEECH_FRAME_SIZE  20      // size of the speech samples per audio frams (20ms)
+
+    #define SC_SR_SPEECH_WORD_SIZE                65  // maximum size in speech frame size unit of the word to acquire
+    #define SC_SR_SPEECH_WORD_BEGIN_VAD_LATENCY   35  // time in speech frame size unit to detect that the word begins
+    #define SC_SR_SPEECH_WORD_END_VAD_LATENCY     35  // time in speech frame size unit to detect that the word is finished
+    #define SC_SR_SPEECH_WORD_BEGIN_MARGIN         5  // time in speech frame size unit to add a beginning margin of the word
+    #define SC_SR_SPEECH_WORD_END_MARGIN           5  // time in speech frame size unit to add a end margin of the word
+    #define SC_SR_SPEECH_ENDING_DONE_MARGING      20  // time in speech frame size unit to have the word done status after the word ending status.
+
+    #define SC_SR_MMI_2_L1_SPEECH_SIZE (SC_SR_SPEECH_WORD_BEGIN_MARGIN + SC_SR_SPEECH_WORD_SIZE + SC_SR_SPEECH_WORD_END_VAD_LATENCY + SC_SR_SPEECH_ENDING_DONE_MARGING) * SC_SR_SPEECH_FRAME_SIZE
+                                       // size of the speech buffer allocated by MMI to acquire the speech.
+    #define SC_SR_MMI_DB_SPEECH_SIZE   (SC_SR_SPEECH_WORD_BEGIN_MARGIN + SC_SR_SPEECH_WORD_SIZE + SC_SR_SPEECH_WORD_END_MARGIN) * SC_SR_SPEECH_FRAME_SIZE + 1 // size of the speech buffer included in a MMI database
+                                                                                                                                                              // "+1" is for the END voice memo mask.
+
+    // DSP Out-Of-Vocabulary constant (tuning value)
+    #define SC_SR_OOV_SFT_THR   10  // OOV rejection threhold (the lower more rejection)
+                                    // if this value is equal to 0, ther's no rejection
+
+  #endif // SPEECH_RECO
+
+  #if (L1_NEW_AEC)
+    // time interval between 2 AEC debug traces (in TDMA). Must be <= 127
+    #define SC_AEC_VISIBILITY_INTERVAL 52
+  #endif
+
+  #if (FIR)
+    // FIR indication (fixed values)
+    #define DL_FIR      1   // The DL FIR must be updated
+    #define UL_FIR      2   // The UL FIR must be updated
+    #define UL_DL_FIR   3   // The UL&DL FIR must be updated
+
+  #endif
+
+  // List of the error returned by the Cust_get_pointer function
+  #define DATA_AVAILABLE    0   // No error is occured
+  #define SESSION_ERROR     1   // Wrong session id
+  #define POINTER_ERROR     2   // Wrong ptr argument
+  #define DATA_AVAIL_ERROR  3   // No more data available
+
+  #if (AUDIO_MODE)
+    #define GSM_ONLY        0   // GSM normal mode
+    #define BT_CORDLESS     1   // Bluetooth cordless mode
+    #define BT_HEADSET      2   // Bluetooth headset mode
+  #endif
+
+  #if (MELODY_E2)
+    #define SC_AUDIO_MELODY_E2_MAX_NUMBER_OF_INSTRUMENT   8    // Maximum number of instruments allowed to play in thesame time
+                                                               // (Fixed value)
+    #define SC_AUDIO_MELODY_E2_MAX_SIZE_OF_INSTRUMENT     (3807 - C_DEBUG_BUFFER_SIZE)
+                                                               // Melody E2 instrument wave table size in the API memory
+                                                               // (fixed value)
+    #define SC_AUDIO_MELODY_E2_MAX_SIZE_OF_DSP_TRACE      (C_DEBUG_BUFFER_SIZE + 1)
+                                                               // DSP API buffer trace size (fixed value)
+
+    // Note :the melody E2 instrument are overlayed with the DSP buffer trace. The size ofthe trace buffer can
+    // change in order to increase the DSP tracability. In all case, the following rules need to be followed
+    // (when melody E2 is activated):
+         // size of the E2 instruments buffer + size of DSP trace buffer = 2049
+         // size of the E2 instrument buffers > 1
+         // size of DSP trace buffer > 1
+  #endif
+#endif // AUDIO_TASK
+
+// Number of coefficient for each FIR (fixed value)
+#define MAX_FIR_COEF  31
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/L1/audio_include/l1audio_abb.h	Thu Jul 10 15:02:48 2014 +0000
@@ -0,0 +1,24 @@
+/*
+ *        Filename l1audio_abb.h
+ *  Copyright 2003 (C) Texas Instruments  
+ *
+ *
+ */
+
+#define ABB_L1_WRITE(addr,data) (((data) << 6) | (addr) | 0x01)
+
+void ABB_CAL_UlVolume     (UWORD8 pga_index);
+void ABB_CAL_DlVolume     (UWORD8 volume_index, UWORD8 pga_index);
+void ABB_UlVolume         (UWORD8 volume_index);
+void ABB_DlVolume         (UWORD8 volume_index);
+void ABB_DlMute           (BOOL mute);
+void ABB_SideTone         (UWORD8 volume_index);
+void ABB_Audio_Config     (UWORD16 data);
+void ABB_Audio_Config_2   (UWORD16 data); 
+void ABB_UlMute           (BOOL mute);
+void ABB_Audio_Control    (UWORD16 data);
+void ABB_Audio_On_Off     (UWORD16 data);
+void ABB_Audio_Volume     (UWORD16 data);
+void ABB_Audio_PLL        (UWORD16 data);
+void ABB_Audio_VBPop      (UWORD16 data);
+void ABB_Audio_Delay_Init (UWORD8 delay);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/L1/audio_include/l1audio_const.h	Thu Jul 10 15:02:48 2014 +0000
@@ -0,0 +1,350 @@
+/************* Revision Controle System Header *************
+ *                  GSM Layer 1 software
+ * L1AUDIO_CONST.H
+ *
+ *        Filename l1audio_const.h
+ *  Copyright 2003 (C) Texas Instruments  
+ *
+ ************* Revision Controle System Header *************/
+
+#if (AUDIO_TASK == 1)
+
+  //----------------------------------------
+  // LAYER 1 Synchronous audio process name.
+  //----------------------------------------
+
+  #define NBR_AUDIO_MANAGER        19   // Number of L1S audio managers
+
+  #define L1S_KEYBEEP_STATE         0   // l1s_keybeep_manager()
+  #define L1S_TONE_STATE            1   // l1s_tone_manager()
+  #define L1S_MELODY0_STATE         2   // l1s_melody0_manager()
+  #define L1S_MELODY1_STATE         3   // l1s_melody1_manager()
+  #define L1S_VM_PLAY_STATE         4   // l1s_vm_play_manager()
+  #define L1S_VM_RECORD_STATE       5   // l1s_vm_record_manager()
+  #define L1S_TONE_UL_STATE         6   // l1s_tone_ul_manager()
+  #define L1S_SR_ENROLL_STATE       7   // l1s_sr_enroll_manager()
+  #define L1S_SR_UPDATE_STATE       8   // l1s_sr_update_manager()
+  #define L1S_SR_RECO_STATE         9   // l1s_sr_reco_manager()
+  #define L1S_SR_PROCESSING_STATE  10   // l1s_sr_processing_manager()
+  #define L1S_SR_SPEECH_STATE      11   // l1s_sr_speech_manager()
+  #define L1S_AEC_STATE            12   // l1s_aec_manager()
+  #define L1S_AUDIO_MODE_STATE     13   // l1s_audio_mode_manager()
+  #define L1S_MELODY0_E2_STATE     14   // l1s_melody0_e2_manager()
+  #define L1S_MELODY1_E2_STATE     15   // l1s_melody1_e2_manager()
+  #define L1S_VM_AMR_PLAY_STATE    16   // l1s_vm_amr_play_manager()
+  #define L1S_VM_AMR_RECORD_STATE  17   // l1s_vm_amr_record_manager()
+  #define L1S_CPORT_STATE          18   // l1s_cport_manager()
+
+  //----------------------------------------
+  // MCU<->DSP communication bit field.
+  //----------------------------------------
+
+  // bit in d_tch_mode for audio features
+  #define B_VOICE_MEMO_DTX      (TRUE_L << 5)
+#if (DSP == 34) || (DSP == 35) || (DSP == 36)
+  #define B_VM_VOCODER_SELECT   (TRUE_L << 6)
+#endif
+
+  // bits in d_toneskb_status
+  #define B_TONE                (TRUE_L <<  0) // Indicate if the DSP tone task is running
+  #define B_KEYBEEP             (TRUE_L <<  1) // Indicate if the DSP Keybeep task is running
+  #define B_VM_RECORD_ON_GOING  (TRUE_L <<  2) // Indicate if the DSP recording speech task is running
+  #define B_VM_PLAY_ON_GOING    (TRUE_L <<  3) // Indicate if the DSP playing task is running
+  #define B_VM_AMR_RECORD_ON_GOING (TRUE_L <<  2) // Indicate if the DSP recording speech amr task is running
+  #define B_VM_AMR_PLAY_ON_GOING   (TRUE_L <<  3) // Indicate if the DSP playing amr task is running
+  #define B_SR_ENROLL_TASK      (TRUE_L <<  4) // Indicate if the DSP enroll task is running
+  #define B_SR_UPDATE_TASK      (TRUE_L <<  5) // Indicate if the DSP update task is running
+  #define B_SR_RECO_TASK        (TRUE_L <<  6) // Indicate if the DSP reco task is running
+  #define B_SR_PROCESSING_TASK  (TRUE_L <<  7) // Indicate if the DSP processing task is running
+  #define B_SR_ALIGNMENT_TASK   (TRUE_L <<  8) // Indicate if the DSP alignment task is running
+  #define B_IT_COM_REQ          (TRUE_L <<  9) // Indicate that the DSP requests an IT com for the next TDMA
+
+  // bits in d_toneskb_init
+  #define B_VM_RECORD_START  (TRUE_L <<  2)   // Start the DSP voice memo recording task
+  #define B_VM_RECORD_STOP   (TRUE_L <<  3)   // Stop the DSP voice memo recording task
+  #define B_VM_PLAY_START    (TRUE_L <<  4)   // Start the DSP voice memo playing task
+  #define B_VM_PLAY_STOP     (TRUE_L <<  5)   // Stop the DSP voice memo playing task
+  #define B_VM_TONE_UL       (TRUE_L <<  6)   // Generate the tone on the UL path
+  #define B_VM_AMR_RECORD_START (TRUE_L <<  2)// Start the DSP voice memo amr recording task
+  #define B_VM_AMR_RECORD_STOP  (TRUE_L <<  3)// Stop the DSP voice memo amr recording task
+  #define B_VM_AMR_PLAY_START   (TRUE_L <<  4)// Start the DSP voice memo amr playing task
+  #define B_VM_AMR_PLAY_STOP    (TRUE_L <<  5)// Stop the DSP voice memo amr playing task
+  #define B_SR_ENROLL        (TRUE_L <<  7)   // Start the DSP speech reco enroll task
+  #define B_SR_UPDATE        (TRUE_L <<  8)   // Start the DSP speech reco update task
+  #define B_SR_RECO          (TRUE_L <<  9)   // Start the DSP speech reco task
+  #define B_SR_PROCESSING    (TRUE_L << 10)   // Start the DSP speech reco processing task
+  #define B_SR_STOP          (TRUE_L << 11)   // Stop the current DSP speech reco task
+
+  #define B_MELO             (TRUE_L << 13)   // Start the DSP melody module if it's not started
+  #if (L1_CPORT == 1)
+    //----------------------------------------
+    // C_PORT constant.
+    //----------------------------------------
+ 
+    #define CPORT_READ_FLAG_OFFSET   11         // offset in configuration field of the "read register" bit
+    #define CPORT_REG_NB_OFFSET      12         // offset in configuration field of the register number
+    #define CPORT_READ_MASK          0xF800     // mask to get the read flag and the read reg id in the d_cport_status field
+
+    // write register defines
+    #define CPORT_W_NONE      0      // do not write anything
+    #define CPORT_W_CTRL      1      // write CTRL, set bit 0 of configuration to 1
+    #define CPORT_W_CPCFR1    1 << 1 // write CPCFR1, set bit 1 of configuration to 1
+    #define CPORT_W_CPCFR2    1 << 2 // write CPCFR2, set bit 2 of configuration to 1
+    #define CPORT_W_CPCFR3    1 << 3 // write CPCFR3, set bit 3 of configuration to 1
+    #define CPORT_W_CPCFR4    1 << 4 // write CPCFR4, set bit 4 of configuration to 1
+    #define CPORT_W_CPTCTL    1 << 5 // write CPTCTL, set bit 5 of configuration to 1
+    #define CPORT_W_CPTTADDR  1 << 6 // write CPTTADDR, set bit 6 of configuration to 1
+    #define CPORT_W_CPTDAT    1 << 7 // write CPTDAT, set bit 7 of configuration to 1
+    #define CPORT_W_CPTVS     1 << 8 // write CPTVS, set bit 8 of configuration to 1
+
+    // read register defines
+    #define CPORT_R_NONE     0       // do not read anything
+    // for each of the following defines, set read flag (bit 11) to 1 and set reg_nb (bits 12..15)
+    #define CPORT_R_CTRL     (0 << CPORT_REG_NB_OFFSET) | (1 << CPORT_READ_FLAG_OFFSET) 
+    #define CPORT_R_CPCFR1   (1 << CPORT_REG_NB_OFFSET) | (1 << CPORT_READ_FLAG_OFFSET)
+    #define CPORT_R_CPCFR2   (2 << CPORT_REG_NB_OFFSET) | (1 << CPORT_READ_FLAG_OFFSET) 
+    #define CPORT_R_CPCFR3   (3 << CPORT_REG_NB_OFFSET) | (1 << CPORT_READ_FLAG_OFFSET) 
+    #define CPORT_R_CPCFR4   (4 << CPORT_REG_NB_OFFSET) | (1 << CPORT_READ_FLAG_OFFSET) 
+    #define CPORT_R_CPTCTL   (5 << CPORT_REG_NB_OFFSET) | (1 << CPORT_READ_FLAG_OFFSET) 
+    #define CPORT_R_CPTTADDR (6 << CPORT_REG_NB_OFFSET) | (1 << CPORT_READ_FLAG_OFFSET) 
+    #define CPORT_R_CPTDAT   (7 << CPORT_REG_NB_OFFSET) | (1 << CPORT_READ_FLAG_OFFSET) 
+    #define CPORT_R_CPTVS    (8 << CPORT_REG_NB_OFFSET) | (1 << CPORT_READ_FLAG_OFFSET) 
+    #define CPORT_R_STATUS   (9 << CPORT_REG_NB_OFFSET) | (1 << CPORT_READ_FLAG_OFFSET) 
+
+  #endif
+
+
+  #if (MELODY_E1)
+    //----------------------------------------
+    // Melody constant.
+    //----------------------------------------
+
+    // Word to indicate that the oscillator must be stopped ASAP
+    #define SC_END_OSCILLATOR_MASK        0xfffe
+
+    // Description of the ml_ocscil_x field (x= 0...SC_NUMBER_OSCILLATOR)
+    #define SC_MELO_OSCILLATOR_USED_MASK  0xff00
+    #define SC_MELO_OSCILLATOR_USED_SHIFT SC_NUMBER_OSCILLATOR
+
+    //  Description of the ml_time_offset field
+    #define SC_MELO_TIME_OFFSET_MASK      0x00ff
+    #define SC_MELO_TIME_OFFSET_SHIFT     0
+
+    // Description of the ml_load1 bit
+    #define SC_MELO_LOAD1_MASK            0x0010
+    #define SC_MELO_LOAD1_SHIFT           4
+
+    // Description of the ml_load2 bit
+    #define SC_MELO_LOAD2_MASK            0x0020
+    #define SC_MELO_LOAD2_SHIFT           5
+
+    // Description of the ml_synchro bit
+    #define SC_MELO_SYNCHRO_MASK          0x0001
+    #define SC_MELO_SYNCHRO_SHIFT         0
+
+    // Description of the ml_length field
+    #define SC_MELO_LENGTH_MASK           0xffc0
+    #define SC_MELO_LENGTH_SHIFT          6
+  #endif // MELODY_E1
+
+  #if (VOICE_MEMO) || (SPEECH_RECO)
+    //----------------------------------------
+    // Voice memo constant.
+    //----------------------------------------
+
+    // Communication DSP<->MCU via the a_du_x buffer:
+
+    // Mask for the bit to indicate:
+    // in VM play: if the DSP requests a new block
+    // in VM record: if the DSP has a new block
+    #define B_BLOCK_READY         (TRUE_L<<10)
+
+    // Mask for the bit of the a_du_x buffer to indicate if the block is the speech or noise
+    #define B_VM_SPEECH           (TRUE_L<<15)
+
+    // Size of the a_du_x buffer when the sample is a noise:
+    #define SC_VM_NOISE_SAMPLE    1
+
+    // Size of the a_du_x buffer when the sample is a speech:
+    #define SC_VM_SPEECH_SAMPLE   20
+  #endif // VOICE_MEMO || SPEECH_RECO
+
+  #if (L1_VOICE_MEMO_AMR)
+    //----------------------------------------
+    // Voice memo amr constant.
+    //----------------------------------------
+
+    #define SC_VM_AMR_HEADER_SIZE    1
+
+    // Communication DSP<->MCU via the a_du_x buffer:
+    #define SC_RX_TX_TYPE_MASK   (7<<3)
+
+    // Communication DSP<->MCU via d_amms_ul_voc and b_amms_channel_type
+    #define SC_CHAN_TYPE_MASK         7
+
+    // RX_TYPE or TX_TYPE (See 06.93)
+    #define SC_VM_AMR_RXTX_SPEECH_GOOD     (0<<3)
+    #define SC_VM_AMR_RXTX_SPEECH_DEGRADED (1<<3)
+    #define SC_VM_AMR_RXTX_ONSET           (2<<3)
+    #define SC_VM_AMR_RXTX_SPEECH_BAD      (3<<3)
+    #define SC_VM_AMR_RXTX_SID_FIRST       (4<<3)
+    #define SC_VM_AMR_RXTX_SID_UPDATE      (5<<3)
+    #define SC_VM_AMR_RXTX_SID_BAD         (6<<3)
+    #define SC_VM_AMR_RXTX_NO_DATA         (7<<3)
+
+    // sample type for ONSET insertion in NO_SPEECH to SPEECH transition
+    #define SC_VM_AMR_SPEECH          0
+    #define SC_VM_AMR_NOISE           1
+    #define SC_VM_AMR_NO_DATA         2
+    #define SC_VM_AMR_ONSET           3
+
+    // Speech channel type
+    #define SC_VM_AMR_SPEECH_475      0
+    #define SC_VM_AMR_SPEECH_515      1
+    #define SC_VM_AMR_SPEECH_59       2
+    #define SC_VM_AMR_SPEECH_67       3
+    #define SC_VM_AMR_SPEECH_74       4
+    #define SC_VM_AMR_SPEECH_795      5
+    #define SC_VM_AMR_SPEECH_102      6
+    #define SC_VM_AMR_SPEECH_122      7
+
+    // Size of data bits in the a_du_x buffer when the sample is SPEECH
+    // a_du_x buffer contains header + 2 non-used words after header + data_bits => recorded size is DATA_SIZE + 1
+    #define SC_VM_AMR_SPEECH_475_DATA_SIZE   12
+    #define SC_VM_AMR_SPEECH_515_DATA_SIZE   13
+    #define SC_VM_AMR_SPEECH_59_DATA_SIZE    15
+    #define SC_VM_AMR_SPEECH_67_DATA_SIZE    17
+    #define SC_VM_AMR_SPEECH_74_DATA_SIZE    19
+    #define SC_VM_AMR_SPEECH_795_DATA_SIZE   20
+    #define SC_VM_AMR_SPEECH_102_DATA_SIZE   26
+    #define SC_VM_AMR_SPEECH_122_DATA_SIZE   31
+
+    // Size of the a_du_x buffer when the sample is SID_FIRST:
+    #define SC_VM_AMR_SID_FIRST_DATA_SIZE    5
+
+    // Size of the a_du_x buffer when the sample is SID_UPDATE:
+    #define SC_VM_AMR_SID_UPDATE_DATA_SIZE   5
+
+    // Size of the a_du_x buffer when the sample is SID_BAD:
+    #define SC_VM_AMR_SID_BAD_DATA_SIZE      5
+
+    // Size of the a_du_x buffer when the sample is NO_DATA:
+    #define SC_VM_AMR_NO_DATA_DATA_SIZE      0
+
+    // Size of the a_du_x buffer when the sample is ONSET:
+    #define SC_VM_AMR_ONSET_DATA_SIZE        0
+
+  #endif // L1_VOICE_MEMO_AMR
+
+  #if (SPEECH_RECO)
+    //----------------------------------------
+    // Speech recognition constant.
+    //----------------------------------------
+
+    // d_sr_status bit field
+    #define B_BAD_ACQUISITION     (TRUE_L <<  8)
+    #define B_GOOD_ACQUISITION    (TRUE_L <<  9)
+    #define B_BAD_UPDATE          (TRUE_L << 10)
+    #define B_GOOD_UPDATE         (TRUE_L << 11)
+
+    // d_sr_status VAD indication
+    #define SC_SR_WORD_MASK       0x00FF
+    #define SC_SR_WORD_SEARCHING  0
+    #define SC_SR_WORD_BEGINNING  1
+    #define SC_SR_WORD_ON_GOING   2
+    #define SC_SR_WORD_ENDING     3
+    #define SC_SR_WORD_DONE       4
+
+  #endif // SPEECH_RECO
+
+  #if (AEC)
+    #define B_AEC_ACK        (TRUE_L <<  0)  // Bit set by the MCU to indicate a new AEC settings and
+                                             // clear by the DSP to confirm the new settings.
+    
+    #define B_AEC_EN         (TRUE_L <<  1)   // enables AEC module
+    #define B_SPENH_EN       (TRUE_L <<  2)   // enables SPENH module
+
+
+    #if (L1_NEW_AEC)
+      #define B_AEC_VISIBILITY (TRUE_L <<  9)  // Bit set by the MCU to have internal output values of AEC copied in API
+      #define SC_AEC_VISIBILITY_SHIFT (9)
+    #endif
+
+  #endif
+
+
+  #if (W_A_DSP_SR_BGD)
+    #define C_BGD_RECOGN  5 // TEMPORARY: DSP Background recognition task code (also used for bitmaps).
+    #define C_BGD_ALIGN   6 // TEMPORARY: DSP Background alignement
+    // bits in d_gsm_bgd_mgt - background task management
+    #define B_DSPBGD_RECO           1       // start of reco in dsp background
+    #define B_DSPBGD_UPD            2       // start of alignement update in dsp background
+  #endif
+  #if (AUDIO_MODE)
+    #define B_GSM_ONLY        ((TRUE_L <<  13) | (TRUE_L <<  11))   // GSM normal mode
+    #define B_BT_CORDLESS     (TRUE_L <<  12)   // Bluetooth cordless mode
+    #define B_BT_HEADSET      (TRUE_L <<  14)   // Bluetooth headset mode
+  #endif
+
+  #define SC_AUDIO_MCU_API_BEGIN_ADDRESS  (0xFFD00000)    // Start address of the API memory in MCU side
+  #define SC_AUDIO_DSP_API_BEGIN_ADDRESS  (0x0800)        // Start address o fthe API memory in DSP side
+
+  #if (MELODY_E2)
+    // Number of oscillator available in the melody E2
+    #define SC_MELODY_E2_NUMBER_OF_OSCILLATOR       (16)
+
+    // Code of extension for data=time
+    #define SC_TIME_CODE_OF_EXTENSION               (1)
+
+    // Position of the GlobalTimeFactor parameter
+    #define SC_MELODY_E2_GLOBALTIMEFACTOR_MASK      (0xFF)
+    #define SC_MELODY_E2_GLOBALTIMEFACTOR_SHIFT     (0)
+
+    // Position of the Number of instrument parameter
+    #define SC_MELODY_E2_NUMBEROFINSTRUMENT_MASK    (0xFF)
+    #define SC_MELODY_E2_NUMBEROFINSTRUMENT_SHIFT   (0)
+
+    // Position of the extension flag
+    #define SC_MELODY_E2_EXTENSION_FLAG_MASK        (0x80)
+    #define SC_MELODY_E2_EXTENSION_FLAG_SHIFT       (7)
+
+    // Position of the code of extension
+    #define SC_MELODY_E2_CODE_OF_EXTENSION_MASK     (0x70)
+    #define SC_MELODY_E2_CODE_OF_EXTENSION_SHIFT    (4)
+
+    // Position of data time
+    #define SC_MELODY_E2_DATA_TIME_MSB_MASK         (0x07)
+    #define SC_MELODY_E2_DATA_TIME_MSB_SHIFT        (0)
+
+    // Position of data time
+    #define SC_MELODY_E2_DATA_TIME_LSB_MASK         (0xFF00)
+    #define SC_MELODY_E2_DATA_TIME_LSB_SHIFT        (8)
+
+    // Position of the Delta Time
+    #define SC_MELODY_E2_DELTA_TIME_MASK            (0x7F)
+    #define SC_MELODY_E2_DELTA_TIME_SHIFT           (0)
+
+    // Mask of the semaphore
+    #define SC_MELODY_E2_SEMAPHORE_MASK             (0x0001)
+
+    // Maximum size of the header of the melody E2
+    #define SC_MELODY_E2_MAXIMUM_HEADER_SIZE        (3 + SC_AUDIO_MELODY_E2_MAX_NUMBER_OF_INSTRUMENT)
+
+    // Maximum number of extension
+    #define SC_MELODY_E2_MAXIMUM_NUMBER_OF_EXTENSION  (2)
+  #endif // MELODY_E2
+
+  // Selection of the melody format
+  #define NO_MELODY_SELECTED    (0)
+  #define MELODY_E0_SELECTED    (1)
+  #define MELODY_E1_SELECTED    (2)
+  #define MELODY_E2_SELECTED    (3)
+
+#endif // AUDIO_TASK
+
+#if (DSP == 17) || (DSP == 32)
+  #define B_FIR_START  (TRUE_L <<  0)  // Bit set by the MCU to start the FIR task for the DSP code 32 and 17.
+#endif
+
+#define B_FIR_LOOP  (TRUE_L <<  1)  // Bit set by the MCU to close the loop between the audio UL and DL path.
+                                    // This features is used to find the FIR coefficient.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/L1/audio_include/l1audio_defty.h	Thu Jul 10 15:02:48 2014 +0000
@@ -0,0 +1,548 @@
+/************* Revision Controle System Header *************
+ *                  GSM Layer 1 software
+ * L1AUDIO_DEFTY.H
+ *
+ *        Filename l1audio_defty.h
+ *  Copyright 2003 (C) Texas Instruments  
+ *
+ ************* Revision Controle System Header *************/
+
+#if (AUDIO_TASK == 1)
+
+  #if (KEYBEEP)
+    /***************************************************************************************/
+    /* Keybeep l1a_l1s_com structure...                                                    */
+    /***************************************************************************************/
+    typedef struct
+    {
+      BOOL  start;
+      BOOL  stop;
+    }
+    T_KEYBEEP_COMMAND;
+
+    typedef struct
+    {
+      T_KEYBEEP_COMMAND   command;
+    }
+    T_KEYBEEP_TASK;
+  #endif
+
+  #if (TONE)
+    /***************************************************************************************/
+    /* Tone l1a_l1s_com structure...                                                    */
+    /***************************************************************************************/
+    typedef struct
+    {
+      BOOL  start;
+      BOOL  stop;
+    }
+    T_TONE_COMMAND;
+
+    typedef struct
+    {
+      T_TONE_COMMAND   command;
+    }
+    T_TONE_TASK;
+  #endif
+
+  #if (MELODY_E1)
+    /***************************************************************************************/
+    /* Melody l1a_l1s_com structure...                                                    */
+    /***************************************************************************************/
+    typedef struct
+    {
+      BOOL  start;
+      BOOL  stop;
+    }
+    T_MELODY_COMMAND;
+
+    typedef struct
+    {
+      UWORD8  session_id;
+      UWORD8  error_id;
+      UWORD16 buffer_size;
+      UWORD16 *ptr_buf;
+      BOOL    loopback;
+      UWORD16 oscillator_used_bitmap;
+      UWORD16 oscillator_melody_bitmap;
+      UWORD8  melody_to_oscillator[SC_NUMBER_OSCILLATOR];
+    }
+    T_MELODY_PARAM;
+
+    typedef struct
+    {
+      T_MELODY_COMMAND    command;
+      T_MELODY_PARAM      parameters;
+    }
+    T_MELODY_TASK;
+
+    /***************************************************************************************/
+    /* Melody l1s structure...                                                             */
+    /***************************************************************************************/
+
+    typedef struct
+    {
+      UWORD8      error_id;
+      UWORD16     buffer_size;
+      UWORD16     *ptr_buf;
+      UWORD16     melody_header;
+      API         *(oscillator[SC_NUMBER_OSCILLATOR]);
+      UWORD16     counter;
+      UWORD16     oscillator_used_in_desc;
+      UWORD16     oscillator_started;
+    }
+    T_L1S_MELODY_TASK;
+  #endif
+
+  #if (VOICE_MEMO)
+    /***************************************************************************************/
+    /* Voice memo l1a_l1s_com structure...                                                 */
+    /***************************************************************************************/
+
+    typedef struct
+    {
+      BOOL  start;
+      BOOL  stop;
+    }
+    T_VM_PLAY_COMMAND;
+
+    typedef struct
+    {
+      UWORD8 session_id;
+    }
+    T_VM_PLAY_PARAM;
+
+    typedef struct
+    {
+      T_VM_PLAY_COMMAND   command;
+      T_VM_PLAY_PARAM     parameters;
+    }
+    T_VM_PLAY_TASK;
+
+    typedef struct
+    {
+      BOOL  start;
+      BOOL  stop;
+    }
+    T_VM_RECORD_COMMAND;
+
+    typedef struct
+    {
+      UWORD8    session_id;
+      UWORD32   maximum_size;
+      BOOL      dtx;
+    }
+    T_VM_RECORD_PARAM;
+
+    typedef struct
+    {
+      BOOL      start;
+    }
+    T_VM_RECORD_TONE_UL;
+
+      typedef struct
+    {
+        T_VM_RECORD_COMMAND   command;
+        T_VM_RECORD_PARAM     parameters;
+        T_VM_RECORD_TONE_UL   tone_ul;
+    }
+    T_VM_RECORD_TASK;
+
+    typedef struct
+    {
+      T_VM_PLAY_TASK    play;
+      T_VM_RECORD_TASK  record;
+    }
+    T_VM_TASK;
+
+    /***************************************************************************************/
+    /* Voice memo l1s structure...                                                         */
+    /***************************************************************************************/
+
+    typedef struct
+    {
+      API     *a_du_x;
+      UWORD8  error_id;
+      UWORD16 buffer_size;
+      UWORD16 *ptr_buf;
+      UWORD32 recorded_size;
+    }
+    T_L1S_VM_RECORD_TASK;
+
+    typedef struct
+    {
+      API     *a_du_x;
+      UWORD8  error_id;
+      UWORD16 buffer_size;
+      UWORD16 *ptr_buf;
+    }
+    T_L1S_VM_PLAY_TASK;
+
+    typedef struct
+    {
+      T_L1S_VM_PLAY_TASK    play;
+      T_L1S_VM_RECORD_TASK  record;
+    }
+    T_L1S_VM_TASK;
+
+  #endif
+  #if (L1_VOICE_MEMO_AMR)
+    /***************************************************************************************/
+    /* Voice memo amr l1a_l1s_com structure...                                                 */
+    /***************************************************************************************/
+
+    typedef struct
+    {
+      BOOL  start;
+      BOOL  stop;
+    }
+    T_VM_AMR_PLAY_COMMAND;
+
+    typedef struct
+    {
+      UWORD8 session_id;
+    }
+    T_VM_AMR_PLAY_PARAM;
+
+    typedef struct
+    {
+      T_VM_AMR_PLAY_COMMAND   command;
+      T_VM_AMR_PLAY_PARAM     parameters;
+    }
+    T_VM_AMR_PLAY_TASK;
+
+    typedef struct
+    {
+      BOOL  start;
+      BOOL  stop;
+    }
+    T_VM_AMR_RECORD_COMMAND;
+
+    typedef struct
+    {
+      UWORD8    session_id;
+      UWORD32   maximum_size;
+      UWORD8    amr_vocoder;
+      BOOL      dtx;
+    }
+    T_VM_AMR_RECORD_PARAM;
+
+    typedef struct
+    {
+        T_VM_AMR_RECORD_COMMAND   command;
+        T_VM_AMR_RECORD_PARAM     parameters;
+    }
+    T_VM_AMR_RECORD_TASK;
+
+    typedef struct
+    {
+      T_VM_AMR_PLAY_TASK    play;
+      T_VM_AMR_RECORD_TASK  record;
+    }
+    T_VM_AMR_TASK;
+
+    /***************************************************************************************/
+    /* Voice memo l1s structure...                                                         */
+    /***************************************************************************************/
+
+    typedef struct
+    {
+      API     *a_du_x;
+      UWORD8  error_id;
+      UWORD16 buffer_size;
+      UWORD8  *ptr_buf;
+      UWORD32 recorded_size;
+    }
+    T_L1S_VM_AMR_RECORD_TASK;
+
+    typedef struct
+    {
+      API     *a_du_x;
+      UWORD8  error_id;
+      UWORD16 buffer_size;
+      UWORD8  *ptr_buf;
+      UWORD8  previous_type;
+      UWORD8  transition_header;
+    }
+    T_L1S_VM_AMR_PLAY_TASK;
+
+    typedef struct
+    {
+      T_L1S_VM_AMR_PLAY_TASK    play;
+      T_L1S_VM_AMR_RECORD_TASK  record;
+    }
+    T_L1S_VM_AMR_TASK;
+
+  #endif // L1_VOICE_MEMO_AMR
+  #if (SPEECH_RECO)
+    /***************************************************************************************/
+    /* Speech recogniton l1a_l1s_com structure...                                          */
+    /***************************************************************************************/
+
+    typedef struct
+    {
+      BOOL enroll_start;
+      BOOL enroll_stop;
+      BOOL update_start;
+      BOOL update_stop;
+      BOOL reco_start;
+      BOOL reco_stop;
+      BOOL processing_start;
+      BOOL processing_stop;
+      BOOL speech_start;
+      BOOL speech_stop;
+    }
+    T_SR_COMMAND;
+
+    typedef struct
+    {
+      UWORD8  database_id;
+      UWORD8  word_index;
+      API     *model_address;
+      UWORD16 *model_temp_address;
+      BOOL    speech;
+      UWORD16 *speech_address;
+      UWORD16 *start_address;
+      UWORD16 *stop_address;
+      BOOL    CTO_algorithm;
+      UWORD8  index_counter;
+      UWORD8  vocabulary_size;
+      UWORD8  word_to_check;
+      UWORD16 best_word_index;
+      UWORD32 best_word_score;
+      UWORD16 second_best_word_index;
+      UWORD32 second_best_word_score;
+      UWORD16 third_best_word_index;
+      UWORD32 third_best_word_score;
+      UWORD16 fourth_best_word_index;
+      UWORD32 fourth_best_word_score;
+      UWORD16 d_sr_db_level;
+      UWORD16 d_sr_db_noise;
+      UWORD16 d_sr_model_size;
+    }
+    T_SR_PARAM;
+
+    typedef struct
+    {
+      T_SR_COMMAND  command;
+      T_SR_PARAM    parameters;
+    }
+    T_SR_TASK;
+
+    typedef struct
+    {
+      UWORD16   time_out;
+      UWORD8    error;
+      UWORD16   *speech_pointer;
+      UWORD16   *end_pointer;
+      API       *a_du_x;
+      UWORD16   speech_old_status;
+      BOOL      first_pass;
+    }
+    T_L1S_SR_TASK;
+
+    typedef struct
+    {
+      BOOL emergency_stop;
+    }
+    T_L1_SRBACK_COM;
+
+  #endif
+
+  #if (AEC)
+    typedef struct
+    {
+      UWORD16 aec_control;
+    #if (L1_NEW_AEC)
+      UWORD16 cont_filter;
+      UWORD16 granularity_att;
+      UWORD16 coef_smooth;
+      UWORD16 es_level_max;
+      UWORD16 fact_vad;
+      UWORD16 thrs_abs;
+      UWORD16 fact_asd_fil;
+      UWORD16 fact_asd_mut;
+    #endif
+    }
+    T_AEC_PARAM;
+
+    typedef struct
+    {
+      BOOL start;
+    }
+    T_AEC_COMMAND;
+
+    typedef struct
+    {
+      T_AEC_COMMAND  command;
+      T_AEC_PARAM    parameters;
+    }
+    T_AEC_TASK;
+
+    typedef struct
+    {
+      UWORD16 aec_control;
+    #if (L1_NEW_AEC)
+      BOOL    aec_visibility;
+      UWORD16 cont_filter;
+      UWORD16 granularity_att;
+      UWORD16 coef_smooth;
+      UWORD16 es_level_max;
+      UWORD16 fact_vad;
+      UWORD16 thrs_abs;
+      UWORD16 fact_asd_fil;
+      UWORD16 fact_asd_mut;
+      WORD8   visibility_interval;
+    #endif
+    } T_L1S_AEC_TASK;
+  #endif
+
+  #if (FIR)
+    typedef struct
+    {
+      BOOL    fir_loop;
+      UWORD8  update_fir;
+      UWORD16 *fir_ul_coefficient;
+      UWORD16 *fir_dl_coefficient;
+    }
+    T_FIR_PARAM;
+
+    typedef struct
+    {
+      BOOL start;
+    }
+    T_FIR_COMMAND;
+
+    typedef struct
+    {
+      T_FIR_COMMAND  command;
+      T_FIR_PARAM    parameters;
+    }
+    T_FIR_TASK;
+  #endif
+
+  #if (AUDIO_MODE)
+    typedef struct
+    {
+      UWORD16  audio_mode;
+    }
+    T_AUDIO_MODE_PARAM;
+
+    typedef struct
+    {
+      BOOL start;
+    }
+    T_AUDIO_MODE_COMMAND;
+
+    typedef struct
+    {
+      T_AUDIO_MODE_COMMAND command;
+      T_AUDIO_MODE_PARAM   parameters;
+    }
+    T_AUDIO_MODE_TASK;
+  #endif
+  #if (MELODY_E2)
+    /***************************************************************************************/
+    /* Melody format E2 l1a_l1s_com structure...                                           */
+    /***************************************************************************************/
+    typedef struct
+    {
+      BOOL  start;
+      BOOL  stop;
+    }
+    T_MELODY_E2_COMMAND;
+
+    typedef struct
+    {
+      UWORD8  session_id;
+      UWORD8  error_id;
+      UWORD16 buffer_size;
+      UWORD8  *ptr_buf;
+      BOOL    loopback;
+      UWORD8  header_size;
+      BOOL    emergency_stop;
+      UWORD8  number_of_instrument;
+      UWORD8  waves_table_id[SC_AUDIO_MELODY_E2_MAX_NUMBER_OF_INSTRUMENT];
+    }
+    T_MELODY_E2_PARAM;
+
+    typedef struct
+    {
+      T_MELODY_E2_COMMAND    command;
+      T_MELODY_E2_PARAM      parameters;
+    }
+    T_MELODY_E2_TASK;
+
+    /***************************************************************************************/
+    /* Melody format E2 l1s structure...                                                   */
+    /***************************************************************************************/
+    typedef struct
+    {
+      UWORD8      error_id;
+      UWORD16     buffer_size;
+      UWORD8      *ptr_buf;
+      UWORD32     counter;
+      UWORD32     note_start_20ms;
+      UWORD16     oscillator_start;
+      UWORD16     oscillator_active;
+      UWORD16     delta_time;
+      BOOL        extension_flag;
+      BOOL        end_of_file;
+    }
+    T_L1S_MELODY_E2_TASK;
+
+    typedef struct
+    {
+      UWORD32     timebase;
+      UWORD16     global_osc_active;
+      UWORD16     global_osc_to_start;
+      UWORD8      timebase_mod_60ms;
+      BOOL        dsp_task;
+    }
+    T_L1S_MELODY_E2_COMMON_VAR;
+
+    /***************************************************************************************/
+    /* Melody format E2 audio background structure...                                      */
+    /***************************************************************************************/
+    typedef struct
+    {
+      API     *API_address;
+      UWORD16 allowed_size;
+      UWORD8  number_of_user[SC_AUDIO_MELODY_E2_MAX_NUMBER_OF_INSTRUMENT];
+      UWORD8  instrument_id[SC_AUDIO_MELODY_E2_MAX_NUMBER_OF_INSTRUMENT];
+      UWORD16 instrument_size[SC_AUDIO_MELODY_E2_MAX_NUMBER_OF_INSTRUMENT];
+    } T_AUDIO_BACK_MELODY_E2;
+  #endif // MELODY_E2
+  #if (L1_CPORT == 1)
+    /***************************************************************************************/
+    /* Cport l1a_l1s_com structure...                                                      */
+    /***************************************************************************************/
+    typedef struct
+    {
+      BOOL  start;
+    }
+    T_CPORT_COMMAND;
+
+    typedef struct
+    {
+     UWORD16 configuration;
+     UWORD16 ctrl;
+     UWORD8  cpcfr1;
+     UWORD8  cpcfr2;
+     UWORD8  cpcfr3;
+     UWORD8  cpcfr4;
+     UWORD8  cptctl;
+     UWORD8  cpttaddr;
+     UWORD16 cptdat;
+     UWORD16 cptvs; 
+    }
+    T_CPORT_PARAM;
+
+    typedef struct
+    {
+      T_CPORT_COMMAND   command;
+      T_CPORT_PARAM     parameters;
+    }
+    T_CPORT_TASK;
+  #endif
+#endif // AUDIO_TASK
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/L1/audio_include/l1audio_macro.h	Thu Jul 10 15:02:48 2014 +0000
@@ -0,0 +1,19 @@
+/************* Revision Controle System Header *************
+ *                  GSM Layer 1 software 
+ * L1AUDIO_CONST.H
+ *
+ *        Filename l1audio_macro.h
+ *  Copyright 2003 (C) Texas Instruments  
+ *
+ ************* Revision Controle System Header *************/
+
+#if (AUDIO_TASK == 1)
+
+  /************************************************************/
+  /* Macros to obtain a value put among a register            */
+  /************************************************************/
+  #define Field(value, mask, shift) (((value) & (mask)) >> shift)
+
+
+
+#endif // AUDIO_TASK
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/L1/audio_include/l1audio_msgty.h	Thu Jul 10 15:02:48 2014 +0000
@@ -0,0 +1,492 @@
+/************* Revision Controle System Header *************
+ *                  GSM Layer 1 software
+ * L1AUDIO_MSGTY.H
+ *
+ *        Filename l1audio_msgty.h
+ *  Copyright 2003 (C) Texas Instruments  
+ *
+ ************* Revision Controle System Header *************/
+
+#if (AUDIO_TASK == 1)
+
+  #if (OP_RIV_AUDIO == 1)
+    #include "rv_general.h"
+  #endif
+
+  #if (KEYBEEP)
+    typedef struct
+   {
+      #if (defined _WINDOWS && (OP_RIV_AUDIO == 1))
+        T_RV_HDR  header;
+      #endif
+      UWORD16 d_k_x1_kt0;
+      UWORD16 d_k_x1_kt1;
+      UWORD16 d_dur_kb;
+    }
+    T_MMI_KEYBEEP_REQ;
+  #endif
+
+  #if (TONE)
+    typedef struct
+    {
+      #if (defined _WINDOWS && (OP_RIV_AUDIO == 1))
+        T_RV_HDR  header;
+      #endif
+      UWORD16 d_k_x1_t0;
+      UWORD16 d_k_x1_t1;
+      UWORD16 d_k_x1_t2;
+      UWORD16 d_pe_rep;
+      UWORD16 d_pe_off;
+      UWORD16 d_se_off;
+      UWORD16 d_bu_off;
+      UWORD16 d_t0_on;
+      UWORD16 d_t0_off;
+      UWORD16 d_t1_on;
+      UWORD16 d_t1_off;
+      UWORD16 d_t2_on;
+      UWORD16 d_t2_off;
+    }
+    T_MMI_TONE_REQ;
+  #endif
+
+  #if (MELODY_E1)
+    typedef struct
+    {
+      #if (defined _WINDOWS && (OP_RIV_AUDIO == 1))
+        T_RV_HDR  header;
+      #endif
+      UWORD8 session_id;
+      BOOL    loopback;
+      UWORD16 oscillator_used_bitmap;
+    }
+    T_MMI_MELODY_REQ;
+  #endif
+  #if (VOICE_MEMO)
+    typedef struct
+    {
+      #if (defined _WINDOWS && (OP_RIV_AUDIO == 1))
+        T_RV_HDR  header;
+      #endif
+      UWORD8  session_id;
+    }
+    T_MMI_VM_PLAY_REQ;
+
+    typedef struct
+    {
+      #if (defined _WINDOWS && (OP_RIV_AUDIO == 1))
+        T_RV_HDR  header;
+      #endif
+      UWORD8  session_id;
+      UWORD32 maximum_size;
+      BOOL    dtx_used;
+      UWORD16 record_coeff_dl;
+      UWORD16 record_coeff_ul;
+      UWORD16 d_k_x1_t0;
+      UWORD16 d_k_x1_t1;
+      UWORD16 d_k_x1_t2;
+      UWORD16 d_pe_rep;
+      UWORD16 d_pe_off;
+      UWORD16 d_se_off;
+      UWORD16 d_bu_off;
+      UWORD16 d_t0_on;
+      UWORD16 d_t0_off;
+      UWORD16 d_t1_on;
+      UWORD16 d_t1_off;
+      UWORD16 d_t2_on;
+      UWORD16 d_t2_off;
+    }
+    T_MMI_VM_RECORD_REQ;
+
+    typedef struct
+    {
+      UWORD32 recorded_size;
+    }
+    T_L1_VM_RECORD_CON;
+
+    #if (OP_RIV_AUDIO == 1)
+      typedef struct
+      {
+        T_RV_HDR  header;
+        UWORD32 recorded_size;
+      }
+      T_MMI_VM_RECORD_CON;
+    #else
+      typedef T_L1_VM_RECORD_CON T_MMI_VM_RECORD_CON;
+    #endif
+  #endif
+
+  #if (L1_VOICE_MEMO_AMR)
+    typedef struct
+    {
+      #if (defined _WINDOWS && (OP_RIV_AUDIO == 1))
+        T_RV_HDR  header;
+      #endif
+      UWORD8  session_id;
+    }
+    T_MMI_VM_AMR_PLAY_REQ;
+
+    typedef struct
+    {
+      #if (defined _WINDOWS && (OP_RIV_AUDIO == 1))
+        T_RV_HDR  header;
+      #endif
+      UWORD8  session_id;
+      UWORD32 maximum_size;
+      BOOL    dtx_used;
+      UWORD16 record_coeff_ul;
+      UWORD8  amr_vocoder;
+    }
+    T_MMI_VM_AMR_RECORD_REQ;
+
+    typedef struct
+    {
+      UWORD32 recorded_size;
+    }
+    T_L1_VM_AMR_RECORD_CON;
+
+    #if (OP_RIV_AUDIO == 1)
+      typedef struct
+      {
+        T_RV_HDR  header;
+        UWORD32 recorded_size;
+      }
+      T_MMI_VM_AMR_RECORD_CON;
+    #else
+      typedef T_L1_VM_AMR_RECORD_CON T_MMI_VM_AMR_RECORD_CON;
+    #endif
+  #endif
+
+  #if (OP_RIV_AUDIO == 1)
+    #if (L1_AUDIO_DRIVER == 1)
+      typedef struct
+      {
+        UWORD8 channel_id;
+        UWORD16 *p_buffer;
+      }
+      T_L1_AUDIO_DRIVER_IND;
+    #endif
+  #endif
+
+  #if (SPEECH_RECO)
+    typedef struct
+    {
+      #if (defined _WINDOWS && (OP_RIV_AUDIO == 1))
+        T_RV_HDR  header;
+      #endif
+      UWORD8  database_id;
+      UWORD8  word_index;
+      BOOL    speech;
+      UWORD16 *speech_address;
+    }
+    T_MMI_SR_ENROLL_REQ;
+
+    typedef struct
+    {
+    #if (OP_RIV_AUDIO == 1)
+      T_RV_HDR  header;
+    #endif
+      UWORD8 error_id;
+    }
+    T_MMI_SR_ENROLL_STOP_CON;
+
+    #if (OP_RIV_AUDIO == 1)
+      typedef struct
+      {
+        UWORD8 error_id;
+      }
+      T_L1_SR_ENROLL_STOP_CON;
+    #else
+      typedef T_MMI_SR_ENROLL_STOP_CON T_L1_SR_ENROLL_STOP_CON;
+    #endif
+
+    typedef struct
+    {
+      #if (defined _WINDOWS && (OP_RIV_AUDIO == 1))
+        T_RV_HDR  header;
+      #endif
+      UWORD8  database_id;
+      UWORD8  word_index;
+      BOOL    speech;
+      UWORD16 *speech_address;
+    }
+    T_MMI_SR_UPDATE_REQ;
+
+    typedef struct
+    {
+    #if (OP_RIV_AUDIO == 1)
+      T_RV_HDR  header;
+    #endif
+      UWORD8 error_id;
+    }
+    T_MMI_SR_UPDATE_STOP_CON;
+
+    #if (OP_RIV_AUDIO == 1)
+      typedef struct
+      {
+        UWORD8 error_id;
+      }
+      T_L1_SR_UPDATE_STOP_CON;
+    #else
+      typedef T_MMI_SR_UPDATE_STOP_CON T_L1_SR_UPDATE_STOP_CON;
+    #endif
+
+    typedef struct
+    {
+      #if (defined _WINDOWS && (OP_RIV_AUDIO == 1))
+        T_RV_HDR  header;
+      #endif
+      UWORD8  database_id;
+      UWORD8  vocabulary_size;
+    }
+    T_MMI_SR_RECO_REQ;
+
+    typedef struct
+    {
+    #if (OP_RIV_AUDIO == 1)
+      T_RV_HDR  header;
+    #endif
+      UWORD8  error_id;
+      UWORD16 best_word_index;
+      UWORD32 best_word_score;
+      UWORD16 second_best_word_index;
+      UWORD32 second_best_word_score;
+      UWORD16 third_best_word_index;
+      UWORD32 third_best_word_score;
+      UWORD16 fourth_best_word_index;
+      UWORD32 fourth_best_word_score;
+      UWORD16 d_sr_db_level;
+      UWORD16 d_sr_db_noise;
+      UWORD16 d_sr_model_size;
+    }
+    T_MMI_SR_RECO_STOP_CON;
+
+    typedef struct
+    {
+      UWORD8 error_id;
+    }
+    T_L1_SR_RECO_STOP_CON;
+
+    #if (OP_RIV_AUDIO == 1)
+      typedef struct
+      {
+        UWORD8  error_id;
+        UWORD16 best_word_index;
+        UWORD32 best_word_score;
+        UWORD16 second_best_word_index;
+        UWORD32 second_best_word_score;
+        UWORD16 third_best_word_index;
+        UWORD32 third_best_word_score;
+        UWORD16 fourth_best_word_index;
+        UWORD32 fourth_best_word_score;
+        UWORD16 d_sr_db_level;
+        UWORD16 d_sr_db_noise;
+        UWORD16 d_sr_model_size;
+      }
+      T_L1_SR_RECO_STOP_IND;
+    #else
+      typedef T_MMI_SR_RECO_STOP_CON T_L1_SR_RECO_STOP_IND;
+    #endif
+
+    typedef T_L1_SR_RECO_STOP_CON T_L1_SR_PROCESSING_STOP_CON;
+
+    typedef struct
+    {
+      #if (defined _WINDOWS && (OP_RIV_AUDIO == 1))
+        T_RV_HDR  header;
+      #endif
+      UWORD8  database_id;
+      UWORD8  word_index;
+      UWORD16 *model_address;
+      BOOL    speech;
+      UWORD16 *speech_address;
+      UWORD8  vocabulary_size;
+    }
+    T_MMI_SR_UPDATE_CHECK_REQ;
+
+    typedef T_MMI_SR_RECO_STOP_CON T_MMI_SR_UPDATE_CHECK_STOP_CON;
+
+    // Background message type
+    typedef struct
+    {
+    #if (OP_RIV_AUDIO == 1)
+      T_RV_HDR  header;
+    #endif
+      UWORD8  database_id;
+      UWORD8  model_index;
+      API     *model_RAM_address;
+      BOOL    speech;
+      UWORD16 *start_buffer;
+      UWORD16 *stop_buffer;
+      UWORD16 *start_address;
+      UWORD16 *stop_address;
+    }
+    T_L1_SRBACK_SAVE_DATA_REQ;
+
+    typedef struct
+    {
+    #if (OP_RIV_AUDIO == 1)
+      T_RV_HDR  header;
+    #endif
+      UWORD8  database_id;
+      UWORD8  model_index;
+      API     *model_RAM_address;
+      BOOL    CTO_enable;
+    }
+    T_L1_SRBACK_LOAD_MODEL_REQ;
+
+    typedef struct
+    {
+    #if (OP_RIV_AUDIO == 1)
+      T_RV_HDR  header;
+    #endif
+      API     *model_RAM_address_input;
+      UWORD16 *model_RAM_address_output;
+    }
+    T_L1_SRBACK_TEMP_SAVE_DATA_REQ;
+  #endif
+
+  #if (AEC)
+    typedef struct
+    {
+      #if (defined _WINDOWS && (OP_RIV_AUDIO == 1))
+        T_RV_HDR  header;
+      #endif
+      UWORD16 aec_control;
+    #if (L1_NEW_AEC)
+      UWORD16 cont_filter;
+      UWORD16 granularity_att;
+      UWORD16 coef_smooth;
+      UWORD16 es_level_max;
+      UWORD16 fact_vad;
+      UWORD16 thrs_abs;
+      UWORD16 fact_asd_fil;
+      UWORD16 fact_asd_mut;
+    #endif
+    }
+    T_MMI_AEC_REQ;
+
+    #if (L1_NEW_AEC)
+      typedef struct
+      {
+        UWORD16 es_level;
+        UWORD32 far_end_pow;
+        UWORD32 far_end_noise;
+      }
+      T_L1_AEC_IND;
+    #endif
+  #endif
+
+  #if (FIR)
+    typedef struct
+    {
+      #if (defined _WINDOWS && (OP_RIV_AUDIO == 1))
+        T_RV_HDR  header;
+      #endif
+      BOOL      fir_loop;
+      UWORD8    update_fir;
+      UWORD16   *fir_ul_coefficient;
+      UWORD16   *fir_dl_coefficient;
+    }
+    T_MMI_AUDIO_FIR_REQ;
+  #endif
+  #if (AUDIO_MODE)
+    typedef struct
+    {
+      #if (defined _WINDOWS && (OP_RIV_AUDIO == 1))
+        T_RV_HDR  header;
+      #endif
+      #if (OP_RIV_AUDIO == 1)
+        UWORD8  audio_mode;
+      #else
+        UWORD16  audio_mode;
+      #endif
+    }
+    T_MMI_AUDIO_MODE;
+  #endif
+  #if (MELODY_E2)
+    typedef struct
+    {
+    #if (OP_RIV_AUDIO == 1)
+      T_RV_HDR  header;
+    #endif
+      UWORD8   melody_id;
+      UWORD8   number_of_instrument;
+      UWORD8   waves_table_id[SC_AUDIO_MELODY_E2_MAX_NUMBER_OF_INSTRUMENT];
+    }
+    T_L1_BACK_MELODY_E2_LOAD_INSTRUMENT_REQ;
+
+    typedef struct
+    {
+    #if (OP_RIV_AUDIO == 1)
+      T_RV_HDR  header;
+    #endif
+      UWORD8   melody_id;
+    }
+    T_L1_BACK_MELODY_E2_LOAD_INSTRUMENT_CON;
+
+    typedef struct
+    {
+    #if (OP_RIV_AUDIO == 1)
+      T_RV_HDR  header;
+    #endif
+      UWORD8    melody_id;
+      UWORD8    number_of_instrument;
+    }
+    T_L1_BACK_MELODY_E2_UNLOAD_INSTRUMENT_REQ;
+
+    typedef struct
+    {
+    #if (OP_RIV_AUDIO == 1)
+      T_RV_HDR  header;
+    #endif
+      UWORD8    melody_id;
+    }
+    T_L1_BACK_MELODY_E2_UNLOAD_INSTRUMENT_CON;
+
+    typedef struct
+    {
+      #if (defined _WINDOWS && (OP_RIV_AUDIO == 1))
+        T_RV_HDR  header;
+      #endif
+      UWORD8 session_id;
+      BOOL    loopback;
+    }
+    T_MMI_MELODY_E2_REQ;
+  #endif
+
+  #if (L1_CPORT == 1)
+    typedef struct
+    {
+     UWORD16 configuration;
+     UWORD16 ctrl;
+     UWORD8  cpcfr1;
+     UWORD8  cpcfr2;
+     UWORD8  cpcfr3;
+     UWORD8  cpcfr4;
+     UWORD8  cptctl;
+     UWORD8  cpttaddr;
+     UWORD16 cptdat;
+     UWORD16 cptvs; 
+    }
+    T_MMI_CPORT_CONFIGURE_REQ;
+
+    typedef struct
+    {
+     UWORD16  register_id;
+     UWORD16 register_value;
+    }
+    T_L1_CPORT_CONFIGURE_CON;
+
+    #if (OP_RIV_AUDIO == 1)
+      typedef struct
+      {
+        T_RV_HDR  header;
+        UWORD8  register_id;
+        UWORD16 register_value;
+      }
+      T_MMI_CPORT_CONFIGURE_CON;
+    #else
+      typedef T_L1_CPORT_CONFIGURE_CON T_MMI_CPORT_CONFIGURE_CON;
+    #endif
+  #endif
+#endif // AUDIO_TASK
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/L1/audio_include/l1audio_signa.h	Thu Jul 10 15:02:48 2014 +0000
@@ -0,0 +1,189 @@
+/************* Revision Controle System Header *************
+ *                  GSM Layer 1 software
+ * L1AUDIO_SIGNA.H
+ *
+ *        Filename l1audio_signa.h
+ *  Copyright 2003 (C) Texas Instruments  
+ *
+ ************* Revision Controle System Header *************/
+
+#if (AUDIO_TASK == 1)
+  #define P_AUDIO ( 0x18 )
+
+  // Messages MMI <-> L1A
+  #if (KEYBEEP)
+    #define MMI_KEYBEEP_START_REQ             ( ( P_AUDIO << 8 ) |   0 )
+    #define MMI_KEYBEEP_STOP_REQ              ( ( P_AUDIO << 8 ) |   1 )
+    #define MMI_KEYBEEP_START_CON             ( ( P_AUDIO << 8 ) |   2 )
+    #define MMI_KEYBEEP_STOP_CON              ( ( P_AUDIO << 8 ) |   3 )
+  #endif
+  #if (TONE)
+    #define MMI_TONE_START_REQ                ( ( P_AUDIO << 8 ) |   4 )
+    #define MMI_TONE_STOP_REQ                 ( ( P_AUDIO << 8 ) |   5 )
+    #define MMI_TONE_START_CON                ( ( P_AUDIO << 8 ) |   6 )
+    #define MMI_TONE_STOP_CON                 ( ( P_AUDIO << 8 ) |   7 )
+  #endif
+  #if (MELODY_E1)
+    #define MMI_MELODY0_START_REQ             ( ( P_AUDIO << 8 ) |   8 )
+    #define MMI_MELODY0_STOP_REQ              ( ( P_AUDIO << 8 ) |   9 )
+    #define MMI_MELODY0_START_CON             ( ( P_AUDIO << 8 ) |  10 )
+    #define MMI_MELODY0_STOP_CON              ( ( P_AUDIO << 8 ) |  11 )
+
+    #define MMI_MELODY1_START_REQ             ( ( P_AUDIO << 8 ) |  12 )
+    #define MMI_MELODY1_STOP_REQ              ( ( P_AUDIO << 8 ) |  13 )
+    #define MMI_MELODY1_START_CON             ( ( P_AUDIO << 8 ) |  14 )
+    #define MMI_MELODY1_STOP_CON              ( ( P_AUDIO << 8 ) |  15 )
+  #endif
+  #if (VOICE_MEMO)
+    #define MMI_VM_PLAY_START_REQ             ( ( P_AUDIO << 8 ) |  16 )
+    #define MMI_VM_PLAY_STOP_REQ              ( ( P_AUDIO << 8 ) |  17 )
+    #define MMI_VM_PLAY_START_CON             ( ( P_AUDIO << 8 ) |  18 )
+    #define MMI_VM_PLAY_STOP_CON              ( ( P_AUDIO << 8 ) |  19 )
+
+    #define MMI_VM_RECORD_START_REQ           ( ( P_AUDIO << 8 ) |  20 )
+    #define MMI_VM_RECORD_STOP_REQ            ( ( P_AUDIO << 8 ) |  21 )
+    #define MMI_VM_RECORD_START_CON           ( ( P_AUDIO << 8 ) |  22 )
+    #define MMI_VM_RECORD_STOP_CON            ( ( P_AUDIO << 8 ) |  23 )
+  #endif
+  #if (SPEECH_RECO)
+    #define MMI_SR_ENROLL_START_REQ           ( ( P_AUDIO << 8 ) |  24 )
+    #define MMI_SR_ENROLL_STOP_REQ            ( ( P_AUDIO << 8 ) |  25 )
+    #define MMI_SR_ENROLL_START_CON           ( ( P_AUDIO << 8 ) |  26 )
+    #define MMI_SR_ENROLL_STOP_CON            ( ( P_AUDIO << 8 ) |  27 )
+
+    #define MMI_SR_UPDATE_START_REQ           ( ( P_AUDIO << 8 ) |  28 )
+    #define MMI_SR_UPDATE_STOP_REQ            ( ( P_AUDIO << 8 ) |  29 )
+    #define MMI_SR_UPDATE_START_CON           ( ( P_AUDIO << 8 ) |  30 )
+    #define MMI_SR_UPDATE_STOP_CON            ( ( P_AUDIO << 8 ) |  31 )
+
+    #define MMI_SR_RECO_START_REQ             ( ( P_AUDIO << 8 ) |  32 )
+    #define MMI_SR_RECO_STOP_REQ              ( ( P_AUDIO << 8 ) |  33 )
+    #define MMI_SR_RECO_START_CON             ( ( P_AUDIO << 8 ) |  34 )
+    #define MMI_SR_RECO_STOP_CON              ( ( P_AUDIO << 8 ) |  35 )
+
+    #define MMI_SR_UPDATE_CHECK_START_REQ     ( ( P_AUDIO << 8 ) |  36 )
+    #define MMI_SR_UPDATE_CHECK_STOP_REQ      ( ( P_AUDIO << 8 ) |  37 )
+    #define MMI_SR_UPDATE_CHECK_START_CON     ( ( P_AUDIO << 8 ) |  38 )
+    #define MMI_SR_UPDATE_CHECK_STOP_CON      ( ( P_AUDIO << 8 ) |  39 )
+  #endif
+  #if (AEC)
+    #define MMI_AEC_REQ                       ( ( P_AUDIO << 8 ) |  40 )
+    #define MMI_AEC_CON                       ( ( P_AUDIO << 8 ) |  41 )
+  #endif
+  #if (FIR)
+    #define MMI_AUDIO_FIR_REQ                 ( ( P_AUDIO << 8 ) |  42 )
+    #define MMI_AUDIO_FIR_CON                 ( ( P_AUDIO << 8 ) |  43 )
+  #endif
+  #if (AUDIO_MODE)
+    #define MMI_AUDIO_MODE_REQ                ( ( P_AUDIO << 8 ) |  44 )
+    #define MMI_AUDIO_MODE_CON                ( ( P_AUDIO << 8 ) |  45 )
+  #endif
+  #if (MELODY_E2)
+    #define MMI_MELODY0_E2_START_REQ          ( ( P_AUDIO << 8 ) |  46 )
+    #define MMI_MELODY0_E2_STOP_REQ           ( ( P_AUDIO << 8 ) |  47 )
+    #define MMI_MELODY0_E2_START_CON          ( ( P_AUDIO << 8 ) |  48 )
+    #define MMI_MELODY0_E2_STOP_CON           ( ( P_AUDIO << 8 ) |  49 )
+
+    #define MMI_MELODY1_E2_START_REQ          ( ( P_AUDIO << 8 ) |  50 )
+    #define MMI_MELODY1_E2_STOP_REQ           ( ( P_AUDIO << 8 ) |  51 )
+    #define MMI_MELODY1_E2_START_CON          ( ( P_AUDIO << 8 ) |  52 )
+    #define MMI_MELODY1_E2_STOP_CON           ( ( P_AUDIO << 8 ) |  53 )
+  #endif
+  #if (L1_VOICE_MEMO_AMR)
+    #define MMI_VM_AMR_PLAY_START_REQ         ( ( P_AUDIO << 8 ) |  54 )
+    #define MMI_VM_AMR_PLAY_STOP_REQ          ( ( P_AUDIO << 8 ) |  55 )
+    #define MMI_VM_AMR_PLAY_START_CON         ( ( P_AUDIO << 8 ) |  56 )
+    #define MMI_VM_AMR_PLAY_STOP_CON          ( ( P_AUDIO << 8 ) |  57 )
+
+    #define MMI_VM_AMR_RECORD_START_REQ       ( ( P_AUDIO << 8 ) |  58 )
+    #define MMI_VM_AMR_RECORD_STOP_REQ        ( ( P_AUDIO << 8 ) |  59 )
+    #define MMI_VM_AMR_RECORD_START_CON       ( ( P_AUDIO << 8 ) |  60 )
+    #define MMI_VM_AMR_RECORD_STOP_CON        ( ( P_AUDIO << 8 ) |  61 )
+  #endif
+  #if (L1_CPORT == 1)
+    #define MMI_CPORT_CONFIGURE_REQ           ( ( P_AUDIO << 8 ) |   62 )
+    #define MMI_CPORT_CONFIGURE_CON           ( ( P_AUDIO << 8 ) |   63 )
+  #endif
+
+
+  // Messages L1S -> L1A
+  #if (KEYBEEP)
+    #define L1_KEYBEEP_START_CON              ( ( P_AUDIO << 8 ) |  64 )
+    #define L1_KEYBEEP_STOP_CON               ( ( P_AUDIO << 8 ) |  65 )
+  #endif
+  #if (TONE)
+    #define L1_TONE_START_CON                 ( ( P_AUDIO << 8 ) |  66 )
+    #define L1_TONE_STOP_CON                  ( ( P_AUDIO << 8 ) |  67 )
+  #endif
+  #if (MELODY_E1)
+    #define L1_MELODY0_START_CON              ( ( P_AUDIO << 8 ) |  68 )
+    #define L1_MELODY0_STOP_CON               ( ( P_AUDIO << 8 ) |  69 )
+
+    #define L1_MELODY1_START_CON              ( ( P_AUDIO << 8 ) |  70 )
+    #define L1_MELODY1_STOP_CON               ( ( P_AUDIO << 8 ) |  71 )
+  #endif
+  #if (VOICE_MEMO)
+    #define L1_VM_PLAY_START_CON              ( ( P_AUDIO << 8 ) |  72 )
+    #define L1_VM_PLAY_STOP_CON               ( ( P_AUDIO << 8 ) |  73 )
+
+    #define L1_VM_RECORD_START_CON            ( ( P_AUDIO << 8 ) |  74 )
+    #define L1_VM_RECORD_STOP_CON             ( ( P_AUDIO << 8 ) |  75 )
+  #endif
+  #if (SPEECH_RECO)
+    #define L1_SR_ENROLL_START_CON            ( ( P_AUDIO << 8 ) |  76 )
+    #define L1_SR_ENROLL_STOP_CON             ( ( P_AUDIO << 8 ) |  77 )
+
+    #define L1_SR_UPDATE_START_CON            ( ( P_AUDIO << 8 ) |  78 )
+    #define L1_SR_UPDATE_STOP_CON             ( ( P_AUDIO << 8 ) |  79 )
+
+    #define L1_SR_RECO_START_CON              ( ( P_AUDIO << 8 ) |  80 )
+    #define L1_SR_RECO_STOP_CON               ( ( P_AUDIO << 8 ) |  81 )
+    #define L1_SR_RECO_STOP_IND               ( ( P_AUDIO << 8 ) |  82 )
+    #define L1_SR_PROCESSING_STOP_CON         ( ( P_AUDIO << 8 ) |  83 )
+  #endif
+  #if (AEC)
+    #define L1_AEC_CON                        ( ( P_AUDIO << 8 ) |  84 )
+    #define L1_AEC_IND                        ( ( P_AUDIO << 8 ) |  85 )
+  #endif
+  #if (FIR)
+    #define L1_AUDIO_FIR_CON                  ( ( P_AUDIO << 8 ) |  86 )
+  #endif
+  #if (AUDIO_MODE)
+    #define L1_AUDIO_MODE_CON                 ( ( P_AUDIO << 8 ) |  87 )
+  #endif
+  #if (L1_VOICE_MEMO_AMR)
+    #define L1_VM_AMR_PLAY_START_CON          ( ( P_AUDIO << 8 ) |  88 )
+    #define L1_VM_AMR_PLAY_STOP_CON           ( ( P_AUDIO << 8 ) |  89 )
+
+    #define L1_VM_AMR_RECORD_START_CON        ( ( P_AUDIO << 8 ) |  90 )
+    #define L1_VM_AMR_RECORD_STOP_CON         ( ( P_AUDIO << 8 ) |  91 )
+  #endif
+  #if (L1_CPORT == 1)
+    #define L1_CPORT_CONFIGURE_CON            ( ( P_AUDIO << 8 ) |  92 )
+  #endif
+
+  // Messages L1A <-> Audio background
+  #if (SPEECH_RECO)
+    #define L1_SRBACK_SAVE_DATA_REQ           ( ( P_AUDIO << 8 ) |  93 )
+    #define L1_SRBACK_SAVE_DATA_CON           ( ( P_AUDIO << 8 ) |  94 )
+    #define L1_SRBACK_LOAD_MODEL_REQ          ( ( P_AUDIO << 8 ) |  95 )
+    #define L1_SRBACK_LOAD_MODEL_CON          ( ( P_AUDIO << 8 ) |  96 )
+    #define L1_SRBACK_TEMP_SAVE_DATA_REQ      ( ( P_AUDIO << 8 ) |  97 )
+    #define L1_SRBACK_TEMP_SAVE_DATA_CON      ( ( P_AUDIO << 8 ) |  98 )
+  #endif
+  #if (MELODY_E2)
+    #define L1_BACK_MELODY_E2_LOAD_INSTRUMENT_REQ   ( ( P_AUDIO << 8 ) |  99 )
+    #define L1_BACK_MELODY_E2_LOAD_INSTRUMENT_CON   ( ( P_AUDIO << 8 ) |  100 )
+    #define L1_BACK_MELODY_E2_UNLOAD_INSTRUMENT_REQ ( ( P_AUDIO << 8 ) |  101 )
+    #define L1_BACK_MELODY_E2_UNLOAD_INSTRUMENT_CON ( ( P_AUDIO << 8 ) |  102 )
+
+    #define L1_MELODY0_E2_STOP_CON                  ( ( P_AUDIO << 8 ) |  103 )
+    #define L1_MELODY1_E2_STOP_CON                  ( ( P_AUDIO << 8 ) |  104 )
+  #endif
+
+  #if (OP_RIV_AUDIO == 1)
+    #if (L1_AUDIO_DRIVER == 1)
+      #define L1_AUDIO_DRIVER_IND                 ( ( P_AUDIO << 8 ) |  105 )
+    #endif
+  #endif
+#endif // AUDIO_TASK == 1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/L1/audio_include/l1audio_varex.h	Thu Jul 10 15:02:48 2014 +0000
@@ -0,0 +1,25 @@
+/************* Revision Controle System Header *************
+ *                  GSM Layer 1 software 
+ * L1AUDIO_VAREX.H
+ *
+ *        Filename l1audio_varex.h
+ *  Copyright 2003 (C) Texas Instruments  
+ *
+ ************* Revision Controle System Header *************/
+
+#if (AUDIO_TASK == 1)
+  #if (SPEECH_RECO)
+    #ifdef L1_SRBACK_COM 
+      T_L1_SRBACK_COM l1_srback_com;
+    #else
+      extern T_L1_SRBACK_COM l1_srback_com;
+    #endif  
+  #endif
+  #if (MELODY_E2)
+    #ifdef L1_AUDIOBACK_MELODYE2
+      T_AUDIO_BACK_MELODY_E2 audioback_melody_e2;
+    #else
+      extern T_AUDIO_BACK_MELODY_E2 audioback_melody_e2;
+    #endif  
+  #endif
+#endif // AUDIO_TASK == 1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/L1/tm_cust0/l1tm_cust.h	Thu Jul 10 15:02:48 2014 +0000
@@ -0,0 +1,66 @@
+/************* Revision Controle System Header *************
+ *                  GSM Layer 1 software
+ * L1TM_CUST.H
+ *
+ *        Filename l1tm_cust.h
+ *  Copyright 2003 (C) Texas Instruments  
+ * 
+ ************* Revision Controle System Header *************/
+
+
+/*---------------------------------------------------------*/
+/* Initial settings for test mode config => Cust_tm_init() */
+/*---------------------------------------------------------*/
+
+// Control algorithm settings: 0=>OFF, 1=>ON
+#define AGC_ENABLE   1
+#define AFC_ENABLE   1
+
+// ADC conversion setting: 0=>OFF, 1=>ON
+#define ADC_ENABLE   1
+
+// AGC settings
+#define TM_AGC_VALUE   50   // AGC gain
+#define TM_LNA_OFF      0   // 0=>LNA ON, 1=>LNA OFF
+
+// Power measurement settings
+#define TM_NUM_MEAS     1  // number of measurements per TDMA
+#define TM_WIN_MEAS     1  // position of measurement within TDMA
+
+// BEACON and TCH settings
+#define TM_BCCH_ARFCN   80     // beacon 
+#define TM_TCH_ARFCN    62     // TCH arfcn
+#define TM_MON_ARFCN    33     // monitor arfcn
+#define TM_CHAN_TYPE    TCH_F  // channel type
+#define TM_SUB_CHAN      0     // subchannel number
+#define TM_SLOT_NUM      4     // TS number
+#define TM_TSC           5     // Training Sequence
+#define TM_TXPWR        15     // TXPWR setting
+#define TM_TXPWR_SKIP    4
+#define TM_TA            0     // timing advance setting
+#define TM_BURST_TYPE    0     // 0=>normal burst, 1=>RACH burst
+#define TM_BURST_DATA    0     // as defined in TM100.doc: tx_param_write
+#define TM_PM_ENABLE     1     // Enable power measurements in packet transfer mode
+
+// Statistics settings
+#define TM_NUM_LOOPS              0  // number of times a task is executed, 0 means infinite loop
+#define TM_AUTO_RESULT_LOOPS      0  // number of loops before stats result is returned, 0 means infinite
+#define TM_AUTO_RESET_LOOPS       0  // number of loops before stats I/F is reset, 0 means infinite
+#define TM_STAT_TYPE              1  // type of stats as defined in TM100.doc: stats_read
+#define TM_STAT_BITMASK      0x6057  // stats bitmaks as defined in TM100.doc: stats_read
+
+#if L1_GPRS
+  // Settings for GPRS test mode:
+  #define TM_PDTCH_ARFCN        62  // PDTCH arfcn
+  #define TM_MULTISLOT_CLASS     1  // GPRS multi slot class
+  #define TM_STAT_GPRS_SLOTS  0x80  // Bit mask for RX stats from PDTCH
+  #define TM_RX_ALLOCATION    0x80  // RX slot allocation (bit7->TS0...bit0->TS7)
+  #define TM_RX_CODING_SCHEME    1  // RX coding scheme
+  #define TM_TX_ALLOCATION    0x80  // TX slot allocation (bit7->TS0...bit0->TS7)
+  #define TM_TX_CODING_SCHEME    2  // TX coding scheme
+  #define TM_TXPWR_GPRS         15  // GPRS txpwr level
+#endif
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/L1/tm_cust0/l1tm_tpu10.h	Thu Jul 10 15:02:48 2014 +0000
@@ -0,0 +1,9 @@
+/****************** Revision Controle System Header ***********************
+ *                      GSM Layer 1 software                                
+ *              Copyright (c) Texas Instruments 1998                      
+ * L1TM_TPU10.H
+ *                                                                        
+ *        Filename l1tm_tpu10.h
+ *  Copyright 2003 (C) Texas Instruments  
+ *                                                                        
+ ****************** Revision Controle System Header ***********************/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/L1/tm_cust0/l1tm_tpu12.h	Thu Jul 10 15:02:48 2014 +0000
@@ -0,0 +1,9 @@
+/****************** Revision Controle System Header ***********************
+ *                      GSM Layer 1 software                                
+ *              Copyright (c) Texas Instruments 1998                      
+ * L1TM_TPU12.H
+ *                                                                        
+ *        Filename l1tm_tpu12.h
+ *  Copyright 2003 (C) Texas Instruments  
+ *                                                                        
+ ****************** Revision Controle System Header ***********************/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/L1/tm_cust0/l1tm_tpu2.h	Thu Jul 10 15:02:48 2014 +0000
@@ -0,0 +1,9 @@
+/****************** Revision Controle System Header ***********************
+ *                      GSM Layer 1 software                                
+ *              Copyright (c) Texas Instruments 1998                      
+ * L1TM_TPU2.H
+ *                                                                       
+ *        Filename l1tm_tpu2.h
+ *  Copyright 2003 (C) Texas Instruments  
+ *                                                                        
+ ****************** Revision Controle System Header ***********************/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/L1/tm_cust0/l1tm_tpu35.h	Thu Jul 10 15:02:48 2014 +0000
@@ -0,0 +1,9 @@
+/****************** Revision Controle System Header ***********************
+ *                      GSM Layer 1 software                                
+ *              Copyright (c) Texas Instruments 1998                      
+ * L1TM_TPU35.H
+ *                                                                       
+ *        Filename l1tm_tpu35.h
+ *  Copyright 2003 (C) Texas Instruments  
+ *                                                                        
+ ****************** Revision Controle System Header ***********************/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/L1/tm_cust0/l1tm_tpu8.h	Thu Jul 10 15:02:48 2014 +0000
@@ -0,0 +1,10 @@
+ /****************** Revision Controle System Header ***********************
+ *                      GSM Layer 1 software                                
+ *              Copyright (c) Texas Instruments 1998                      
+ * L1TM_TPU8.H
+ *
+ *                                                                        
+ *        Filename l1tm_tpu8.h
+ *  Copyright 2003 (C) Texas Instruments  
+ *                                                                        
+ ****************** Revision Controle System Header ***********************/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/L1/tm_include/l1tm_defty.h	Thu Jul 10 15:02:48 2014 +0000
@@ -0,0 +1,169 @@
+/************* Revision Controle System Header *************
+ *                  GSM Layer 1 software 
+ * L1TM_DEFTY.H
+ *
+ *        Filename l1tm_defty.h
+ *  Copyright 2003 (C) Texas Instruments  
+ *
+ ************* Revision Controle System Header *************/
+
+
+// Max size of data portion of a testmode packet
+#define TM_PAYLOAD_UPLINK_SIZE_MAX   128
+
+// CID, STATUS and CHECKSUM
+#define TM_UPLINK_PACKET_OVERHEAD 3
+
+typedef struct
+{
+  UWORD32   toa_sum;
+  UWORD32   toa_sq_sum;
+  UWORD32   toa_recent;  
+  UWORD32   pm_sum;
+  UWORD32   pm_sq_sum;
+  UWORD16   pm_recent;  
+  WORD16    angle_sum;
+  UWORD32   angle_sq_sum;
+  WORD16    angle_min;
+  WORD16    angle_max;
+  WORD16    angle_recent;  
+  UWORD32   snr_sum;
+  UWORD32   snr_sq_sum;
+  UWORD32   snr_recent;  
+  UWORD8    rssi_fifo[4];
+  UWORD8    rssi_recent;  
+  WORD32    loop_count;  //Must be signed for divide operation in statistics!!!
+  WORD32    flag_count;  //Must be signed for divide operation in statistics!!!
+  UWORD32   flag_recent;
+  UWORD8    bsic;
+  UWORD32   fn;
+  UWORD32   qual_acc_full;      // Fullset: accu. rxqual meas.
+  UWORD32   qual_nbr_meas_full; // Fullset: nbr meas. of rxqual.
+  #if L1_GPRS
+    UWORD8    nb_dl_pdtch_slots;
+  #endif
+}
+T_TM_STATS;
+
+typedef struct
+{
+  UWORD8  dedicated_active;
+  UWORD32 rx_counter;
+  UWORD16 num_bcchs;
+  #if L1_GPRS
+    BOOL packet_transfer_active;
+  #endif
+}
+T_TM_STATE;
+
+typedef struct
+{
+    UWORD16 prbs1_seed;
+ // UWORD16 prbs2_seed; 	//for future use
+}
+T_TM_PRBS;
+
+// Global TM variable
+typedef struct
+{
+  BOOL       tm_msg_received;
+  T_TM_STATS tmode_stats;
+  T_TM_STATE tmode_state;
+  T_TM_PRBS  tmode_prbs;
+}
+T_L1TM_GLOBAL;
+
+typedef struct
+{
+  UWORD16     bcch_arfcn;
+  UWORD16     tch_arfcn;
+  UWORD16     mon_arfcn;
+  #if L1_GPRS
+    UWORD16     pdtch_arfcn;
+    UWORD8      multislot_class;
+  #endif
+  UWORD8      down_up;
+  UWORD8      channel_type;
+  UWORD8      subchannel;
+  UWORD8      tmode_continuous;
+  UWORD8      reload_ramps_flag;
+  BOOL        mon_report; //Used to determine wether RX stats are done in Monitor channel or TCH channel 
+  BOOL        mon_tasks;  //Used to enable tasks associated with Monitor Channel
+}
+T_TM_RF_PARAMS;
+
+typedef struct
+{
+  UWORD8      slot_num;
+  WORD8       agc;
+  WORD8       lna_off;
+  UWORD8      number_of_measurements;
+  UWORD8      place_of_measurement;
+  BOOL        pm_enable;
+  UWORD8      rssi_band;
+  #if L1_GPRS
+    UWORD8      timeslot_alloc;
+    UWORD8      coding_scheme;
+  #endif
+}
+T_TM_RX_PARAMS;
+
+typedef struct
+{
+  UWORD8      tsc;
+  UWORD8      txpwr;
+  UWORD8      txpwr_skip;
+  UWORD8      timing_advance;
+  UWORD8      burst_type;
+  UWORD8      burst_data;
+  #if L1_GPRS
+    UWORD8      timeslot_alloc;
+    UWORD8      txpwr_gprs[8];
+    UWORD8      coding_scheme;
+    UWORD8      rlc_buffer_size;
+    UWORD16     rlc_buffer[27];
+  #endif
+}
+T_TM_TX_PARAMS;
+
+typedef struct
+{
+  UWORD32     num_loops;
+  UWORD32     auto_result_loops;
+  UWORD32     auto_reset_loops;
+  UWORD8      stat_type;
+  UWORD16     stat_bitmask;
+  #if L1_GPRS
+    UWORD8      stat_gprs_slots;
+  #endif
+}
+T_TM_STATS_CONFIG;
+
+typedef struct 
+{
+  T_TM_RF_PARAMS    rf_params;
+  T_TM_RX_PARAMS    rx_params;
+  T_TM_TX_PARAMS    tx_params;
+  T_TM_STATS_CONFIG stats_config;
+}
+T_TM_PARAMS;
+
+typedef struct
+{
+  UWORD8  cid;
+  UWORD8  index;
+  UWORD8  status;
+  UWORD16 size;  // size of result[] array
+  UWORD8  result[TM_PAYLOAD_UPLINK_SIZE_MAX];
+}
+T_TM_RETURN;
+
+typedef struct
+{
+  UWORD8  cid;
+  UWORD8  index;
+  UWORD8  status;
+  UWORD16 size;  // size of result[] array
+  UWORD8  result[5];
+}
+T_TM_RETURN_ABBREV;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/L1/tm_include/l1tm_msgty.h	Thu Jul 10 15:02:48 2014 +0000
@@ -0,0 +1,536 @@
+ /************* Revision Controle System Header *************
+ *                  GSM Layer 1 software 
+ * L1TM_MSGTY.H
+ *
+ *        Filename l1tm_msgty.h
+ *  Copyright 2003 (C) Texas Instruments  
+ *
+ ************* Revision Controle System Header *************/
+
+
+/***********************************************************************/
+/*                           TESTMODE 3.X                              */
+/***********************************************************************/
+
+
+typedef struct
+{ 
+  UWORD8 cid;
+  UWORD8 str_len_in_bytes;
+
+  // all primitive types should be a unique struct within
+  // the union u.
+  union
+    {
+    struct
+    {
+      WORD16 index;
+      UWORD16 value;
+    } tm_params;
+    struct
+    {
+      WORD8 index;
+      UWORD8 table[TM_PAYLOAD_UPLINK_SIZE_MAX];
+    } tm_table;
+    struct
+    {
+      UWORD32 address;
+      UWORD8 table[TM_PAYLOAD_UPLINK_SIZE_MAX];
+    } mem_write;
+    struct
+    {
+      UWORD32 src;
+      UWORD32 length;
+    } mem_read;
+    struct
+    {
+      UWORD8 packet[128];
+    } ffs;
+  } u;
+}
+T_TESTMODE_PRIM;
+
+typedef struct
+{ 
+  UWORD32          arfcn;
+  UWORD32          number_of_measurements;
+  UWORD8           place_of_measurement;
+  UWORD32          num_loop;  
+  UWORD32          agc;
+}
+T_TMODE_PM_REQ;
+
+typedef struct
+{
+  UWORD16       power_array_size;
+  T_POWER_ARRAY power_array[1];
+}
+T_TMODE_RXLEV_REQ;
+
+typedef struct
+{ 
+  UWORD32   dummy; 
+}
+T_TMODE_FB0_REQ;
+
+typedef struct
+{ 
+  UWORD32   dummy; 
+}
+T_TMODE_FB1_REQ;
+
+typedef struct
+{ 
+  UWORD32   dummy;
+}
+T_TMODE_SB_REQ;
+
+typedef struct
+{ 
+  UWORD32   dummy; 
+}
+T_TMODE_FB_SB_REQ;
+
+typedef struct
+{
+  BOOL          fb_flag;    //TRUE if FB found, otherwise FALSE 
+  WORD8         ntdma;      //tdma between window start and beginning of FB (0..23)
+  UWORD8        neigh_id;
+  UWORD32       pm_fullres;
+  UWORD32       toa;
+  WORD16        angle;
+  UWORD32       snr;
+}
+T_TMODE_FB_CON;
+
+typedef struct
+{
+  UWORD16     radio_freq;
+  BOOL        sb_flag;
+  UWORD32     fn_offset;
+  UWORD32     time_alignmt;
+  UWORD8      bsic;
+  UWORD8      neigh_id;
+  UWORD8      attempt;
+  UWORD32     pm_fullres;
+  UWORD32     toa;
+  WORD16      angle;
+  UWORD32     snr;  
+}
+T_TMODE_NCELL_SYNC_IND;
+
+typedef struct
+{
+  UWORD32     fn_offset;
+  UWORD32     time_alignmt;
+  UWORD8      bsic;
+}
+T_TMODE_NEW_SCELL_REQ;
+
+typedef struct
+{
+  UWORD16        radio_freq;
+  UWORD8         l2_channel;
+  BOOL           error_flag;
+  T_RADIO_FRAME  l2_frame;
+  UWORD8         tc;
+  UWORD32        fn;
+  UWORD8         neigh_id;
+}
+T_TMODE_BCCHS_CON; 
+
+typedef struct
+{
+  UWORD32 dummy;
+}
+T_TMODE_STOP_SCELL_BCCH_REQ;
+
+typedef struct
+{
+  UWORD32 dummy;
+}
+T_TMODE_SCELL_NBCCH_REQ;
+
+typedef struct 
+{
+  UWORD32   fn;
+  UWORD8    channel_request;
+} 
+T_TMODE_RA_DONE;
+
+typedef struct
+{
+  UWORD32   dummy;
+}
+T_TMODE_RA_START;
+
+typedef struct
+{
+  #if (CODE_VERSION == SIMULATION)
+    UWORD8  ul_dl;
+  #else
+    UWORD32 dummy;
+  #endif
+}  
+T_TMODE_IMMED_ASSIGN_REQ;
+
+typedef struct
+{
+  UWORD8  A[22+1];
+}
+T_TMODE_RADIO_FRAME;
+
+typedef struct
+{
+  UWORD16      radio_freq;
+  UWORD8       l2_channel;
+  UWORD8       error_cause;
+  T_TMODE_RADIO_FRAME l2_frame;
+  UWORD8       bsic;
+  UWORD8       tc;
+}
+T_TMODE_SACCH_INFO;
+
+typedef struct
+{
+  UWORD32  pm_fullres;
+  UWORD32  snr;
+  UWORD32  toa;
+  WORD16   angle;
+  UWORD32  qual_nbr_meas_full; // Fullset: nbr meas. of rxqual.
+  UWORD32  qual_full;          // Fullset: rxqual meas.
+}
+T_TMODE_TCH_INFO;
+
+typedef struct
+{
+  UWORD32 none;
+}
+T_TMODE_STOP_RX_TX;
+
+#if L1_GPRS
+  typedef struct
+  {
+    #if (CODE_VERSION == SIMULATION)
+      UWORD8 multislot_class;
+      UWORD8 dl_ts_alloc;
+      UWORD8 ul_ts_alloc;
+      UWORD8 ul_alloc_length;
+      BOOL   mon_enable;
+      BOOL   pm_enable;
+    #else
+      UWORD32 dummy;
+    #endif
+  }  
+  T_TMODE_PDTCH_ASSIGN_REQ;
+
+  typedef struct
+  {
+    UWORD32  pm_fullres;
+    UWORD32  snr;
+    UWORD32  toa;
+    WORD16   angle;
+    BOOL     crc_error_tbl[8];
+  }
+  T_TMODE_PDTCH_INFO;
+#endif
+
+
+
+/**************** ENUMs ***********************/
+
+// TestMode Error Codes
+enum
+{
+  E_OK         =   0,   // Function completed successfully.
+  E_FINISHED   =   1,   // Previously started operation has finished.
+  E_TESTMODE   =   2,   // Function not legal in this GGT test mode.
+  E_BADINDEX   =   3,   // The index is undefined.
+  E_INVAL      =   4,   // Invalid Argument (out of range or other).
+  E_BADSIZE    =   7,   // Some table or list parameter was wrong in size
+  E_AGAIN      =   8,   // Not ready, try again later.
+  E_NOSYS      =   9,   // Function not implemented.
+  E_NOSUBSYS   =  10,   // Sub-Function not implemented.
+  E_BADCID     =  14,   // Invalid CID.
+  E_CHECKSUM   =  15,   // Checksum Error.
+  E_PACKET     =  16,    // Packet format is bad (wrong number of arguments).
+  E_FORWARD    =  31   // Command parsed successfully, but further processing necessary
+};
+
+// CID's 
+enum 
+{
+  TM_INIT                    = 0x20,
+  TM_MODE_SET                = 0x21,
+  VERSION_GET                = 0x22,
+  RF_ENABLE                  = 0x23,
+  STATS_READ                 = 0x24,
+  STATS_CONFIG_WRITE         = 0x25,
+  STATS_CONFIG_READ          = 0x26,
+  RF_PARAM_WRITE             = 0x30,
+  RF_PARAM_READ              = 0x31,
+  RF_TABLE_WRITE             = 0x32,
+  RF_TABLE_READ              = 0x33,
+  RX_PARAM_WRITE             = 0x34,
+  RX_PARAM_READ              = 0x35,
+  TX_PARAM_WRITE             = 0x36,
+  TX_PARAM_READ              = 0x37,
+  TX_TEMPLATE_WRITE          = 0x38,
+  TX_TEMPLATE_READ           = 0x39,
+  MEM_WRITE                  = 0x40,
+  MEM_READ                   = 0x41,
+  CODEC_WRITE                = 0x42,
+  CODEC_READ                 = 0x43,
+  MISC_PARAM_WRITE           = 0x44,
+  MISC_PARAM_READ            = 0x45,
+  MISC_TABLE_WRITE           = 0x46,
+  MISC_TABLE_READ            = 0x47,
+  MISC_ENABLE                = 0x48,
+  SPECIAL_PARAM_WRITE        = 0x50,
+  SPECIAL_PARAM_READ         = 0x51,
+  SPECIAL_TABLE_WRITE        = 0x52,
+  SPECIAL_TABLE_READ         = 0x53,
+  SPECIAL_ENABLE             = 0x54,
+
+  #if (CODE_VERSION != SIMULATION)
+    TPU_TABLE_WRITE            = 0x55,
+    TPU_TABLE_READ             = 0x56,
+  #endif
+
+  TM_FFS                     = 0x70
+};
+
+// TestMode function enum's
+enum RF_PARAM 
+{
+  BCCH_ARFCN         = 1,
+  TCH_ARFCN          = 2,
+  MON_ARFCN          = 3,
+  #if L1_GPRS
+    PDTCH_ARFCN        = 4,
+  #endif
+  STD_BAND_FLAG      = 7,
+  AFC_ENA_FLAG       = 8,
+  AFC_DAC_VALUE      = 9,
+  INITIAL_AFC_DAC    = 10
+  #if L1_GPRS
+    ,MULTISLOT_CLASS    = 20
+  #endif
+};
+
+enum RF_TABLE 
+{
+  RX_AGC_TABLE              = 8,
+  AFC_PARAMS                = 9,
+  RX_AGC_GLOBAL_PARAMS      = 12,
+  RX_IL_2_AGC_MAX           = 13,
+  RX_IL_2_AGC_PWR           = 14,
+  RX_IL_2_AGC_AV            = 15,
+  TX_LEVELS                 = 16, // 16=GSM900, 32=DCS1800, 48=PCS1900
+  TX_CAL_CHAN               = 17, // 17=GSM900, 33=DCS1800, 49=PCS1900
+
+#if (ORDER2_TX_TEMP_CAL==1)
+  TX_CAL_TEMP               = 20, // 20=GSM900, 36=DCS1800, 52=PCS1900
+#else
+  TX_CAL_TEMP               = 18, // 18=GSM900, 34=DCS1800, 50=PCS1900
+#endif
+
+  TX_CAL_EXTREME            = 19, // 19=GSM900, 35=DCS1800, 51=PCS1900
+  RX_CAL_CHAN               = 25, // 25=GSM900, 41=DCS1800, 57=PCS1900
+  RX_CAL_TEMP               = 26, // 26=GSM900, 42=DCS1800, 58=PCS1900
+  RX_CAL_LEVEL              = 27, // 27=GSM900, 43=DCS1800, 59=PCS1900
+  RX_AGC_PARAMS             = 31, // 31=GSM900, 47=DCS1800, 63=PCS1900
+  RX_AGC_PARAMS_PCS         = 63,
+  #if (RF_FAM == 35)
+    RX_PLL_TUNING_TABLE     = 65, 
+  #endif 
+  TX_DATA_BUFFER            = 80
+  #if L1_GPRS
+   ,RLC_TX_BUFFER_CS1       = 81,
+    RLC_TX_BUFFER_CS2       = 82,
+    RLC_TX_BUFFER_CS3       = 83,
+    RLC_TX_BUFFER_CS4       = 84
+  #endif
+};
+
+enum RX_PARAM 
+{
+  RX_AGC_GAIN             = 1,
+  RX_TIMESLOT             = 2,
+  RX_AGC_ENA_FLAG         = 8,
+  RX_PM_ENABLE            = 9,
+  RX_FRONT_DELAY          = 10,
+  RX_FLAGS_CAL            = 14,
+  RX_FLAGS_PLATFORM       = 15,
+  RX_FLAGS_IQ_SWAP        = 17,
+  RX_FLAGS_ALL            = 18
+  #if L1_GPRS
+    ,RX_GPRS_SLOTS          = 28,
+    RX_GPRS_CODING          = 29
+  #endif
+};
+
+enum TX_PARAM 
+{
+  TX_PWR_LEVEL            = 1,
+  TX_APC_DAC              = 4,
+  TX_RAMP_TEMPLATE        = 5,
+  TX_CHAN_CAL_TABLE       = 6,
+  TX_RESERVED             = 7,
+  TX_BURST_TYPE           = 8,
+  TX_BURST_DATA           = 9,
+  TX_TIMING_ADVANCE       = 10,
+  TX_TRAINING_SEQ         = 11,
+  TX_PWR_SKIP             = 13,
+  TX_FLAGS_CAL            = 14,
+  TX_FLAGS_PLATFORM       = 15,
+  TX_FLAGS_IQ_SWAP        = 17,
+  TX_FLAGS_ALL            = 18
+  #if L1_GPRS
+    ,TX_GPRS_POWER0         = 20,
+    TX_GPRS_POWER1          = 21,
+    TX_GPRS_POWER2          = 22,
+    TX_GPRS_POWER3          = 23,
+    TX_GPRS_POWER4          = 24,
+    TX_GPRS_POWER5          = 25,
+    TX_GPRS_POWER6          = 26,
+    TX_GPRS_POWER7          = 27,
+    TX_GPRS_SLOTS           = 28,
+    TX_GPRS_CODING          = 29
+  #endif
+};
+
+enum MISC_PARAM 
+{
+  GPIOSTATE0                = 8,
+  GPIODIR0                  = 9,
+  GPIOSTATE1                = 10,
+  GPIODIR1                  = 11,
+  GPIOSTATE0P               = 12,
+  GPIODIR0P                 = 13,
+  GPIOSTATE1P               = 14,
+  GPIODIR1P                 = 15,
+  ADC_INTERVAL              = 18,
+  ADC_ENA_FLAG              = 19,
+  CONVERTED_ADC0            = 20,
+  CONVERTED_ADC1            = 21,
+  CONVERTED_ADC2            = 22,
+  CONVERTED_ADC3            = 23,
+  CONVERTED_ADC4            = 24,
+  CONVERTED_ADC5            = 25,
+  CONVERTED_ADC6            = 26,
+  CONVERTED_ADC7            = 27,
+  CONVERTED_ADC8            = 28,
+  RAW_ADC0                  = 30,
+  RAW_ADC1                  = 31,
+  RAW_ADC2                  = 32,
+  RAW_ADC3                  = 33,
+  RAW_ADC4                  = 34,
+  RAW_ADC5                  = 35,
+  RAW_ADC6                  = 36,
+  RAW_ADC7                  = 37,
+  RAW_ADC8                  = 38,
+  ADC0_COEFF_A              = 50,
+  ADC1_COEFF_A              = 51,
+  ADC2_COEFF_A              = 52,
+  ADC3_COEFF_A              = 53,
+  ADC4_COEFF_A              = 54,
+  ADC5_COEFF_A              = 55,
+  ADC6_COEFF_A              = 56,
+  ADC7_COEFF_A              = 57,
+  ADC8_COEFF_A              = 58,
+  ADC0_COEFF_B              = 60,
+  ADC1_COEFF_B              = 61,
+  ADC2_COEFF_B              = 62,
+  ADC3_COEFF_B              = 63,
+  ADC4_COEFF_B              = 64,
+  ADC5_COEFF_B              = 65,
+  ADC6_COEFF_B              = 66,
+  ADC7_COEFF_B              = 67,
+  ADC8_COEFF_B              = 68,
+  SLEEP_MODE                = 80,
+  CURRENT_TM_MODE           = 127
+};
+
+enum STATS_CONFIG 
+{
+  LOOPS                     = 16,
+  AUTO_RESULT_LOOPS         = 17,
+  AUTO_RESET_LOOPS          = 18,
+  #if L1_GPRS
+    STAT_GPRS_SLOTS           = 20,
+  #endif
+  STAT_TYPE                 = 24,
+  STAT_BITMASK              = 25
+};
+
+enum STATS_READ 
+{
+  ACCUMULATED_RX_STATS      = 1,
+  MOST_RECENT_RX_STATS      = 2
+};
+
+enum BITMASK 
+{
+  RSSI                      = 0x0001,
+  DSP_PM                    = 0x0002,
+  ANGLE_MEAN                = 0x0004,
+  ANGLE_VAR                 = 0x0008,
+  SNR_MEAN                  = 0x0010,
+  SNR_VAR                   = 0x0020,
+  TOA_MEAN                  = 0x0040,
+  TOA_VAR                   = 0x0080,
+  RESERVED1                 = 0x0100,
+  RESERVED2                 = 0x0200,
+  ANGLE_MIN                 = 0x0400,
+  ANGLE_MAX                 = 0x0800,
+  FRAME_NUMBER              = 0x1000,
+  RUNS                      = 0x2000,
+  SUCCESSES                 = 0x4000,
+  BSIC                      = 0x8000
+};
+
+enum RF_ENABLE_E 
+{
+  STOP_ALL                  =  0,
+  RX_TCH                    =  1,
+  TX_TCH                    =  2,
+  RX_TX_TCH                 =  3,
+  #if L1_GPRS
+    RX_TX_PDTCH              =  4,
+  #endif
+  RX_TCH_CONT               =  8,
+  TX_TCH_CONT               =  9,
+  BCCH_LOOP                 = 10,
+  SB_LOOP                   = 11,
+  FB1_LOOP                  = 12,
+  FB0_LOOP                  = 13,
+  SINGLE_PM                 = 15,
+  #if L1_GPRS
+    RX_TX_PDTCH_MON           = 16,
+  #endif
+  #if (RF_FAM == 35)
+    RX_PLL_TUNING             =  17,
+  #endif
+  RX_TX_MON_TCH             = 19,
+  RX_TX_MON                 = 27
+};
+  
+enum VERSION_GET_E 
+{
+  BBCHIP_MODULE_REV         = 0x10,
+  CHIPID_MODULE_REV         = 0x14,
+  CHIPVER_MODULE_REV        = 0x15,
+  DSPSW_MODULE_REV          = 0x22,
+  ANALOGCHIP_MODULE_REV     = 0x30,
+  GSM_MODULE_REV            = 0x80,
+  LAYER1_MODULE_REV         = 0x84,
+  RFDRIVER_MODULE_REV       = 0x88,
+  TM_API_MODULE_REV         = 0xE0,
+  L1_TM_CORE_MODULE_REV     = 0xE1,
+  STD_MODULE_REV            = 0xE2,
+  DSP_MODULE_REV            = 0xE3,
+  BOARD_MODULE_REV          = 0xE4,
+  RF_MODULE_REV             = 0xE5 
+};
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/L1/tm_include/l1tm_signa.h	Thu Jul 10 15:02:48 2014 +0000
@@ -0,0 +1,43 @@
+/************* Revision Controle System Header *************
+ *                  GSM Layer 1 software 
+ * L1TM_SIGNA.H
+ *
+ *        Filename l1tm_signa.h
+ *  Copyright 2003 (C) Texas Instruments  
+ *
+ ************* Revision Controle System Header *************/
+
+  #define P_TMODE ( P_L1C + 3 ) // keep compatibility with GPRS code
+
+
+  //TestMode
+  #define TMODE_RXLEV_REQ                  ( ( P_TMODE << 8 ) | 1 )
+  #define TMODE_RXLEV_IND                  ( ( P_TMODE << 8 ) | 2 )
+  #define TMODE_STOP_RXLEV_CON             ( ( P_TMODE << 8 ) | 3 )
+  #define TMODE_FB0_REQ                    ( ( P_TMODE << 8 ) | 4 )
+  #define TMODE_FB1_REQ                    ( ( P_TMODE << 8 ) | 5 )
+  #define TMODE_SB_REQ                     ( ( P_TMODE << 8 ) | 6 )
+  #define TMODE_FB_CON                     ( ( P_TMODE << 8 ) | 7 )
+  #define TMODE_SB_CON                     ( ( P_TMODE << 8 ) | 8 )
+  #define TMODE_BCCHS_CON                  ( ( P_TMODE << 8 ) | 9 )
+  #define TMODE_RA_START                   ( ( P_TMODE << 8 ) | 10 )
+  #define TMODE_RA_DONE                    ( ( P_TMODE << 8 ) | 11 )
+  #define TMODE_SCELL_NBCCH_REQ            ( ( P_TMODE << 8 ) | 12 )
+  #define TMODE_STOP_SCELL_BCCH_REQ        ( ( P_TMODE << 8 ) | 13 )
+  #define TMODE_NEW_SCELL_REQ              ( ( P_TMODE << 8 ) | 14 )
+  #define TMODE_TCH_REQ                    ( ( P_TMODE << 8 ) | 15 )
+  #define TMODE_IMMED_ASSIGN_REQ           ( ( P_TMODE << 8 ) | 16 )
+  #define TMODE_IMMED_ASSIGN_CON           ( ( P_TMODE << 8 ) | 17 )
+  #define TMODE_STOP_RX_TX                 ( ( P_TMODE << 8 ) | 18 )
+  #define TMODE_SACCH_INFO                 ( ( P_TMODE << 8 ) | 19 )
+  #define TESTMODE_PRIM                    ( ( P_TMODE << 8 ) | 20 )
+  #define TMODE_FB_SB_REQ                  ( ( P_TMODE << 8 ) | 21 )
+  #define TMODE_NETWORK_SYNC_IND           ( ( P_TMODE << 8 ) | 22 )
+  #define TMODE_TCH_INFO                   ( ( P_TMODE << 8 ) | 23 )
+  #if L1_GPRS
+    #define TMODE_PDTCH_ASSIGN_REQ           ( ( P_TMODE << 8 ) | 24 )
+    #define TMODE_PDTCH_INFO                 ( ( P_TMODE << 8 ) | 25 )
+  #endif
+
+//  #define TMODE_RXLEV_REQ                  ( ( P_TMODE << 8 ) | 24 )
+//  #define TMODE_RXLEV_IND                  ( ( P_TMODE << 8 ) | 25 )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/L1/tm_include/l1tm_varex.h	Thu Jul 10 15:02:48 2014 +0000
@@ -0,0 +1,18 @@
+ /************* Revision Controle System Header *************
+ *                  GSM Layer 1 software 
+ * L1TM_VAREX.H
+ *
+ *        Filename l1tm_varex.h
+ *  Copyright 2003 (C) Texas Instruments  
+ *
+ ************* Revision Controle System Header *************/
+
+
+#ifdef L1TM_ASYNC_C //Defined in l1_tmode.c
+  #define TMVAR
+#else
+  #define TMVAR extern
+#endif
+
+TMVAR T_L1TM_GLOBAL  l1tm;
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gsm-fw/L1/tm_include/l1tm_ver.h	Thu Jul 10 15:02:48 2014 +0000
@@ -0,0 +1,56 @@
+/************* Revision Controle System Header *************
+ *                  GSM Layer 1 software 
+ * L1TM_VER.H
+ *
+ *        Filename l1tm_ver.h
+ *  Copyright 2003 (C) Texas Instruments  
+ *
+ ************* Revision Controle System Header *************/
+
+/*****************************/
+/* Test mode version numbers */
+/*****************************/
+
+
+//#define    TESTMODEVERSION  0x0300L // All previous TestMode versions pertain to
+                                    // GGT Protocol version 2.0, which has been replaced
+                                    // by version 3.0.
+
+//#define    TESTMODEVERSION  0x0320L // AFC Params part of "rftw"; APCDEL intialized in "tm_init"; New fcn "l1tm_initialize_var" to switch to TestMode
+                                    // Uplink-only tests loop count; RACH loop count; Dedicated mode Pass/Fail stats updated
+                                    // New structure "T_TM_RETURN_ABBREV"; Continous TX/RX; New fcn "tmstats_auto_result_reset_loops";
+                                    // Corrected BSIC reporting problem; Power skip fcn implemented ("rftw/rftr 16"); A-F Loopback modes supported;
+                                    // Chan. monitoring while in dedic. mode possible; FB26/D_BAMS_MEAS tasks enabled only with chan. monitoring;
+                                    // New fcn "tmstats_mon_confirm"; RF struct incorporates new TX descriptor table;
+                                    // AGC includes lna_off bit (least-significant bit); agc_, afc_ & adc_enable part of l1_config struct;
+                                    // Variable number of guard bits in "l1tm_fill_burst"......
+//#define    TESTMODEVERSION  0x0321L // Implemented FRAME_NUMBER in l1tm_stats_read(). Timing advance takes effect immediately. stats_read reports 16 or 32 bit values only.
+                                    // Only one uplink message sent. Some indices in l1tm_version_get implemented. AGC gain and lna_off set only once to save instruction cycles.
+                                    // Cleaned up enums in l1_tm_types.h. Removed case STANDARD from rf_param_read. 
+                                    // Updated all argument types of testmode functions according to TM100 v3.2.1. Changed mem_read to support reception of page and 
+                                    // register values in one 16-bit value from PCTM.  mem_read can read up to 124 bytes. Changed the TestMode primitive structure to include
+                                    // only 2 generic ones plus mem_write and mem_read.
+
+//#define    TESTMODEVERSION  0x0400L // REQ991:
+                                    // - SIMULATION for test mode => new non-regression flow regress_tm.bat
+                                    // - Rework of test mode state machines to make them independent from each other
+                                    // - Rework of simulated upper layers (L3,CST) to be able to run L1 scenarios with TESTMODE=3
+                                    // Correction of BUG989, BUG990, BUG992
+
+//#define    TESTMODEVERSION  0x0401L // Merge with TM version 0x321
+
+//#define    TESTMODEVERSION  0x0402L // TM rework PART II
+//#define    TESTMODEVERSION  0x0403L // Alignment with TM100 v.3.5.0
+                                    // Implementation of new functionality: single PM on monitor channel (rfe 15)
+//#define    TESTMODEVERSION  0x0404L // Closed REQ01129: Implementation of GPRS test mode
+//#define    TESTMODEVERSION  0x0405L // Alignment with SSA 5.3.3, 
+                                      // Correction of BUG2048, BUG2050, BUG2294, BUG2295
+#define    TESTMODEVERSION  0x0406L   // REQ03410
+
+
+//#define    TMAPIVERSION     0x0350L  // New: TM API version (TM100 version number)
+//#define    TMAPIVERSION     0x0360L  // TM100 change for GPRS test mode
+//#define    TMAPIVERSION     0x0361L  // tm patch 361 for SW version 520
+//#define    TMAPIVERSION     0x0362L  // tm patch 362 for SW version 531
+#define    TMAPIVERSION     0x0370L  // Multi-band support
+