l1_rf12.c

来自「是一个手机功能的模拟程序」· C语言 代码 · 共 2,110 行 · 第 1/5 页

C
2,110 行
字号
T_RF_BAND rf_band[GSM_BANDS]; //uninitialised rf struct for bands

const T_RF_BAND rf_900 =
{
  { //RX structure
     //T_RX_CAL_PARAMS rx_cal_params
    {
        193,      //g_magic
         40,      //lna_gain_max * 2
         40,      //lna_th_high
         44       //lna_th_low
    },
    { //T_RF_AGC_BAND   agc_bands[RF_RX_CAL_CHAN_SIZE];
     // Remark: ARFCN=0 (GSM-E) is maintained by 1st GSM subbband.
                     // upper_bound, agc_calib
      {  10,  0},    // sub-band1 up to arfcn =  10, Agc calibration = 0db
      {  30,  0},    // sub-band2 up to arfcn =  30, Agc calibration = 0db
      {  51,  0},    // sub-band3 up to arfcn =  51, Agc calibration = 0db
      {  71,  0},    // etc.
      {  90,  0},    //
      { 112,  0},    //
      { 124,  0},    //
      { 991,  0},    //
      { 992,  0},    //
      {1023,  0},    //
    },
    { //RX temperature compensation
      { -15 ,  0  },
      {  -5 ,  0  },
      {   6 ,  0  },
      {  16 ,  0  },
      {  25 ,  0  },
      {  35 ,  0  },
      {  45 ,  0  },
      {  56 ,  0  },
      {  66 ,  0  },
      {  75 ,  0  },
      { 100 ,  0  }
    }
  },
  { //TX structure
    {// gsm900 T_LEVEL_TX
#if (PA == 3)  // Hitachi
    {550,  0, 0}, // 0
    {550,  0, 0}, // 1
    {550,  0, 0}, // 2
    {550,  0, 0}, // 3
    {550,  0, 0}, // 4
    {560,  0, 0}, // 5 Highest power
    {510,  1, 0}, // 6
    {460,  2, 0}, // 7
    {400,  3, 1}, // 8
    {325,  4, 1}, // 9
    {280,  5, 1}, // 10
    {230,  6, 1}, // 11
    {195,  7, 1}, // 12
    {175,  8, 2}, // 13
    {158,  9, 2},  // 14
    {140, 10, 2}, // 15
    {130, 11, 2}, // 16
    {120, 12, 3}, // 17
    {115, 13, 3}, // 18
    {110, 14, 3}, // 19 Lowest power
    { 43, 14, 0}, // 20
    { 43, 14, 0}, // 21
    { 43, 14, 0}, // 22
    { 43, 14, 0}, // 23
    { 43, 14, 0}, // 24
    { 43, 14, 0}, // 25
    { 43, 14, 0}, // 26
    { 43, 14, 0}, // 27
    { 43, 14, 0}, // 28
    { 43, 14, 0}, // 29
    { 43, 14, 0}, // 30
    { 43, 14, 0}, // 31
#else
      { 673, 0, 0  }, // 0
      { 673, 0, 0  }, // 1
      { 673, 0, 0  }, // 2
      { 673, 0, 0  }, // 3
      { 673, 0, 0  }, // 4
      { 673, 0, 0  }, // 5 Highest power
      { 478, 1, 0  }, // 6
      { 389, 2, 0  }, // 7
      { 318, 3, 0  }, // 8
      { 260, 4, 0  }, // 9
      { 217, 5, 0  }, // 10
      { 180, 6, 0  }, // 11
      { 151, 7, 0  }, // 12
      { 128, 8, 0  }, // 13
      { 109, 9, 0  }, // 14
      { 94, 10, 0  }, // 15
      { 86, 11, 0  }, // 16
      { 78, 12, 0  }, // 17
      { 72, 13, 0  }, // 18
      { 67, 14, 0  }, // 19 Lowest power
      { 67, 14, 0  }, // 20
      { 67, 14, 0  }, // 21
      { 67, 14, 0  }, // 22
      { 67, 14, 0  }, // 23
      { 67, 14, 0  }, // 24
      { 67, 14, 0  }, // 25
      { 67, 14, 0  }, // 26
      { 67, 14, 0  }, // 27
      { 67, 14, 0  }, // 28
      { 67, 14, 0  }, // 29
      { 67, 14, 0  }, // 30
      { 67, 14, 0  }, // 31
#endif
    },
    {// Channel Calibration Tables
      {// arfcn, tx_chan_cal
#if (PA == 3)  // Hitachi
        {   21, 128 }, // Calibration Table 0
        {   41, 128 },
        {   62, 128 },
        {   82, 128 },
        {  103, 128 },
        {  124, 129 },
        {  885, 128 },
        { 1023, 128 }
        },
#else
        {   40, 128 }, // Calibration Table 0
        {   80, 128 },
        {  124, 128 },
        {  586, 128 },
        {  661, 128 },
        {  736, 128 },
        {  885, 128 },
        { 1023, 128 }
        },
#endif
      {// arfcn, tx_chan_cal
        {   21, 128 }, // Calibration Table 1
        {   41, 128 },
        {   62, 128 },
        {   82, 128 },
        {  103, 128 },
        {  124, 128 },
        {  885, 128 },
        { 1023, 128 }
        },
      {// arfcn, tx_chan_cal
        {   21, 128 }, // Calibration Table 2
        {   41, 128 },
        {   62, 128 },
        {   82, 128 },
        {  103, 128 },
        {  124, 128 },
        {  885, 128 },
        { 1023, 128 }
        },
      {// arfcn, tx_chan_cal
        {   21, 128 }, // Calibration Table 3
        {   41, 128 },
        {   62, 128 },
        {   82, 128 },
        {  103, 128 },
        {  124, 128 },
        {  885, 128 },
        { 1023, 128 }
      }
    },
    { // GSM Power Ramp Values
#if (PA == 3)  // Hitachi
     {
      {// Ramp-Up      #0 profile - Power Level 5
        0,0,6,0,11,7,1,0,0,11,0,26,23,22,16,5 
      },
      {// Ramp-Down    #0 profile
        0,5,7,16,26,24,30,6,0,14,0,0,0,0,0,0
      },
     },
     {
      {// Ramp-Up      #1 profile - Power Level 6
        0,4,8,0,0,0,25,0,0,0,0,17,30,19,25,0
      },
      {// Ramp-Down    #1 profile
        0,7,19,24,28,25,23,2,0,0,0,0,0,0,0,0
      },
     },
     {
      {// Ramp-Up      #2 profile - Power Level 7
        0,4,8,0,0,0,25,0,0,0,0,17,30,19,25,0
      },
      {// Ramp-Down    #2 profile
        0,7,19,24,28,25,23,2,0,0,0,0,0,0,0,0
      },
     },
     {
      {// Ramp-Up      #3 profile - Power Level 8
        5,9,11,3,0,4,16,0,1,0,0,7,18,24,12,18
      },
      {// Ramp-Down    #3 profile
        0,9,16,23,23,21,18,9,3,2,0,0,0,2,1,1
      },
     },
     {
      {// Ramp-Up      #4 profile - Power Level 9
        5,0,18,17,0,8,0,0,0,3,0,14,21,21,15,6
      },
      {// Ramp-Down    #4 profile
        0,8,12,31,24,20,19,7,4,2,1,0,0,0,0,0
      },
     },
     {
      {// Ramp-Up      #5 profile - Power Level 10
        5,10,11,20,0,7,0,0,14,0,0,0,15,17,22,7
      },
      {// Ramp-Down    #5 profile
        0,7,17,24,27,20,18,11,4,0,0,0,0,0,0,0
      },
     },
     {
      {// Ramp-Up      #6 profile - Power Level 11
        0,11,1,8,30,0,0,0,0,28,0,1,14,14,12,9
      },
      {// Ramp-Down    #6 profile
        0,7,16,19,27,26,19,7,4,2,1,0,0,0,0,0
      },
     },
     {
      {// Ramp-Up      #7 profile - Power Level 12
        0,0,12,0,2,0,21,26,0,0,0,24,9,3,20,11
      },
      {// Ramp-Down    #7 profile
        0,6,17,21,28,23,19,7,4,2,1,0,0,0,0,0
      },
     },
     {
      {// Ramp-Up      #8 profile - Power Level 13
        5,0,0,26,31,16,0,0,0,0,0,0,0,31,13,6
      },
      {// Ramp-Down    #8 profile
        0,15,14,20,22,24,19,9,2,2,1,0,0,0,0,0
      },
     },
     {
      {// Ramp-Up      #9 profile - Power Level 14
        5,10,9,0,4,3,10,10,23,2,7,13,4,12,11,5
      },
      {// Ramp-Down    #9 profile
        0,4,19,28,24,20,19,7,4,2,1,0,0,0,0,0
      },
     },
     {
      {// Ramp-Up      #10 profile - Power Level 15
        5,0,10,9,4,4,12,13,14,15,19,13,7,2,1,0
      },
      {// Ramp-Down    #10 profile
        0,3,18,29,25,20,19,7,4,2,1,0,0,0,0,0
      },
     },
     {
      {// Ramp-Up      #11 profile - Power Level 16
        5,10,9,6,14,7,13,11,13,10,15,5,4,2,4,0
      },
      {// Ramp-Down    #11 profile
        0,0,13,24,31,27,19,7,4,2,1,0,0,0,0,0
      },
     },
     {
      {// Ramp-Up      #12 profile - Power Level 17
        5,10,9,11,15,6,13,9,19,31,0,0,0,0,0,0
      },
      {// Ramp-Down    #12 profile
        0,0,4,31,31,29,19,7,4,2,1,0,0,0,0,0
      },
     },
     {
      {// Ramp-Up      #13 profile - Power Level 18
        5,10,9,9,6,27,31,31,0,0,0,0,0,0,0,0
      },
      {// Ramp-Down    #13 profile
        0,0,4,31,29,25,25,7,4,2,1,0,0,0,0,0
      },
     },
     {
      {// Ramp-Up      #14 profile - Power Level 19
        5,10,20,31,31,31,0,0,0,0,0,0,0,0,0,0
      },
      {// Ramp-Down    #14 profile
        0,0,2,27,31,30,24,7,4,2,1,0,0,0,0,0
      },
     },
     {
      {// Ramp-Up      #15 profile - Power Level 19
        5,10,20,31,31,31,0,0,0,0,0,0,0,0,0,0
      },
      {// Ramp-Down    #15 profile
        0,0,2,27,31,30,24,7,4,2,1,0,0,0,0,0
      },
     },
    },
#else
{ { 0,0,0,17,0,0,0,0,0,11,31,31,31,7,0,0  },        // Ramp-Up       #0 profile - Power Level 5
{   0,18,31,31,31,17,0,0,0,0,0,0,0,0,0,0  }, },     // Ramp-Down   #0 profile
{ { 0,0,0,0,6,17,0,0,0,0,30,31,25,9,10,0  },        // Ramp-Up       #0 profile - Power Level 6
{   0,19,23,26,31,15,0,14,0,0,0,0,0,0,0,0  }, },    // Ramp-Down  #0 profile
{ { 0,0,0,0,25,0,0,0,0,10,31,31,31,0,0,0  },        // Ramp-Up        #0 profile - Power Level 7
{   0,31,31,31,31,4,0,0,0,0,0,0,0,0,0,0  }, },      // Ramp-Down     # profile
{ { 0,0,0,0,10,17,0,0,0,7,31,31,31,1,0,0  },        // Ramp-Up       #0 profile - Power Level 8
{   0,31,31,31,31,4,0,0,0,0,0,0,0,0,0,0  }, },      // Ramp-Down   #0 profile
{ { 0,0,0,0,28,0,0,0,0,7,31,31,31,0,0,0  },         // Ramp-Up       #0 profile - Power Level 9
{   0,31,31,31,31,4,0,0,0,0,0,0,0,0,0,0  }, },      // Ramp-Down   #0 profile
{ { 0,0,0,0,11,0,31,0,0,0,12,31,31,12,0,0  },      // Ramp-Up       #0 profile - Power Level 10
{   0,31,31,31,31,4,0,0,0,0,0,0,0,0,0,0  }, },      // Ramp-Down   #0 profile
{ { 0,0,0,31,0,0,18,0,0,9,23,30,17,0,0,0  },         // Ramp-Up       #0 profile - Power Level 11
{   0,31,31,31,31,4,0,0,0,0,0,0,0,0,0,0  }, },       // Ramp-Down   #0 profile
{ { 0,0,31,0,0,0,19,0,0,0,19,31,23,5,0,0  },         // Ramp-Up      #0 profile - Power Level 12
{   0,31,31,31,21,14,0,0,0,0,0,0,0,0,0,0  }, },     // Ramp-Down    #0 profile
{ { 0,0,0,0,0,0,31,25,0,0,14,9,31,18,0,0  },        // Ramp-Up       #0 profile - Power Level 13
{   0,0,31,31,31,31,4,0,0,0,0,0,0,0,0,0  }, },     // Ramp-Down     #0 profile
{ { 0,0,4,31,0,0,0,0,31,31,0,22,9,0,0,0  },         // Ramp-Up        #0 profile - Power Level 14
{   0,0,31,31,31,31,4,0,0,0,0,0,0,0,0,0  }, },     // Ramp-Down     #0 profile
{ { 0,0,0,0,31,5,0,11,31,31,0,19,0,0,0,0  },        // Ramp-Up      #0 profile - Power Level 15
{   0,0,31,31,31,31,4,0,0,0,0,0,0,0,0,0  }, },     // Ramp-Down     #0 profile
{ { 0,0,0,0,0,0,0,31,31,31,31,4,0,0,0,0  },        // Ramp-Up       #0 profile - Power Level 16
{   0,0,31,31,31,31,4,0,0,0,0,0,0,0,0,0  }, },    // Ramp-Down    #0 profile
{ { 0,0,0,0,0,4,31,31,31,31,0,0,0,0,0,0  },        // Ramp-Up       #0 profile - Power Level 17
{   0,0,31,31,31,31,4,0,0,0,0,0,0,0,0,0  }, },    // Ramp-Down    #0 profile
{ { 0,0,0,0,0,31,31,31,31,4,0,0,0,0,0,0  },        // Ramp-Up       #0 profile - Power Level 18
{   0,0,31,31,31,31,4,0,0,0,0,0,0,0,0,0  }, },    // Ramp-Down    #0 profile
{ { 0,0,0,0,4,31,31,31,31,0,0,0,0,0,0,0  },        // Ramp-Up       #0 profile - Power Level 19
{   0,0,31,31,31,31,4,0,0,0,0,0,0,0,0,0  } } },    // Ramp-Down    #0 profile
#endif
    { //TX temperature compensation
      #if (ORDER2_TX_TEMP_CAL==1)
      { -11,  0,  0,  0 },
      {  +9,  0,  0,  0 },
      { +39,  0,  0,  0 },
      { +59,  0,  0,  0 },
      { 127,  0,  0,  0 }
      #else
      { -11,  0 },
      {  +9,  0 },
      { +39,  0 },
      { +59,  0 },
      { 127,  0 }
      #endif
    },
  },
  //IQ swap
  SWAP_IQ_GSM,
};

