tcmu30311.c
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:126k
- #include <gendef.h> /* Generic Definitions system wide */
- #include <osp.h>
- #include <i2c.h> /* For I2C communication with the NIM */
- #include <dmd.h> /* Macros, protos for demodulator interface */
- #include "tcmu30311.h"
- #define SUCCESS RETOK
- #define FAILURE RETFIAL1
- static UINT32 i2c_dmd_handle; /* stv0297 i2c handle */
- static UINT32 i2c_pll_handle; /* tuner i2c handle */
- static INT32 count;
- static UINT32 InputQAMSize_MODE=64;
- static float InputFrequency ; //Unit MHz 400.MHz
- static UINT32 InputSR ; //Unit KHz SR = 6.5Msps -> 6500
- static INT32 InputQAMSize; // 16,32,64,128,256
- static KB_DMDModulation qam_mode;
- static INT32 _ExtClk; /* MasterClock */
- static FLAG_SAM RegTrigger;
- static INT32 RegNbI2cAccess;
- static FLAG_SAM RegTracking;
- static INT32 RegQAMSize;
- static INT32 RegSymbolRate;
- static FLAG_SAM Driv0297DataLost;
- static FLAG_SAM Driv0297DataLocked;
- static SIGNAL Driv0297Signal;
- static REGISTER RegMap [NBREG];
- static FIELD FieldMap[NBFIELD];
- static KB_DMDTunerParameters *TransponderCopy = NULL;
- #define QAM0297 0x00000297
- #define Tuner_Samsung 0x00030311
- #define Tuner_Thomson 0x00008722
- #define QAM0297_Revision 0x20
- #define Sysclk 57840000 //STV0297系统时钟频率
- UINT32 SAMSignalVAGC(void);
- #define TUNER_PRINT_DEBUG 0
- UINT16 EXT_CLK=2880;
- static UINT32 SAMReadReg(UINT32 whichReg);
- int CheckInversion(void);
- /******************************************
- **函数名:SAMInit
- **输入: 无
- **输出: 无
- **功能: 初始化TCMU30311
- ********************************************/
- void SAMInit(KB_DMDTunerParameters *pParam)
- {
- TransponderCopy = pParam;
- QAM_Init();
- }
- UINT16 RegGetAGC2(void)
- {
- UINT16 val=0;
- val = RegGetField(AGC2SD_LO);
- val += RegGetField(AGC2SD_HI)<<8;
- return(val);
- }
- UINT32 SAMSignalVAGC(void)
- {
- UINT32 value=0;
- value=(unsigned short)(1000-(UINT16)RegGetAGC2()*1000/0x3ff);
- if(value>300) value-=10;
- else if((value<20)&&(SAMCheckLock()))
- value=(unsigned short)(RegGetAGC2()/8);
- value/=4;
- return(value);
- }
- struct SigMap_t2
- {
- int agc;
- int dbuv;
- } g_sigmap[78] =
- {
- {117 , 301},
- {118, 308},
- {120, 314},
- {122, 322},
- {124, 331},
- {127, 341},
- {130, 354},
- {131, 358},
- {133, 369},
- {135, 377},
- {136, 380},
- {138, 391},
- {140, 399},
- {141, 408},
- {143, 418},
- {145, 429},
- {147, 439},
- {149, 454},
- {150, 459},
- {152, 468},
- {154, 478},
- {155, 491},
- {157, 500},
- {160, 502},
- {164, 505},
- {168, 507},
- {170, 507},
- {173, 509},
- {176, 509},
- {177, 511},
- {178, 512},
- {179, 513},
- {180, 513},
- {185, 522},
- {187, 534},
- {189, 544},
- {190, 557},
- {191, 563},
- {192, 583},
- {193, 593},
- {194, 611},
- {195, 628},
- {196, 649},
- {197, 663},
- {198, 678},
- {199, 687},
- {200, 701},
- {201, 711},
- {202, 731},
- {203, 740},
- {204, 751},
- {206, 764},
- {207, 770},
- {208, 780},
- {209, 789},
- {211, 802},
- {213, 811},
- {215, 820},
- {216, 830},
- {218, 839},
- {221, 851},
- {224, 865},
- {225, 871},
- {227, 880},
- {229, 890},
- {231, 902},
- {233, 912},
- {234, 920},
- {236, 930},
- {237, 942},
- {238, 951},
- {240, 966},
- {241, 971},
- {242, 980},
- {243, 991},
- {245, 1001},
- {246, 1011},
- {247, 1021},
- };
- //在要获取信号电平时先调用SAMSignalVAGC(),然后将返回直带入下面函数
- //信号质量直接调用SAMReadNoise()
- INT32 QamagcToDbuv(UINT32 nQamagc)
- {
- int ret = 0;
- int i;
- for(i = 0;i< 78;i++)
- {
- if(g_sigmap[i].agc >= nQamagc)
- {
- ret = g_sigmap[i].dbuv;
- break;
- }
- }
-
- return ret;
- }
- /******************************************
- **函数名:SAMCalSAMlateVAFC
- **输入: 无
- **输出: 频偏KHz
- **功能: 在载波恢复时计算频偏
- ********************************************/
- INT32 SAMCalSAMlateVAFC(void)
- {
- INT32 temp;
- SAMWriteReg(STV_CRL_11,0xff);
- temp = SAMReadReg(STV_CRL_6);
- temp += SAMReadReg(STV_CRL_7)<<8;
- temp += SAMReadReg(STV_CRL_8)<<16;
- temp += (SAMReadReg(STV_CRL_9)& 0x0f)<<24;
- if (temp >= 0x08000000)
- {
- temp -= 0x10000000 ; // 0x10000000 = 2**28
- }
- temp /= 2684354L ; // (2**28)/100 = 268435456/100
- return(temp);
- }
- UINT32 SAMReadBER(void)
- {
- UINT16 _ErrMode=0,err_hi0, err_lo0 , err_hi1 , err_lo1 ;
- UINT16 BER ;
- INT32 int_tmp,powt;
- float double_tmp ;
- UINT32 NByte ;
- UINT8 times=0,Trackinglock=0;
- UINT32 BlocksBertBER ;
-
- RegSetField(NBYTE,4);
-
- while((times<10)&&(Trackinglock==0))
- {
- Trackinglock += RegGetField(SYNCSTATE) ;
- times++;
- }
-
- if(Trackinglock==0)
- {
- return(99999999);
- }
- err_hi0 = RegGetField(ERRCOUNT_HI) ;
- err_lo0 = RegGetField(ERRCOUNT_LO) ;
- err_hi1 = RegGetField(ERRCOUNT_HI) ;
- err_lo1 = RegGetField(ERRCOUNT_LO) ;
- if(err_hi0 == err_hi1)
- BER = err_lo0 + (err_hi0 <<8) ;
- else
- BER = err_lo1 + (err_hi1 <<8) ;
- if(_ErrMode == 0)
- {
- if(RegGetField(BERT_ON) == 0)
- {
- double_tmp = (float)BER ;
- int_tmp = RegGetField(NBYTE) ;
- NByte=1;powt=0;
- while(powt<2*int_tmp + 12)
- {
- NByte=NByte*2;
- powt++;
- }
-
- if(RegGetField(ERR_SOURCE) == 0)
- {
- double_tmp /= (8*NByte) ;
- }
- else
- {
- double_tmp /= NByte ;
- }
- BlocksBertBER = double_tmp*1000000000 ;
- RegSetField(BERT_ON,1) ;
- }
- if(SAMSignalVAGC()<44)
- BlocksBertBER=78000000;
- return (BlocksBertBER);
-
- }
- return (BlocksBertBER);
- }
- UINT32 SAMReadNoise(void)
- {UINT32 NoiseVal;/*Add ,TestNoiseVal the testing function*/
- NoiseVal=SAMReadReg(STV_EQU_8);
- NoiseVal=NoiseVal<<8;
- //TestNoiseVal=SAMReadReg(STV_EQU_7);
- NoiseVal|=(SAMReadReg(STV_EQU_7)&0xff);
- //Print("The output signal quality is %ld %xn",TestNoiseVal,NoiseVal);
- //Print("The output signal quality is %ldn",NoiseVal);
-
- if(NoiseVal>12000)
- NoiseVal=12000;
- if(NoiseVal<6000)
- NoiseVal=6000;
- NoiseVal=12000-NoiseVal;
- NoiseVal/=60;
- //Print("The output signal quality is %ldn",NoiseVal);
- return NoiseVal;
-
- }
- int Driv_RF_Level[101];
- void init_RF_Level(void)
- {
- Driv_RF_Level[99] = 0;
- Driv_RF_Level[98] = 15;
- Driv_RF_Level[97] = 30;
- Driv_RF_Level[96] = 44;
- Driv_RF_Level[95] = 57;
- Driv_RF_Level[94] = 70;
- Driv_RF_Level[93] = 83;
- Driv_RF_Level[92] = 94;
- Driv_RF_Level[91] = 105;
- Driv_RF_Level[90] = 115;
- Driv_RF_Level[89] = 125;
- Driv_RF_Level[88] = 134;
- Driv_RF_Level[87] = 143;
- Driv_RF_Level[86] = 152;
- Driv_RF_Level[85] = 160;
- Driv_RF_Level[84] = 169;
- Driv_RF_Level[83] = 177;
- Driv_RF_Level[82] = 184;
- Driv_RF_Level[81] = 191;
- Driv_RF_Level[80] = 198;
- Driv_RF_Level[79] = 205;
- Driv_RF_Level[78] = 213;
- Driv_RF_Level[77] = 221;
- Driv_RF_Level[76] = 229;
- Driv_RF_Level[75] = 236;
- Driv_RF_Level[74] = 243;
- Driv_RF_Level[73] = 250;
- Driv_RF_Level[72] = 256;
- Driv_RF_Level[71] = 263;
- Driv_RF_Level[70] = 269;
- Driv_RF_Level[69] = 275;
- Driv_RF_Level[68] = 282;
- Driv_RF_Level[67] = 289;
- Driv_RF_Level[66] = 296;
- Driv_RF_Level[65] = 302;
- Driv_RF_Level[64] = 308;
- Driv_RF_Level[63] = 314;
- Driv_RF_Level[62] = 320;
- Driv_RF_Level[61] = 325;
- Driv_RF_Level[60] = 330;
- Driv_RF_Level[59] = 335;
- Driv_RF_Level[58] = 339;
- Driv_RF_Level[57] = 344;
- Driv_RF_Level[56] = 348;
- Driv_RF_Level[55] = 352;
- Driv_RF_Level[54] = 356;
- Driv_RF_Level[53] = 360;
- Driv_RF_Level[52] = 364;
- Driv_RF_Level[51] = 368;
- Driv_RF_Level[50] = 372;
- Driv_RF_Level[49] = 375;
- Driv_RF_Level[48] = 378;
- Driv_RF_Level[47] = 381;
- Driv_RF_Level[46] = 384;
- Driv_RF_Level[45] = 387;
- Driv_RF_Level[44] = 390;
- Driv_RF_Level[43] = 392;
- Driv_RF_Level[42] = 395;
- Driv_RF_Level[41] = 397;
- Driv_RF_Level[40] = 400;
- Driv_RF_Level[39] = 402;
- Driv_RF_Level[38] = 405;
- Driv_RF_Level[37] = 408;
- Driv_RF_Level[36] = 411;
- Driv_RF_Level[35] = 414;
- Driv_RF_Level[34] = 417;
- Driv_RF_Level[33] = 420;
- Driv_RF_Level[32] = 423;
- Driv_RF_Level[31] = 426;
- Driv_RF_Level[30] = 429;
- Driv_RF_Level[29] = 432;
- Driv_RF_Level[28] = 435;
- Driv_RF_Level[27] = 438;
- Driv_RF_Level[26] = 441;
- Driv_RF_Level[25] = 444;
- Driv_RF_Level[24] = 455;
- Driv_RF_Level[23] = 465;
- Driv_RF_Level[22] = 480;
- Driv_RF_Level[21] = 500;
- Driv_RF_Level[20] = 520;
- Driv_RF_Level[19] = 540;
- Driv_RF_Level[18] = 560;
- Driv_RF_Level[17] = 580;
- Driv_RF_Level[16] = 600;
- Driv_RF_Level[15] = 620;
- Driv_RF_Level[14] = 640;
- Driv_RF_Level[13] = 660;
- Driv_RF_Level[12] = 680;
- Driv_RF_Level[11] = 700;
- Driv_RF_Level[10] = 720;
- Driv_RF_Level[9] = 740;
- Driv_RF_Level[8] = 760;
- Driv_RF_Level[7] = 780;
- Driv_RF_Level[6] = 805;
- Driv_RF_Level[5] = 830;
- Driv_RF_Level[4] = 855;
- Driv_RF_Level[3] = 880;
- Driv_RF_Level[2] = 910;
- Driv_RF_Level[1] = 950;
- Driv_RF_Level[0] = 1000;
-
- }
- /*{{{ Ber_counter ()*/
- int Ber_counter_counter = 0;
- int Ber_counter(void)
- {
- int iBer=0,iBerLow=0,iBerHigh=0;
- return -1;
- if(RegGetField( BERT_ON )==0)
- {
- iBerLow=RegGetField( ERRCOUNT_LO );
- iBerHigh=RegGetField( ERRCOUNT_HI );
- RegSetField( ERRCOUNT_LO,0x00 );
- RegSetField( ERRCOUNT_HI,0x00 );
- RegSetField( BERT_ON,1 );
- iBer=((iBerHigh&0x00ff)<<8 | (iBerLow&0x00ff))&0x0000ffff;
- Ber_counter_counter++;
- if(Ber_counter_counter>300)
- {
- Ber_counter_counter = 0;
- //RegSTV0297reset() ;
- // do_report_zmy(severity_info,"bern");
- //RegResetAfterDI() ;
- }
- return iBer;
- }
- else
- {
- return -1;
- }
- }
- /*{{{ End Ber_counter ()*/
- static int ber_count = 0;
- static char signal_count = 0;
- static int strengh[4];
- static int quality[4];
- void ResetSignalArray(void)
- {
- int i;
- for(i=0; i<4; i++)
- {
- strengh[i]=0;
- quality[i]=0;
- }
- signal_count = 0;
- }
- boolean Check_Signal_Strenth_Quality(int *Signal_Strengh,int *Signal_Quality)
- //int *Signal_BER_FixedPoint_Multiply_10,int *Signal_BER_Exponent)
- {
- int ber_count_temp = 0;
- int v_agc1,i;
- int cn_value;
- int *Signal_BER_FixedPoint_Multiply_10 = 0;
- int *Signal_BER_Exponent = 0;
- ber_count_temp = Ber_counter();
- if(ber_count_temp != -1)
- {
- ber_count=ber_count_temp;
- }
-
- if (0)
- {
- if(ber_count<1)
- {
- *Signal_BER_FixedPoint_Multiply_10 = 0;
- *Signal_BER_Exponent = -8;
- }
- else if(ber_count<10)
- {
- *Signal_BER_FixedPoint_Multiply_10 = ber_count*10;
- *Signal_BER_Exponent = -7;
- }
- else if(ber_count<83)
- {
- *Signal_BER_FixedPoint_Multiply_10 = (ber_count*100)/83;
- *Signal_BER_Exponent = -6;
- }
- else if(ber_count<838)
- {
- *Signal_BER_FixedPoint_Multiply_10 = (ber_count*100)/838;
- *Signal_BER_Exponent = -5;
- }
- else if(ber_count<8388)
- {
- *Signal_BER_FixedPoint_Multiply_10 = (ber_count*100)/8388;
- *Signal_BER_Exponent = -4;
- }
- else if(ber_count<83886)
- {
- *Signal_BER_FixedPoint_Multiply_10 = (ber_count*100)/83886;
- *Signal_BER_Exponent = -3;
- }
- else if(ber_count<838860)
- {
- *Signal_BER_FixedPoint_Multiply_10 = (ber_count*100)/838860;
- *Signal_BER_Exponent = -2;
- }
- else if(ber_count<8388608)
- {
- *Signal_BER_FixedPoint_Multiply_10 = (ber_count*100)/8388608;
- *Signal_BER_Exponent = -1;
- }
- }
- v_agc1=(RegGetField(AGC2SD_HI)<<8) + RegGetField(AGC2SD_LO);
-
- for(i=99;i>0;i--)
- {
- if(v_agc1<Driv_RF_Level[i])
- break;
- }
- if(v_agc1==0)
- {
- i=99;
- }
- printf("v_agc1 %d %dn",v_agc1,i);
- *Signal_Strengh=i;
- /*strengh[signal_count % 4] = i;
- if (signal_count>=4)
- *Signal_Strengh = (strengh[0]+strengh[1]+strengh[2]+strengh[3])/4;
- else
- *Signal_Strengh=i;*/
- cn_value=(RegGetField(NOISE_EST_HI)<<8) + RegGetField(NOISE_EST_LO);
- printf("v_agc1 %d %dn",v_agc1,cn_value);
-
- i = RegGetQAMSize() ;
-
- switch(i)
- {
- case 16:
- cn_value -= 1500;
- break;
- case 32:
- cn_value -= 2200;
- break;
- case 64:
- cn_value -= 2700;
- break;
- case 128:
- cn_value -= 3600;
- break;
- case 256:
- cn_value -= 5800;
- break;
- }
- if(cn_value<0)
- cn_value =0;
- else
- {
- if(cn_value>6500)
- cn_value = 6500;
- cn_value = 6500 - cn_value;
- cn_value= cn_value*100/6500;
- }
-
- if(cn_value>99)
- cn_value=99;
- *Signal_Quality = cn_value;
- /*quality[signal_count % 4] = cn_value;
- if (signal_count>=4)
- *Signal_Quality = (quality[0]+quality[1]+quality[2]+quality[3])/4;
- else
- *Signal_Quality = cn_value;
- signal_count++;*/
- //cn_value -= ((((cn_value << 7) * (rand() % 100)) / 100) >> 7 );
- //*Signal_Quality = 100 - ( 200000 - ((cn_value * 200000) / 100 ));
- return FALSE;
- }
- UINT32 SAMReadSCOffset(void)
- {
- return(0);
- }
- UINT8 SAMReadUncor(void)
- {
- return(0);
- }
- INT32 SAMCheckLock(void)
- {
- UINT32 status=0,temp=0;
- while((temp<200)&&(status<2))
- {status += ((SAMReadReg(STV_RS_DESC_15)&0x80)>>7);
- temp++;
- }
-
- if(status) //读取SYNC寄存器的FEL位为HIGH表明QAM锁定,为低没锁定
- {
- return (TRUE);
- }
- else
- {
- return (FALSE);
- }
- }
- void SAMReset(void)
- {
- SAMWriteReg(STV_CTRL_1,1);
- SAMWriteReg(STV_CTRL_1,0);
- }
- void SAMStopConnect(void)
- {
- SAMReset();
- }
- void SAMSetQAMMode(UINT8 qammode)
- {
- UINT8 agcref,lockthr,mseth,aref,mode,temp;
- mode=qammode;
- SAMWriteReg(STV_CTRL_9,0x7f);
- switch(mode)
- {
- case 1 : //SAM_QAM16
- SAMWriteReg(STV_EQU_0,0x08);
- SAMWriteReg(STV_EQU_1,0x58);
- SAMWriteReg(STV_STLOOP_3,0x04);
- SAMWriteReg(STV_DELAGC_7,0x60);
- SAMWriteReg(STV_WBAGC_11,0xe1);
- SAMWriteReg(STV_CRL_0,0x37);
- break;
- case 2 : //SAM_QAM32
- SAMWriteReg(STV_EQU_0,0x18);
- SAMWriteReg(STV_EQU_1,0x58);
- break;
- case 3 : //SAM_QAM64
- SAMWriteReg(STV_EQU_0,0x46);
- SAMWriteReg(STV_EQU_1,0x5a);
- break;
- case 4 : //SAM_QAM128
- SAMWriteReg(STV_EQU_0,0x28);
- SAMWriteReg(STV_EQU_1,0x58);
- SAMWriteReg(STV_WBAGC_11,0xfe);
- SAMWriteReg(STV_CRL_0,0x0d);
- SAMWriteReg(STV_CRL_1,0x4a);
- SAMWriteReg(STV_CRL_3,0x00);
- SAMWriteReg(STV_CRL_4,0x00);
- SAMWriteReg(STV_CRL_5,0x00);
- SAMWriteReg(STV_CRL_6,0x00);
- SAMWriteReg(STV_CRL_7,0xa5);
- SAMWriteReg(STV_CRL_8,0xf0);
- SAMWriteReg(STV_CRL_9,0x0f);
- break;
- case 5 : //SAM_QAM256
- SAMWriteReg(STV_EQU_0,0x38);
- SAMWriteReg(STV_EQU_1,0x58);
- SAMWriteReg(STV_WBAGC_11,0xff);
- SAMWriteReg(STV_CRL_0,0x0d);
- SAMWriteReg(STV_CRL_1,0x39);
- SAMWriteReg(STV_CRL_3,0x00);
- SAMWriteReg(STV_CRL_4,0x00);
- SAMWriteReg(STV_CRL_5,0x00);
- SAMWriteReg(STV_CRL_6,0x4c);
- SAMWriteReg(STV_CRL_7,0x7e);
- SAMWriteReg(STV_CRL_8,0xf6);
- SAMWriteReg(STV_CRL_9,0x0f);
- break;
- default :
- SAMWriteReg(STV_EQU_0,0x48);
- SAMWriteReg(STV_EQU_1,0x58);
- break;
- }
- }
- void SAMResetAll(void)
- {
- SAMWriteReg(STV_CTRL_0,1);
- SAMWriteReg(STV_CTRL_0,0);
- }
- static UINT32 SAMReadReg(UINT32 whichReg)
- {
- INT32 nret;
- UINT32 databyte=0;
- UINT8 sout[1];
- sout[0] =(UINT8)(whichReg);
- if(KB_I2CWriteWithStop(i2c_dmd_handle, 1, sout) == RETOK)
- {
- if(KB_I2CReadWithStop(i2c_dmd_handle, 1, sout) == RETOK)
- {
- databyte = (UINT32)sout[0];
- }
- }
- return(databyte);
- }
- INT32 SAMWriteReg( UINT32 whichReg,UINT32 writeValue)
- {
- INT32 nret;
- UINT8 sout[2];
- sout[0] = (UINT8)(whichReg);
- sout[1] = (UINT8)(writeValue);
-
- nret = KB_I2CWriteWithStop(i2c_dmd_handle, 2, sout);
- if (RETOK== nret)
- {
- return(SUCCESS);
- }
- else
- {
- Print("[tcmu30311.c] SAMWriteReg(): write demod register fail.");
- //printf("-=whichReg=0x%x, writeValue=0x%x=-n", whichReg, writeValue);
- return (FAILURE);
- }
- }
- INT32 SAMStartConnect(void)
- {
- UINT32 temp,i;
- FLAG_SAM fSam;
-
-
- FLAG_SAM InputSpectrumInverse = AUTO;
- STTBX_Print(("[tcmu30311.c] SAMStartConnect():Fre=%d, SR=%d, QAM=%d.n",
- TransponderCopy->frequency,
- TransponderCopy->details.qam.symbolRatekSs,
- TransponderCopy->details.qam.modulation));
-
- if((InputFrequency==(float)(TransponderCopy->frequency/1000)))
- if(InputSR==(UINT32)(TransponderCopy->details.qam.symbolRatekSs))
- if(qam_mode ==TransponderCopy->details.qam.modulation)
- if(SAMReadReg(STV_RS_DESC_15)&0x80)
- {
- STTBX_Print(("[tcmu30311.c] SAMStartConnect(): Locked 1 :)n"));
- return(TRUE);
- }
- InputFrequency=(float)(TransponderCopy->frequency/1000);
- InputSR=(UINT32)(TransponderCopy->details.qam.symbolRatekSs);
-
- if((InputFrequency == 0) || (InputSR == 0))
- {
- InputFrequency = 355;
- InputSR = 6875;
- }
- qam_mode = (TransponderCopy->details.qam.modulation);
- switch(qam_mode)
- {
- case QAM_16 : //SAM_QAM16
- InputQAMSize = 16;
- break;
- case QAM_32 : //SAM_QAM32
- InputQAMSize = 32;
- break;
-
- case QAM_64 : //SAM_QAM64
- InputQAMSize = 64;
- break;
-
- case QAM_128 : //SAM_QAM128
- InputQAMSize = 128;
- break;
- case QAM_256 : //SAM_QAM256
- InputQAMSize = 256;
- break;
-
- default :
- InputQAMSize = 64;
- break;
- }
- InputQAMSize_MODE=InputQAMSize;
- fSam = Acquisition(InputFrequency,InputSR,InputQAMSize,InputSpectrumInverse);
- if (fSam == YES)
- {
- CarrierStatusSetAcquisitionStatus();
- STTBX_Print(("[tcmu30311.c] SAMStartConnect(): Locked 2.n"));
- return(TRUE);
- }
-
- STTBX_Print(("[tcmu30311.c] SAMStartConnect(): unLocked.n"));
- return(FALSE);
- }
- UINT8 SAMRevision(void)
- {
- UINT8 Revision;
- Revision=SAMReadReg(STV_CTRL_0);
- return(Revision);
- }
- INT32 SAMSetTunerFrequency(UINT32 freq1)
- {
- UINT8 value_data,temp;
- UINT32 divide_rate,i,frequency;
- UINT8 byte[4];
-
- UINT16 m_cnt;
- float tuner_offset;
- UINT8 TunerS[6] ;
- frequency=(UINT32)(freq1*1000);
-
-
- if(frequency>860000 || frequency<50000 )
- { Print("nTuner frequency is %ldn",frequency);
- Print("Tuner frequency is ERROR!n");
- return(FALSE);
- }
-
- if((UINT16)EXT_CLK ==2880) /*Select thomson tuner*/
- {
- divide_rate=((frequency+36125)*10)/625;/*First_IF 36125 */
- byte[0] = (UINT8) ((divide_rate & 0x00007f00) >> 8);
- byte[1] = (UINT8) (divide_rate & 0x000000ff);
- byte[2] = 0x8e;
- if(frequency>=50000&&frequency<170000)
- {
- byte[3]=0x01; /* Tuner frequency is low band!*/
- }
- if(frequency>=170000&&frequency<468000)
- {
- byte[3]=0x02; /* Tuner frequency is mid band!*/
- }
- if(frequency>=468000&&frequency<=860000)
- {
- byte[3]=0x08; /* Tuner frequency is high band!*/
- }
- SAMWriteTunerReg(byte, IIC_TUNER_ADDRESS_TH);
- }
- else /*Select thomson tuner*/
- {
- tuner_offset =(float) 36.125; /*PAL MHz */
- if (freq1 < 171.) TunerS[5] = 0x01;/*P0 = 1until 48.25 and 168.25*/
- else if (freq1 < 468.) TunerS[5] = 0x02;/*P1 = 1 between 175.25 and 463.25*/
- else if (freq1 < 960.) TunerS[5] = 0x08;/*P3 = 1 between 471.25 and 855.25*/
- /* else QAMPrint("Out of frequency range for tunern");*/
- freq1 += tuner_offset;
- m_cnt = (UINT16)(16.0 * freq1);
- /* Compute tuner settings */
- TunerS[1] = IIC_TUNER_ADDRESS_SAM;
- TunerS[2] = (UINT8) 0x007f & (m_cnt >> 8);
- TunerS[3] = (UINT8) 0x00ff & m_cnt;
- TunerS[4] = (UINT8) 0x8E; /*TCMU30311PTB new version*/
- /* send this data */
- /*I2cReadWrite(WRITE,TunerS[1],&TunerS[2],4); */
- SAMWriteTunerReg(&TunerS[2], IIC_TUNER_ADDRESS_SAM);
-
- }
- }
- INT32 SAMWriteTunerReg(UINT8 *cont,UINT8 DEMOD_ADD)
- {
- //INT32 nret,temp;
- UINT8 sout[4];
- int i = 0;
- INT32 ret = RETFIAL1;
- //UINT8 i;
- sout[0] = cont[0];
- sout[1] = cont[1];
- sout[2] = cont[2];
- sout[3] = cont[3];
- while(i <= 3)
- {
- if(RETOK == KB_I2COpen(IIC_TUNER_ADDRESS_TH, &i2c_pll_handle))
- {
- SAMEnableIICTuner(); //打开TUNER的IIC
- ret = KB_I2CWriteWithStop(i2c_pll_handle, 4, sout);
- SAMDisableIICTuner(); //关闭TUNER的IIC
- if(ret == RETFIAL1)
- {
- i++;
- Print("[tcmu30311.c] SAMWriteTunerReg() :write to PLL. [%x] ================= n",i);
- }
- else
- {
- i = 10;
- }
- KB_I2CClose(i2c_pll_handle);
- }
- else
- {
- i ++;
- Print("+++++++++++++++++++++++++++++++++++++ error open iic pll n");
- }
- }
- return(SUCCESS);
- }
- void SAMEnableIICTuner(void)
- {
- SAMWriteReg(STV_CTRL_7, 0x78);
- SAMWriteReg(STV_CTRL_6, 0xc8);
- }
- void SAMDisableIICTuner(void)
- {
- UINT32 temp;
- temp = SAMReadReg(STV_CTRL_6);
- temp = (temp & 0x7f);
- SAMWriteReg(STV_CTRL_6,temp);
- }
- UINT8 FieldCreateMask(INT32 field)
- {
- INT32 i;
- UINT8 mask=0;
- for (i = 0; i < FieldMap[field].Bits; i++)
- {
- mask <<= 1 ;
- mask += 1 ;
- }
- mask = mask << FieldMap[field].Pos;
- return mask;
- }
- void RegSetOneRegister(INT32 reg_id, UINT8 Data)
- {
- SAMWriteReg(RegMap[reg_id].Addr,Data); //hcao
- RegMap[reg_id].Value=Data;
- return ;
- }
- INT32 RegGetOneRegister(INT32 reg_id)
- {
- RegMap[reg_id].Value=SAMReadReg(RegMap[reg_id].Addr);
- return(RegMap[reg_id].Value) ;
- }
- void FieldSetVal(INT32 field, INT32 fieldval)
- {
- INT32 value;
- FIELD *pfield;
- pfield=&(FieldMap[field]);
- if(pfield->Type == SIGNED)
- fieldval = (fieldval > 0 ) ? fieldval : fieldval + (1<<pfield->Bits);
- fieldval = pfield->Mask & (fieldval << pfield->Pos);
- RegMap[pfield->Reg].Value = (RegMap[pfield->Reg].Value & (~pfield->Mask)) + fieldval;
- }
- void RegSetField(INT32 field,INT32 value)
- {
- INT32 valread;
- FIELD *pfield;
- pfield=&(FieldMap[field]);
- RegGetOneRegister(pfield->Reg);
- FieldSetVal(field,value);
- RegSetOneRegister(pfield->Reg,RegMap[pfield->Reg].Value);
- }
- INT32 FieldGetVal(INT32 field)
- {
- INT32 value;
- FIELD *pfield;
- pfield=&(FieldMap[field]);
- value= RegMap[pfield->Reg].Value;
- value=(RegMap[pfield->Reg].Value & pfield->Mask) >> pfield->Pos;
- if((pfield->Type == SIGNED)&&(value>=(1<<(pfield->Bits-1))))
- value = value - (1<<pfield->Bits);
- return value;
- }
- INT32 RegGetField(INT32 field)
- {
- INT32 mask = 0,
- val=0;
- FIELD *pfield;
- pfield=&(FieldMap[field]);
- RegGetOneRegister(pfield->Reg);
- return FieldGetVal(field);
- }
- void QAM64_RegInit(void)
- {
- INT16 i;
- INT32 S32val;
- S32val = Driv0297Signal.QAMSize;
- /* EQU_0*/
- RegMap[EQU_0].Addr = 0x00 ;
- RegMap[EQU_0].Reset = 0x48 ;
- if(S32val == 16)
- RegMap[EQU_0].Reset = 0x08 ;
- if(S32val == 32)
- RegMap[EQU_0].Reset = 0x18 ;
- if(S32val == 64)
- RegMap[EQU_0].Value = 0x48 ;
- if(S32val == 128)
- RegMap[EQU_0].Value = 0x28 ;
- if(S32val == 256)
- RegMap[EQU_0].Value = 0x38 ;
- strcpy(RegMap[EQU_0].Name,"EQU_0") ;
- /* FIELDS*/
- strcpy(FieldMap[U_THRESHOLD].Name,"U_THRESHOLD") ;
- FieldMap[U_THRESHOLD].Reg = EQU_0 ;
- FieldMap[U_THRESHOLD].Pos = 0 ;
- FieldMap[U_THRESHOLD].Bits = 4 ;
- FieldMap[U_THRESHOLD].Type = UNSIGNED ;
- FieldMap[U_THRESHOLD].Mask = FieldCreateMask(U_THRESHOLD) ;
- strcpy(FieldMap[MODE_SELECT].Name,"MODE_SELECT") ;
- FieldMap[MODE_SELECT].Reg = EQU_0 ;
- FieldMap[MODE_SELECT].Pos = 4 ;
- FieldMap[MODE_SELECT].Bits = 3 ;
- FieldMap[MODE_SELECT].Type = UNSIGNED ;
- FieldMap[MODE_SELECT].Mask = FieldCreateMask(MODE_SELECT) ;
- /* EQU_1*/
- RegMap[EQU_1].Addr = 0x01 ;
- RegMap[EQU_1].Reset = 0x58 ;
- RegMap[EQU_1].Value = 0x69 ;
- strcpy(RegMap[EQU_1].Name,"EQU_1") ;
- /* FIELDS*/
- strcpy(FieldMap[BLIND_U].Name,"BLIND_U") ;
- FieldMap[BLIND_U].Reg = EQU_1 ;
- FieldMap[BLIND_U].Pos = 0 ;
- FieldMap[BLIND_U].Bits = 4 ;
- FieldMap[BLIND_U].Type = UNSIGNED ;
- FieldMap[BLIND_U].Mask = FieldCreateMask(BLIND_U) ;
- strcpy(FieldMap[INITIAL_U].Name,"INITIAL_U") ;
- FieldMap[INITIAL_U].Reg = EQU_1 ;
- FieldMap[INITIAL_U].Pos = 4 ;
- FieldMap[INITIAL_U].Bits = 4 ;
- FieldMap[INITIAL_U].Type = UNSIGNED ;
- FieldMap[INITIAL_U].Mask = FieldCreateMask(INITIAL_U) ;
- /* EQU_2*/
- RegMap[TST_EQU_2].Addr = 0x02 ;
- RegMap[TST_EQU_2].Reset = 0x00 ;
- RegMap[TST_EQU_2].Value = 0x00 ;
- strcpy(RegMap[TST_EQU_2].Name,"TEST:EQU_2") ;
- /* EQU_3*/
- RegMap[EQU_3].Addr = 0x03 ;
- RegMap[EQU_3].Reset = 0x00 ;
- RegMap[EQU_3].Value = 0x00 ;
- strcpy(RegMap[EQU_3].Name,"EQU_3") ;
- /* FIELDS*/
- strcpy(FieldMap[EQ_FSM_CTL].Name,"EQ_FSM_CTL") ;
- FieldMap[EQ_FSM_CTL].Reg = EQU_3 ;
- FieldMap[EQ_FSM_CTL].Pos = 0 ;
- FieldMap[EQ_FSM_CTL].Bits = 2 ;
- FieldMap[EQ_FSM_CTL].Type = UNSIGNED ;
- FieldMap[EQ_FSM_CTL].Mask = FieldCreateMask(EQ_FSM_CTL) ;
- /* FIELDS*/
- strcpy(FieldMap[EQ_COEFF_CTL].Name,"EQ_COEFF_CTL") ;
- FieldMap[EQ_COEFF_CTL].Reg = EQU_3 ;
- FieldMap[EQ_COEFF_CTL].Pos = 2 ;
- FieldMap[EQ_COEFF_CTL].Bits = 2 ;
- FieldMap[EQ_COEFF_CTL].Type = UNSIGNED ;
- FieldMap[EQ_COEFF_CTL].Mask = FieldCreateMask(EQ_COEFF_CTL) ;
- /* EQU_4*/
- RegMap[EQU_4].Addr = 0x04 ;
- RegMap[EQU_4].Reset = 0x00 ;
- RegMap[EQU_4].Value = 0x00 ;
- strcpy(RegMap[EQU_4].Name,"EQU_4") ;
- /* FIELDS*/
- strcpy(FieldMap[NBLIND].Name,"NBLIND") ;
- FieldMap[NBLIND].Reg = EQU_4 ;
- FieldMap[NBLIND].Pos = 0 ;
- FieldMap[NBLIND].Bits = 1 ;
- FieldMap[NBLIND].Type = UNSIGNED ;
- FieldMap[NBLIND].Mask = FieldCreateMask(NBLIND) ;
- /* EQU_7*/
- RegMap[EQU_7].Addr = 0x07 ;
- RegMap[EQU_7].Reset = 0x00 ;
- RegMap[EQU_7].Value = 0x00 ;
- strcpy(RegMap[EQU_7].Name,"EQU_7") ;
- /* FIELDS*/
- strcpy(FieldMap[NOISE_EST_LO].Name,"NOISE_EST_LO") ;
- FieldMap[NOISE_EST_LO].Reg = EQU_7 ;
- FieldMap[NOISE_EST_LO].Pos = 0 ;
- FieldMap[NOISE_EST_LO].Bits = 8 ;
- FieldMap[NOISE_EST_LO].Type = UNSIGNED ;
- FieldMap[NOISE_EST_LO].Mask = FieldCreateMask(NOISE_EST_LO) ;
- /* EQU_8*/
- RegMap[EQU_8].Addr = 0x08 ;
- RegMap[EQU_8].Reset = 0x00 ;
- RegMap[EQU_8].Value = 0x00 ;
- strcpy(RegMap[EQU_8].Name,"EQU_8") ;
- /* FIELDS*/
- strcpy(FieldMap[NOISE_EST_HI].Name,"NOISE_EST_HI") ;
- FieldMap[NOISE_EST_HI].Reg = EQU_8 ;
- FieldMap[NOISE_EST_HI].Pos = 0 ;
- FieldMap[NOISE_EST_HI].Bits = 8 ;
- FieldMap[NOISE_EST_HI].Type = UNSIGNED ;
- FieldMap[NOISE_EST_HI].Mask = FieldCreateMask(NOISE_EST_HI) ;
- /* INITDEM_0*/
- RegMap[INITDEM_0].Addr = 0x20 ;
- RegMap[INITDEM_0].Reset = 0x00 ;
- RegMap[INITDEM_0].Value = 0x00 ;
- strcpy(RegMap[INITDEM_0].Name,"INITDEM_0") ;
- /* FIELDS*/
- strcpy(FieldMap[DEM_FQCY_LO].Name,"DEM_FQCY_LO") ;
- FieldMap[DEM_FQCY_LO].Reg = INITDEM_0 ;
- FieldMap[DEM_FQCY_LO].Pos = 0 ;
- FieldMap[DEM_FQCY_LO].Bits = 8 ;
- FieldMap[DEM_FQCY_LO].Type = UNSIGNED ;
- FieldMap[DEM_FQCY_LO].Mask = FieldCreateMask(DEM_FQCY_LO) ;
- /* INITDEM_1*/
- RegMap[INITDEM_1].Addr = 0x21 ;
- RegMap[INITDEM_1].Reset = 0x40 ;
- RegMap[INITDEM_1].Value = 0x00 ;
- strcpy(RegMap[INITDEM_1].Name,"INITDEM_1") ;
- /* FIELDS*/
- strcpy(FieldMap[DEM_FQCY_HI].Name,"DEM_FQCY_HI") ;
- FieldMap[DEM_FQCY_HI].Reg = INITDEM_1 ;
- FieldMap[DEM_FQCY_HI].Pos = 0 ;
- FieldMap[DEM_FQCY_HI].Bits = 8 ;
- FieldMap[DEM_FQCY_HI].Type = UNSIGNED ;
- FieldMap[DEM_FQCY_HI].Mask = FieldCreateMask(DEM_FQCY_HI) ;
- FieldMap[DEM_FQCY_LO].Mask = FieldCreateMask(DEM_FQCY_LO) ;
- /* INITDEM_2*/
- RegMap[INITDEM_2].Addr = 0x22 ;
- RegMap[INITDEM_2].Reset = 0x00 ;
- RegMap[INITDEM_2].Value = 0x00 ;
- strcpy(RegMap[INITDEM_2].Name,"INITDEM_2") ;
- /* FIELDS*/
- strcpy(FieldMap[LATENCY].Name,"LATENCY") ;
- FieldMap[LATENCY].Reg = INITDEM_2 ;
- FieldMap[LATENCY].Pos = 0 ;
- FieldMap[LATENCY].Bits = 8 ;
- FieldMap[LATENCY].Type = UNSIGNED ;
- FieldMap[LATENCY].Mask = FieldCreateMask(LATENCY) ;
- /* INITDEM_3*/
- RegMap[INITDEM_3].Addr = 0x23 ;
- RegMap[INITDEM_3].Reset = 0x00 ;
- RegMap[INITDEM_3].Value = 0x00 ;
- strcpy(RegMap[INITDEM_3].Name,"INITDEM_3") ;
- /* FIELDS*/
- strcpy(FieldMap[SCAN_STEP_LO].Name,"SCAN_STEP_LO") ;
- FieldMap[SCAN_STEP_LO].Reg = INITDEM_3 ;
- FieldMap[SCAN_STEP_LO].Pos = 0 ;
- FieldMap[SCAN_STEP_LO].Bits = 8 ;
- FieldMap[SCAN_STEP_LO].Type = UNSIGNED ;
- FieldMap[SCAN_STEP_LO].Mask = FieldCreateMask(SCAN_STEP_LO) ;
- /* INITDEM_4*/
- RegMap[INITDEM_4].Addr = 0x24 ;
- RegMap[INITDEM_4].Reset = 0x40 ;
- RegMap[INITDEM_4].Value = 0x40 ;
- strcpy(RegMap[INITDEM_4].Name,"INITDEM_4") ;
- /* FIELDS*/
- strcpy(FieldMap[CHSCANITEN].Name,"CHSCANITEN") ;
- FieldMap[CHSCANITEN].Reg = INITDEM_4 ;
- FieldMap[CHSCANITEN].Pos = 7 ;
- FieldMap[CHSCANITEN].Bits = 1 ;
- FieldMap[CHSCANITEN].Type = UNSIGNED ;
- FieldMap[CHSCANITEN].Mask = FieldCreateMask(CHSCANITEN) ;
- /* FIELDS*/
- strcpy(FieldMap[CHSCANITSOFT].Name,"CHSCANITSOFT") ;
- FieldMap[CHSCANITSOFT].Reg = INITDEM_4 ;
- FieldMap[CHSCANITSOFT].Pos = 6 ;
- FieldMap[CHSCANITSOFT].Bits = 1 ;
- FieldMap[CHSCANITSOFT].Type = UNSIGNED ;
- FieldMap[CHSCANITSOFT].Mask = FieldCreateMask(CHSCANITSOFT) ;
- /* FIELDS*/
- strcpy(FieldMap[SCAN_STEP_HI].Name,"SCAN_STEP_HI") ;
- FieldMap[SCAN_STEP_HI].Reg = INITDEM_4 ;
- FieldMap[SCAN_STEP_HI].Pos = 0 ;
- FieldMap[SCAN_STEP_HI].Bits = 6 ;
- FieldMap[SCAN_STEP_HI].Type = UNSIGNED ;
- FieldMap[SCAN_STEP_HI].Mask = FieldCreateMask(SCAN_STEP_HI) ;
- /* INITDEM_5*/
- RegMap[INITDEM_5].Addr = 0x25 ;
- RegMap[INITDEM_5].Reset = 0x88 ;
- RegMap[INITDEM_5].Value = 0x08 ;
- strcpy(RegMap[INITDEM_5].Name,"INITDEM_5") ;
- /* FIELDS*/
- strcpy(FieldMap[IN_DEMOD_EN].Name,"IN_DEMOD_EN") ;
- FieldMap[IN_DEMOD_EN].Reg = INITDEM_5 ;
- FieldMap[IN_DEMOD_EN].Pos = 7 ;
- FieldMap[IN_DEMOD_EN].Bits = 1 ;
- FieldMap[IN_DEMOD_EN].Type = UNSIGNED ;
- FieldMap[IN_DEMOD_EN].Mask = FieldCreateMask(IN_DEMOD_EN) ;
- /* FIELDS*/
- strcpy(FieldMap[SCAN_ON].Name,"SCAN_ON") ;
- FieldMap[SCAN_ON].Reg = INITDEM_5 ;
- FieldMap[SCAN_ON].Pos = 6 ;
- FieldMap[SCAN_ON].Bits = 1 ;
- FieldMap[SCAN_ON].Type = UNSIGNED ;
- FieldMap[SCAN_ON].Mask = FieldCreateMask(SCAN_ON) ;
- /* FIELDS*/
- strcpy(FieldMap[AUTOSTOP].Name,"AUTOSTOP") ;
- FieldMap[AUTOSTOP].Reg = INITDEM_5 ;
- FieldMap[AUTOSTOP].Pos = 5 ;
- FieldMap[AUTOSTOP].Bits = 1 ;
- FieldMap[AUTOSTOP].Type = UNSIGNED ;
- FieldMap[AUTOSTOP].Mask = FieldCreateMask(AUTOSTOP) ;
- /* FIELDS*/
- strcpy(FieldMap[SCALE_A].Name,"SCALE_A") ;
- FieldMap[SCALE_A].Reg = INITDEM_5 ;
- FieldMap[SCALE_A].Pos = 4 ;
- FieldMap[SCALE_A].Bits = 1 ;
- FieldMap[SCALE_A].Type = UNSIGNED ;
- FieldMap[SCALE_A].Mask = FieldCreateMask(SCALE_A) ;
- /* FIELDS*/
- strcpy(FieldMap[SCALE_B].Name,"SCALE_B") ;
- FieldMap[SCALE_B].Reg = INITDEM_5 ;
- FieldMap[SCALE_B].Pos = 2 ;
- FieldMap[SCALE_B].Bits = 2 ;
- FieldMap[SCALE_B].Type = UNSIGNED ;
- FieldMap[SCALE_B].Mask = FieldCreateMask(SCALE_B) ;
- /* DELAGC_0*/
- RegMap[DELAGC_0].Addr = 0x30 ;
- RegMap[DELAGC_0].Reset = 0xE6 ;
- RegMap[DELAGC_0].Value = 0x00 ;
- strcpy(RegMap[DELAGC_0].Name,"DELAGC_0") ;
- /* FIELDS*/
- strcpy(FieldMap[AGC2MAX].Name,"AGC2MAX") ;
- FieldMap[AGC2MAX].Reg = DELAGC_0 ;
- FieldMap[AGC2MAX].Pos = 0 ;
- FieldMap[AGC2MAX].Bits = 8 ;
- FieldMap[AGC2MAX].Type = UNSIGNED ;
- FieldMap[AGC2MAX].Mask = FieldCreateMask(AGC2MAX) ;
- /* DELAGC_1*/
- RegMap[DELAGC_1].Addr = 0x31 ;
- RegMap[DELAGC_1].Reset = 0x91 ;
- RegMap[DELAGC_1].Value = 0x00 ;
- strcpy(RegMap[DELAGC_1].Name,"DELAGC_1") ;
- /* FIELDS*/
- strcpy(FieldMap[AGC2MIN].Name,"AGC2MIN") ;
- FieldMap[AGC2MIN].Reg = DELAGC_1 ;
- FieldMap[AGC2MIN].Pos = 0 ;
- FieldMap[AGC2MIN].Bits = 8 ;
- FieldMap[AGC2MIN].Type = UNSIGNED ;
- FieldMap[AGC2MIN].Mask = FieldCreateMask(AGC2MIN) ;
- /* DELAGC_2*/
- RegMap[DELAGC_2].Addr = 0x32 ;
- RegMap[DELAGC_2].Reset = 0xFD ;
- RegMap[DELAGC_2].Value = 0x00 ;
- strcpy(RegMap[DELAGC_2].Name,"DELAGC_2") ;
- /* FIELDS*/
- strcpy(FieldMap[AGC1MAX].Name,"AGC1MAX") ;
- FieldMap[AGC1MAX].Reg = DELAGC_2 ;
- FieldMap[AGC1MAX].Pos = 0 ;
- FieldMap[AGC1MAX].Bits = 8 ;
- FieldMap[AGC1MAX].Type = UNSIGNED ;
- FieldMap[AGC1MAX].Mask = FieldCreateMask(AGC1MAX) ;
- /* DELAGC_3*/
- RegMap[DELAGC_3].Addr = 0x33 ;
- RegMap[DELAGC_3].Reset = 0x44 ;
- RegMap[DELAGC_3].Value = 0x00 ;
- strcpy(RegMap[DELAGC_3].Name,"DELAGC_3") ;
- /* FIELDS*/
- strcpy(FieldMap[AGC1MIN].Name,"AGC1MIN") ;
- FieldMap[AGC1MIN].Reg = DELAGC_3 ;
- FieldMap[AGC1MIN].Pos = 0 ;
- FieldMap[AGC1MIN].Bits = 8 ;
- FieldMap[AGC1MIN].Type = UNSIGNED ;
- FieldMap[AGC1MIN].Mask = FieldCreateMask(AGC1MIN) ;
- /* DELAGC_4*/
- RegMap[DELAGC_4].Addr = 0x34 ;
- RegMap[DELAGC_4].Reset = 0x29 ;
- RegMap[DELAGC_4].Value = 0x00 ;
- strcpy(RegMap[DELAGC_4].Name,"DELAGC_4") ;
- /* FIELDS*/
- strcpy(FieldMap[RATIO_A].Name,"RATIO_A") ;
- FieldMap[RATIO_A].Reg = DELAGC_4 ;
- FieldMap[RATIO_A].Pos = 5 ;
- FieldMap[RATIO_A].Bits = 3 ;
- FieldMap[RATIO_A].Type = UNSIGNED ;
- FieldMap[RATIO_A].Mask = FieldCreateMask(RATIO_A) ;
- /* FIELDS*/
- strcpy(FieldMap[RATIO_B].Name,"RATIO_B") ;
- FieldMap[RATIO_B].Reg = DELAGC_4 ;
- FieldMap[RATIO_B].Pos = 3 ;
- FieldMap[RATIO_B].Bits = 2 ;
- FieldMap[RATIO_B].Type = UNSIGNED ;
- FieldMap[RATIO_B].Mask = FieldCreateMask(RATIO_B) ;
- /* FIELDS*/
- strcpy(FieldMap[RATIO_C].Name,"RATIO_C") ;
- FieldMap[RATIO_C].Reg = DELAGC_4 ;
- FieldMap[RATIO_C].Pos = 0 ;
- FieldMap[RATIO_C].Bits = 3 ;
- FieldMap[RATIO_C].Type = UNSIGNED ;
- FieldMap[RATIO_C].Mask = FieldCreateMask(RATIO_C) ;
- /* DELAGC_5*/
- RegMap[DELAGC_5].Addr = 0x35 ;
- RegMap[DELAGC_5].Reset = 0x8F ;
- RegMap[DELAGC_5].Value = 0x00 ;
- strcpy(RegMap[DELAGC_5].Name,"DELAGC_5") ;
- /* FIELDS*/
- strcpy(FieldMap[AGC2_THRES].Name,"AGC2_THRES") ;
- FieldMap[AGC2_THRES].Reg = DELAGC_5 ;
- FieldMap[AGC2_THRES].Pos = 0 ;
- FieldMap[AGC2_THRES].Bits = 8 ;
- FieldMap[AGC2_THRES].Type = UNSIGNED ;
- FieldMap[AGC2_THRES].Mask = FieldCreateMask(AGC2_THRES) ;
- /* DELAGC_6*/
- RegMap[DELAGC_6].Addr = 0x36 ;
- RegMap[DELAGC_6].Reset = 0x80 ;
- RegMap[DELAGC_6].Value = 0x00 ;
- strcpy(RegMap[DELAGC_6].Name,"DELAGC_6") ;
- /* FIELDS*/
- strcpy(FieldMap[DAGC_ON].Name,"DAGC_ON") ;
- FieldMap[DAGC_ON].Reg = DELAGC_6 ;
- FieldMap[DAGC_ON].Pos = 7 ;
- FieldMap[DAGC_ON].Bits = 1 ;
- FieldMap[DAGC_ON].Type = UNSIGNED ;
- FieldMap[DAGC_ON].Mask = FieldCreateMask(DAGC_ON) ;
- /* FIELDS*/
- strcpy(FieldMap[FRZ2_CTRL].Name,"FRZ2_CTRL") ;
- FieldMap[FRZ2_CTRL].Reg = DELAGC_6 ;
- FieldMap[FRZ2_CTRL].Pos = 5 ;
- FieldMap[FRZ2_CTRL].Bits = 2 ;
- FieldMap[FRZ2_CTRL].Type = UNSIGNED ;
- FieldMap[FRZ2_CTRL].Mask = FieldCreateMask(FRZ2_CTRL) ;
- /* FIELDS*/
- strcpy(FieldMap[FRZ1_CTRL].Name,"FRZ1_CTRL") ;
- FieldMap[FRZ1_CTRL].Reg = DELAGC_6 ;
- FieldMap[FRZ1_CTRL].Pos = 3 ;
- FieldMap[FRZ1_CTRL].Bits = 2 ;
- FieldMap[FRZ1_CTRL].Type = UNSIGNED ;
- FieldMap[FRZ1_CTRL].Mask = FieldCreateMask(FRZ1_CTRL) ;
- /* DELAGC_7*/
- RegMap[DELAGC_7].Addr = 0x37 ;
- RegMap[DELAGC_7].Reset = 0x70 ;
- RegMap[DELAGC_7].Value = 0x00 ;
- strcpy(RegMap[DELAGC_7].Name,"DELAGC_7") ;
- /* FIELDS*/
- strcpy(FieldMap[TIME_CST].Name,"TIME_CST") ;
- FieldMap[TIME_CST].Reg = DELAGC_7 ;
- FieldMap[TIME_CST].Pos = 4 ;
- FieldMap[TIME_CST].Bits = 3 ;
- FieldMap[TIME_CST].Type = UNSIGNED ;
- FieldMap[TIME_CST].Mask = FieldCreateMask(TIME_CST) ;
- /* FIELDS*/
- strcpy(FieldMap[OVF_RATE_LO].Name,"OVF_RATE_LO") ;
- FieldMap[OVF_RATE_LO].Reg = DELAGC_7 ;
- FieldMap[OVF_RATE_LO].Pos = 0 ;
- FieldMap[OVF_RATE_LO].Bits = 4 ;
- FieldMap[OVF_RATE_LO].Type = UNSIGNED ;
- FieldMap[OVF_RATE_LO].Mask = FieldCreateMask(OVF_RATE_LO) ;
- /* FIELDS*/
- strcpy(FieldMap[CORNER_RATE_LO].Name,"CORNER_RATE_LO") ;
- FieldMap[CORNER_RATE_LO].Reg = DELAGC_7 ;
- FieldMap[CORNER_RATE_LO].Pos = 0 ;
- FieldMap[CORNER_RATE_LO].Bits = 4 ;
- FieldMap[CORNER_RATE_LO].Type = UNSIGNED ;
- FieldMap[CORNER_RATE_LO].Mask = FieldCreateMask(CORNER_RATE_LO) ;
- /* DELAGC_8*/
- RegMap[DELAGC_8].Addr = 0x38 ;
- RegMap[DELAGC_8].Reset = 0x00 ;
- RegMap[DELAGC_8].Value = 0x00 ;
- strcpy(RegMap[DELAGC_8].Name,"DELAGC_8") ;
- /* FIELDS*/
- strcpy(FieldMap[OVF_RATE_HI].Name,"OVF_RATE_HI") ;
- FieldMap[OVF_RATE_HI].Reg = DELAGC_8 ;
- FieldMap[OVF_RATE_HI].Pos = 0 ;
- FieldMap[OVF_RATE_HI].Bits = 8 ;
- FieldMap[OVF_RATE_HI].Type = UNSIGNED ;
- FieldMap[OVF_RATE_HI].Mask = FieldCreateMask(OVF_RATE_HI) ;
- /* FIELDS*/
- strcpy(FieldMap[CORNER_RATE_HI].Name,"CORNER_RATE_HI") ;
- FieldMap[CORNER_RATE_HI].Reg = DELAGC_8 ;
- FieldMap[CORNER_RATE_HI].Pos = 0 ;
- FieldMap[CORNER_RATE_HI].Bits = 8 ;
- FieldMap[CORNER_RATE_HI].Type = UNSIGNED ;
- FieldMap[CORNER_RATE_HI].Mask = FieldCreateMask(CORNER_RATE_HI) ;
- /* WBAGC_0*/
- RegMap[WBAGC_0].Addr = 0x40 ;
- RegMap[WBAGC_0].Reset = 0x1A ;
- RegMap[WBAGC_0].Value = 0x1C ;
- strcpy(RegMap[WBAGC_0].Name,"WBAGC_0") ;
- /* FIELDS*/
- strcpy(FieldMap[I_REF].Name,"I_REF") ;
- FieldMap[I_REF].Reg = WBAGC_0 ;
- FieldMap[I_REF].Pos = 0 ;
- FieldMap[I_REF].Bits = 8 ;
- FieldMap[I_REF].Type = UNSIGNED ;
- FieldMap[I_REF].Mask = FieldCreateMask(I_REF) ;
- /* WBAGC_1*/
- RegMap[WBAGC_1].Addr = 0x41 ;
- RegMap[WBAGC_1].Reset = 0x64 ;
- RegMap[WBAGC_1].Value = 0x00 ;
- strcpy(RegMap[WBAGC_1].Name,"WBAGC_1") ;
- /* FIELDS*/
- strcpy(FieldMap[AGC2SD_LO].Name,"AGC2SD_LO") ;
- FieldMap[AGC2SD_LO].Reg = WBAGC_1 ;
- FieldMap[AGC2SD_LO].Pos = 0 ;
- FieldMap[AGC2SD_LO].Bits = 8 ;
- FieldMap[AGC2SD_LO].Type = UNSIGNED ;
- FieldMap[AGC2SD_LO].Mask = FieldCreateMask(AGC2SD_LO) ;
- /* WBAGC_2*/
- RegMap[WBAGC_2].Addr = 0x42 ;
- RegMap[WBAGC_2].Reset = 0x31 ;
- RegMap[WBAGC_2].Value = 0x02 ;
- strcpy(RegMap[WBAGC_2].Name,"WBAGC_2") ;
- /* FIELDS*/
- strcpy(FieldMap[AGC2SD_HI].Name,"AGC2SD_HI") ;
- FieldMap[AGC2SD_HI].Reg = WBAGC_2 ;
- FieldMap[AGC2SD_HI].Pos = 0 ;
- FieldMap[AGC2SD_HI].Bits = 2 ;
- FieldMap[AGC2SD_HI].Type = UNSIGNED ;
- FieldMap[AGC2SD_HI].Mask = FieldCreateMask(AGC2SD_HI) ;
- strcpy(FieldMap[ACQ_THRESH].Name,"ACQ_THRESH") ;
- FieldMap[ACQ_THRESH].Reg = WBAGC_2 ;
- FieldMap[ACQ_THRESH].Pos = 2 ;
- FieldMap[ACQ_THRESH].Bits = 4 ;
- FieldMap[ACQ_THRESH].Type = UNSIGNED ;
- FieldMap[ACQ_THRESH].Mask = FieldCreateMask(ACQ_THRESH) ;
- /* WBAGC_3*/
- RegMap[WBAGC_3].Addr = 0x43 ;
- RegMap[WBAGC_3].Reset = 0x18 ;
- RegMap[WBAGC_3].Value = 0x20 ;
- strcpy(RegMap[WBAGC_3].Name,"WBAGC_3") ;
- /* FIELDS*/
- strcpy(FieldMap[WAGC_CLR].Name,"WAGC_CLR") ;
- FieldMap[WAGC_CLR].Reg = WBAGC_3 ;
- FieldMap[WAGC_CLR].Pos = 6 ;
- FieldMap[WAGC_CLR].Bits = 1 ;
- FieldMap[WAGC_CLR].Type = UNSIGNED ;
- FieldMap[WAGC_CLR].Mask = FieldCreateMask(WAGC_CLR) ;
- /* FIELDS*/
- strcpy(FieldMap[WAGC_INV].Name,"WAGC_INV") ;
- FieldMap[WAGC_INV].Reg = WBAGC_3 ;
- FieldMap[WAGC_INV].Pos = 5 ;
- FieldMap[WAGC_INV].Bits = 1 ;
- FieldMap[WAGC_INV].Type = UNSIGNED ;
- FieldMap[WAGC_INV].Mask = FieldCreateMask(WAGC_INV) ;
- /* FIELDS*/
- strcpy(FieldMap[WAGC_EN].Name,"WAGC_EN") ;
- FieldMap[WAGC_EN].Reg = WBAGC_3 ;
- FieldMap[WAGC_EN].Pos = 4 ;
- FieldMap[WAGC_EN].Bits = 1 ;
- FieldMap[WAGC_EN].Type = UNSIGNED ;
- FieldMap[WAGC_EN].Mask = FieldCreateMask(WAGC_EN) ;
- /* FIELDS*/
- strcpy(FieldMap[WAGC_ACQ].Name,"WAGC_ACQ") ;
- FieldMap[WAGC_ACQ].Reg = WBAGC_3 ;
- FieldMap[WAGC_ACQ].Pos = 3 ;
- FieldMap[WAGC_ACQ].Bits = 1 ;
- FieldMap[WAGC_ACQ].Type = UNSIGNED ;
- FieldMap[WAGC_ACQ].Mask = FieldCreateMask(WAGC_ACQ) ;
- /* FIELDS*/
- strcpy(FieldMap[SWAP].Name,"SWAP") ;
- FieldMap[SWAP].Reg = WBAGC_3 ;
- FieldMap[SWAP].Pos = 2 ;
- FieldMap[SWAP].Bits = 1 ;
- FieldMap[SWAP].Type = UNSIGNED ;
- FieldMap[SWAP].Mask = FieldCreateMask(SWAP) ;
- /* WBAGC_4*/
- RegMap[WBAGC_4].Addr = 0x44 ;
- RegMap[WBAGC_4].Reset = 0xFF ;
- RegMap[WBAGC_4].Value = 0x00 ;
- strcpy(RegMap[WBAGC_4].Name,"WBAGC_4") ;
- /* FIELDS*/
- strcpy(FieldMap[ROLL_LO].Name,"ROLL_LO") ;
- FieldMap[ROLL_LO].Reg = WBAGC_4 ;
- FieldMap[ROLL_LO].Pos = 0 ;
- FieldMap[ROLL_LO].Bits = 8 ;
- FieldMap[ROLL_LO].Type = UNSIGNED ;
- FieldMap[ROLL_LO].Mask = FieldCreateMask(ROLL_LO) ;
- /* WBAGC_5*/
- RegMap[WBAGC_5].Addr = 0x45 ;
- RegMap[WBAGC_5].Reset = 0x00 ;
- RegMap[WBAGC_5].Value = 0x00 ;
- strcpy(RegMap[WBAGC_5].Name,"WBAGC_5") ;
- /* FIELDS*/
- strcpy(FieldMap[ACQ_COUNT_LO].Name,"ACQ_COUNT_LO") ;
- FieldMap[ACQ_COUNT_LO].Reg = WBAGC_5 ;
- FieldMap[ACQ_COUNT_LO].Pos = 0 ;
- FieldMap[ACQ_COUNT_LO].Bits = 8 ;
- FieldMap[ACQ_COUNT_LO].Type = UNSIGNED ;
- FieldMap[ACQ_COUNT_LO].Mask = FieldCreateMask(ACQ_COUNT_LO) ;
- /* WBAGC_6*/
- RegMap[WBAGC_6].Addr = 0x46 ;
- RegMap[WBAGC_6].Reset = 0x00 ;
- RegMap[WBAGC_6].Value = 0x00 ;
- strcpy(RegMap[WBAGC_6].Name,"WBAGC_6") ;
- /* FIELDS*/
- strcpy(FieldMap[ACQ_COUNT_HI].Name,"ACQ_COUNT_HI") ;
- FieldMap[ACQ_COUNT_HI].Reg = WBAGC_6 ;
- FieldMap[ACQ_COUNT_HI].Pos = 0 ;
- FieldMap[ACQ_COUNT_HI].Bits = 8 ;
- FieldMap[ACQ_COUNT_HI].Type = UNSIGNED ;
- FieldMap[ACQ_COUNT_HI].Mask = FieldCreateMask(ACQ_COUNT_HI) ;
- /* WBAGC_9*/
- RegMap[WBAGC_9].Addr = 0x49 ;
- RegMap[WBAGC_9].Reset = 0x04 ;
- RegMap[WBAGC_9].Value = 0x04 ;
- strcpy(RegMap[WBAGC_9].Name,"WBAGC_9") ;
- /* FIELDS*/
- strcpy(FieldMap[ROLL_HI].Name,"ROLL_HI") ;
- FieldMap[ROLL_HI].Reg = WBAGC_9 ;
- FieldMap[ROLL_HI].Pos = 0 ;
- FieldMap[ROLL_HI].Bits = 8 ;
- FieldMap[ROLL_HI].Type = UNSIGNED ;
- FieldMap[ROLL_HI].Mask = FieldCreateMask(ROLL_HI) ;
- /* WBAGC_10*/
- RegMap[WBAGC_10].Addr = 0x4A ;
- RegMap[WBAGC_10].Reset = 0x51 ;
- RegMap[WBAGC_10].Value = 0x00 ;
- strcpy(RegMap[WBAGC_10].Name,"WBAGC_10") ;
- /* FIELDS*/
- strcpy(FieldMap[IF_PWM_LO].Name,"IF_PWM_LO") ;
- FieldMap[IF_PWM_LO].Reg = WBAGC_10 ;
- FieldMap[IF_PWM_LO].Pos = 0 ;
- FieldMap[IF_PWM_LO].Bits = 8 ;
- FieldMap[IF_PWM_LO].Type = UNSIGNED ;
- FieldMap[IF_PWM_LO].Mask = FieldCreateMask(IF_PWM_LO) ;
- /* FIELDS*/
- strcpy(FieldMap[TARGET_RATE_LO].Name,"TARGET_RATE_LO") ;
- FieldMap[TARGET_RATE_LO].Reg = WBAGC_10 ;
- FieldMap[TARGET_RATE_LO].Pos = 0 ;
- FieldMap[TARGET_RATE_LO].Bits = 8 ;
- FieldMap[TARGET_RATE_LO].Type = UNSIGNED ;
- FieldMap[TARGET_RATE_LO].Mask = FieldCreateMask(TARGET_RATE_LO) ;
- /* WBAGC_11*/
- RegMap[WBAGC_11].Addr = 0x4B ;
- RegMap[WBAGC_11].Reset = 0xF8 ; /* orginal f8 */
- RegMap[WBAGC_11].Value = 0x00 ;
- strcpy(RegMap[WBAGC_11].Name,"WBAGC_11") ;
- /* FIELDS*/
- strcpy(FieldMap[IF_PWM_HI].Name,"IF_PWM_HI") ;
- FieldMap[IF_PWM_HI].Reg = WBAGC_11 ;
- FieldMap[IF_PWM_HI].Pos = 0 ;
- FieldMap[IF_PWM_HI].Bits = 8 ;
- FieldMap[IF_PWM_HI].Type = UNSIGNED ;
- FieldMap[IF_PWM_HI].Mask = FieldCreateMask(IF_PWM_HI) ;
- /* FIELDS*/
- strcpy(FieldMap[TARGET_RATE_HI].Name,"TARGET_RATE_HI") ;
- FieldMap[TARGET_RATE_HI].Reg = WBAGC_11 ;
- FieldMap[TARGET_RATE_HI].Pos = 0 ;
- FieldMap[TARGET_RATE_HI].Bits = 8 ;
- FieldMap[TARGET_RATE_HI].Type = UNSIGNED ;
- FieldMap[TARGET_RATE_HI].Mask = FieldCreateMask(TARGET_RATE_HI) ;
- /* STLOOP_2*/
- RegMap[STLOOP_2].Addr = 0x52 ;
- RegMap[STLOOP_2].Reset = 0x30 ;
- RegMap[STLOOP_2].Value = 0x00 ;
- strcpy(RegMap[STLOOP_2].Name,"STLOOP_2") ;
- /* FIELDS*/
- strcpy(FieldMap[GAIN_SCALE_PATH0].Name,"GAIN_SCALE_PATH0") ;
- FieldMap[GAIN_SCALE_PATH0].Reg = STLOOP_2 ;
- FieldMap[GAIN_SCALE_PATH0].Pos = 5 ;
- FieldMap[GAIN_SCALE_PATH0].Bits = 3 ;
- FieldMap[GAIN_SCALE_PATH0].Type = UNSIGNED ;
- FieldMap[GAIN_SCALE_PATH0].Mask = FieldCreateMask(GAIN_SCALE_PATH0) ;
- /* FIELDS*/
- strcpy(FieldMap[GAIN_SCALE_PATH1].Name,"GAIN_SCALE_PATH1") ;
- FieldMap[GAIN_SCALE_PATH1].Reg = STLOOP_2 ;
- FieldMap[GAIN_SCALE_PATH1].Pos = 2 ;
- FieldMap[GAIN_SCALE_PATH1].Bits = 3 ;
- FieldMap[GAIN_SCALE_PATH1].Type = UNSIGNED ;
- FieldMap[GAIN_SCALE_PATH1].Mask = FieldCreateMask(GAIN_SCALE_PATH1) ;
- /* FIELDS*/
- strcpy(FieldMap[INTEGRAL_GAIN_HI].Name,"INTEGRAL_GAIN_HI") ;
- FieldMap[INTEGRAL_GAIN_HI].Reg = STLOOP_2 ;
- FieldMap[INTEGRAL_GAIN_HI].Pos = 0 ;
- FieldMap[INTEGRAL_GAIN_HI].Bits = 2 ;
- FieldMap[INTEGRAL_GAIN_HI].Type = UNSIGNED ;
- FieldMap[INTEGRAL_GAIN_HI].Mask = FieldCreateMask(INTEGRAL_GAIN_HI) ;
- /* STLOOP_3*/
- RegMap[STLOOP_3].Addr = 0x53 ;
- RegMap[STLOOP_3].Reset = 0x06 ;
- RegMap[STLOOP_3].Value = 0x00 ;
- strcpy(RegMap[STLOOP_3].Name,"STLOOP_3") ;
- /* FIELDS*/
- strcpy(FieldMap[DIRECT_GAIN_LO].Name,"DIRECT_GAIN_LO") ;
- FieldMap[DIRECT_GAIN_LO].Reg = STLOOP_3 ;
- FieldMap[DIRECT_GAIN_LO].Pos = 0 ;
- FieldMap[DIRECT_GAIN_LO].Bits = 8 ;
- FieldMap[DIRECT_GAIN_LO].Type = UNSIGNED ;
- FieldMap[DIRECT_GAIN_LO].Mask = FieldCreateMask(DIRECT_GAIN_LO) ;
- /* STLOOP_5*/
- RegMap[STLOOP_5].Addr = 0x55 ;
- RegMap[STLOOP_5].Reset = 0x6a ;
- RegMap[STLOOP_5].Value = 0x00 ;
- strcpy(RegMap[STLOOP_5].Name,"STLOOP_5") ;
- /* FIELDS*/
- strcpy(FieldMap[SYMB_RATE_0].Name,"SYMB_RATE_0") ;
- FieldMap[SYMB_RATE_0].Reg = STLOOP_5 ;
- FieldMap[SYMB_RATE_0].Pos = 0 ;
- FieldMap[SYMB_RATE_0].Bits = 8 ;
- FieldMap[SYMB_RATE_0].Type = UNSIGNED ;
- FieldMap[SYMB_RATE_0].Mask = FieldCreateMask(SYMB_RATE_0) ;
- /* STLOOP_6*/
- RegMap[STLOOP_6].Addr = 0x56 ;
- RegMap[STLOOP_6].Reset = 0xA3 ;
- RegMap[STLOOP_6].Value = 0x00 ;
- strcpy(RegMap[STLOOP_6].Name,"STLOOP_6") ;
- /* FIELDS*/
- strcpy(FieldMap[SYMB_RATE_1].Name,"SYMB_RATE_1") ;
- FieldMap[SYMB_RATE_1].Reg = STLOOP_6 ;
- FieldMap[SYMB_RATE_1].Pos = 0 ;
- FieldMap[SYMB_RATE_1].Bits = 8 ;
- FieldMap[SYMB_RATE_1].Type = UNSIGNED ;
- FieldMap[SYMB_RATE_1].Mask = FieldCreateMask(SYMB_RATE_1) ;
- /* STLOOP_7*/
- RegMap[STLOOP_7].Addr = 0x57 ;
- RegMap[STLOOP_7].Reset = 0x8B ;
- RegMap[STLOOP_7].Value = 0x00 ;
- strcpy(RegMap[STLOOP_7].Name,"STLOOP_7") ;
- /* FIELDS*/
- strcpy(FieldMap[SYMB_RATE_2].Name,"SYMB_RATE_2") ;
- FieldMap[SYMB_RATE_2].Reg = STLOOP_7 ;
- FieldMap[SYMB_RATE_2].Pos = 0 ;
- FieldMap[SYMB_RATE_2].Bits = 8 ;
- FieldMap[SYMB_RATE_2].Type = UNSIGNED ;
- FieldMap[SYMB_RATE_2].Mask = FieldCreateMask(SYMB_RATE_2) ;
- /* STLOOP_8*/
- RegMap[STLOOP_8].Addr = 0x58 ;
- RegMap[STLOOP_8].Reset = 0x39 ;
- RegMap[STLOOP_8].Value = 0x00 ;
- strcpy(RegMap[STLOOP_8].Name,"STLOOP_8") ;
- /* FIELDS*/
- strcpy(FieldMap[SYMB_RATE_3].Name,"SYMB_RATE_3") ;
- FieldMap[SYMB_RATE_3].Reg = STLOOP_8 ;
- FieldMap[SYMB_RATE_3].Pos = 0 ;
- FieldMap[SYMB_RATE_3].Bits = 8 ;
- FieldMap[SYMB_RATE_3].Type = UNSIGNED ;
- FieldMap[SYMB_RATE_3].Mask = FieldCreateMask(SYMB_RATE_3) ;
- /* STLOOP_9*/
- RegMap[STLOOP_9].Addr = 0x59 ;
- RegMap[STLOOP_9].Reset = 0x06 ;
- RegMap[STLOOP_9].Value = 0x00 ;
- strcpy(RegMap[STLOOP_9].Name,"STLOOP_9") ;
- /* FIELDS*/
- strcpy(FieldMap[INTEGRAL_GAIN_LO].Name,"INTEGRAL_GAIN_LO") ;
- FieldMap[INTEGRAL_GAIN_LO].Reg = STLOOP_9 ;
- FieldMap[INTEGRAL_GAIN_LO].Pos = 0 ;
- FieldMap[INTEGRAL_GAIN_LO].Bits = 5 ;
- FieldMap[INTEGRAL_GAIN_LO].Type = UNSIGNED ;
- FieldMap[INTEGRAL_GAIN_LO].Mask = FieldCreateMask(INTEGRAL_GAIN_LO) ;
- /* FIELDS*/
- strcpy(FieldMap[DIRECT_GAIN_HI].Name,"DIRECT_GAIN_HI") ;
- FieldMap[DIRECT_GAIN_HI].Reg = STLOOP_9 ;
- FieldMap[DIRECT_GAIN_HI].Pos = 5 ;
- FieldMap[DIRECT_GAIN_HI].Bits = 3 ;
- FieldMap[DIRECT_GAIN_HI].Type = UNSIGNED ;
- FieldMap[DIRECT_GAIN_HI].Mask = FieldCreateMask(DIRECT_GAIN_HI) ;
- /* STLOOP_10*/
- RegMap[STLOOP_10].Addr = 0x5A ;
- RegMap[STLOOP_10].Reset = 0x5E ;
- RegMap[STLOOP_10].Value = 0x5E ;
- strcpy(RegMap[STLOOP_10].Name,"STLOOP_10") ;
- /* FIELDS*/
- strcpy(FieldMap[PHASE_EN].Name,"PHASE_EN") ;
- FieldMap[PHASE_EN].Reg = STLOOP_10 ;
- FieldMap[PHASE_EN].Pos = 6 ;
- FieldMap[PHASE_EN].Bits = 1 ;
- FieldMap[PHASE_EN].Type = UNSIGNED ;
- FieldMap[PHASE_EN].Mask = FieldCreateMask(PHASE_EN) ;
- /* FIELDS*/
- strcpy(FieldMap[PHASE_CLR].Name,"PHASE_CLR") ;
- FieldMap[PHASE_CLR].Reg = STLOOP_10 ;
- FieldMap[PHASE_CLR].Pos = 5 ;
- FieldMap[PHASE_CLR].Bits = 1 ;
- FieldMap[PHASE_CLR].Type = UNSIGNED ;
- FieldMap[PHASE_CLR].Mask = FieldCreateMask(PHASE_CLR) ;
- /* FIELDS*/
- strcpy(FieldMap[ERR_RANGE].Name,"ERR_RANGE") ;
- FieldMap[ERR_RANGE].Reg = STLOOP_10 ;
- FieldMap[ERR_RANGE].Pos = 0 ;
- FieldMap[ERR_RANGE].Bits = 5 ;
- FieldMap[ERR_RANGE].Type = UNSIGNED ;
- FieldMap[ERR_RANGE].Mask = FieldCreateMask(ERR_RANGE) ;
- /* STLOOP_11*/
- RegMap[STLOOP_11].Addr = 0x5B ;
- RegMap[STLOOP_11].Reset = 0x04 ;
- RegMap[STLOOP_11].Value = 0x05 ;
- strcpy(RegMap[STLOOP_11].Name,"STLOOP_11") ;
- /* FIELDS*/
- strcpy(FieldMap[ALGOSEL].Name,"ALGOSEL") ;
- FieldMap[ALGOSEL].Reg = STLOOP_11 ;
- FieldMap[ALGOSEL].Pos = 4 ;
- FieldMap[ALGOSEL].Bits = 2 ;
- FieldMap[ALGOSEL].Type = UNSIGNED ;
- FieldMap[ALGOSEL].Mask = FieldCreateMask(ALGOSEL) ;
- /* FIELDS*/
- strcpy(FieldMap[ERR_CLR].Name,"ERR_CLR") ;
- FieldMap[ERR_CLR].Reg = STLOOP_11 ;
- FieldMap[ERR_CLR].Pos = 1 ;
- FieldMap[ERR_CLR].Bits = 1 ;
- FieldMap[ERR_CLR].Type = UNSIGNED ;
- FieldMap[ERR_CLR].Mask = FieldCreateMask(ERR_CLR) ;
- /* FIELDS*/
- strcpy(FieldMap[ERR_EN].Name,"ERR_EN") ;
- FieldMap[ERR_EN].Reg = STLOOP_11 ;
- FieldMap[ERR_EN].Pos = 0 ;
- FieldMap[ERR_EN].Bits = 1 ;
- FieldMap[ERR_EN].Type = UNSIGNED ;
- FieldMap[ERR_EN].Mask = FieldCreateMask(ERR_EN) ;
- /* CRL_0*/
- RegMap[CRL_0].Addr = 0x60 ;
- RegMap[CRL_0].Reset = 0x16 ;
- RegMap[CRL_0].Value = 0x00 ;
- strcpy(RegMap[CRL_0].Name,"CRL_0") ;
- /* FIELDS*/
- strcpy(FieldMap[SWEEP_LO].Name,"SWEEP_LO") ;
- FieldMap[SWEEP_LO].Reg = CRL_0 ;
- FieldMap[SWEEP_LO].Pos = 0 ;
- FieldMap[SWEEP_LO].Bits = 8 ;
- FieldMap[SWEEP_LO].Type = UNSIGNED ;
- FieldMap[SWEEP_LO].Mask = FieldCreateMask(SWEEP_LO) ;
- /* CRL_1*/
- RegMap[CRL_1].Addr = 0x61 ;
- RegMap[CRL_1].Reset = 0x49 ; /*org 49*/
- RegMap[CRL_1].Value = 0x38 ; /*org 38*/
- strcpy(RegMap[CRL_1].Name,"CRL_1") ;
- /* FIELDS*/
- strcpy(FieldMap[GAIN_INT].Name,"GAIN_INT") ;
- FieldMap[GAIN_INT].Reg = CRL_1 ;
- FieldMap[GAIN_INT].Pos = 0 ;
- FieldMap[GAIN_INT].Bits = 4 ;
- FieldMap[GAIN_INT].Type = UNSIGNED ;
- FieldMap[GAIN_INT].Mask = FieldCreateMask(GAIN_INT) ;
- /* FIELDS*/
- strcpy(FieldMap[GAIN_DIR].Name,"GAIN_DIR") ;
- FieldMap[GAIN_DIR].Reg = CRL_1 ;
- FieldMap[GAIN_DIR].Pos = 4 ;
- FieldMap[GAIN_DIR].Bits = 3 ;
- FieldMap[GAIN_DIR].Type = UNSIGNED ;
- FieldMap[GAIN_DIR].Mask = FieldCreateMask(GAIN_DIR) ;
- /* CRL_2*/
- RegMap[CRL_2].Addr = 0x62 ;
- RegMap[CRL_2].Reset = 0x05 ;
- RegMap[CRL_2].Value = 0x06 ;
- strcpy(RegMap[CRL_2].Name,"CRL_2") ;
- /* FIELDS*/
- strcpy(FieldMap[GAIN_INT_ADJ].Name,"GAIN_INT_ADJ") ;
- FieldMap[GAIN_INT_ADJ].Reg = CRL_2 ;
- FieldMap[GAIN_INT_ADJ].Pos = 0 ;
- FieldMap[GAIN_INT_ADJ].Bits = 2 ;
- FieldMap[GAIN_INT_ADJ].Type = UNSIGNED ;
- FieldMap[GAIN_INT_ADJ].Mask = FieldCreateMask(GAIN_INT_ADJ) ;
- /* FIELDS*/
- strcpy(FieldMap[GAIN_DIR_ADJ].Name,"GAIN_DIR_ADJ") ;
- FieldMap[GAIN_DIR_ADJ].Reg = CRL_2 ;
- FieldMap[GAIN_DIR_ADJ].Pos = 2 ;
- FieldMap[GAIN_DIR_ADJ].Bits = 2 ;
- FieldMap[GAIN_DIR_ADJ].Type = UNSIGNED ;
- FieldMap[GAIN_DIR_ADJ].Mask = FieldCreateMask(GAIN_DIR_ADJ) ;
- /* CRL_3*/
- RegMap[CRL_3].Addr = 0x63 ;
- RegMap[CRL_3].Reset = 0x00 ;
- RegMap[CRL_3].Value = 0x00 ;
- strcpy(RegMap[CRL_3].Name,"CRL_3") ;
- /* FIELDS*/
- strcpy(FieldMap[APHASE_0].Name,"APHASE_0") ;
- FieldMap[APHASE_0].Reg = CRL_3 ;
- FieldMap[APHASE_0].Pos = 0 ;
- FieldMap[APHASE_0].Bits = 8 ;
- FieldMap[APHASE_0].Type = UNSIGNED ;
- FieldMap[APHASE_0].Mask = FieldCreateMask(APHASE_0) ;
- /* CRL_4*/
- RegMap[CRL_4].Addr = 0x64 ;
- RegMap[CRL_4].Reset = 0x00 ;
- RegMap[CRL_4].Value = 0x00 ;
- strcpy(RegMap[CRL_4].Name,"CRL_4") ;
- /* FIELDS*/
- strcpy(FieldMap[APHASE_1].Name,"APHASE_1") ;
- FieldMap[APHASE_1].Reg = CRL_4 ;
- FieldMap[APHASE_1].Pos = 0 ;
- FieldMap[APHASE_1].Bits = 8 ;
- FieldMap[APHASE_1].Type = UNSIGNED ;
- FieldMap[APHASE_1].Mask = FieldCreateMask(APHASE_1) ;
- /* CRL_5*/
- RegMap[CRL_5].Addr = 0x65 ;
- RegMap[CRL_5].Reset = 0x00 ;
- RegMap[CRL_5].Value = 0x00 ;
- strcpy(RegMap[CRL_5].Name,"CRL_5") ;
- /* FIELDS*/
- strcpy(FieldMap[APHASE_2].Name,"APHASE_2") ;
- FieldMap[APHASE_2].Reg = CRL_5 ;
- FieldMap[APHASE_2].Pos = 0 ;
- FieldMap[APHASE_2].Bits = 8 ;
- FieldMap[APHASE_2].Type = UNSIGNED ;
- FieldMap[APHASE_2].Mask = FieldCreateMask(APHASE_2) ;
- /* CRL_6*/
- RegMap[CRL_6].Addr = 0x66 ;
- RegMap[CRL_6].Reset = 0xbf ;
- RegMap[CRL_6].Value = 0x00 ;
- strcpy(RegMap[CRL_6].Name,"CRL_6") ;
- /* FIELDS*/
- strcpy(FieldMap[IPHASE_0].Name,"IPHASE_0") ;
- FieldMap[IPHASE_0].Reg = CRL_6 ;
- FieldMap[IPHASE_0].Pos = 0 ;
- FieldMap[IPHASE_0].Bits = 8 ;
- FieldMap[IPHASE_0].Type = UNSIGNED ;
- FieldMap[IPHASE_0].Mask = FieldCreateMask(IPHASE_0) ;
- /* CRL_7*/
- RegMap[CRL_7].Addr = 0x67 ;
- RegMap[CRL_7].Reset = 0x0D ;
- RegMap[CRL_7].Value = 0x00 ;
- strcpy(RegMap[CRL_7].Name,"CRL_7") ;
- /* FIELDS*/
- strcpy(FieldMap[IPHASE_1].Name,"IPHASE_1") ;
- FieldMap[IPHASE_1].Reg = CRL_7 ;
- FieldMap[IPHASE_1].Pos = 0 ;
- FieldMap[IPHASE_1].Bits = 8 ;
- FieldMap[IPHASE_1].Type = UNSIGNED ;
- FieldMap[IPHASE_1].Mask = FieldCreateMask(IPHASE_1) ;
- /* CRL_8*/
- RegMap[CRL_8].Addr = 0x68 ;
- RegMap[CRL_8].Reset = 0xf8 ;
- RegMap[CRL_8].Value = 0x00 ;
- strcpy(RegMap[CRL_8].Name,"CRL_8") ;
- /* FIELDS*/
- strcpy(FieldMap[IPHASE_2].Name,"IPHASE_2") ;
- FieldMap[IPHASE_2].Reg = CRL_8 ;
- FieldMap[IPHASE_2].Pos = 0 ;
- FieldMap[IPHASE_2].Bits = 8 ;
- FieldMap[IPHASE_2].Type = UNSIGNED ;
- FieldMap[IPHASE_2].Mask = FieldCreateMask(IPHASE_2) ;
- /* CRL_9*/
- RegMap[CRL_9].Addr = 0x69 ;
- RegMap[CRL_9].Reset = 0x0D ;
- RegMap[CRL_9].Value = 0x00 ;
- strcpy(RegMap[CRL_9].Name,"CRL_9") ;
- /* FIELDS*/
- strcpy(FieldMap[IPHASE_3].Name,"IPHASE_3") ;
- FieldMap[IPHASE_3].Reg = CRL_9 ;
- FieldMap[IPHASE_3].Pos = 0 ;
- FieldMap[IPHASE_3].Bits = 4 ;
- FieldMap[IPHASE_3].Type = UNSIGNED ;
- FieldMap[IPHASE_3].Mask = FieldCreateMask(IPHASE_3) ;
- /* FIELDS*/
- strcpy(FieldMap[SWEEP_HI].Name,"SWEEP_HI") ;
- FieldMap[SWEEP_HI].Reg = CRL_9 ;
- FieldMap[SWEEP_HI].Pos = 4 ;
- FieldMap[SWEEP_HI].Bits = 4 ;
- FieldMap[SWEEP_HI].Type = UNSIGNED ;
- FieldMap[SWEEP_HI].Mask = FieldCreateMask(SWEEP_HI) ;
- /* CRL_10*/
- RegMap[CRL_10].Addr = 0x6A ;
- RegMap[CRL_10].Reset = 0x03 ;
- RegMap[CRL_10].Value = 0x03 ;
- strcpy(RegMap[CRL_10].Name,"CRL_10") ;
- /* FIELDS*/
- strcpy(FieldMap[SWEEP_EN].Name,"SWEEP_EN") ;
- FieldMap[SWEEP_EN].Reg = CRL_10 ;
- FieldMap[SWEEP_EN].Pos = 0 ;
- FieldMap[SWEEP_EN].Bits = 1 ;
- FieldMap[SWEEP_EN].Type = UNSIGNED ;
- FieldMap[SWEEP_EN].Mask = FieldCreateMask(SWEEP_EN) ;
- /* FIELDS*/
- strcpy(FieldMap[PH_EN].Name,"PH_EN") ;
- FieldMap[PH_EN].Reg = CRL_10 ;
- FieldMap[PH_EN].Pos = 1 ;
- FieldMap[PH_EN].Bits = 1 ;
- FieldMap[PH_EN].Type = UNSIGNED ;
- FieldMap[PH_EN].Mask = FieldCreateMask(PH_EN) ;
- /* FIELDS*/
- strcpy(FieldMap[DIR_EN].Name,"DIR_EN") ;
- FieldMap[DIR_EN].Reg = CRL_10 ;
- FieldMap[DIR_EN].Pos = 2 ;
- FieldMap[DIR_EN].Bits = 1 ;
- FieldMap[DIR_EN].Type = UNSIGNED ;
- FieldMap[DIR_EN].Mask = FieldCreateMask(DIR_EN) ;
- /* FIELDS*/
- strcpy(FieldMap[INT_EN].Name,"INT_EN") ;
- FieldMap[INT_EN].Reg = CRL_10 ;
- FieldMap[INT_EN].Pos = 3 ;
- FieldMap[INT_EN].Bits = 1 ;
- FieldMap[INT_EN].Type = UNSIGNED ;
- FieldMap[INT_EN].Mask = FieldCreateMask(INT_EN) ;
- /* FIELDS*/
- strcpy(FieldMap[DIR_DIS].Name,"DIR_DIS") ;
- FieldMap[DIR_DIS].Reg = CRL_10 ;
- FieldMap[DIR_DIS].Pos = 4 ;
- FieldMap[DIR_DIS].Bits = 1 ;
- FieldMap[DIR_DIS].Type = UNSIGNED ;
- FieldMap[DIR_DIS].Mask = FieldCreateMask(DIR_DIS) ;
- /* FIELDS*/
- strcpy(FieldMap[INT_DIS].Name,"INT_DIS") ;
- FieldMap[INT_DIS].Reg = CRL_10 ;
- FieldMap[INT_DIS].Pos = 5 ;
- FieldMap[INT_DIS].Bits = 1 ;
- FieldMap[INT_DIS].Type = UNSIGNED ;
- FieldMap[INT_DIS].Mask = FieldCreateMask(INT_DIS) ;
- /* CRL_11*/
- RegMap[CRL_11].Addr = 0x6B ;
- RegMap[CRL_11].Reset = 0x92 ;
- RegMap[CRL_11].Value = 0x00 ;
- strcpy(RegMap[CRL_11].Name,"CRL_11") ;
- /* FIELDS*/
- strcpy(FieldMap[CRL_SNAPSHOT].Name,"CRL_SNAPSHOT") ;
- FieldMap[CRL_SNAPSHOT].Reg = CRL_11 ;
- FieldMap[CRL_SNAPSHOT].Pos = 0 ;
- FieldMap[CRL_SNAPSHOT].Bits = 8 ;
- FieldMap[CRL_SNAPSHOT].Type = UNSIGNED ;
- FieldMap[CRL_SNAPSHOT].Mask = FieldCreateMask(CRL_SNAPSHOT) ;
- /* PMF_AGC_0*/
- RegMap[PMFAGC_0].Addr = 0x70 ;
- RegMap[PMFAGC_0].Reset = 0xFF ;
- RegMap[PMFAGC_0].Value = 0xFF ;
- strcpy(RegMap[PMFAGC_0].Name,"PMFAGC_0") ;
- /* FIELDS*/
- strcpy(FieldMap[LOCK_THRES_LO].Name,"LOCK_THRES_LO") ;
- FieldMap[LOCK_THRES_LO].Reg = PMFAGC_0 ;
- FieldMap[LOCK_THRES_LO].Pos = 0 ;
- FieldMap[LOCK_THRES_LO].Bits = 8 ;
- FieldMap[LOCK_THRES_LO].Type = UNSIGNED ;
- FieldMap[LOCK_THRES_LO].Mask = FieldCreateMask(LOCK_THRES_LO) ;
- /* PMF_AGC_1*/
- RegMap[PMFAGC_1].Addr = 0x71 ;
- RegMap[PMFAGC_1].Reset = 0x04 ;
- RegMap[PMFAGC_1].Value = 0x00 ;
- strcpy(RegMap[PMFAGC_1].Name,"PMFAGC_1") ;
- /* FIELDS*/
- strcpy(FieldMap[PMFA_F_UNLOCK].Name,"PMFA_F_UNLOCK") ;
- FieldMap[PMFA_F_UNLOCK].Reg = PMFAGC_1 ;
- FieldMap[PMFA_F_UNLOCK].Pos = 7 ;
- FieldMap[PMFA_F_UNLOCK].Bits = 1 ;
- FieldMap[PMFA_F_UNLOCK].Type = UNSIGNED ;
- FieldMap[PMFA_F_UNLOCK].Mask = FieldCreateMask(PMFA_F_UNLOCK) ;
- /* FIELDS*/
- strcpy(FieldMap[PMFA_F_LOCK].Name,"PMFA_F_LOCK") ;
- FieldMap[PMFA_F_LOCK].Reg = PMFAGC_1 ;
- FieldMap[PMFA_F_LOCK].Pos = 6 ;
- FieldMap[PMFA_F_LOCK].Bits = 1 ;
- FieldMap[PMFA_F_LOCK].Type = UNSIGNED ;
- FieldMap[PMFA_F_LOCK].Mask = FieldCreateMask(PMFA_F_LOCK) ;
- /* FIELDS*/
- strcpy(FieldMap[WBAGC_F_LOCK].Name,"WBAGC_F_LOCK") ;
- FieldMap[WBAGC_F_LOCK].Reg = PMFAGC_1 ;
- FieldMap[WBAGC_F_LOCK].Pos = 5 ;
- FieldMap[WBAGC_F_LOCK].Bits = 1 ;
- FieldMap[WBAGC_F_LOCK].Type = UNSIGNED ;
- FieldMap[WBAGC_F_LOCK].Mask = FieldCreateMask(WBAGC_F_LOCK) ;
- /* FIELDS*/
- strcpy(FieldMap[UP_STOP].Name,"UP_STOP") ;
- FieldMap[UP_STOP].Reg = PMFAGC_1 ;
- FieldMap[UP_STOP].Pos = 4 ;
- FieldMap[UP_STOP].Bits = 1 ;
- FieldMap[UP_STOP].Type = UNSIGNED ;
- FieldMap[UP_STOP].Mask = FieldCreateMask(UP_STOP) ;
- /* FIELDS*/
- strcpy(FieldMap[LOCK_THRES_HI].Name,"LOCK_THRES_HI") ;
- FieldMap[LOCK_THRES_HI].Reg = PMFAGC_1 ;
- FieldMap[LOCK_THRES_HI].Pos = 0 ;
- FieldMap[LOCK_THRES_HI].Bits = 4 ;
- FieldMap[LOCK_THRES_HI].Type = UNSIGNED ;
- FieldMap[LOCK_THRES_HI].Mask = FieldCreateMask(LOCK_THRES_HI) ;
- /* PMF_AGC_2*/
- RegMap[PMFAGC_2].Addr = 0x72 ;
- RegMap[PMFAGC_2].Reset = 0x00 ;
- RegMap[PMFAGC_2].Value = 0x00 ;
- strcpy(RegMap[PMFAGC_2].Name,"PMFAGC_2") ;
- /* FIELDS*/
- strcpy(FieldMap[PMFA_ACC0].Name,"PMFA_ACC0") ;
- FieldMap[PMFA_ACC0].Reg = PMFAGC_2 ;
- FieldMap[PMFA_ACC0].Pos = 0 ;
- FieldMap[PMFA_ACC0].Bits = 8 ;
- FieldMap[PMFA_ACC0].Type = UNSIGNED ;
- FieldMap[PMFA_ACC0].Mask = FieldCreateMask(PMFA_ACC0) ;
- /* PMF_AGC_3*/
- RegMap[PMFAGC_3].Addr = 0x73 ;
- RegMap[PMFAGC_3].Reset = 0x00 ;
- RegMap[PMFAGC_3].Value = 0x00 ;
- strcpy(RegMap[PMFAGC_3].Name,"PMFAGC_3") ;
- /* FIELDS*/
- strcpy(FieldMap[PMFA_ACC1].Name,"PMFA_ACC1") ;
- FieldMap[PMFA_ACC1].Reg = PMFAGC_3 ;
- FieldMap[PMFA_ACC1].Pos = 0 ;
- FieldMap[PMFA_ACC1].Bits = 8 ;
- FieldMap[PMFA_ACC1].Type = UNSIGNED ;
- FieldMap[PMFA_ACC1].Mask = FieldCreateMask(PMFA_ACC1) ;
- /* PMF_AGC_4*/
- RegMap[PMFAGC_4].Addr = 0x74 ;
- RegMap[PMFAGC_4].Reset = 0x00 ;
- RegMap[PMFAGC_4].Value = 0x00 ;
- strcpy(RegMap[PMFAGC_4].Name,"PMFAGC_4") ;
- /* FIELDS*/
- strcpy(FieldMap[PMFA_LOCK_STATE].Name,"PMFA_LOCK_STATE") ;
- FieldMap[PMFA_LOCK_STATE].Reg = PMFAGC_4 ;
- FieldMap[PMFA_LOCK_STATE].Pos = 7 ;
- FieldMap[PMFA_LOCK_STATE].Bits = 1 ;
- FieldMap[PMFA_LOCK_STATE].Type = UNSIGNED ;
- FieldMap[PMFA_LOCK_STATE].Mask = FieldCreateMask(PMFA_LOCK_STATE) ;
- /* FIELDS*/
- strcpy(FieldMap[PMFA_ACC2].Name,"PMFA_ACC2") ;
- FieldMap[PMFA_ACC2].Reg = PMFAGC_4 ;
- FieldMap[PMFA_ACC2].Pos = 0 ;
- FieldMap[PMFA_ACC2].Bits = 4 ;
- FieldMap[PMFA_ACC2].Type = UNSIGNED ;
- FieldMap[PMFA_ACC2].Mask = FieldCreateMask(PMFA_ACC2) ;
- /* CTRL_0*/
- RegMap[CTRL_0].Addr = 0x80 ;
- RegMap[CTRL_0].Reset = 0x20 ;
- RegMap[CTRL_0].Value = 0x00 ;
- strcpy(RegMap[CTRL_0].Name,"CTRL_0") ;
- /* FIELDS*/
- strcpy(FieldMap[SOFT_RESET].Name,"SOFT_RESET") ;
- FieldMap[SOFT_RESET].Reg = CTRL_0 ;
- FieldMap[SOFT_RESET].Pos = 0 ;
- FieldMap[SOFT_RESET].Bits = 1 ;
- FieldMap[SOFT_RESET].Type = UNSIGNED ;
- FieldMap[SOFT_RESET].Mask = FieldCreateMask(SOFT_RESET) ;
- /* FIELDS*/
- strcpy(FieldMap[VERSION].Name,"VERSION") ;
- FieldMap[VERSION].Reg = CTRL_0 ;
- FieldMap[VERSION].Pos = 4 ;
- FieldMap[VERSION].Bits = 3 ;
- FieldMap[VERSION].Type = UNSIGNED ;
- FieldMap[VERSION].Mask = FieldCreateMask(VERSION) ;
- /* CTRL_1*/
- RegMap[CTRL_1].Addr = 0x81 ;
- RegMap[CTRL_1].Reset = 0x00 ;
- RegMap[CTRL_1].Value = 0x00 ;
- strcpy(RegMap[CTRL_1].Name,"CTRL_1") ;
- /* FIELDS*/
- strcpy(FieldMap[RESET_DI].Name,"RESET_DI") ;
- FieldMap[RESET_DI].Reg = CTRL_1 ;
- FieldMap[RESET_DI].Pos = 0 ;
- FieldMap[RESET_DI].Bits = 1 ;
- FieldMap[RESET_DI].Type = UNSIGNED ;
- FieldMap[RESET_DI].Mask = FieldCreateMask(RESET_DI) ;
- /* CTRL_2*/
- RegMap[CTRL_2].Addr = 0x82 ;
- RegMap[CTRL_2].Reset = 0x27 ;
- RegMap[CTRL_2].Value = 0x00 ;
- strcpy(RegMap[CTRL_2].Name,"CTRL_2") ;
- /* FIELDS*/
- strcpy(FieldMap[RS_UNCORR].Name,"RS_UNCORR") ;
- FieldMap[RS_UNCORR].Reg = CTRL_2 ;
- FieldMap[RS_UNCORR].Pos = 5 ;
- FieldMap[RS_UNCORR].Bits = 1 ;
- FieldMap[RS_UNCORR].Type = UNSIGNED ;
- FieldMap[RS_UNCORR].Mask = FieldCreateMask(RS_UNCORR) ;
- /* FIELDS*/
- strcpy(FieldMap[CORNER_LOCK].Name,"CORNER_LOCK") ;
- FieldMap[CORNER_LOCK].Reg = CTRL_2 ;
- FieldMap[CORNER_LOCK].Pos = 4 ;
- FieldMap[CORNER_LOCK].Bits = 1 ;
- FieldMap[CORNER_LOCK].Type = UNSIGNED ;
- FieldMap[CORNER_LOCK].Mask = FieldCreateMask(CORNER_LOCK) ;
- /* FIELDS*/
- strcpy(FieldMap[EQU_LMS2].Name,"EQU_LMS2") ;
- FieldMap[EQU_LMS2].Reg = CTRL_2 ;
- FieldMap[EQU_LMS2].Pos = 3 ;
- FieldMap[EQU_LMS2].Bits = 1 ;
- FieldMap[EQU_LMS2].Type = UNSIGNED ;
- FieldMap[EQU_LMS2].Mask = FieldCreateMask(EQU_LMS2) ;
- /* FIELDS*/
- strcpy(FieldMap[EQU_LMS1].Name,"EQU_LMS1") ;
- FieldMap[EQU_LMS1].Reg = CTRL_2 ;
- FieldMap[EQU_LMS1].Pos = 2 ;
- FieldMap[EQU_LMS1].Bits = 1 ;
- FieldMap[EQU_LMS1].Type = UNSIGNED ;
- FieldMap[EQU_LMS1].Mask = FieldCreateMask(EQU_LMS1) ;
- /* FIELDS*/
- strcpy(FieldMap[PMFAGC_IT].Name,"PMFAGC_IT") ;
- FieldMap[PMFAGC_IT].Reg = CTRL_2 ;
- FieldMap[PMFAGC_IT].Pos = 1 ;
- FieldMap[PMFAGC_IT].Bits = 1 ;
- FieldMap[PMFAGC_IT].Type = UNSIGNED ;
- FieldMap[PMFAGC_IT].Mask = FieldCreateMask(PMFAGC_IT) ;
- /* FIELDS*/
- strcpy(FieldMap[WBAGC_IT].Name,"WBAGC_IT") ;
- FieldMap[WBAGC_IT].Reg = CTRL_2 ;
- FieldMap[WBAGC_IT].Pos = 0 ;
- FieldMap[WBAGC_IT].Bits = 1 ;
- FieldMap[WBAGC_IT].Type = UNSIGNED ;
- FieldMap[WBAGC_IT].Mask = FieldCreateMask(WBAGC_IT) ;
- /* CTRL_3*/
- RegMap[CTRL_3].Addr = 0x83 ;
- RegMap[CTRL_3].Reset = 0x08 ;
- RegMap[CTRL_3].Value = 0x02 ;
- strcpy(RegMap[CTRL_3].Name,"CTRL_3") ;
- /* FIELDS*/
- strcpy(FieldMap[J83C].Name,"J83C") ;
- FieldMap[J83C].Reg = CTRL_3;
- FieldMap[J83C].Pos = 0 ;
- FieldMap[J83C].Bits = 1 ;
- FieldMap[J83C].Type = UNSIGNED ;
- FieldMap[J83C].Mask = FieldCreateMask(J83C) ;
- /* FIELDS*/
- strcpy(FieldMap[DFS].Name,"DFS") ;
- FieldMap[DFS].Reg = CTRL_3;
- FieldMap[DFS].Pos = 1 ;
- FieldMap[DFS].Bits = 1 ;
- FieldMap[DFS].Type = UNSIGNED ;
- FieldMap[DFS].Mask = FieldCreateMask(DFS) ;
- /* FIELDS*/
- strcpy(FieldMap[SPEC_INV].Name,"SPEC_INV") ;
- FieldMap[SPEC_INV].Reg = CTRL_3;
- FieldMap[SPEC_INV].Pos = 3 ;
- FieldMap[SPEC_INV].Bits = 1 ;
- FieldMap[SPEC_INV].Type = UNSIGNED ;
- FieldMap[SPEC_INV].Mask = FieldCreateMask(SPEC_INV) ;
- /* FIELDS*/
- strcpy(FieldMap[RESET_RS].Name,"RESET_RS") ;
- FieldMap[RESET_RS].Reg = CTRL_3;
- FieldMap[RESET_RS].Pos = 4 ;
- FieldMap[RESET_RS].Bits = 1 ;
- FieldMap[RESET_RS].Type = UNSIGNED ;
- FieldMap[RESET_RS].Mask = FieldCreateMask(RESET_RS) ;
- /* FIELDS*/
- strcpy(FieldMap[TEST_SEL].Name,"TEST_SEL") ;
- FieldMap[TEST_SEL].Reg = CTRL_3;
- FieldMap[TEST_SEL].Pos = 5 ;
- FieldMap[TEST_SEL].Bits = 3 ;
- FieldMap[TEST_SEL].Type = UNSIGNED ;
- FieldMap[TEST_SEL].Mask = FieldCreateMask(TEST_SEL) ;
- /* CTRL_4*/
- RegMap[CTRL_4].Addr = 0x84 ;
- RegMap[CTRL_4].Reset = 0x02 ;
- RegMap[CTRL_4].Value = 0x0A ;
- strcpy(RegMap[CTRL_4].Name,"CTRL_4") ;
- /* FIELDS*/
- strcpy(FieldMap[RESET_EQL].Name,"RESET_EQL") ;
- FieldMap[RESET_EQL].Reg = CTRL_4 ;
- FieldMap[RESET_EQL].Pos = 0 ;
- FieldMap[RESET_EQL].Bits = 1 ;
- FieldMap[RESET_EQL].Type = UNSIGNED ;
- FieldMap[RESET_EQL].Mask = FieldCreateMask(RESET_EQL) ;
- /* FIELDS*/
- strcpy(FieldMap[CKX2SEL].Name,"CKX2SEL") ;
- FieldMap[CKX2SEL].Reg = CTRL_4 ;
- FieldMap[CKX2SEL].Pos = 1 ;
- FieldMap[CKX2SEL].Bits = 1 ;
- FieldMap[CKX2SEL].Type = UNSIGNED ;
- FieldMap[CKX2SEL].Mask = FieldCreateMask(CKX2SEL) ;
- /* FIELDS*/
- strcpy(FieldMap[CKX2DIS].Name,"CKX2DIS") ;
- FieldMap[CKX2DIS].Reg = CTRL_4 ;
- FieldMap[CKX2DIS].Pos = 2 ;
- FieldMap[CKX2DIS].Bits = 1 ;
- FieldMap[CKX2DIS].Type = UNSIGNED ;
- FieldMap[CKX2DIS].Mask = FieldCreateMask(CKX2DIS) ;
- /* FIELDS*/
- strcpy(FieldMap[INVADCLK].Name,"INVADCLK") ;
- FieldMap[INVADCLK].Reg = CTRL_4 ;
- FieldMap[INVADCLK].Pos = 3 ;
- FieldMap[INVADCLK].Bits = 1 ;
- FieldMap[INVADCLK].Type = UNSIGNED ;
- FieldMap[INVADCLK].Mask = FieldCreateMask(INVADCLK) ;
- /* FIELDS*/
- strcpy(FieldMap[M_OEN].Name,"M_OEN") ;
- FieldMap[M_OEN].Reg = CTRL_4 ;
- FieldMap[M_OEN].Pos = 4 ;
- FieldMap[M_OEN].Bits = 1 ;
- FieldMap[M_OEN].Type = UNSIGNED ;
- FieldMap[M_OEN].Mask = FieldCreateMask(M_OEN) ;
- /* FIELDS*/
- strcpy(FieldMap[AGC_OD].Name,"AGC_OD") ;
- FieldMap[AGC_OD].Reg = CTRL_4 ;
- FieldMap[AGC_OD].Pos = 5 ;
- FieldMap[AGC_OD].Bits = 1 ;
- FieldMap[AGC_OD].Type = UNSIGNED ;
- FieldMap[AGC_OD].Mask = FieldCreateMask(AGC_OD) ;
- /* CTRL_5*/
- RegMap[CTRL_5].Addr = 0x85 ;
- RegMap[CTRL_5].Reset = 0xA2 ;
- RegMap[CTRL_5].Value = 0x00 ;
- strcpy(RegMap[CTRL_5].Name,"CTRL_5") ;
- /* FIELDS*/
- strcpy(FieldMap[LOCKPOL].Name,"LOCKPOL") ;
- FieldMap[LOCKPOL].Reg = CTRL_5 ;
- FieldMap[LOCKPOL].Pos = 7 ;
- FieldMap[LOCKPOL].Bits = 1 ;
- FieldMap[LOCKPOL].Type = UNSIGNED ;
- FieldMap[LOCKPOL].Mask = FieldCreateMask(LOCKPOL) ;
- /* FIELDS*/
- strcpy(FieldMap[DY_SY_MASK].Name,"DY_SY_MASK") ;
- FieldMap[DY_SY_MASK].Reg = CTRL_5 ;
- FieldMap[DY_SY_MASK].Pos = 6 ;
- FieldMap[DY_SY_MASK].Bits = 1 ;
- FieldMap[DY_SY_MASK].Type = UNSIGNED ;
- FieldMap[DY_SY_MASK].Mask = FieldCreateMask(DY_SY_MASK) ;
- /* FIELDS*/
- strcpy(FieldMap[DY_SY_EV].Name,"DY_SY_EV") ;
- FieldMap[DY_SY_EV].Reg = CTRL_5 ;
- FieldMap[DY_SY_EV].Pos = 5 ;
- FieldMap[DY_SY_EV].Bits = 1 ;
- FieldMap[DY_SY_EV].Type = UNSIGNED ;
- FieldMap[DY_SY_EV].Mask = FieldCreateMask(DY_SY_EV) ;
- /* FIELDS*/
- strcpy(FieldMap[DY_SY_DIR].Name,"DY_SY_DIR") ;
- FieldMap[DY_SY_DIR].Reg = CTRL_5 ;
- FieldMap[DY_SY_DIR].Pos = 4 ;
- FieldMap[DY_SY_DIR].Bits = 1 ;
- FieldMap[DY_SY_DIR].Type = UNSIGNED ;
- FieldMap[DY_SY_DIR].Mask = FieldCreateMask(DY_SY_DIR) ;
- /* FIELDS*/
- strcpy(FieldMap[SYNC_MSK].Name,"SYNC_MSK") ;
- FieldMap[SYNC_MSK].Reg = CTRL_5 ;
- FieldMap[SYNC_MSK].Pos = 2 ;
- FieldMap[SYNC_MSK].Bits = 1 ;
- FieldMap[SYNC_MSK].Type = UNSIGNED ;
- FieldMap[SYNC_MSK].Mask = FieldCreateMask(SYNC_MSK) ;
- /* FIELDS*/
- strcpy(FieldMap[SYNC_EV].Name,"SYNC_EV") ;
- FieldMap[SYNC_EV].Reg = CTRL_5 ;
- FieldMap[SYNC_EV].Pos = 1 ;
- FieldMap[SYNC_EV].Bits = 1 ;
- FieldMap[SYNC_EV].Type = UNSIGNED ;
- FieldMap[SYNC_EV].Mask = FieldCreateMask(SYNC_EV) ;
- /* FIELDS*/
- strcpy(FieldMap[SYNC_DIR].Name,"SYNC_DIR") ;
- FieldMap[SYNC_DIR].Reg = CTRL_5 ;
- FieldMap[SYNC_DIR].Pos = 0 ;
- FieldMap[SYNC_DIR].Bits = 1 ;
- FieldMap[SYNC_DIR].Type = UNSIGNED ;
- FieldMap[SYNC_DIR].Mask = FieldCreateMask(SYNC_DIR) ;
- /* CTRL_6*/
- RegMap[CTRL_6].Addr = 0x86 ;
- RegMap[CTRL_6].Reset = 0x08 ;
- RegMap[CTRL_6].Value = 0x40 ;
- strcpy(RegMap[CTRL_6].Name,"CTRL_6") ;
- /* FIELDS*/
- strcpy(FieldMap[I2CT_EN].Name,"I2CT_EN") ;
- FieldMap[I2CT_EN].Reg = CTRL_6 ;
- FieldMap[I2CT_EN].Pos = 7 ;
- FieldMap[I2CT_EN].Bits = 1 ;
- FieldMap[I2CT_EN].Type = UNSIGNED ;
- FieldMap[I2CT_EN].Mask = FieldCreateMask(I2CT_EN) ;
- /* FIELDS*/
- strcpy(FieldMap[SCLT_OD].Name,"SCLT_OD") ;
- FieldMap[SCLT_OD].Reg = CTRL_6 ;
- FieldMap[SCLT_OD].Pos = 6 ;
- FieldMap[SCLT_OD].Bits = 1 ;
- FieldMap[SCLT_OD].Type = UNSIGNED ;
- FieldMap[SCLT_OD].Mask = FieldCreateMask(SCLT_OD) ;
- /* FIELDS*/
- strcpy(FieldMap[EXTADCLK_EN].Name,"EXTADCLK_EN") ;
- FieldMap[EXTADCLK_EN].Reg = CTRL_6 ;
- FieldMap[EXTADCLK_EN].Pos = 5 ;
- FieldMap[EXTADCLK_EN].Bits = 1 ;
- FieldMap[EXTADCLK_EN].Type = UNSIGNED ;
- FieldMap[EXTADCLK_EN].Mask = FieldCreateMask(EXTADCLK_EN) ;
- /* FIELDS*/
- strcpy(FieldMap[ITLOCKSEL].Name,"ITLOCKSEL") ;
- FieldMap[ITLOCKSEL].Reg = CTRL_6 ;
- FieldMap[ITLOCKSEL].Pos = 4 ;
- FieldMap[ITLOCKSEL].Bits = 1 ;
- FieldMap[ITLOCKSEL].Type = UNSIGNED ;
- FieldMap[ITLOCKSEL].Mask = FieldCreateMask(ITLOCKSEL) ;
- /* FIELDS*/
- strcpy(FieldMap[ITPWMSEL].Name,"ITPWMSEL") ;
- FieldMap[ITPWMSEL].Reg = CTRL_6 ;
- FieldMap[ITPWMSEL].Pos = 3 ;
- FieldMap[ITPWMSEL].Bits = 1 ;
- FieldMap[ITPWMSEL].Type = UNSIGNED ;
- FieldMap[ITPWMSEL].Mask = FieldCreateMask(ITPWMSEL) ;
- /* FIELDS*/
- strcpy(FieldMap[LOCKSCE].Name,"LOCKSCE") ;
- FieldMap[LOCKSCE].Reg = CTRL_6 ;
- FieldMap[LOCKSCE].Pos = 1 ;
- FieldMap[LOCKSCE].Bits = 2 ;
- FieldMap[LOCKSCE].Type = UNSIGNED ;
- FieldMap[LOCKSCE].Mask = FieldCreateMask(LOCKSCE) ;
- /* FIELDS*/
- strcpy(FieldMap[TWB_ACT].Name,"TWB_ACT") ;
- FieldMap[TWB_ACT].Reg = CTRL_6 ;
- FieldMap[TWB_ACT].Pos = 0 ;
- FieldMap[TWB_ACT].Bits = 1 ;
- FieldMap[TWB_ACT].Type = UNSIGNED ;
- FieldMap[TWB_ACT].Mask = FieldCreateMask(TWB_ACT) ;
- /* CTRL_7*/
- RegMap[CTRL_7].Addr = 0x87 ;
- RegMap[CTRL_7].Reset = 0x63 ;
- RegMap[CTRL_7].Value = 0x03 ;
- strcpy(RegMap[CTRL_7].Name,"CTRL_7") ;
- /* FIELDS*/
- strcpy(FieldMap[SOURCESEL].Name,"SOURCESEL") ;
- FieldMap[SOURCESEL].Reg = CTRL_7 ;
- FieldMap[SOURCESEL].Pos = 7 ;
- FieldMap[SOURCESEL].Bits = 1 ;
- FieldMap[SOURCESEL].Type = UNSIGNED ;
- FieldMap[SOURCESEL].Mask = FieldCreateMask(SOURCESEL) ;
- /* FIELDS*/
- strcpy(FieldMap[PRGCLKDIV].Name,"PRGCLKDIV") ;
- FieldMap[PRGCLKDIV].Reg = CTRL_7 ;
- FieldMap[PRGCLKDIV].Pos = 4 ;
- FieldMap[PRGCLKDIV].Bits = 3 ;
- FieldMap[PRGCLKDIV].Type = UNSIGNED ;
- FieldMap[PRGCLKDIV].Mask = FieldCreateMask(PRGCLKDIV) ;
- /* FIELDS*/
- strcpy(FieldMap[AUXCLKSEL].Name,"AUXCLKSEL") ;
- FieldMap[AUXCLKSEL].Reg = CTRL_7 ;
- FieldMap[AUXCLKSEL].Pos = 3 ;
- FieldMap[AUXCLKSEL].Bits = 1 ;
- FieldMap[AUXCLKSEL].Type = UNSIGNED ;
- FieldMap[AUXCLKSEL].Mask = FieldCreateMask(AUXCLKSEL) ;
- /* FIELDS*/
- strcpy(FieldMap[ITLOCK_OD].Name,"ITLOCK_OD") ;
- FieldMap[ITLOCK_OD].Reg = CTRL_7 ;
- FieldMap[ITLOCK_OD].Pos = 1 ;
- FieldMap[ITLOCK_OD].Bits = 1 ;
- FieldMap[ITLOCK_OD].Type = UNSIGNED ;
- FieldMap[ITLOCK_OD].Mask = FieldCreateMask(ITLOCK_OD) ;
- /* FIELDS*/
- strcpy(FieldMap[ITPWM_OD].Name,"ITPWM_OD") ;
- FieldMap[ITPWM_OD].Reg = CTRL_7 ;
- FieldMap[ITPWM_OD].Pos = 0 ;
- FieldMap[ITPWM_OD].Bits = 1 ;
- FieldMap[ITPWM_OD].Type = UNSIGNED ;
- FieldMap[ITPWM_OD].Mask = FieldCreateMask(ITPWM_OD) ;
- /* CTRL_8*/
- RegMap[CTRL_8].Addr = 0x88 ;
- RegMap[CTRL_8].Reset = 0x00 ;
- RegMap[CTRL_8].Value = 0x00 ;
- strcpy(RegMap[CTRL_8].Name,"CTRL_8") ;
- /* FIELDS*/
- strcpy(FieldMap[AGC12SEL].Name,"AGC12SEL") ;
- FieldMap[AGC12SEL].Reg = CTRL_8 ;
- FieldMap[AGC12SEL].Pos = 7 ;
- FieldMap[AGC12SEL].Bits = 1 ;
- FieldMap[AGC12SEL].Type = UNSIGNED ;
- FieldMap[AGC12SEL].Mask = FieldCreateMask(AGC12SEL) ;
- /* FIELDS*/
- strcpy(FieldMap[AGC12B_EN].Name,"AGC12B_EN") ;
- FieldMap[AGC12B_EN].Reg = CTRL_8 ;
- FieldMap[AGC12B_EN].Pos = 6 ;
- FieldMap[AGC12B_EN].Bits = 1 ;
- FieldMap[AGC12B_EN].Type = UNSIGNED ;
- FieldMap[AGC12B_EN].Mask = FieldCreateMask(AGC12B_EN) ;
- /* FIELDS*/
- strcpy(FieldMap[SIGMA_INV_1].Name,"SIGMA_INV_1") ;
- FieldMap[SIGMA_INV_1].Reg = CTRL_8 ;
- FieldMap[SIGMA_INV_1].Pos = 5 ;
- FieldMap[SIGMA_INV_1].Bits = 1 ;
- FieldMap[SIGMA_INV_1].Type = UNSIGNED ;
- FieldMap[SIGMA_INV_1].Mask = FieldCreateMask(SIGMA_INV_1) ;
- /* FIELDS*/
- strcpy(FieldMap[SIGMA_INV_2].Name,"SIGMA_INV_2") ;
- FieldMap[SIGMA_INV_2].Reg = CTRL_8 ;
- FieldMap[SIGMA_INV_2].Pos = 4 ;
- FieldMap[SIGMA_INV_2].Bits = 1 ;
- FieldMap[SIGMA_INV_2].Type = UNSIGNED ;
- FieldMap[SIGMA_INV_2].Mask = FieldCreateMask(SIGMA_INV_2) ;
- /* FIELDS*/
- strcpy(FieldMap[EN_CORNER_DET].Name,"EN_CORNER_DET") ;
- FieldMap[EN_CORNER_DET].Reg = CTRL_8 ;
- FieldMap[EN_CORNER_DET].Pos = 3 ;
- FieldMap[EN_CORNER_DET].Bits = 1 ;
- FieldMap[EN_CORNER_DET].Type = UNSIGNED ;
- FieldMap[EN_CORNER_DET].Mask = FieldCreateMask(EN_CORNER_DET) ;
- /* CTRL_9*/
- RegMap[CTRL_9].Addr = 0x89 ;
- RegMap[CTRL_9].Reset = 0x00 ;
- RegMap[CTRL_9].Value = 0x00 ;
- strcpy(RegMap[CTRL_9].Name,"CTRL_9") ;
- /* FIELDS*/
- strcpy(FieldMap[AUTOQAMMODE_SEL].Name,"AUTOQAMMODE_SEL") ;
- FieldMap[AUTOQAMMODE_SEL].Reg = CTRL_9 ;
- FieldMap[AUTOQAMMODE_SEL].Pos = 7 ;
- FieldMap[AUTOQAMMODE_SEL].Bits = 1 ;
- FieldMap[AUTOQAMMODE_SEL].Type = UNSIGNED ;
- FieldMap[AUTOQAMMODE_SEL].Mask = FieldCreateMask(AUTOQAMMODE_SEL) ;
- /* FIELDS*/
- strcpy(FieldMap[AUTOCONSTEL_TIMER].Name,"AUTOCONSTEL_TIMER") ;
- FieldMap[AUTOCONSTEL_TIMER].Reg = CTRL_9 ;
- FieldMap[AUTOCONSTEL_TIMER].Pos = 3 ;
- FieldMap[AUTOCONSTEL_TIMER].Bits = 4 ;
- FieldMap[AUTOCONSTEL_TIMER].Type = UNSIGNED ;
- FieldMap[AUTOCONSTEL_TIMER].Mask = FieldCreateMask(AUTOCONSTEL_TIMER) ;
- /* FIELDS*/
- strcpy(FieldMap[AUTOSTOP_CONSTEL].Name,"AUTOSTOP_CONSTEL") ;
- FieldMap[AUTOSTOP_CONSTEL].Reg = CTRL_9 ;
- FieldMap[AUTOSTOP_CONSTEL].Pos = 2 ;
- FieldMap[AUTOSTOP_CONSTEL].Bits = 1 ;
- FieldMap[AUTOSTOP_CONSTEL].Type = UNSIGNED ;
- FieldMap[AUTOSTOP_CONSTEL].Mask = FieldCreateMask(AUTOSTOP_CONSTEL) ;
- /* FIELDS*/
- strcpy(FieldMap[AUTOCONSTEL_ON].Name,"AUTOCONSTEL_ON") ;
- FieldMap[AUTOCONSTEL_ON].Reg = CTRL_9 ;
- FieldMap[AUTOCONSTEL_ON].Pos = 1 ;
- FieldMap[AUTOCONSTEL_ON].Bits = 1 ;
- FieldMap[AUTOCONSTEL_ON].Type = UNSIGNED ;
- FieldMap[AUTOCONSTEL_ON].Mask = FieldCreateMask(AUTOCONSTEL_ON) ;
- /* DEINT_SYNC_0*/
- RegMap[DEINT_SYNC_0].Addr = 0x90 ;
- RegMap[DEINT_SYNC_0].Reset = 0x00 ;
- RegMap[DEINT_SYNC_0].Value = 0x01 ;
- strcpy(RegMap[DEINT_SYNC_0].Name,"DEINT_SYNC_0") ;
- /* FIELDS*/
- strcpy(FieldMap[DI_UNLOCK].Name,"DI_UNLOCK") ;
- FieldMap[DI_UNLOCK].Reg = DEINT_SYNC_0 ;
- FieldMap[DI_UNLOCK].Pos = 7 ;
- FieldMap[DI_UNLOCK].Bits = 1 ;
- FieldMap[DI_UNLOCK].Type = UNSIGNED ;
- FieldMap[DI_UNLOCK].Mask = FieldCreateMask(DI_UNLOCK) ;
- /* FIELDS*/
- strcpy(FieldMap[DI_FREEZE].Name,"DI_FREEZE") ;
- FieldMap[DI_FREEZE].Reg = DEINT_SYNC_0 ;
- FieldMap[DI_FREEZE].Pos = 6 ;
- FieldMap[DI_FREEZE].Bits = 1 ;
- FieldMap[DI_FREEZE].Type = UNSIGNED ;
- FieldMap[DI_FREEZE].Mask = FieldCreateMask(DI_FREEZE) ;
- /* FIELDS*/
- strcpy(FieldMap[MISMATCH].Name,"MISMATCH") ;
- FieldMap[MISMATCH].Reg = DEINT_SYNC_0 ;
- FieldMap[MISMATCH].Pos = 4 ;
- FieldMap[MISMATCH].Bits = 2 ;
- FieldMap[MISMATCH].Type = UNSIGNED ;
- FieldMap[MISMATCH].Mask = FieldCreateMask(MISMATCH) ;
- /* FIELDS*/
- strcpy(FieldMap[ACQ_MODE].Name,"ACQ_MODE") ;
- FieldMap[ACQ_MODE].Reg = DEINT_SYNC_0 ;
- FieldMap[ACQ_MODE].Pos = 2 ;
- FieldMap[ACQ_MODE].Bits = 2 ;
- FieldMap[ACQ_MODE].Type = UNSIGNED ;
- FieldMap[ACQ_MODE].Mask = FieldCreateMask(ACQ_MODE) ;
- /* FIELDS*/
- strcpy(FieldMap[TRKMODE].Name,"TRKMODE") ;
- FieldMap[TRKMODE].Reg = DEINT_SYNC_0 ;
- FieldMap[TRKMODE].Pos = 0 ;
- FieldMap[TRKMODE].Bits = 2 ;
- FieldMap[TRKMODE].Type = UNSIGNED ;
- FieldMap[TRKMODE].Mask = FieldCreateMask(TRKMODE) ;
- /* DEINT_SYNC_1*/
- RegMap[DEINT_SYNC_1].Addr = 0x91 ;
- RegMap[DEINT_SYNC_1].Reset = 0x04 ;
- RegMap[DEINT_SYNC_1].Value = 0x01 ;
- strcpy(RegMap[DEINT_SYNC_1].Name,"DEINT_SYNC_1") ;
- /* FIELDS*/
- strcpy(FieldMap[SYNLOST].Name,"SYNLOST") ;
- FieldMap[SYNLOST].Reg = DEINT_SYNC_1 ;
- FieldMap[SYNLOST].Pos = 5 ;
- FieldMap[SYNLOST].Bits = 1 ;
- FieldMap[SYNLOST].Type = UNSIGNED ;
- FieldMap[SYNLOST].Mask = FieldCreateMask(SYNLOST) ;
- /* BERT_0*/
- RegMap[BERT_0].Addr = 0xA0 ;
- RegMap[BERT_0].Reset = 0x85 ; /*TIME 0.9SEC*/
- RegMap[BERT_0].Value = 0x00 ;
- strcpy(RegMap[BERT_0].Name,"BERT_0") ;
- /* FIELDS*/
- strcpy(FieldMap[BERT_ON].Name,"BERT_ON") ;
- FieldMap[BERT_ON].Reg = BERT_0 ;
- FieldMap[BERT_ON].Pos = 7 ;
- FieldMap[BERT_ON].Bits = 1 ;
- FieldMap[BERT_ON].Type = UNSIGNED ;
- FieldMap[BERT_ON].Mask = FieldCreateMask(BERT_ON) ;
- /* FIELDS*/
- strcpy(FieldMap[ERR_SOURCE].Name,"ERR_SOURCE") ;
- FieldMap[ERR_SOURCE].Reg = BERT_0 ;
- FieldMap[ERR_SOURCE].Pos = 4 ;
- FieldMap[ERR_SOURCE].Bits = 1 ;
- FieldMap[ERR_SOURCE].Type = UNSIGNED ;
- FieldMap[ERR_SOURCE].Mask = FieldCreateMask(ERR_SOURCE) ;
- /* FIELDS*/
- strcpy(FieldMap[ERR_MODE].Name,"ERR_MODE") ;
- FieldMap[ERR_MODE].Reg = BERT_0 ;
- FieldMap[ERR_MODE].Pos = 3 ;
- FieldMap[ERR_MODE].Bits = 1 ;
- FieldMap[ERR_MODE].Type = UNSIGNED ;
- FieldMap[ERR_MODE].Mask = FieldCreateMask(ERR_MODE) ;
- /* FIELDS*/
- strcpy(FieldMap[NBYTE].Name,"NBYTE") ;
- FieldMap[NBYTE].Reg = BERT_0 ;
- FieldMap[NBYTE].Pos = 0 ;
- FieldMap[NBYTE].Bits = 3 ;
- FieldMap[NBYTE].Type = UNSIGNED ;
- FieldMap[NBYTE].Mask = FieldCreateMask(NBYTE) ;
- /* BERT_1*/
- RegMap[BERT_1].Addr = 0xA1 ;
- RegMap[BERT_1].Reset = 0x22 ;
- RegMap[BERT_1].Value = 0x00 ;
- strcpy(RegMap[BERT_1].Name,"BERT_1") ;
- /* FIELDS*/
- strcpy(FieldMap[ERRCOUNT_LO].Name,"ERRCOUNT_LO") ;
- FieldMap[ERRCOUNT_LO].Reg = BERT_1 ;
- FieldMap[ERRCOUNT_LO].Pos = 0 ;
- FieldMap[ERRCOUNT_LO].Bits = 8 ;
- FieldMap[ERRCOUNT_LO].Type = UNSIGNED ;
- FieldMap[ERRCOUNT_LO].Mask = FieldCreateMask(ERRCOUNT_LO) ;
- /* BERT_2*/
- RegMap[BERT_2].Addr = 0xA2 ;
- RegMap[BERT_2].Reset = 0x4C ;
- RegMap[BERT_2].Value = 0x00 ;
- strcpy(RegMap[BERT_2].Name,"BERT_2") ;
- /* FIELDS*/
- strcpy(FieldMap[ERRCOUNT_HI].Name,"ERRCOUNT_HI") ;
- FieldMap[ERRCOUNT_HI].Reg = BERT_2 ;
- FieldMap[ERRCOUNT_HI].Pos = 0 ;
- FieldMap[ERRCOUNT_HI].Bits = 8 ;
- FieldMap[ERRCOUNT_HI].Type = UNSIGNED ;
- FieldMap[ERRCOUNT_HI].Mask = FieldCreateMask(ERRCOUNT_HI) ;
- /* DEINT_0*/
- RegMap[DEINT_0].Addr = 0xB0 ;
- RegMap[DEINT_0].Reset = 0x91 ;
- RegMap[DEINT_0].Value = 0x91 ;
- strcpy(RegMap[DEINT_0].Name,"DEINT_0") ;
- /* FIELDS*/
- strcpy(FieldMap[USEINT].Name,"USEINT") ;
- FieldMap[USEINT].Reg = DEINT_0 ;
- FieldMap[USEINT].Pos = 7 ;
- FieldMap[USEINT].Bits = 1 ;
- FieldMap[USEINT].Type = UNSIGNED ;
- FieldMap[USEINT].Mask = FieldCreateMask(USEINT) ;
- /* FIELDS*/
- strcpy(FieldMap[DAVIC].Name,"DAVIC") ;
- FieldMap[DAVIC].Reg = DEINT_0 ;
- FieldMap[DAVIC].Pos = 6 ;
- FieldMap[DAVIC].Bits = 1 ;
- FieldMap[DAVIC].Type = UNSIGNED ;
- FieldMap[DAVIC].Mask = FieldCreateMask(DAVIC) ;
- /* FIELDS*/
- strcpy(FieldMap[M].Name,"M") ;
- FieldMap[M].Reg = DEINT_0 ;
- FieldMap[M].Pos = 0 ;
- FieldMap[M].Bits = 5 ;
- FieldMap[M].Type = UNSIGNED ;
- FieldMap[M].Mask = FieldCreateMask(M) ;
- /* DEINT_1*/
- RegMap[DEINT_1].Addr = 0xB1 ;
- RegMap[DEINT_1].Reset = 0x0B ;
- RegMap[DEINT_1].Value = 0x0B ;
- strcpy(RegMap[DEINT_1].Name,"DEINT_1") ;
- /* FIELDS*/
- strcpy(FieldMap[DEPTH].Name,"DEPTH") ;
- FieldMap[DEPTH].Reg = DEINT_1 ;
- FieldMap[DEPTH].Pos = 0 ;
- FieldMap[DEPTH].Bits = 8 ;
- FieldMap[DEPTH].Type = UNSIGNED ;
- FieldMap[DEPTH].Mask = FieldCreateMask(DEPTH) ;
- /* OUTFORMAT_0*/
- RegMap[OUTFORMAT_0].Addr = 0xC0 ;
- RegMap[OUTFORMAT_0].Reset = 0x4b ; /*2001.03.02 papi*/
- RegMap[OUTFORMAT_0].Value = 0x4b ; /*2001.03.02*/
- strcpy(RegMap[OUTFORMAT_0].Name,"OUTFORMAT_0") ;
- /* FIELDS*/
- strcpy(FieldMap[REFRESH47].Name,"REFRESH47") ;
- FieldMap[REFRESH47].Reg = OUTFORMAT_0 ;
- FieldMap[REFRESH47].Pos = 6 ;
- FieldMap[REFRESH47].Bits = 1 ;
- FieldMap[REFRESH47].Type = UNSIGNED ;
- FieldMap[REFRESH47].Mask = FieldCreateMask(REFRESH47) ;
- /* FIELDS*/
- strcpy(FieldMap[BE_BYPASS].Name,"BE_BYPASS") ;
- FieldMap[BE_BYPASS].Reg = OUTFORMAT_0 ;
- FieldMap[BE_BYPASS].Pos = 5 ;
- FieldMap[BE_BYPASS].Bits = 1 ;
- FieldMap[BE_BYPASS].Type = UNSIGNED ;
- FieldMap[BE_BYPASS].Mask = FieldCreateMask(BE_BYPASS) ;
- /* FIELDS*/
- strcpy(FieldMap[CKOUTPAR].Name,"CKOUTPAR") ;
- FieldMap[CKOUTPAR].Reg = OUTFORMAT_0 ;
- FieldMap[CKOUTPAR].Pos = 4 ;
- FieldMap[CKOUTPAR].Bits = 1 ;
- FieldMap[CKOUTPAR].Type = UNSIGNED ;
- FieldMap[CKOUTPAR].Mask = FieldCreateMask(CKOUTPAR) ;
- /* FIELDS*/
- strcpy(FieldMap[CT_NBST].Name,"CT_NBST") ;
- FieldMap[CT_NBST].Reg = OUTFORMAT_0 ;
- FieldMap[CT_NBST].Pos = 3 ;
- FieldMap[CT_NBST].Bits = 1 ;
- FieldMap[CT_NBST].Type = UNSIGNED ;
- FieldMap[CT_NBST].Mask = FieldCreateMask(CT_NBST) ;
- /* FIELDS*/
- strcpy(FieldMap[S_NP].Name,"S_NP") ;
- FieldMap[S_NP].Reg = OUTFORMAT_0 ;
- FieldMap[S_NP].Pos = 2 ;
- FieldMap[S_NP].Bits = 1 ;
- FieldMap[S_NP].Type = UNSIGNED ;
- FieldMap[S_NP].Mask = FieldCreateMask(S_NP) ;
- /* FIELDS*/
- strcpy(FieldMap[TEI_ENA].Name,"TEI_ENA") ;
- FieldMap[TEI_ENA].Reg = OUTFORMAT_0 ;
- FieldMap[TEI_ENA].Pos = 1 ;
- FieldMap[TEI_ENA].Bits = 1 ;
- FieldMap[TEI_ENA].Type = UNSIGNED ;
- FieldMap[TEI_ENA].Mask = FieldCreateMask(TEI_ENA) ;
- /* FIELDS*/
- strcpy(FieldMap[DS_ENA].Name,"DS_ENA") ;
- FieldMap[DS_ENA].Reg = OUTFORMAT_0 ;
- FieldMap[DS_ENA].Pos = 0 ;
- FieldMap[DS_ENA].Bits = 1 ;
- FieldMap[DS_ENA].Type = UNSIGNED ;
- FieldMap[DS_ENA].Mask = FieldCreateMask(DS_ENA) ;
- /* OUTFORMAT_1*/
- RegMap[OUTFORMAT_1].Addr = 0xC1 ;
- RegMap[OUTFORMAT_1].Reset = 0x00 ; /*2001.03.02 papi*/
- RegMap[OUTFORMAT_1].Value = 0x00 ;
- strcpy(RegMap[OUTFORMAT_1].Name,"OUTFORMAT_1") ;
- /* FIELDS*/
- strcpy(FieldMap[SYNC_STRIP].Name,"SYNC_STRIP") ;
- FieldMap[SYNC_STRIP].Reg = OUTFORMAT_1 ;
- FieldMap[SYNC_STRIP].Pos = 7 ;
- FieldMap[SYNC_STRIP].Bits = 1 ;
- FieldMap[SYNC_STRIP].Type = UNSIGNED ;
- FieldMap[SYNC_STRIP].Mask = FieldCreateMask(SYNC_STRIP) ;
- /* FIELDS*/
- strcpy(FieldMap[CI_EN].Name,"CI_EN") ;
- FieldMap[CI_EN].Reg = OUTFORMAT_1 ;
- FieldMap[CI_EN].Pos = 6 ;
- FieldMap[CI_EN].Bits = 1 ;
- FieldMap[CI_EN].Type = UNSIGNED ;
- FieldMap[CI_EN].Mask = FieldCreateMask(CI_EN) ;
- /* FIELDS*/
- strcpy(FieldMap[CICLK_POL].Name,"CICLK_POL") ;
- FieldMap[CICLK_POL].Reg = OUTFORMAT_1 ;
- FieldMap[CICLK_POL].Pos = 5 ;
- FieldMap[CICLK_POL].Bits = 1 ;
- FieldMap[CICLK_POL].Type = UNSIGNED ;
- FieldMap[CICLK_POL].Mask = FieldCreateMask(CICLK_POL) ;
- /* FIELDS*/
- strcpy(FieldMap[CICLK_BASE].Name,"CICLK_BASE") ;
- FieldMap[CICLK_BASE].Reg = OUTFORMAT_1 ;
- FieldMap[CICLK_BASE].Pos = 4 ;
- FieldMap[CICLK_BASE].Bits = 1 ;
- FieldMap[CICLK_BASE].Type = UNSIGNED ;
- FieldMap[CICLK_BASE].Mask = FieldCreateMask(CICLK_BASE) ;
- /* OUTFORMAT_2*/
- RegMap[OUTFORMAT_2].Addr = 0xC2 ;
- RegMap[OUTFORMAT_2].Reset = 0x00 ;
- RegMap[OUTFORMAT_2].Value = 0x24 ;
- strcpy(RegMap[OUTFORMAT_2].Name,"OUTFORMAT_2") ;
- /* FIELDS*/
- strcpy(FieldMap[CI_DIVRANGE].Name,"CI_DIVRANGE") ;
- FieldMap[CI_DIVRANGE].Reg = OUTFORMAT_2 ;
- FieldMap[CI_DIVRANGE].Pos = 0 ;
- FieldMap[CI_DIVRANGE].Bits = 6 ;
- FieldMap[CI_DIVRANGE].Type = UNSIGNED ;
- FieldMap[CI_DIVRANGE].Mask = FieldCreateMask(CI_DIVRANGE) ;
- /* RS_DESC_0*/
- RegMap[RS_DESC_0].Addr = 0xD0 ;
- RegMap[RS_DESC_0].Reset = 0x6E ;
- RegMap[RS_DESC_0].Value = 0x00 ;
- strcpy(RegMap[RS_DESC_0].Name,"RS_DESC_0") ;
- /* FIELDS*/
- strcpy(FieldMap[BK_CT_LO].Name,"BK_CT_LO") ;
- FieldMap[BK_CT_LO].Reg = RS_DESC_0 ;
- FieldMap[BK_CT_LO].Pos = 0 ;
- FieldMap[BK_CT_LO].Bits = 8 ;
- FieldMap[BK_CT_LO].Type = UNSIGNED ;
- FieldMap[BK_CT_LO].Mask = FieldCreateMask(BK_CT_LO) ;
- /* RS_DESC_1*/
- RegMap[RS_DESC_1].Addr = 0xD1 ;
- RegMap[RS_DESC_1].Reset = 0x01 ;
- RegMap[RS_DESC_1].Value = 0x00 ;
- strcpy(RegMap[RS_DESC_1].Name,"RS_DESC_1") ;
- /* FIELDS*/
- strcpy(FieldMap[BK_CT_HI].Name,"BK_CT_HI") ;
- FieldMap[BK_CT_HI].Reg = RS_DESC_1 ;
- FieldMap[BK_CT_HI].Pos = 0 ;
- FieldMap[BK_CT_HI].Bits = 8 ;
- FieldMap[BK_CT_HI].Type = UNSIGNED ;
- FieldMap[BK_CT_HI].Mask = FieldCreateMask(BK_CT_HI) ;
- /* RS_DESC_2*/
- RegMap[RS_DESC_2].Addr = 0xD2 ;
- RegMap[RS_DESC_2].Reset = 0x00 ;
- RegMap[RS_DESC_2].Value = 0x00 ;
- strcpy(RegMap[RS_DESC_2].Name,"RS_DESC_2") ;
- /* FIELDS*/
- strcpy(FieldMap[CORR_CT_LO].Name,"CORR_CT_LO") ;
- FieldMap[CORR_CT_LO].Reg = RS_DESC_2 ;
- FieldMap[CORR_CT_LO].Pos = 0 ;
- FieldMap[CORR_CT_LO].Bits = 8 ;
- FieldMap[CORR_CT_LO].Type = UNSIGNED ;
- FieldMap[CORR_CT_LO].Mask = FieldCreateMask(CORR_CT_LO) ;
- /* RS_DESC_3*/
- RegMap[RS_DESC_3].Addr = 0xD3 ;
- RegMap[RS_DESC_3].Reset = 0x00 ;
- RegMap[RS_DESC_3].Value = 0x00 ;
- strcpy(RegMap[RS_DESC_3].Name,"RS_DESC_3") ;
- /* FIELDS*/
- strcpy(FieldMap[CORR_CT_HI].Name,"CORR_CT_HI") ;
- FieldMap[CORR_CT_HI].Reg = RS_DESC_3 ;
- FieldMap[CORR_CT_HI].Pos = 0 ;
- FieldMap[CORR_CT_HI].Bits = 8 ;
- FieldMap[CORR_CT_HI].Type = UNSIGNED ;
- FieldMap[CORR_CT_HI].Mask = FieldCreateMask(CORR_CT_HI) ;
- /* RS_DESC_4*/
- RegMap[RS_DESC_4].Addr = 0xD4 ;
- RegMap[RS_DESC_4].Reset = 0x6D ;
- RegMap[RS_DESC_4].Value = 0x00 ;
- strcpy(RegMap[RS_DESC_4].Name,"RS_DESC_4") ;
- /* FIELDS*/
- strcpy(FieldMap[UNCORR_CT_LO].Name,"UNCORR_CT_LO") ;
- FieldMap[UNCORR_CT_LO].Reg = RS_DESC_4 ;
- FieldMap[UNCORR_CT_LO].Pos = 0 ;
- FieldMap[UNCORR_CT_LO].Bits = 8 ;
- FieldMap[UNCORR_CT_LO].Type = UNSIGNED ;
- FieldMap[UNCORR_CT_LO].Mask = FieldCreateMask(UNCORR_CT_LO) ;
- /* RS_DESC_5*/
- RegMap[RS_DESC_5].Addr = 0xD5 ;
- RegMap[RS_DESC_5].Reset = 0x01 ;
- RegMap[RS_DESC_5].Value = 0x00 ;
- strcpy(RegMap[RS_DESC_5].Name,"RS_DESC_5") ;
- /* FIELDS*/
- strcpy(FieldMap[UNCORR_CT_HI].Name,"UNCORR_CT_HI") ;
- FieldMap[UNCORR_CT_HI].Reg = RS_DESC_5 ;
- FieldMap[UNCORR_CT_HI].Pos = 0 ;
- FieldMap[UNCORR_CT_HI].Bits = 8 ;
- FieldMap[UNCORR_CT_HI].Type = UNSIGNED ;
- FieldMap[UNCORR_CT_HI].Mask = FieldCreateMask(UNCORR_CT_HI) ;
- /* RS_DESC_14*/
- RegMap[RS_DESC_14].Addr = 0xDE ;
- RegMap[RS_DESC_14].Reset = 0x00 ;
- RegMap[RS_DESC_14].Value = 0x00 ;
- strcpy(RegMap[RS_DESC_14].Name,"RS_DESC_14") ;
- /* FIELDS*/
- strcpy(FieldMap[DIS_UNLOCK].Name,"DIS_UNLOCK") ;
- FieldMap[DIS_UNLOCK].Reg = RS_DESC_14 ;
- FieldMap[DIS_UNLOCK].Pos = 2 ;
- FieldMap[DIS_UNLOCK].Bits = 1 ;
- FieldMap[DIS_UNLOCK].Type = UNSIGNED ;
- FieldMap[DIS_UNLOCK].Mask = FieldCreateMask(DIS_UNLOCK) ;
- /* FIELDS*/
- strcpy(FieldMap[MODE].Name,"MODE") ;
- FieldMap[MODE].Reg = RS_DESC_14 ;
- FieldMap[MODE].Pos = 0 ;
- FieldMap[MODE].Bits = 2 ;
- FieldMap[MODE].Type = UNSIGNED ;
- FieldMap[MODE].Mask = FieldCreateMask(MODE) ;
- /* RS_DESC_15*/
- RegMap[RS_DESC_15].Addr = 0xDF ;
- RegMap[RS_DESC_15].Reset = 0x01 ;
- RegMap[RS_DESC_15].Value = 0x00 ;
- strcpy(RegMap[RS_DESC_15].Name,"RS_DESC_15") ;
- /* FIELDS*/
- strcpy(FieldMap[CT_CLEAR].Name,"CT_CLEAR") ;
- FieldMap[CT_CLEAR].Reg = RS_DESC_15 ;
- FieldMap[CT_CLEAR].Pos = 0 ;
- FieldMap[CT_CLEAR].Bits = 1 ;
- FieldMap[CT_CLEAR].Type = UNSIGNED ;
- FieldMap[CT_CLEAR].Mask = FieldCreateMask(CT_CLEAR) ;
- /* FIELDS*/
- strcpy(FieldMap[CT_HOLD].Name,"CT_HOLD") ;
- FieldMap[CT_HOLD].Reg = RS_DESC_15 ;
- FieldMap[CT_HOLD].Pos = 1 ;
- FieldMap[CT_HOLD].Bits = 1 ;
- FieldMap[CT_HOLD].Type = UNSIGNED ;
- FieldMap[CT_HOLD].Mask = FieldCreateMask(CT_HOLD) ;
- /* FIELDS*/
- strcpy(FieldMap[RS_NOCORR].Name,"RS_NOCORR") ;
- FieldMap[RS_NOCORR].Reg = RS_DESC_15 ;
- FieldMap[RS_NOCORR].Pos = 2 ;
- FieldMap[RS_NOCORR].Bits = 1 ;
- FieldMap[RS_NOCORR].Type = UNSIGNED ;
- FieldMap[RS_NOCORR].Mask = FieldCreateMask(RS_NOCORR) ;
- /* FIELDS*/
- strcpy(FieldMap[SYNCSTATE].Name,"SYNCSTATE") ;
- FieldMap[SYNCSTATE].Reg = RS_DESC_15 ;
- FieldMap[SYNCSTATE].Pos = 7 ;
- FieldMap[SYNCSTATE].Bits = 1 ;
- FieldMap[SYNCSTATE].Type = UNSIGNED ;
- FieldMap[SYNCSTATE].Mask = FieldCreateMask(SYNCSTATE) ;
- //RegTrigger = NO ;
- //RegNbI2cAccess = 0 ;
- //count = 0 ;
- //RegTracking = NO ;
-
- RegSTV0297reset() ;
- RegResetAfterDI() ;
- RegReset() ;
-
- _ExtClk = (INT32)(10*EXT_CLK) ;
- RegGetQAMSize() ;
- RegSetSymbolRate(Driv0297Signal.SymbolRate) ;
- return;
- }
- void QAM64_Regreset(void)
- {
- INT16 i;
- INT32 S32val;
- RegSTV0297reset() ;
- RegResetAfterDI() ;
- RegSetOneRegister(EQU_0,0x48);
- RegSetOneRegister(EQU_1,0x58);
- RegSetOneRegister(EQU_3,0x00);
- RegSetOneRegister(EQU_4,0x00);
- RegSetOneRegister(EQU_7,0x00);
- RegSetOneRegister(EQU_8,0x00);
- RegSetOneRegister(INITDEM_0,0x00);
- RegSetOneRegister(INITDEM_1,0x40);
- RegSetOneRegister(INITDEM_2,0x00);
- RegSetOneRegister(INITDEM_3,0x00);
- RegSetOneRegister(INITDEM_4,0x40);
- RegSetOneRegister(INITDEM_5,0x08);
- RegSetOneRegister(DELAGC_0,0xE6);
- RegSetOneRegister(DELAGC_1,0x91);
- RegSetOneRegister(DELAGC_2,0xFD);
- RegSetOneRegister(DELAGC_3,0x44);
- RegSetOneRegister(DELAGC_4,0x29);
- RegSetOneRegister(DELAGC_5,0x8F);
- RegSetOneRegister(DELAGC_6,0x80);
- RegSetOneRegister(DELAGC_7,0x70);
- RegSetOneRegister(DELAGC_8,0x00);
- RegSetOneRegister(WBAGC_0,0x1A);
- RegSetOneRegister(WBAGC_1,0x64);
- RegSetOneRegister(WBAGC_2,0x31);
- RegSetOneRegister(WBAGC_3,0x18);
- RegSetOneRegister(WBAGC_4,0xFF);
- RegSetOneRegister(WBAGC_5,0x00);
- RegSetOneRegister(WBAGC_6,0x00);
- RegSetOneRegister(WBAGC_9,0x04);
- RegSetOneRegister(WBAGC_10,0x51);
- RegSetOneRegister(WBAGC_11,0xF8);
- RegSetOneRegister(STLOOP_2,0x30);
- RegSetOneRegister(STLOOP_3,0x06);
- RegSetOneRegister(STLOOP_5,0x6A);
- RegSetOneRegister(STLOOP_6,0xA3);
- RegSetOneRegister(STLOOP_7,0x8B);
- RegSetOneRegister(STLOOP_8,0x39);
- RegSetOneRegister(STLOOP_9,0x06);
- RegSetOneRegister(STLOOP_10,0x5E);
- RegSetOneRegister(STLOOP_11,0x04);
- RegSetOneRegister(CRL_0,0x16);
- RegSetOneRegister(CRL_1,0x49);
- RegSetOneRegister(CRL_2,0x05);
- RegSetOneRegister(CRL_3,0x00);
- RegSetOneRegister(CRL_4,0x00);
- RegSetOneRegister(CRL_5,0x00);
- RegSetOneRegister(CRL_6,0xBF);
- RegSetOneRegister(CRL_7,0x0D);
- RegSetOneRegister(CRL_8,0xF8);
- RegSetOneRegister(CRL_9,0x0D);
- RegSetOneRegister(CRL_10,0x03);
- RegSetOneRegister(CRL_11,0x92);
- RegSetOneRegister(PMFAGC_0,0xFF);
- RegSetOneRegister(PMFAGC_1,0x04);
- RegSetOneRegister(PMFAGC_2,0x00);
- RegSetOneRegister(PMFAGC_3,0x00);
- RegSetOneRegister(PMFAGC_4,0x00);
- RegSetOneRegister(CTRL_0,0x20);
- RegSetOneRegister(CTRL_1,0x00);
- RegSetOneRegister(CTRL_2,0x27);
- RegSetOneRegister(CTRL_3,0x08);
- RegSetOneRegister(CTRL_4,0x02);
- RegSetOneRegister(CTRL_5,0xA2);
- RegSetOneRegister(CTRL_6,0x08);
- RegSetOneRegister(CTRL_7,0x63);
- RegSetOneRegister(CTRL_8,0x00);
- RegSetOneRegister(CTRL_9,0x00);
- RegSetOneRegister(DEINT_SYNC_0,0x00);
- RegSetOneRegister(DEINT_SYNC_1,0x04);
- RegSetOneRegister(BERT_0,0x85);
- RegSetOneRegister(BERT_1,0x22);
- RegSetOneRegister(BERT_2,0x4C);
- RegSetOneRegister(DEINT_0,0x91);
- RegSetOneRegister(DEINT_1,0x0B);
- RegSetOneRegister(OUTFORMAT_0,0x4B);
- RegSetOneRegister(OUTFORMAT_1,0x00);
- RegSetOneRegister(OUTFORMAT_2,0x00);
- RegSetOneRegister(RS_DESC_0,0x6E);
- RegSetOneRegister(RS_DESC_1,0x01);
- RegSetOneRegister(RS_DESC_2,0x00);
- RegSetOneRegister(RS_DESC_3,0x00);
- RegSetOneRegister(RS_DESC_4,0x6D);
- RegSetOneRegister(RS_DESC_5,0x01);
- RegSetOneRegister(RS_DESC_14,0x00);
- RegSetOneRegister(RS_DESC_15,0x01);
- //RegTrigger = NO ;
- //RegNbI2cAccess = 0 ;
- //count = 0 ;
- //RegTracking = NO ;
-
- _ExtClk = (INT32)(10*EXT_CLK) ;
- RegGetQAMSize() ;
- RegSetSymbolRate(Driv0297Signal.SymbolRate) ;
- return;
- }
- void QAM256_Regreset(void)
- {
- INT16 i;
- INT32 S32val;
- RegSTV0297reset() ;
- RegResetAfterDI() ;
- RegSetOneRegister(EQU_0,0x38);
- RegSetOneRegister(EQU_1,0x58);
- RegSetOneRegister(EQU_3,0x00);
- RegSetOneRegister(EQU_4,0x01);
- RegSetOneRegister(EQU_7,0xe8);
- RegSetOneRegister(EQU_8,0x0b);
- RegSetOneRegister(INITDEM_0,0x00);
- RegSetOneRegister(INITDEM_1,0x40);
- RegSetOneRegister(INITDEM_2,0x00);
- RegSetOneRegister(INITDEM_3,0x00);
- RegSetOneRegister(INITDEM_4,0x40);
- RegSetOneRegister(INITDEM_5,0x08);
- RegSetOneRegister(DELAGC_0,0xE6);
- RegSetOneRegister(DELAGC_1,0x91);
- RegSetOneRegister(DELAGC_2,0xFD);
- RegSetOneRegister(DELAGC_3,0x44);
- RegSetOneRegister(DELAGC_4,0x29);
- RegSetOneRegister(DELAGC_5,0x8F);
- RegSetOneRegister(DELAGC_6,0x80);
- RegSetOneRegister(DELAGC_7,0x70);
- RegSetOneRegister(DELAGC_8,0x00);
- RegSetOneRegister(WBAGC_0,0x1A);
- RegSetOneRegister(WBAGC_1,0x64);
- RegSetOneRegister(WBAGC_2,0x31);
- RegSetOneRegister(WBAGC_3,0x18);
- RegSetOneRegister(WBAGC_4,0xFF);
- RegSetOneRegister(WBAGC_5,0x00);
- RegSetOneRegister(WBAGC_6,0x00);
- RegSetOneRegister(WBAGC_9,0x04);
- RegSetOneRegister(WBAGC_10,0x51);
- RegSetOneRegister(WBAGC_11,0xFF);
- RegSetOneRegister(STLOOP_2,0x30);
- RegSetOneRegister(STLOOP_3,0x02);
- RegSetOneRegister(STLOOP_5,0x6A);
- RegSetOneRegister(STLOOP_6,0xA3);
- RegSetOneRegister(STLOOP_7,0x8B);
- RegSetOneRegister(STLOOP_8,0x39);
- RegSetOneRegister(STLOOP_9,0x06);
- RegSetOneRegister(STLOOP_10,0x5E);
- RegSetOneRegister(STLOOP_11,0x04);
- RegSetOneRegister(CRL_0,0x16);
- RegSetOneRegister(CRL_1,0x29);
- RegSetOneRegister(CRL_2,0x05);
- RegSetOneRegister(CRL_3,0x00);
- RegSetOneRegister(CRL_4,0x00);
- RegSetOneRegister(CRL_5,0x00);
- RegSetOneRegister(CRL_6,0xBF);
- RegSetOneRegister(CRL_7,0x0D);
- RegSetOneRegister(CRL_8,0xF8);
- RegSetOneRegister(CRL_9,0x0D);
- RegSetOneRegister(CRL_10,0x03);
- RegSetOneRegister(CRL_11,0x92);
- RegSetOneRegister(PMFAGC_0,0xFF);
- RegSetOneRegister(PMFAGC_1,0x04);
- RegSetOneRegister(PMFAGC_2,0x00);
- RegSetOneRegister(PMFAGC_3,0x00);
- RegSetOneRegister(PMFAGC_4,0x00);
- RegSetOneRegister(CTRL_0,0x20);
- RegSetOneRegister(CTRL_1,0x00);
- RegSetOneRegister(CTRL_2,0x27);
- RegSetOneRegister(CTRL_3,0x08);
- RegSetOneRegister(CTRL_4,0x02);
- RegSetOneRegister(CTRL_5,0xA2);
- RegSetOneRegister(CTRL_6,0x08);
- RegSetOneRegister(CTRL_7,0x63);
- RegSetOneRegister(CTRL_8,0x00);
- RegSetOneRegister(CTRL_9,0x00);
- RegSetOneRegister(DEINT_SYNC_0,0x00);
- RegSetOneRegister(DEINT_SYNC_1,0x04);
- RegSetOneRegister(BERT_0,0x85);
- RegSetOneRegister(BERT_1,0x22);
- RegSetOneRegister(BERT_2,0x4C);
- RegSetOneRegister(DEINT_0,0x91);
- RegSetOneRegister(DEINT_1,0x0B);
- RegSetOneRegister(OUTFORMAT_0,0x4B);
- RegSetOneRegister(OUTFORMAT_1,0x00);
- RegSetOneRegister(OUTFORMAT_2,0x00);
- RegSetOneRegister(RS_DESC_0,0x6E);
- RegSetOneRegister(RS_DESC_1,0x01);
- RegSetOneRegister(RS_DESC_2,0x00);
- RegSetOneRegister(RS_DESC_3,0x00);
- RegSetOneRegister(RS_DESC_4,0x6D);
- RegSetOneRegister(RS_DESC_5,0x01);
- RegSetOneRegister(RS_DESC_14,0x00);
- RegSetOneRegister(RS_DESC_15,0x01);
- //RegTrigger = NO ;
- //RegNbI2cAccess = 0 ;
- //count = 0 ;
- //RegTracking = NO ;
-
- _ExtClk = (INT32)(10*EXT_CLK) ;
- RegGetQAMSize() ;
- RegSetSymbolRate(Driv0297Signal.SymbolRate) ;
- return;
- }
- void QAM64_Regreset_TH(void)
- {
- INT16 i;
- INT32 S32val;
- RegSTV0297reset() ;
- RegResetAfterDI() ;
- RegSetOneRegister(EQU_0,0x4b);
- RegSetOneRegister(EQU_1,0x58);
- /* testmode RegSetOneRegister(EQU_2,0x00);*/
- RegSetOneRegister(EQU_3,0x00);
- RegSetOneRegister(EQU_4,0x01);
- RegSetOneRegister(EQU_7,0x07);
- RegSetOneRegister(EQU_8,0x1c);
- RegSetOneRegister(INITDEM_0,0x00);
- RegSetOneRegister(INITDEM_1,0x40);
- RegSetOneRegister(INITDEM_2,0x0a);
- RegSetOneRegister(INITDEM_3,0x00);
- RegSetOneRegister(INITDEM_4,0x40);
- RegSetOneRegister(INITDEM_5,0x08);
- RegSetOneRegister(DELAGC_0,0xFF);
- RegSetOneRegister(DELAGC_1,0x5C);
- RegSetOneRegister(DELAGC_2,0xFF);
- RegSetOneRegister(DELAGC_3,0x00);
- RegSetOneRegister(DELAGC_4,0x32);
- RegSetOneRegister(DELAGC_5,0x5C);
- RegSetOneRegister(DELAGC_6,0x80);
- RegSetOneRegister(DELAGC_7,0x30);
- RegSetOneRegister(DELAGC_8,0x00);
- RegSetOneRegister(WBAGC_0,0x1B);
- RegSetOneRegister(WBAGC_1,0x9D);
- RegSetOneRegister(WBAGC_2,0x30);
- RegSetOneRegister(WBAGC_3,0x18);
- RegSetOneRegister(WBAGC_4,0x58);
- RegSetOneRegister(WBAGC_5,0x00);
- RegSetOneRegister(WBAGC_6,0x00);
- RegSetOneRegister(WBAGC_9,0x02);
- RegSetOneRegister(WBAGC_10,0x33);
- RegSetOneRegister(WBAGC_11,0xFF);
- RegSetOneRegister(STLOOP_2,0x30);
- RegSetOneRegister(STLOOP_3,0x08);
- RegSetOneRegister(STLOOP_5,0x50);
- RegSetOneRegister(STLOOP_6,0xBB);
- RegSetOneRegister(STLOOP_7,0x18);
- RegSetOneRegister(STLOOP_8,0x3D);
- RegSetOneRegister(STLOOP_9,0x08);
- RegSetOneRegister(STLOOP_10,0x1E);
- RegSetOneRegister(STLOOP_11,0x04);
- RegSetOneRegister(CRL_0,0x13);
- RegSetOneRegister(CRL_1,0x39);
- RegSetOneRegister(CRL_2,0x06);
- RegSetOneRegister(CRL_3,0x00);
- RegSetOneRegister(CRL_4,0x00);
- RegSetOneRegister(CRL_5,0x00);
- RegSetOneRegister(CRL_6,0x9E);
- RegSetOneRegister(CRL_7,0xC4);
- RegSetOneRegister(CRL_8,0x01);
- RegSetOneRegister(CRL_9,0x00);
- RegSetOneRegister(CRL_10,0x02);
- RegSetOneRegister(CRL_11,0x0F);
- RegSetOneRegister(PMFAGC_0,0xFF);
- RegSetOneRegister(PMFAGC_1,0x04);
- RegSetOneRegister(PMFAGC_2,0x00);
- RegSetOneRegister(PMFAGC_3,0x00);
- RegSetOneRegister(PMFAGC_4,0x00);
- RegSetOneRegister(CTRL_0,0x20);
- RegSetOneRegister(CTRL_1,0x00);
- RegSetOneRegister(CTRL_2,0x0F);
- RegSetOneRegister(CTRL_3,0x00);
- RegSetOneRegister(CTRL_4,0x2A);
- RegSetOneRegister(CTRL_5,0x00);
- RegSetOneRegister(CTRL_6,0xC0);
- RegSetOneRegister(CTRL_7,0x6B);
- RegSetOneRegister(CTRL_8,0x00);
- RegSetOneRegister(CTRL_9,0x00);
- RegSetOneRegister(DEINT_SYNC_0,0x02);
- RegSetOneRegister(DEINT_SYNC_1,0x04);
- RegSetOneRegister(BERT_0,0x85);
- RegSetOneRegister(BERT_1,0x49);
- RegSetOneRegister(BERT_2,0x1A);
- RegSetOneRegister(DEINT_0,0x91);
- RegSetOneRegister(DEINT_1,0x0B);
- RegSetOneRegister(OUTFORMAT_0,0x4b);
- RegSetOneRegister(OUTFORMAT_1,0x00);
- RegSetOneRegister(OUTFORMAT_2,0x00);/*0x24*/
- RegSetOneRegister(RS_DESC_0,0x6e);/*f4*/
- RegSetOneRegister(RS_DESC_1,0x01);/*0e*/
- RegSetOneRegister(RS_DESC_2,0x00);/*25*/
- RegSetOneRegister(RS_DESC_3,0x00);/*3a*/
- RegSetOneRegister(RS_DESC_4,0x6d);/*00*/
- RegSetOneRegister(RS_DESC_5,0x01);/*00*/
- RegSetOneRegister(RS_DESC_14,0x00);
- RegSetOneRegister(RS_DESC_15,0x81);
- RegTrigger = NO ;
- RegNbI2cAccess = 0 ;
- count = 0 ;
- RegTracking = NO ;
- /**/
- /**/
- _ExtClk = (INT32)(10*EXT_CLK) ; /*unit Khz */
- /**/
- RegGetQAMSize() ;
- /* RegSetSymbolRate(6500) ; 6.89 MBd */
- RegSetSymbolRate(Driv0297Signal.SymbolRate) ; /* 6.89 MBd */
- /**/
- return;
- }
- void QAM256_Regreset_TH(void)
- {
- INT16 i;
- INT32 S32val;
- RegSTV0297reset() ;
- RegResetAfterDI() ;
- RegSetOneRegister(EQU_0,0x39);
- RegSetOneRegister(EQU_1,0x69);
- /* testmode RegSetOneRegister(EQU_2,0x00);*/
- RegSetOneRegister(EQU_3,0x00);
- RegSetOneRegister(EQU_4,0x01);
- RegSetOneRegister(EQU_7,0x32);
- RegSetOneRegister(EQU_8,0x1A);
- RegSetOneRegister(INITDEM_0,0x00);
- RegSetOneRegister(INITDEM_1,0x40);
- RegSetOneRegister(INITDEM_2,0x0A);
- RegSetOneRegister(INITDEM_3,0x00);
- RegSetOneRegister(INITDEM_4,0x40);
- RegSetOneRegister(INITDEM_5,0x08);
- RegSetOneRegister(DELAGC_0,0xFF);
- RegSetOneRegister(DELAGC_1,0x5C);
- RegSetOneRegister(DELAGC_2,0xFF);
- RegSetOneRegister(DELAGC_3,0x00);
- RegSetOneRegister(DELAGC_4,0x32);
- RegSetOneRegister(DELAGC_5,0x5C);
- RegSetOneRegister(DELAGC_6,0x80);
- RegSetOneRegister(DELAGC_7,0x00);
- RegSetOneRegister(DELAGC_8,0x00);
- RegSetOneRegister(WBAGC_0,0x1B);
- RegSetOneRegister(WBAGC_1,0xBA);
- RegSetOneRegister(WBAGC_2,0x30);
- RegSetOneRegister(WBAGC_3,0x18);
- RegSetOneRegister(WBAGC_4,0x58);
- RegSetOneRegister(WBAGC_5,0x00);
- RegSetOneRegister(WBAGC_6,0x00);
- RegSetOneRegister(WBAGC_9,0x02);
- RegSetOneRegister(WBAGC_10,0xFF);
- RegSetOneRegister(WBAGC_11,0xFF);
- RegSetOneRegister(STLOOP_2,0x30);
- RegSetOneRegister(STLOOP_3,0x08);
- RegSetOneRegister(STLOOP_5,0xC0);
- RegSetOneRegister(STLOOP_6,0x92);
- RegSetOneRegister(STLOOP_7,0x18);
- RegSetOneRegister(STLOOP_8,0x3D);
- RegSetOneRegister(STLOOP_9,0x08);
- RegSetOneRegister(STLOOP_10,0x1E);
- RegSetOneRegister(STLOOP_11,0x04);
- RegSetOneRegister(CRL_0,0x13);
- RegSetOneRegister(CRL_1,0x39);
- RegSetOneRegister(CRL_2,0x06);
- RegSetOneRegister(CRL_3,0x00);
- RegSetOneRegister(CRL_4,0x00);
- RegSetOneRegister(CRL_5,0x00);
- RegSetOneRegister(CRL_6,0xA0);
- RegSetOneRegister(CRL_7,0x7A);
- RegSetOneRegister(CRL_8,0x4C);
- RegSetOneRegister(CRL_9,0x00);
- RegSetOneRegister(CRL_10,0x02);
- RegSetOneRegister(CRL_11,0xC1);
- RegSetOneRegister(PMFAGC_0,0xFF);
- RegSetOneRegister(PMFAGC_1,0x04);
- RegSetOneRegister(PMFAGC_2,0x00);
- RegSetOneRegister(PMFAGC_3,0x00);
- RegSetOneRegister(PMFAGC_4,0x00);
- RegSetOneRegister(CTRL_0,0x20);
- RegSetOneRegister(CTRL_1,0x00);
- RegSetOneRegister(CTRL_2,0x1F);
- RegSetOneRegister(CTRL_3,0x00);
- RegSetOneRegister(CTRL_4,0x2A);
- RegSetOneRegister(CTRL_5,0x00);
- RegSetOneRegister(CTRL_6,0xC0);
- RegSetOneRegister(CTRL_7,0x6B);
- RegSetOneRegister(CTRL_8,0x00);
- RegSetOneRegister(CTRL_9,0x00);
- RegSetOneRegister(DEINT_SYNC_0,0x02);
- RegSetOneRegister(DEINT_SYNC_1,0x04);
- RegSetOneRegister(BERT_0,0x85);
- RegSetOneRegister(BERT_1,0x75);
- RegSetOneRegister(BERT_2,0x16);
- RegSetOneRegister(DEINT_0,0x91);
- RegSetOneRegister(DEINT_1,0x0B);
- RegSetOneRegister(OUTFORMAT_0,0x4B);
- RegSetOneRegister(OUTFORMAT_1,0x00);
- RegSetOneRegister(OUTFORMAT_2,0x00);/*24*/
- RegSetOneRegister(RS_DESC_0,0x6e);/*00*/
- RegSetOneRegister(RS_DESC_1,0x01);/*00*/
- RegSetOneRegister(RS_DESC_2,0x00);
- RegSetOneRegister(RS_DESC_3,0x00);
- RegSetOneRegister(RS_DESC_4,0x6D);
- RegSetOneRegister(RS_DESC_5,0x01);/**/
- RegSetOneRegister(RS_DESC_14,0x00);
- RegSetOneRegister(RS_DESC_15,0x81);
- RegTrigger = NO ;
- RegNbI2cAccess = 0 ;
- count = 0 ;
- RegTracking = NO ;
- /**/
- /**/
- _ExtClk = (INT32)(10*EXT_CLK) ; /*unit Khz */
- /**/
- RegGetQAMSize() ;
- /* RegSetSymbolRate(6500) ; 6.89 MBd */
- RegSetSymbolRate(Driv0297Signal.SymbolRate) ; /* 6.89 MBd */
- /**/
- return;
- }
- void RegSTV0297reset(void)
- {
- RegSetField(SOFT_RESET,1);
- RegSetField(SOFT_RESET,0);
- }
- void RegResetAfterDI(void)
- {
- RegSetField(RESET_DI,1);
- RegSetField(RESET_DI,0);
- return ;
- }
- void RegSetQAMSize(INT32 _QAMSize)
- {
- INT32 QAMSize ;
- RegQAMSize = _QAMSize ;
- switch (_QAMSize)
- {
- case 16:
- QAMSize = 0; //QAM16 ;
- break;
- case 32:
- QAMSize = 1; //QAM32 ;
- break;
- case 64:
- QAMSize = 4; //QAM64 ;
- break;
- case 128:
- QAMSize = 2; //QAM128 ;
- break;
- case 256:
- QAMSize = 3; //QAM256 ;
- break;
- default:
- break;
- }
- RegSetField(MODE_SELECT, QAMSize);
- return;
- }
- INT32 RegGetQAMSize(void)
- {
- INT32 Value ;
- Value = RegGetField(MODE_SELECT);
- switch (Value)
- {
- case 0:
- RegQAMSize = 16 ;
- break;
- case 1:
- RegQAMSize = 32 ;
- break;
- case 4:
- RegQAMSize = 64 ;
- break;
- case 2:
- RegQAMSize = 128 ;
- break;
- case 3:
- RegQAMSize = 256 ;
- break;
- default:
- break;
- }
- return(RegQAMSize);
- }
- INT32 RegGetSymbolRate(void)
- {
- INT32 regsym = 0L;
- _ExtClk = (INT32)(10*EXT_CLK) ;
- regsym = RegGetField(SYMB_RATE_0);
- regsym += RegGetField(SYMB_RATE_1)<<8;
- regsym += RegGetField(SYMB_RATE_2)<<16;
- regsym += RegGetField(SYMB_RATE_3)<<24;
- regsym = regsym/4096L; // 4096 = 2**12
- regsym = (_ExtClk/ 8) * regsym;
- RegSymbolRate = regsym/131072L; // 131072 = 2**17
- if(RegSymbolRate == 0)
- {
- RegSymbolRate = 6875;
- }
- //Print("RegSymbolRate is %ldn",RegSymbolRate);
- return(RegSymbolRate);
- }
- void RegSetSymbolRate(INT32 _SymbolRate)
- {
- INT32 tmp, ExtClk;
- RegSymbolRate = _SymbolRate ;
- _ExtClk = (INT32)(10*EXT_CLK) ;
- ExtClk = _ExtClk/4;
- tmp = 131072L * _SymbolRate; // 131072 = 2**17
- tmp = tmp /ExtClk;
- tmp = tmp * 8192L; // 8192L = 2**13
- //Print("tmp : %lx",tmp);
- RegSetField(SYMB_RATE_0,tmp);
- RegSetField(SYMB_RATE_1,(tmp>>8));
- RegSetField(SYMB_RATE_2,(tmp>>16));
- RegSetField(SYMB_RATE_3,(tmp>>24));
- return;
- }
- INT32 RegGetSweepRate(void)
- {
- INT16 swrate=0;
- INT32 _SymbolRate;
- INT32 tmp;
- tmp = RegGetField(SWEEP_LO);
- tmp += RegGetField(SWEEP_HI)<<8;
- _SymbolRate = RegSymbolRate / 0x10;
- if (tmp & 0x00000800) {
- tmp = (~tmp + 1) & 0x00000FFF;
- tmp = (tmp * _SymbolRate * 1000)/ 0x1000; /* 0x1000 = 2**12 */
- tmp = (-tmp * 1000) / 0x1000;
- }
- else {
- tmp = tmp & 0x00000FFF;
- tmp = (tmp * _SymbolRate * 1000)/ 0x1000;
- tmp = (tmp * 1000) / 0x1000;
- }
- return(tmp);
- }
- void RegSetSweepRate(INT16 _FShift)
- {
- INT32 S32_tmp;
- INT16 FShift ;
- FShift = _FShift ; /* in mS sweep = Fshift * 2^28/SR*/
- RegSymbolRate = RegGetSymbolRate() ; /* in KHz */
- S32_tmp = FShift * 262144L ; /* 262144 = 2*18 */
- S32_tmp /= RegSymbolRate ;
- S32_tmp *= 1024 ;
- if(S32_tmp >= 0)
- S32_tmp += 500000 ;
- else
- S32_tmp -= 500000 ;
- S32_tmp /= 1000000 ;
- RegSetField(SWEEP_LO,S32_tmp & 0xFF);
- RegSetField(SWEEP_HI,(S32_tmp>>8) & 0x0F);
- return;
- }
- INT32 RegGetCarrierOffset(void)
- {
- INT32 S32_tmp;
- INT32 OldCarrierOffset ;
- RegSetField(CRL_SNAPSHOT,0xFF) ;
- S32_tmp = RegGetField(IPHASE_0);
- S32_tmp += RegGetField(IPHASE_1)<<8;
- S32_tmp += RegGetField(IPHASE_2)<<16;
- S32_tmp += RegGetField(IPHASE_3)<<24;
- return(S32_tmp);
- }
-
- void RegSetFrequencyOffset(INT32 _CarrierOffset)
- {
- INT32 S32_tmp;
- INT32 CarrierOffset ;
- CarrierOffset = _CarrierOffset ;
- S32_tmp = CarrierOffset * 26844L ;
- if(S32_tmp < 0) S32_tmp += 0x10000000 ;
- S32_tmp &= 0x0FFFFFFF ;
- RegSetField(IPHASE_0,S32_tmp);
- RegSetField(IPHASE_1,(S32_tmp>>8));
- RegSetField(IPHASE_2,(S32_tmp>>16));
- RegSetField(IPHASE_3,(S32_tmp>>24));
- return;
- }
- void Driv0297Init(void)
- {
- RegSTV0297reset() ;
- RegReset() ;
-
- Driv0297DataLost = NO ;
- Driv0297DataLocked = NO ;
- Driv0297Signal.QAMSize = 64 ;
- Driv0297Signal.SymbolRate = 6500 ;
- Driv0297Signal.Frequency = 400000 ;
- return ;
- }
- void Driv0297DemodSetting(INT32 _Offset)
- {
- INT32 S32_tmp ;
- INT32 ExtClk ;
- INT32 S16_tmp ;
- RegSetField(IN_DEMOD_EN, 1);
- ExtClk = (INT32)(10*EXT_CLK) ;
- S32_tmp = 36125 + _Offset;
- S32_tmp -= ExtClk;
- S32_tmp *= 65536 ;
- S32_tmp /= ExtClk;
- if(S32_tmp > 65535) S32_tmp = 65535 ;
- S16_tmp = S32_tmp ;
- RegSetField(DEM_FQCY_HI, S16_tmp>>8);
- RegSetField(DEM_FQCY_LO, S16_tmp);
- return;
- }
- FLAG_SAM Driv0297DataSearch(SIGNAL *_pSignal, INT32 _SweepRate, INT32 _CarrierOffset,
- FLAG_SAM _SpectrumInversion, INT32 _InitDemodOffset)
- {
- INT32 TimeOut ;
- INT32 LMS1TimeOut ;
- INT32 LMS2TimeOut ;
- INT32 FECTimeOut ;
- INT32 NbSymbols ;
- INT32 Log2QAMSize ;
- INT32 AcqLoopsTime ;
- INT32 AcqAGCTime ;
- INT32 QAMSize ;
- INT32 SweepRate ;
- INT32 CarrierOffset ;
- INT32 LMS1TrackingLock ;
- INT32 LMS2TrackingLock ;
- INT32 FECTrackingLock ;
- UINT32 SymbolRate ;
- INT32 Frequency ;
- FLAG_SAM SpectrumInversion ;
- INT32 DataSearchTime ;
- INT32 WBAGCLock ;
- INT32 S16_tmp ;
- INT32 initial_u ;
- INT32 blind_u ;
- INT32 u_threshold ;
- INT32 AGC1Max, AGC1Min, AGC2Max, AGC2Min, AGC2Threshold ;
- FLAG_SAM EndOfSearch ;
- FLAG_SAM DataFound ;
-
- DataFound = NO ;
- EndOfSearch = NO ;
- DataSearchTime = 0 ;
- Frequency = _pSignal->Frequency ;
- QAMSize = _pSignal->QAMSize ;
- SymbolRate = _pSignal->SymbolRate ;
- SweepRate = _SweepRate ;
- CarrierOffset = _CarrierOffset ;
- SpectrumInversion = _SpectrumInversion ;
-
- AcqAGCTime = 20 ;
- switch (QAMSize)
- {
- case 16 :
- NbSymbols = 45000 ;
- Log2QAMSize = 4 ;
- break;
- case 32 :
- NbSymbols = 45000 ;
- Log2QAMSize = 5 ;
- break ;
- case 64 :
- NbSymbols = 45000 ;
- Log2QAMSize = 6 ;
- break;
- case 128 :
- NbSymbols = 45000 ;
- Log2QAMSize = 7 ;
- break ;
- case 256 :
- NbSymbols = 45000 ;
- Log2QAMSize = 8 ;
- break;
- }
- if(SymbolRate == 0)
- {
- SymbolRate = 6875;
- }
- AcqLoopsTime = (INT32)(NbSymbols/SymbolRate) ;
- // samDelay((unsigned )(AcqLoopsTime));
- /*
- if(SymbolRate <1500)
- LMS1TimeOut = 400 ;
- else
- LMS1TimeOut = 200 ;
- if(SymbolRate <1500)
- LMS2TimeOut = 300 ;
- else
- LMS2TimeOut = 200 ;
-
- if(SymbolRate <1500)
- FECTimeOut = 100;
- else
- FECTimeOut = 20;
- */
- if(SymbolRate <1500)
- {
- LMS1TimeOut = 400;
- LMS2TimeOut = 300;
- FECTimeOut = 100;
- }
- else
- {
- LMS1TimeOut = 200;
- LMS2TimeOut = 200;
- FECTimeOut = 20;
- }
- LMS1TimeOut /= 2;
- LMS2TimeOut /= 2;
- FECTimeOut /= 2;
- LoadRegisters() ;
- Driv0297DemodSetting(_InitDemodOffset) ;
- RegSetField(WAGC_EN,0x01) ;
-
- AGC2Max = RegGetField(AGC2MAX) ;
- AGC2Min = RegGetField(AGC2MIN) ;
- AGC1Max = RegGetField(AGC1MAX) ;
- AGC1Min = RegGetField(AGC1MIN) ;
- AGC2Threshold = RegGetField(AGC2_THRES) ;
-
- RegSetField(WAGC_EN,0x00) ;
- RegSetField(AGC2SD_LO,0x00) ;
- RegSetField(AGC2SD_HI,0x01) ;
- RegSetField(FRZ2_CTRL,0x00) ;
- RegSetField(FRZ1_CTRL,0x00) ;
- RegSetField(PMFA_F_UNLOCK,0x01) ;
- RegSetField(PMFA_ACC0,0x00) ;
- RegSetField(PMFA_ACC1,0x00) ;
- RegSetField(PMFA_ACC2,0x00) ;
- RegSetField(WAGC_ACQ,0x00) ;
- RegSetField(PMFA_F_UNLOCK,0x00) ;
- RegSetField(PHASE_CLR,0x01) ;
- RegSetField(ERR_CLR,0x01) ;
- RegSetField(ERR_CLR,0x00) ;
- RegSetField(ERR_EN,0x00) ;
- RegSetField(PHASE_EN,0x01) ;
- RegSetField(SWEEP_EN,0) ;
- RegSetField(RESET_DI,1) ;
- RegSetField(RESET_DI,0) ;
- RegSetField(RESET_RS,1) ;
- RegSetField(RESET_RS,0) ;
-
- u_threshold = RegGetField(U_THRESHOLD) ;
- initial_u = RegGetField(INITIAL_U) ;
- blind_u = RegGetField(BLIND_U) ;
- RegSetField(RESET_EQL,1) ;
- RegSetField(RESET_EQL,0) ;
- RegSetField(U_THRESHOLD,u_threshold) ;
- RegSetField(INITIAL_U,initial_u) ;
- RegSetField(BLIND_U,blind_u) ;
- RegSetField(SOURCESEL,0) ;
- RegSetField(APHASE_0,0x00) ;
- RegSetField(APHASE_1,0x00) ;
- RegSetField(APHASE_2,0x00) ;
- RegSetField(IPHASE_0,0x00) ;
- RegSetField(IPHASE_1,0x00) ;
- RegSetField(IPHASE_2,0x00) ;
- RegSetField(IPHASE_3,0x00) ;
-
- RegSetQAMSize(QAMSize) ;
- RegSetSymbolRate(SymbolRate) ;
- /*Print("RegGetSymbolRate=%dn",RegGetSymbolRate());*/
- RegSetSweepRate(SweepRate) ;
- RegSetFrequencyOffset(CarrierOffset) ;
- RegSetField(SPEC_INV,SpectrumInversion) ;
- samDelay(1);
-
- RegSetField(EN_CORNER_DET,0x01) ;
- samDelay(1);
- RegSetField(PHASE_CLR,0x00) ;
- samDelay(1);
- RegSetField(SWEEP_EN,1) ;
- RegSetField(WAGC_CLR,0x01) ;
- RegSetField(WAGC_EN,0x01) ;
- WBAGCLock = 0 ;
- TimeOut = DataSearchTime + 50 ;
- while((WBAGCLock == 0)&&(EndOfSearch == NO))
- {
- // samDelay(500);
- DataSearchTime += 1 ;
- WBAGCLock = RegGetField(WAGC_ACQ) ;
- if((WBAGCLock == 1)||(DataSearchTime > TimeOut))
- EndOfSearch = YES ;
- }
-
- if(WBAGCLock == 0)
- {
- return (DataFound);
- }
- /* samDelay(AcqAGCTime); */
- DataSearchTime += AcqAGCTime ;
- EndOfSearch = NO ;
- TimeOut = DataSearchTime + LMS1TimeOut ;
- S16_tmp = 0 ;
- while (EndOfSearch == NO)
- {
- samDelay(0);
- DataSearchTime += 1 ;
- LMS1TrackingLock = RegGetField(EQU_LMS1) ;
- if(LMS1TrackingLock == 1)
- S16_tmp += 1 ;
- else
- S16_tmp = 0 ;
- if((S16_tmp >= 20)||(DataSearchTime > TimeOut))
- EndOfSearch = YES ;
- }
- if(LMS1TrackingLock == 0)
- {
- return (DataFound);
- }
- //Print("EQU_LMS1=%dn",LMS1TrackingLock);
- EndOfSearch = NO ;
- TimeOut = DataSearchTime + LMS2TimeOut ;
- S16_tmp = 0 ;
- while (EndOfSearch == NO)
- {
- samDelay(0);
- DataSearchTime += 1 ;
- LMS2TrackingLock = RegGetField(EQU_LMS2) ;
- if(LMS2TrackingLock == 1)
- S16_tmp += 1 ;
- else
- S16_tmp = 0 ;
- if((S16_tmp >= 2)||(DataSearchTime > TimeOut))
- EndOfSearch = YES ;
- }
- if(LMS2TrackingLock == 0)
- {
- return (DataFound);
- }
-
- //Print("EQU_LMS2=%dn",LMS2TrackingLock);
- EndOfSearch = NO ;
- TimeOut = DataSearchTime + FECTimeOut ;
- TimeOut += 100/2 ;
- FECTrackingLock=0;
- while (EndOfSearch == NO)
- {
- samDelay(1);
- DataSearchTime +=1 ;
- FECTrackingLock = RegGetField(SYNCSTATE) ;
- if((FECTrackingLock == 1)||(DataSearchTime > TimeOut))
- EndOfSearch = YES ;
- }
-
- //Print("SYNCSTATE=%dn",FECTrackingLock);
- if(FECTrackingLock)
- {
- RegSetField(EN_CORNER_DET,0x00) ;
- DataFound = YES;
- }
- if(DataFound == NO) return(DataFound) ;
- _pSignal->SymbolRate = RegGetSymbolRate() ;
- Driv0297Signal.QAMSize = _pSignal->QAMSize ;
- Driv0297Signal.SymbolRate = _pSignal->SymbolRate ;
- Driv0297Signal.Frequency = _pSignal->Frequency ;
- return (DataFound);
- }
-
- FLAG_SAM Driv0297CarrierSearch(SIGNAL *_pSignal, FLAG_SAM _SpectrumInversion,
- INT32 _SweepRate, INT32 _CarrierOffset)
- {
- FLAG_SAM DataFound ;
- INT32 CarrierOffset ;
- INT32 InitDemodOffset ;
- INT32 SweepRate ;
- DataFound = NO ;
- if(((_SweepRate > 0)&&(_CarrierOffset > 0)) ||
- ((_SweepRate < 0)&&(_CarrierOffset < 0)) ||
- (_SweepRate == 0)) return(DataFound) ;
- if(_SweepRate < 0)
- {
- SweepRate = -_SweepRate ;
- CarrierOffset = -_CarrierOffset ;
- }
- else
- {
- SweepRate = _SweepRate ;
- CarrierOffset = _CarrierOffset ;
- }
-
- InitDemodOffset = 0 ;
- CarrierOffset = -500 ;
- if( _pSignal->QAMSize == 128)
- CarrierOffset = -11000 ;
-
- if(_SpectrumInversion ==AUTO)
- {
- DataFound = Driv0297DataSearch(_pSignal, SweepRate, CarrierOffset, NO,
- InitDemodOffset) ;
- if(DataFound==NO)
- {
- //Print("error return 1 n");
- if( CheckInversion()==NO)
- {
- DataFound = Driv0297DataSearch(_pSignal, SweepRate, CarrierOffset,
- YES, InitDemodOffset) ;
- }
- }
- if(DataFound==NO)
- {
- RegSetField(SPEC_INV,NO) ;
- //Print("error return 2 n");
- }
- }
- else
- {
- DataFound = Driv0297DataSearch(_pSignal, SweepRate, CarrierOffset,
- _SpectrumInversion, InitDemodOffset) ;
- }
- //Print("come to here n");
- return (DataFound) ;
- }
- void CarrierStatusSetAcquisitionStatus(void)
- {
- INT16 Cornerlock;
- INT16 WBAGCLock ;
- INT16 PMFAGCLock ;
- INT16 LMS1lock ;
- INT16 LMS2lock ;
- INT16 Trackinglock ;
- INT16 status ;
-
- WBAGCLock = RegGetField(WBAGC_IT) ;
- PMFAGCLock = RegGetField(PMFAGC_IT) ;
- LMS1lock = RegGetField(EQU_LMS1) ;
- LMS2lock = RegGetField(EQU_LMS2) ;
- Cornerlock = RegGetField(CORNER_LOCK);
- if(LMS1lock == 0)
- LMS2lock = 0 ;
- Trackinglock = RegGetField(SYNCSTATE) ;
- if(LMS2lock == 0)
- Trackinglock = 0 ;/* find faults lock*/
- /* Print("nAGC is : WBAGC: %s PMFAGC: %s", WBAGCLock?"Lock ":"Out of Lock",PMFAGCLock?"Lock ":"Out of Lock");
- Print("nEQU is : EQU1 : %s EQU2 : %s", LMS1lock?"Lock ":"Out of Lock",LMS2lock?"Lock ":"Out of Lock");
- Print("nFEC is : %s",Trackinglock?"Lock ":"Out of Lock");
- */
- return ;
- }
- FLAG_SAM Acquisition(float _Freq1, UINT32 _SymbolRate,
- INT32 _QAMSize, FLAG_SAM _SpectrumInversion)
- {
- UINT8 u8val;
- FLAG_SAM DataFound=NO;
- SIGNAL MySignal;
- Driv0297Signal.QAMSize = _QAMSize;
- Driv0297Signal.SymbolRate = _SymbolRate;
- Driv0297Signal.Frequency = (INT32)(_Freq1*1000);
-
- RegSetField(PRGCLKDIV,1);
- samDelay(1);
- RegSetField(I2CT_EN,0x01);
- samDelay(1);
- SAMSetTunerFrequency(_Freq1);
- samDelay(1);
- RegSetField(I2CT_EN,0x00);
- samDelay(1);
- RegSetField(PRGCLKDIV,0);
- samDelay(0);
-
- if(Driv0297Signal.QAMSize == 64 )
- {
- RegSetField(DIRECT_GAIN_LO,6);
- RegSetField(INTEGRAL_GAIN_LO,6);
- }
- else if(Driv0297Signal.QAMSize == 128 )
- {
- RegSetField(DIRECT_GAIN_LO,6);
- RegSetField(INTEGRAL_GAIN_LO,6);
- }
- else if(Driv0297Signal.QAMSize == 256 )
- {
- RegSetField(DIRECT_GAIN_LO,6);
- RegSetField(INTEGRAL_GAIN_LO,6);
- if(Driv0297Signal.SymbolRate < 1500)
- {
- RegSetField(DIRECT_GAIN_LO,4);
- RegSetField(INTEGRAL_GAIN_LO,6);
- }
- }
- else if(Driv0297Signal.QAMSize == 32 )
- {
- RegSetField(DIRECT_GAIN_LO,6);
- RegSetField(INTEGRAL_GAIN_LO,6);
- }
- else /* QAM 16 */
- {
- RegSetField(DIRECT_GAIN_LO,4);
- RegSetField(INTEGRAL_GAIN_LO,6);
- RegSetOneRegister(DELAGC_7,0x60) ;
- }
- RegSetField(ALGOSEL,0);
- if(Driv0297Signal.QAMSize == 64 )
- {
- RegSetOneRegister(WBAGC_11,0xF8) ;
- if(RegGetField(ALGOSEL) == 0)
- {
- RegSetField(U_THRESHOLD,0x06);
- RegSetField(INITIAL_U,0x05);
- RegSetField(BLIND_U,0x0a);
- }
- else
- {
- RegSetField(U_THRESHOLD,0x09);
- RegSetField(INITIAL_U,0x06);
- RegSetField(BLIND_U,0x09);
- }
- }
- else if(Driv0297Signal.QAMSize == 32)
- {
- RegSetOneRegister(WBAGC_11,0xF0) ;
- if(RegGetField(ALGOSEL) == 0)
- {
- RegSetField(U_THRESHOLD,0x08);
- RegSetField(INITIAL_U,0x05);
- RegSetField(BLIND_U,0x08);
- }
- else
- {
- RegSetField(U_THRESHOLD,0x09);
- RegSetField(INITIAL_U,0x06);
- RegSetField(BLIND_U,0x09);
- }
- }
- else if(Driv0297Signal.QAMSize == 16)
- {
- RegSetOneRegister(WBAGC_11,0xE1) ;
- if(RegGetField(ALGOSEL) == 0)
- {
- RegSetField(U_THRESHOLD,0x08);
- RegSetField(INITIAL_U,0x05);
- RegSetField(BLIND_U,0x08);
- }
- else
- {
- RegSetField(U_THRESHOLD,0x09);
- RegSetField(INITIAL_U,0x06);
- RegSetField(BLIND_U,0x09);
- }
- }
- else if(Driv0297Signal.QAMSize == 128)
- {
- RegSetOneRegister(WBAGC_11,0xFE) ;
- if(RegGetField(ALGOSEL) == 0)
- {
- RegSetField(U_THRESHOLD,0x08);
- RegSetField(INITIAL_U,0x05);
- RegSetField(BLIND_U,0x08);
- }
- else
- {
- RegSetField(U_THRESHOLD,0x09);
- RegSetField(INITIAL_U,0x06);
- RegSetField(BLIND_U,0x09);
- }
- }
- else if(Driv0297Signal.QAMSize == 256)
- {
- RegSetOneRegister(WBAGC_11,0xFF) ;
- if(RegGetField(ALGOSEL) == 0)
- {
- RegSetField(U_THRESHOLD,0x08);
- RegSetField(INITIAL_U,0x05);
- RegSetField(BLIND_U,0x08);
- if(Driv0297Signal.SymbolRate <=1500)
- {
- RegSetField(U_THRESHOLD,0x0A);
- RegSetField(INITIAL_U,0x08);
- RegSetField(BLIND_U,0x0A);
- }
- }
- else
- {
- RegSetField(U_THRESHOLD,0x0A);
- RegSetField(INITIAL_U,0x07);
- RegSetField(BLIND_U,0x0A);
- }
- }
- else
- {
- RegSetOneRegister(WBAGC_11,0xF8) ;
- if(RegGetField(ALGOSEL) == 0)
- {
- RegSetField(U_THRESHOLD,0x08);
- RegSetField(INITIAL_U,0x05);
- RegSetField(BLIND_U,0x08);
- }
- else
- {
- RegSetField(U_THRESHOLD,0x09);
- RegSetField(INITIAL_U,0x06);
- RegSetField(BLIND_U,0x09);
- }
- }
- MySignal.QAMSize = Driv0297Signal.QAMSize ;
- MySignal.SymbolRate = Driv0297Signal.SymbolRate ;
- MySignal.Frequency = Driv0297Signal.Frequency ;
-
- if(Driv0297Signal.SymbolRate >=4500)
- {
- if(_QAMSize == 16)
- {
- RegSetField(GAIN_DIR,4);
- RegSetField(GAIN_INT,8);
- }
- else if(_QAMSize == 32)
- {
- RegSetField(GAIN_DIR,4);
- RegSetField(GAIN_INT,8);
- }
- else if(_QAMSize == 64)
- {
- RegSetField(GAIN_DIR,2);
- RegSetField(GAIN_INT,9);
- }
- else if(_QAMSize == 128)
- {
- RegSetField(GAIN_DIR,3);
- RegSetField(GAIN_INT,10);
- }
- else if(_QAMSize == 256)
- {
- RegSetField(GAIN_DIR,3);
- RegSetField(GAIN_INT,9);
- }
- }
- else if(3500 < Driv0297Signal.SymbolRate && Driv0297Signal.SymbolRate < 4500)
- {
- if(_QAMSize == 16)
- {
- RegSetField(GAIN_DIR,4);
- RegSetField(GAIN_INT,9);
- }
- else if(_QAMSize == 32)
- {
- RegSetField(GAIN_DIR,4);
- RegSetField(GAIN_INT,9);
- }
- else if(_QAMSize == 64)
- {
- RegSetField(GAIN_DIR,4);
- RegSetField(GAIN_INT,10);
- }
- else if(_QAMSize == 128)
- {
- RegSetField(GAIN_DIR,4);
- RegSetField(GAIN_INT,10);
- }
- else if(_QAMSize == 256)
- {
- RegSetField(GAIN_DIR,3);
- RegSetField(GAIN_INT,9);
- }
- }
- else if(1500 < Driv0297Signal.SymbolRate && Driv0297Signal.SymbolRate < 3500)
- {
- if(_QAMSize == 16)
- {
- RegSetField(GAIN_DIR,4);
- RegSetField(GAIN_INT,9);
- }
- else if(_QAMSize == 32)
- {
- RegSetField(GAIN_DIR,4);
- RegSetField(GAIN_INT,9);
- }
- else if(_QAMSize == 64)
- {
- RegSetField(GAIN_DIR,4);
- RegSetField(GAIN_INT,10);
- }
- else if(_QAMSize == 128)
- {
- RegSetField(GAIN_DIR,4);
- RegSetField(GAIN_INT,10);
- }
- else if(_QAMSize == 256)
- {
- RegSetField(GAIN_DIR,3);
- RegSetField(GAIN_INT,9);
- }
- }
- else /* SR <1500 */
- {
- if(_QAMSize == 16)
- {
- RegSetField(GAIN_DIR,4);
- RegSetField(GAIN_INT,9);
- }
- else if(_QAMSize == 32)
- {
- RegSetField(GAIN_DIR,4);
- RegSetField(GAIN_INT,9);
- }
- else if(_QAMSize == 64)
- {
- RegSetField(GAIN_DIR,4);
- RegSetField(GAIN_INT,10);
- }
- else if(_QAMSize == 128)
- {
- RegSetField(GAIN_DIR,4);
- RegSetField(GAIN_INT,10);
- }
- else if(_QAMSize == 256)
- {
- RegSetField(GAIN_DIR,3);
- RegSetField(GAIN_INT,9);
- }
- }
- //Print(" Driv0297Signal.SymbolRate is [%d] [%d]n",Driv0297Signal.SymbolRate,_QAMSize);
- if(Driv0297Signal.SymbolRate >=6500)
- {
- if(_QAMSize == 16)
- DataFound=Driv0297CarrierSearch(&MySignal,_SpectrumInversion,1400,-100);
- else if(_QAMSize == 32)
- DataFound=Driv0297CarrierSearch(&MySignal,_SpectrumInversion,700,-100);
- else if(_QAMSize == 64)
- DataFound=Driv0297CarrierSearch(&MySignal,_SpectrumInversion,600,-100);
- else if(_QAMSize == 128)
- DataFound=Driv0297CarrierSearch(&MySignal,_SpectrumInversion,550,-700);
- else if(_QAMSize == 256)
- DataFound=Driv0297CarrierSearch(&MySignal,_SpectrumInversion,Driv0297Signal.SymbolRate/20,-100);
- }
- else if(3500 <= Driv0297Signal.SymbolRate && Driv0297Signal.SymbolRate< 6500)
- {
- if(_QAMSize == 16)
- DataFound=Driv0297CarrierSearch(&MySignal,_SpectrumInversion,1200,-100);
- else if(_QAMSize == 32)
- DataFound=Driv0297CarrierSearch(&MySignal,_SpectrumInversion,550,-100);
- else if(_QAMSize == 64)
- DataFound=Driv0297CarrierSearch(&MySignal,_SpectrumInversion,600,-100);
- else if(_QAMSize == 128)
- DataFound=Driv0297CarrierSearch(&MySignal,_SpectrumInversion,550,-700);
- else if(_QAMSize == 256)
- DataFound=Driv0297CarrierSearch(&MySignal,_SpectrumInversion,Driv0297Signal.SymbolRate/20,-100);
- }
- else if(1500 < Driv0297Signal.SymbolRate && Driv0297Signal.SymbolRate< 3500)
- {
- if(_QAMSize == 16)
- DataFound=Driv0297CarrierSearch(&MySignal,_SpectrumInversion,600,-100);
- else if(_QAMSize == 32)
- DataFound=Driv0297CarrierSearch(&MySignal,_SpectrumInversion,200,-100);
- else if(_QAMSize == 64)
- DataFound=Driv0297CarrierSearch(&MySignal,_SpectrumInversion,500,-100);
- else if(_QAMSize == 128)
- DataFound=Driv0297CarrierSearch(&MySignal,_SpectrumInversion,500,-700);
- else if(_QAMSize == 256)
- DataFound=Driv0297CarrierSearch(&MySignal,_SpectrumInversion,230,-100);
- }
- else /* SR <=1500 */
- {
- if(_QAMSize == 16)
- DataFound=Driv0297CarrierSearch(&MySignal,_SpectrumInversion,500,-100);
- else if(_QAMSize == 32)
- DataFound=Driv0297CarrierSearch(&MySignal,_SpectrumInversion,200,-100);
- else if(_QAMSize == 64)
- DataFound=Driv0297CarrierSearch(&MySignal,_SpectrumInversion,230,-100);
- else if(_QAMSize == 128)
- DataFound=Driv0297CarrierSearch(&MySignal,_SpectrumInversion,270,-100);
- else if(_QAMSize == 256)
- DataFound=Driv0297CarrierSearch(&MySignal,_SpectrumInversion,290,-110);
- }
- return (DataFound);
- }
- void QAM_Init(void)
- {
- RegReset();
- Driv0297Init();
- QAM64_RegInit();
- }
- INT16 Check_Lock(void)
- {
- INT16 LMS1lock ;
- INT16 LMS2lock ;
- INT16 Trackinglock ;
- INT16 status ;
- RegSetOneRegister(CTRL_2,0x00) ;
- LMS1lock = RegGetField(EQU_LMS1) ;
- LMS2lock = RegGetField(EQU_LMS2) ;
- if(LMS1lock == 0)
- LMS2lock = 0 ;
- Trackinglock = RegGetField(SYNCSTATE) ;
- if(LMS2lock == 0)
- Trackinglock = 0 ;
- return Trackinglock;
- }
- void RegReset(void)
- {
- INT32 reg ;
- for ( reg = 0 ; reg < NBREG ; reg++ )
- {
- RegSetOneRegister(reg,RegMap[reg].Reset);
- }
- }
- int CheckInversion(void)
- {
- if(( RegGetField(WBAGC_IT) &&RegGetField(PMFAGC_IT) && RegGetField(EQU_LMS1)&& RegGetField(EQU_LMS2) ))
- {
- if(RegGetField(SYNCSTATE))
- {
- //Print("Spectral Right!!");
- return YES;
- }
- else
- {
- //Print("Spectral Changed !!");
- return NO;
- }
- }
- return NO;
- }
- void LoadRegisters(void)
- {
- /* RegStoreValue() ;
- RegSetOneRegister(RegSearchAddress(0x80 ),0x01 ) ;
- RegSetOneRegister(RegSearchAddress(0x80 ),0x00 ) ;
- RegReloadValue() ;
- */
-
-
-
- RegSetField(SOFT_RESET,1);
- RegSetField(SOFT_RESET,0);
- if((UINT16)EXT_CLK ==2880)
- {if((InputQAMSize_MODE==128)||(InputQAMSize_MODE==256))
- QAM256_Regreset_TH();
- else QAM64_Regreset_TH();
- /*printf("THOMSON InputQAMSize =%dn",InputQAMSize);*/
- }
- else
- {
- if((InputQAMSize_MODE==128)||(InputQAMSize_MODE==256))
- QAM256_Regreset();
- else QAM64_Regreset();
- }
-
-
-
- return ;
- }
-
- void RegStoreValue(void)
- {
- INT32 reg ;
- for ( reg = 0 ; reg < NBREG ; reg++ )
- RegMap[reg].Store = RegMap[reg].Value ;
- return;
- }
- INT32 RegSearchAddress(INT32 _Address)
- {
- INT32 Index=-1;
- for(Index = 0; ((Index < NBREG)&&(RegMap[Index].Addr !=_Address)); Index++) ;
- if(Index>= NBREG)
- Index = -1 ;
- return (Index);
- }
- void RegReloadValue(void)
- {
- INT32 reg ;
- for ( reg = 0 ; reg < NBREG ; reg++ )
- {
- RegMap[reg].Value = RegMap[reg].Store ;
- RegSetOneRegister(reg,RegMap[reg].Value);
- }
- return;
- }
-
-
- void samDelay(int n)
- {
-
- KB_OSPTaskDelay(n);
-
- }
- INT32 SAMDetect(UINT16 addr)
- {
- INT32 rc = DMD_TYPE_NONE;
- UINT8 pllFound = 0;
-
- if(RETOK == KB_I2COpen(IIC_ADDR_NIM_30311, &i2c_dmd_handle))
- {
- Print("[tcmu30311.c] SAMDetect(): i2c_dmd_handle = 0x%X.n",i2c_dmd_handle);
- if(QAM0297_Revision == SAMRevision())
- {
- UINT8 sout[4];
- sout[0] = 0x1B; /* TUNER DIVIDER BYTE1 */
- sout[1] = 0x15; /* TUNER DIVIDER BYTE2 */
- sout[2] = 0x02; /* TUNER CONTROL BYTE1 */
- sout[3] = 0x02; /* TUNER CONTROL BYTE2 */
- /*
- ** has detect stv0297 exist. Now detect the pll type.
- ** Write 4 bytes to the pll and confirm the operartion
- ** result(success or failure). So can confirm which
- ** tuner is in use.
- */
- if(!pllFound)
- {
- if(RETOK == KB_I2COpen(IIC_TUNER_ADDRESS_TH, &i2c_pll_handle))
- {
- Print("[tcmu30311.c] SAMDetect(): i2c_pll_handle = 0x%X.n",
- i2c_pll_handle);
- SAMEnableIICTuner();
- if(RETOK == KB_I2CWriteWithStop(i2c_pll_handle, 4, sout))
- {
- pllFound = 1;
- EXT_CLK = 2880;
- rc = DMD_TYPE_QAM;
- }
- else
- {
- KB_I2CClose(i2c_pll_handle);
- }
- SAMDisableIICTuner();
- KB_I2CClose(i2c_pll_handle);
- }
- else
- {
- Print("[tcmu30311.c] SAMDetect(): open i2c_pll_handle failed.n");
- }
- }
- if(!pllFound)
- {
- if(RETOK == KB_I2COpen(IIC_TUNER_ADDRESS_SAM, &i2c_pll_handle))
- {
- SAMEnableIICTuner();
- if(RETOK == KB_I2CWriteWithStop(i2c_pll_handle, 4, sout))
- {
- pllFound = 1;
- EXT_CLK = 2892;
- rc = DMD_TYPE_QAM;
- }
- else
- {
- KB_I2CClose(i2c_pll_handle);
- }
- SAMDisableIICTuner();
- }
- }
- }
- else
- {
- KB_I2CClose(i2c_dmd_handle);
- }
- }
- STTBX_Print(("demod type = %d, clock = %d.n", rc, EXT_CLK));
-
- return rc;
- }