const T_RF_BAND rf_1800 =
{
  { //RX structure
    { //T_RX_CAL_PARAMS rx_cal_params
      188,      //g_magic
       40,      //lna gain * 2
       40,      //lna_th_high
       44       //lna_th_low
    },
    { //T_RF_AGC_BAND   agc_bands[RF_RX_CAL_CHAN_SIZE];
     /*--------------*/
     /*-- DCS band --*/
     /*--------------*/
      { 548,  0},     //
      { 622,  0},     //
      { 680,  0},     //
      { 745,  0},     //
      { 812,  0},     //
      { 860,  0},     //
      { 885,  0},     //
      { 991,  0},     //
      { 992,  0},     //
      {1023,  0},     //
    },
    { //RX temperature compensation
      { -15 ,  0  },
      {  -5 ,  0  },
      {   6 ,  0  },
      {  16 ,  0  },
      {  25 ,  0  },
      {  35 ,  0  },
      {  45 ,  0  },
      {  56 ,  0  },
      {  66 ,  0  },
      {  75 ,  0  },
      { 100 ,  0  }
    }
  },
  { //TX structure
    {// dcs1800 T_LEVEL_TX
#if (PA == 3)  // Hitachi
    {720, 0, 0}, // 0 Highest power
    {637, 1, 0}, // 1
    {570, 2, 0}, // 2
    {470, 3, 1}, // 3
    {390, 4, 1}, // 4
    {328, 5, 1}, // 5
    {277, 6, 1}, // 6
    {238, 7, 1}, // 7
    {205, 8, 2}, // 8
    {178, 9, 2}, // 9
    {158, 10, 2}, // 10
    {140, 11, 2}, // 11
    {133, 12, 2}, // 12
    {125, 13, 3}, // 13
    {118, 14, 3}, // 14
    {114, 15, 3}, // 15 Lowest power
    {61, 15, 0}, // 16
    {61, 15, 0}, // 17
    {61, 15, 0}, // 18
    {61, 15, 0}, // 19
    {61, 15, 0}, // 20
    {61, 15, 0}, // 21
    {61, 15, 0}, // 22
    {61, 15, 0}, // 23    {61, 15, 0}, // 24
    {61, 15, 0}, // 25
    {61, 15, 0}, // 26
    {61, 15, 0}, // 27
    {61, 15, 0}, // 28
    {750, 0, 0}, // 29 Highest power
    {750, 0, 0}, // 30 Highest power
    {750, 0, 0}, // 31 Highest power
#else
      { 918, 0, 0  }, // 0 Highest power
      { 616, 1, 0  }, // 1

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?