| 1 | /****************************************************************************/ |
|---|
| 2 | /* */ |
|---|
| 3 | /* Copyright (c) 2003 Trident Technologies, Inc. */ |
|---|
| 4 | /* All rights reserved */ |
|---|
| 5 | /* */ |
|---|
| 6 | /* The content of this file or document is CONFIDENTIAL and PROPRIETARY */ |
|---|
| 7 | /* to Trident Microsystems, Inc. It is subject to the terms of a */ |
|---|
| 8 | /* License Agreement between Licensee and Trident Technologies, Inc. */ |
|---|
| 9 | /* restricting among other things, the use, reproduction, distribution */ |
|---|
| 10 | /* and transfer. Each of the embodiments, including this information and */ |
|---|
| 11 | /* any derivative work shall retain this copyright notice */ |
|---|
| 12 | /* */ |
|---|
| 13 | /****************************************************************************/ |
|---|
| 14 | /**************************************************************************** |
|---|
| 15 | * Copyright (C) 2003-2005, Trident Technologies, Inc. |
|---|
| 16 | * Copyright (C) 2003-2005, Oren Semiconductor |
|---|
| 17 | * |
|---|
| 18 | * File: TunerDTVS205FH201A.H |
|---|
| 19 | * |
|---|
| 20 | * Created: 01-25-05 |
|---|
| 21 | * Description: This file contain header file code for DTVS205FH201A |
|---|
| 22 | * Modified by Alex, 2006-4-29 |
|---|
| 23 | * |
|---|
| 24 | ****************************************************************************/ |
|---|
| 25 | #ifndef TUNER_DTVS205FH201A_H |
|---|
| 26 | #define TUNER_DTVS205FH201A_H |
|---|
| 27 | |
|---|
| 28 | #include "Cas2BGeneralDefinitions_dtvs205.h" |
|---|
| 29 | |
|---|
| 30 | #define MAX_TUNER_SUPPORT 2 |
|---|
| 31 | #define YIELD_TIME 3000 |
|---|
| 32 | |
|---|
| 33 | #if 1 |
|---|
| 34 | //For Tuner DTVS205FH201A |
|---|
| 35 | typedef enum EN_TYPE_TUNERDTVS205FH201A_REF_DIVIDER_RATIO{ |
|---|
| 36 | TUNERDTVS205FH201A_REF_DIVIDER_RATIO_31_25 = 0, |
|---|
| 37 | TUNERDTVS205FH201A_REF_DIVIDER_RATIO_50, |
|---|
| 38 | TUNERDTVS205FH201A_REF_DIVIDER_RATIO_62_5, |
|---|
| 39 | // TUNERDTVS205FH201A_REF_DIVIDER_RATIO_166_7 |
|---|
| 40 | }TYPE_TUNERDTVS205FH201A_REF_DIVIDER_RATIO; |
|---|
| 41 | |
|---|
| 42 | typedef enum EN_TYPE_TUNERDTVS205FH201A_AGC{ |
|---|
| 43 | TUNERDTVS205FH201A_AGC_102_A = 0, |
|---|
| 44 | TUNERDTVS205FH201A_AGC_102_B, |
|---|
| 45 | TUNERDTVS205FH201A_AGC_99, |
|---|
| 46 | TUNERDTVS205FH201A_AGC_96, |
|---|
| 47 | TUNERDTVS205FH201A_AGC_93, |
|---|
| 48 | TUNERDTVS205FH201A_AGC_90, |
|---|
| 49 | TUNERDTVS205FH201A_AGC_WIDE_BAND_OFF |
|---|
| 50 | }TYPE_TUNERDTVS205FH201A_AGC; |
|---|
| 51 | |
|---|
| 52 | typedef enum EN_TYPE_TUNERDTVS205FH201A_CHARGE_PUMP{ |
|---|
| 53 | TUNERDTVS205FH201A_CHARGE_PUMP_20 = 0, |
|---|
| 54 | TUNERDTVS205FH201A_CHARGE_PUMP_100 |
|---|
| 55 | }TYPE_TUNERDTVS205FH201A_CHARGE_PUMP; |
|---|
| 56 | |
|---|
| 57 | typedef enum EN_TYPE_TUNERDTVS205FH201A_AGC_TIME_CONSTANT{ |
|---|
| 58 | TUNERDTVS205FH201A_AGC_TIME_CONSTANT_50_MS = 0, |
|---|
| 59 | TUNERDTVS205FH201A_AGC_TIME_CONSTANT_2_SEC |
|---|
| 60 | }TYPE_TUNERDTVS205FH201A_AGC_TIME_CONSTANT; |
|---|
| 61 | |
|---|
| 62 | #if 1//20071016 |
|---|
| 63 | #define DTVS205FH201A_DEVICE_ADDRESS_WRITE 0xC2 |
|---|
| 64 | #define DTVS205FH201A_SLAVE_ADDRESS 0xC3 |
|---|
| 65 | #else |
|---|
| 66 | #define DTVS205FH201A_DEVICE_ADDRESS_WRITE 0xC2 // can be read from i2c. Tuner I2C address |
|---|
| 67 | #define DTVS205FH201A_SLAVE_ADDRESS 0x86 // Alex modify , 0x86 PIN open, can be read from i2c. Tuner IF address |
|---|
| 68 | #endif |
|---|
| 69 | |
|---|
| 70 | #define DTVS205FH201A_CHANNEL_DOES_NOT_FIT_ANY_FREQUENCY -1 |
|---|
| 71 | #define DTVS205FH201A_SUCCESS 0 |
|---|
| 72 | #define DTVS205FH201A_FREQUENCY_VALUE_OUT_OF_RANGE 1 |
|---|
| 73 | #define DTVS205FH201A_VALUE_OUT_OF_RANGE 2 |
|---|
| 74 | #define DTVS205FH201A_COULD_NOT_SET_N 3 |
|---|
| 75 | #define DTVS205FH201A_BEFORE_SEND_BYTES_FAILED 4 |
|---|
| 76 | #define DTVS205FH201A_AFTER_SEND_BYTES_FAILED 5 |
|---|
| 77 | #define DTVS205FH201A_SEND_CONTROL_DATA_FAILED 6 |
|---|
| 78 | #define DTVS205FH201A_CHANNEL_OUT_OF_RANGE 7 |
|---|
| 79 | |
|---|
| 80 | #define DTVS205FH201A_LOW_BAND_MIN 54000 |
|---|
| 81 | #define DTVS205FH201A_LOW_BAND_MAX 168000 |
|---|
| 82 | #define DTVS205FH201A_MID_BAND_MIN 168000 |
|---|
| 83 | #define DTVS205FH201A_MID_BAND_MAX 470000 |
|---|
| 84 | #define DTVS205FH201A_HIGH_BAND_MIN 470000 |
|---|
| 85 | #define DTVS205FH201A_HIGH_BAND_MAX 863000 |
|---|
| 86 | #define DTVS205FH201A_F_IF_KHZ 44000 |
|---|
| 87 | #define DTVS205FH201A_N_MAX 32768 //15 bits |
|---|
| 88 | |
|---|
| 89 | //20071110 add |
|---|
| 90 | #define DTVS205FH201A_100MHz 100000 |
|---|
| 91 | #define DTVS205FH201A_168MHz 168000 |
|---|
| 92 | #define DTVS205FH201A_700MHz 700000 |
|---|
| 93 | #define DTVS205FH201A_866MHz 866000 |
|---|
| 94 | |
|---|
| 95 | |
|---|
| 96 | |
|---|
| 97 | int TunerDTVS205FH201ASendChannel(unsigned int uiChannel, int iAdjustFreqKHZ, CHANNEL_TABLE_TYPE iChannelTable,TYPE_TUNERDTVS205FH201A_REF_DIVIDER_RATIO iRefDividerRatio,unsigned int uiAgc, unsigned int uiAgcMode,unsigned int uiChargePump,unsigned int uiAgcTimeConstant); |
|---|
| 98 | int TunerDTVS205FH201ASendFreq(unsigned long ulFrequency,TYPE_TUNERDTVS205FH201A_REF_DIVIDER_RATIO iRefDividerRatio,unsigned int uiAgc, unsigned int uiAgcMode,unsigned int uiChargePump,unsigned int uiAgcTimeConstant); |
|---|
| 99 | int TunerDTVS205FH201ASendPicCarrier(unsigned long ulFrequency,TYPE_TUNERDTVS205FH201A_REF_DIVIDER_RATIO iRefDividerRatio,unsigned int uiAgc, unsigned int uiAgcMode,unsigned int uiChargePump,unsigned int uiAgcTimeConstant); |
|---|
| 100 | void DTVS205FH201ASetCPandStepSize(TYPE_TUNERDTVS205FH201A_REF_DIVIDER_RATIO iRefDividerRatio, TYPE_TUNERDTVS205FH201A_CHARGE_PUMP iRefChargePump, unsigned char* pucCb); |
|---|
| 101 | void DTVS205FH201ASetStepSize(TYPE_TUNERDTVS205FH201A_REF_DIVIDER_RATIO iRefDividerRatio, unsigned char* pucCb,unsigned char* pucCb2); |
|---|
| 102 | void DTVS205FH201ASetAGC(unsigned int uiAgc, unsigned char* pucAb); |
|---|
| 103 | void DTVS205FH201ASetATC(unsigned int uiAgcTimeConstant,unsigned char* pucAb); |
|---|
| 104 | void DTVS205FH201AInitBytes(unsigned char* pucDb1,unsigned char* pucDb2,unsigned char* pucCb,unsigned char* pucBb); |
|---|
| 105 | BOOLEAN TunerDTVS205FH201ASetRFFreq(unsigned long ulFrequency,unsigned int iAgcMode ,unsigned char* pucBb); |
|---|
| 106 | BOOLEAN DTVS205FH201ASetN(unsigned long ulFrequency,TYPE_TUNERDTVS205FH201A_REF_DIVIDER_RATIO iRefDividerRatio, unsigned char* pucDb1,unsigned char* pucDb2); |
|---|
| 107 | unsigned int DTVS205FH201ASendControlData(unsigned int uiAgcMode,unsigned char Db1,unsigned char Db2,unsigned char Cb,unsigned char Bb); |
|---|
| 108 | unsigned long TunerDTVS205FH201AGetFrequency(unsigned int uiChannelNumber,CHANNEL_TABLE_TYPE iChannelTable); |
|---|
| 109 | |
|---|
| 110 | //----------------------------------------------------------------------------------------------------------- |
|---|
| 111 | // Function name : SetTunerDTVS205FH201A |
|---|
| 112 | // Description : controls the Thomson DTVS205FH201A tuner |
|---|
| 113 | // Return type : INT: 0 - Succeeded to set the tuner, other value - Did not succeed to set the tuner |
|---|
| 114 | // Argument : TYPE_TUNER_SET_OPTION TunerSet: Determines how to set the tuner PLL frequency |
|---|
| 115 | // by channel, by center frequency(Khz) or by picture carrier(Khz). |
|---|
| 116 | // Argument : void* pvTunerSet: The value to set according to TunerSet. |
|---|
| 117 | // Argument : CHANNEL_TABLE_TYPE iChannelTableType - determines which channel table will be selected to get the tuner pll frequency from the channel number. |
|---|
| 118 | // Argument : TYPE_TUNERDTVS205FH201A_REF_DIVIDER_RATIO: Determines the reference divider ratio for the tuner |
|---|
| 119 | // Argument : TYPE_TUNERDTVS205FH201A_AGC: Determines the AGC value for the tuner |
|---|
| 120 | // Argument : TYPE_TUNER_AGC_MODE: Determines if the tuner will internal AGC digital or analog |
|---|
| 121 | // the default value is TUNERDTVS205FH201A_AGC_MODE_EXTERNAL |
|---|
| 122 | // Argument : CHARGE_PUMP: Determines the charge pump value |
|---|
| 123 | // Argument : TYPE_TUNERDTVS205FH201A_AGC_TIME_CONSTANT: Determines the AGC time constant value, |
|---|
| 124 | //----------------------------------------------------------------------------------------------------------- |
|---|
| 125 | int __stdcall SetTunerDTVS205FH201A(TYPE_TUNER_SET_OPTION TunerSet, void* pvTunerSet, int iAdjustFreqKHZ, |
|---|
| 126 | CHANNEL_TABLE_TYPE iChannelTable, |
|---|
| 127 | TYPE_TUNERDTVS205FH201A_REF_DIVIDER_RATIO iRefDividerRatio, |
|---|
| 128 | TYPE_TUNERDTVS205FH201A_AGC iAgc, |
|---|
| 129 | TYPE_TUNER_AGC_MODE iAgcMode, |
|---|
| 130 | CHARGE_PUMP iChargePump, |
|---|
| 131 | TYPE_TUNERDTVS205FH201A_AGC_TIME_CONSTANT iAgcTimeConstant); |
|---|
| 132 | |
|---|
| 133 | |
|---|
| 134 | |
|---|
| 135 | |
|---|
| 136 | //----------------------------------------------------------------------------------------------------------- |
|---|
| 137 | // Function name : __stdcall SetChannel |
|---|
| 138 | // Description : This function sets the tuner PLL frequencyand sends channel change command to the cascade2B DSP right after the |
|---|
| 139 | // tuner freuency was set. This function can perform set tuner PLL frequencyand operation by passing the parameters |
|---|
| 140 | // usDelay = 0 and pstChannelChangeParameters = NULL |
|---|
| 141 | // Return type : unsigned int - 0 If CC succeeded, a number greater than zero - if CC did not succeeded. |
|---|
| 142 | // Argument : CAS_2B_TUNER_PARAMETERS stTunerParameters - this struct holds the parameters for the set tuner PLL frequencyand operation |
|---|
| 143 | // The struct fields are: |
|---|
| 144 | // - TUNER_TYPE iTunerType - set the tuner type TUNER_DTVS205FH201A, TUNER_DTT7612 or TUNER_THOMSON_T_2000 |
|---|
| 145 | // - TYPE_TUNER_SET_OPTION iTunerSet - Determines how to set the tuner PLL frequency |
|---|
| 146 | // by channel, by center frequency(Khz) or by picture carrier(Khz). |
|---|
| 147 | // - unsigned long ulSetValue - holds the value to set according to iTunerSet channel, or center frequency(Khz) or by picture carrier(Khz). |
|---|
| 148 | // - CHANNEL_TABLE_TYPE iChannelTableType - determines which channel table will be selected to get the tuner pll frequency from the channel number. |
|---|
| 149 | // this field in needed only when the iTunerSet = TUNER_SET_CHANNEL is selected (not valid for TUNER_THOMSON_T_2000). |
|---|
| 150 | // - TYPE_TUNER_AGC_MODE iAgcMode - determines the agc mode can be digital or analog. |
|---|
| 151 | // - TYPE_TUNER_INPUT_SELECTION iInputSelection - determines the input selection terrestrial or cable (valid only for TUNER_THOMSON_T_2000). |
|---|
| 152 | // |
|---|
| 153 | // Argument : unsigned short usDelay - this parameter is used determine the delay between the set tuner PLL frequency operation and the cascade2B DSP channel change command. |
|---|
| 154 | // The delay value is multiplied by 10000 and than it is decremented in a loop each time by one until the value reaches to 0. The delay time |
|---|
| 155 | // will be influenced by the processor speed. |
|---|
| 156 | // Set the usDelay value to 0 when only a set tuner PLL frequency operation takes place. |
|---|
| 157 | // Argument : CAS_2B_CHANNEL_CHANGE_PARAMETERS* pstChannelChangeParameters - this parameter is a pointer the a struct that holds all the parameters needed for a |
|---|
| 158 | // Cascade2B DSP channel change operation. Set the pstChannelChangeParameters value to NULL when only a set tuner PLL frequency operation takes place. |
|---|
| 159 | // The struct fields are: |
|---|
| 160 | // - TYPE_RECEIVER_MODE iReceiverMode: Describes to which receiver mode to change if needed. |
|---|
| 161 | // - TYPE_CARRIER_ACQUISITION iCarrierAcquisition: Describes the carrier acquisition - normal, wide. |
|---|
| 162 | // this parameter has to be set only for the VSB and QAM Annex B recievers |
|---|
| 163 | // - TYPE_INVERSE_SPECTRUM iInverseSpectrum: Describes if inverse spectrum is on or off |
|---|
| 164 | // this parameter has to be set only for the VSB recievers |
|---|
| 165 | //----------------------------------------------------------------------------------------------------------- |
|---|
| 166 | //unsigned int __stdcall SetChannel( CAS_2B_TUNER_PARAMETERS stTunerParameters,unsigned short usDelay,CAS_2B_CHANNEL_CHANGE_PARAMETERS* pstChannelChangeParameters); |
|---|
| 167 | |
|---|
| 168 | |
|---|
| 169 | int DTVS205FH201A_Init(TUNER_INIT_PARAMETERS InitParam[2]); |
|---|
| 170 | int DTVS205FH201A_SetChannel( CAS_2B_TUNER_PARAMETERS* pstTunerParameters,unsigned short usDelay,CAS_2B_CHANNEL_CHANGE_PARAMETERS* pstChannelChangeParameters); |
|---|
| 171 | int DTVS205FH201A_GetInfo( CAS_2B_TUNER_GET_PARAMETERS* pstTunerParameters); |
|---|
| 172 | |
|---|
| 173 | #endif |
|---|
| 174 | |
|---|
| 175 | |
|---|
| 176 | #if 0 |
|---|
| 177 | //For Tuner DTT7611 |
|---|
| 178 | typedef enum EN_TYPE_TUNERDTT7611_REF_DIVIDER_RATIO{ |
|---|
| 179 | TUNERDTT7611_REF_DIVIDER_RATIO_31_25 = 0, |
|---|
| 180 | TUNERDTT7611_REF_DIVIDER_RATIO_50, |
|---|
| 181 | TUNERDTT7611_REF_DIVIDER_RATIO_62_5, |
|---|
| 182 | TUNERDTT7611_REF_DIVIDER_RATIO_166_7 |
|---|
| 183 | }TYPE_TUNERDTT7611_REF_DIVIDER_RATIO; |
|---|
| 184 | |
|---|
| 185 | typedef enum EN_TYPE_TUNERDTT7611_AGC{ |
|---|
| 186 | TUNERDTT7611_AGC_102_A = 0, |
|---|
| 187 | TUNERDTT7611_AGC_102_B, |
|---|
| 188 | TUNERDTT7611_AGC_99, |
|---|
| 189 | TUNERDTT7611_AGC_96, |
|---|
| 190 | TUNERDTT7611_AGC_93, |
|---|
| 191 | TUNERDTT7611_AGC_90, |
|---|
| 192 | TUNERDTT7611_AGC_WIDE_BAND_OFF |
|---|
| 193 | }TYPE_TUNERDTT7611_AGC; |
|---|
| 194 | |
|---|
| 195 | typedef enum EN_TYPE_TUNERDTT7611_CHARGE_PUMP{ |
|---|
| 196 | TUNERDTT7611_CHARGE_PUMP_60 = 0, |
|---|
| 197 | TUNERDTT7611_CHARGE_PUMP_280 |
|---|
| 198 | }TYPE_TUNERDTT7611_CHARGE_PUMP; |
|---|
| 199 | |
|---|
| 200 | typedef enum EN_TYPE_TUNERDTT7611_AGC_TIME_CONSTANT{ |
|---|
| 201 | TUNERDTT7611_AGC_TIME_CONSTANT_50_MS = 0, |
|---|
| 202 | TUNERDTT7611_AGC_TIME_CONSTANT_2_SEC |
|---|
| 203 | }TYPE_TUNERDTT7611_AGC_TIME_CONSTANT; |
|---|
| 204 | |
|---|
| 205 | |
|---|
| 206 | #define DTT7611_DEVICE_ADDRESS_WRITE 0xC2 // can be read from i2c. Tuner I2C address |
|---|
| 207 | #define DTT7611_SLAVE_ADDRESS 0x86 // Alex modify , 0x86 PIN open, can be read from i2c. Tuner IF address |
|---|
| 208 | |
|---|
| 209 | |
|---|
| 210 | #define DTT7611_CHANNEL_DOES_NOT_FIT_ANY_FREQUENCY -1 |
|---|
| 211 | #define DTT7611_SUCCESS 0 |
|---|
| 212 | #define DTT7611_FREQUENCY_VALUE_OUT_OF_RANGE 1 |
|---|
| 213 | #define DTT7611_VALUE_OUT_OF_RANGE 2 |
|---|
| 214 | #define DTT7611_COULD_NOT_SET_N 3 |
|---|
| 215 | #define DTT7611_BEFORE_SEND_BYTES_FAILED 4 |
|---|
| 216 | #define DTT7611_AFTER_SEND_BYTES_FAILED 5 |
|---|
| 217 | #define DTT7611_SEND_CONTROL_DATA_FAILED 6 |
|---|
| 218 | #define DTT7611_CHANNEL_OUT_OF_RANGE 7 |
|---|
| 219 | |
|---|
| 220 | #define DTT7611_LOW_BAND_MIN 55250 |
|---|
| 221 | //#define DTT7611_LOW_BAND_MAX 145250 |
|---|
| 222 | //#define DTT7611_LOW_BAND_MAX 147000 |
|---|
| 223 | #define DTT7611_LOW_BAND_MAX 149000 |
|---|
| 224 | #define DTT7611_MID_BAND_MIN 151250 |
|---|
| 225 | //#define DTT7611_MID_BAND_MAX 415250 |
|---|
| 226 | //#define DTT7611_MID_BAND_MAX 417000 |
|---|
| 227 | #define DTT7611_MID_BAND_MAX 419000 |
|---|
| 228 | #define DTT7611_HIGH_BAND_MIN 421250 |
|---|
| 229 | //#define DTT7611_HIGH_BAND_MAX 859250 |
|---|
| 230 | #define DTT7611_HIGH_BAND_MAX 870000 |
|---|
| 231 | #define DTT7611_F_IF_KHZ 44000 |
|---|
| 232 | #define DTT7611_N_MAX 32768 //15 bits |
|---|
| 233 | |
|---|
| 234 | //For DTT7612 |
|---|
| 235 | #define FM_MIN_VALUE 88000 |
|---|
| 236 | #define FM_MAX_VALUE 108000 |
|---|
| 237 | #define FM_DTT7612_F_IF_KHZ 41300 |
|---|
| 238 | |
|---|
| 239 | int TunerDTT7611SendChannel(unsigned int uiChannel, int iAdjustFreqKHZ, CHANNEL_TABLE_TYPE iChannelTable,TYPE_TUNERDTT7611_REF_DIVIDER_RATIO iRefDividerRatio,unsigned int uiAgc, unsigned int uiAgcMode,unsigned int uiChargePump,unsigned int uiAgcTimeConstant); |
|---|
| 240 | int TunerDTT7611SendFreq(unsigned long ulFrequency,TYPE_TUNERDTT7611_REF_DIVIDER_RATIO iRefDividerRatio,unsigned int uiAgc, unsigned int uiAgcMode,unsigned int uiChargePump,unsigned int uiAgcTimeConstant); |
|---|
| 241 | int TunerDTT7611SendPicCarrier(unsigned long ulFrequency,TYPE_TUNERDTT7611_REF_DIVIDER_RATIO iRefDividerRatio,unsigned int uiAgc, unsigned int uiAgcMode,unsigned int uiChargePump,unsigned int uiAgcTimeConstant); |
|---|
| 242 | void DTT7611SetCP(unsigned int uiChargePump,unsigned char* pucCb); |
|---|
| 243 | void DTT7611SetStepSize(TYPE_TUNERDTT7611_REF_DIVIDER_RATIO iRefDividerRatio, unsigned char* pucCb,unsigned char* pucCb2); |
|---|
| 244 | void DTT7611SetAGC(unsigned int uiAgc, unsigned char* pucAb); |
|---|
| 245 | void DTT7611SetATC(unsigned int uiAgcTimeConstant,unsigned char* pucAb); |
|---|
| 246 | void DTT7611InitBytes(unsigned char* pucDb1,unsigned char* pucDb2,unsigned char* pucCb,unsigned char* pucBb,unsigned char* pucAb,unsigned char* pucCb2); |
|---|
| 247 | BOOLEAN TunerDTT7611SetRFFreq(unsigned long ulFrequency,unsigned int uiAgcMode,unsigned char* pucBb); |
|---|
| 248 | BOOLEAN DTT7611SetN(unsigned long ulFrequency,TYPE_TUNERDTT7611_REF_DIVIDER_RATIO iRefDividerRatio, unsigned char* pucDb1,unsigned char* pucDb2); |
|---|
| 249 | unsigned int DTT7611SendControlData(unsigned int uiAgcMode,unsigned char Db1,unsigned char Db2,unsigned char Cb,unsigned char Bb,unsigned char Ab,unsigned char Cb2); |
|---|
| 250 | unsigned long TunerDTT7611GetFrequency(unsigned int uiChannelNumber,CHANNEL_TABLE_TYPE iChannelTable); |
|---|
| 251 | |
|---|
| 252 | //----------------------------------------------------------------------------------------------------------- |
|---|
| 253 | // Function name : SetTunerDTT7611 |
|---|
| 254 | // Description : controls the Thomson DTT7611 tuner |
|---|
| 255 | // Return type : INT: 0 - Succeeded to set the tuner, other value - Did not succeed to set the tuner |
|---|
| 256 | // Argument : TYPE_TUNER_SET_OPTION TunerSet: Determines how to set the tuner PLL frequency |
|---|
| 257 | // by channel, by center frequency(Khz) or by picture carrier(Khz). |
|---|
| 258 | // Argument : void* pvTunerSet: The value to set according to TunerSet. |
|---|
| 259 | // Argument : CHANNEL_TABLE_TYPE iChannelTableType - determines which channel table will be selected to get the tuner pll frequency from the channel number. |
|---|
| 260 | // Argument : TYPE_TUNERDTT7611_REF_DIVIDER_RATIO: Determines the reference divider ratio for the tuner |
|---|
| 261 | // Argument : TYPE_TUNERDTT7611_AGC: Determines the AGC value for the tuner |
|---|
| 262 | // Argument : TYPE_TUNER_AGC_MODE: Determines if the tuner will internal AGC digital or analog |
|---|
| 263 | // the default value is TUNERDTT7611_AGC_MODE_EXTERNAL |
|---|
| 264 | // Argument : CHARGE_PUMP: Determines the charge pump value |
|---|
| 265 | // Argument : TYPE_TUNERDTT7611_AGC_TIME_CONSTANT: Determines the AGC time constant value, |
|---|
| 266 | //----------------------------------------------------------------------------------------------------------- |
|---|
| 267 | int __stdcall SetTunerDTT7611(TYPE_TUNER_SET_OPTION TunerSet, void* pvTunerSet, int iAdjustFreqKHZ, |
|---|
| 268 | CHANNEL_TABLE_TYPE iChannelTable, |
|---|
| 269 | TYPE_TUNERDTT7611_REF_DIVIDER_RATIO iRefDividerRatio, |
|---|
| 270 | TYPE_TUNERDTT7611_AGC iAgc, |
|---|
| 271 | TYPE_TUNER_AGC_MODE iAgcMode, |
|---|
| 272 | CHARGE_PUMP iChargePump, |
|---|
| 273 | TYPE_TUNERDTT7611_AGC_TIME_CONSTANT iAgcTimeConstant); |
|---|
| 274 | |
|---|
| 275 | |
|---|
| 276 | |
|---|
| 277 | |
|---|
| 278 | //----------------------------------------------------------------------------------------------------------- |
|---|
| 279 | // Function name : __stdcall SetChannel |
|---|
| 280 | // Description : This function sets the tuner PLL frequencyand sends channel change command to the cascade2B DSP right after the |
|---|
| 281 | // tuner freuency was set. This function can perform set tuner PLL frequencyand operation by passing the parameters |
|---|
| 282 | // usDelay = 0 and pstChannelChangeParameters = NULL |
|---|
| 283 | // Return type : unsigned int - 0 If CC succeeded, a number greater than zero - if CC did not succeeded. |
|---|
| 284 | // Argument : CAS_2B_TUNER_PARAMETERS stTunerParameters - this struct holds the parameters for the set tuner PLL frequencyand operation |
|---|
| 285 | // The struct fields are: |
|---|
| 286 | // - TUNER_TYPE iTunerType - set the tuner type TUNER_DTT7611, TUNER_DTT7612 or TUNER_THOMSON_T_2000 |
|---|
| 287 | // - TYPE_TUNER_SET_OPTION iTunerSet - Determines how to set the tuner PLL frequency |
|---|
| 288 | // by channel, by center frequency(Khz) or by picture carrier(Khz). |
|---|
| 289 | // - unsigned long ulSetValue - holds the value to set according to iTunerSet channel, or center frequency(Khz) or by picture carrier(Khz). |
|---|
| 290 | // - CHANNEL_TABLE_TYPE iChannelTableType - determines which channel table will be selected to get the tuner pll frequency from the channel number. |
|---|
| 291 | // this field in needed only when the iTunerSet = TUNER_SET_CHANNEL is selected (not valid for TUNER_THOMSON_T_2000). |
|---|
| 292 | // - TYPE_TUNER_AGC_MODE iAgcMode - determines the agc mode can be digital or analog. |
|---|
| 293 | // - TYPE_TUNER_INPUT_SELECTION iInputSelection - determines the input selection terrestrial or cable (valid only for TUNER_THOMSON_T_2000). |
|---|
| 294 | // |
|---|
| 295 | // Argument : unsigned short usDelay - this parameter is used determine the delay between the set tuner PLL frequency operation and the cascade2B DSP channel change command. |
|---|
| 296 | // The delay value is multiplied by 10000 and than it is decremented in a loop each time by one until the value reaches to 0. The delay time |
|---|
| 297 | // will be influenced by the processor speed. |
|---|
| 298 | // Set the usDelay value to 0 when only a set tuner PLL frequency operation takes place. |
|---|
| 299 | // Argument : CAS_2B_CHANNEL_CHANGE_PARAMETERS* pstChannelChangeParameters - this parameter is a pointer the a struct that holds all the parameters needed for a |
|---|
| 300 | // Cascade2B DSP channel change operation. Set the pstChannelChangeParameters value to NULL when only a set tuner PLL frequency operation takes place. |
|---|
| 301 | // The struct fields are: |
|---|
| 302 | // - TYPE_RECEIVER_MODE iReceiverMode: Describes to which receiver mode to change if needed. |
|---|
| 303 | // - TYPE_CARRIER_ACQUISITION iCarrierAcquisition: Describes the carrier acquisition - normal, wide. |
|---|
| 304 | // this parameter has to be set only for the VSB and QAM Annex B recievers |
|---|
| 305 | // - TYPE_INVERSE_SPECTRUM iInverseSpectrum: Describes if inverse spectrum is on or off |
|---|
| 306 | // this parameter has to be set only for the VSB recievers |
|---|
| 307 | //----------------------------------------------------------------------------------------------------------- |
|---|
| 308 | //unsigned int __stdcall SetChannel( CAS_2B_TUNER_PARAMETERS stTunerParameters,unsigned short usDelay,CAS_2B_CHANNEL_CHANGE_PARAMETERS* pstChannelChangeParameters); |
|---|
| 309 | |
|---|
| 310 | |
|---|
| 311 | int DTT7611_Init(TUNER_INIT_PARAMETERS InitParam[2]); |
|---|
| 312 | int DTT7611_SetChannel( CAS_2B_TUNER_PARAMETERS* pstTunerParameters,unsigned short usDelay,CAS_2B_CHANNEL_CHANGE_PARAMETERS* pstChannelChangeParameters); |
|---|
| 313 | int DTT7611_GetInfo( CAS_2B_TUNER_GET_PARAMETERS* pstTunerParameters); |
|---|
| 314 | #endif |
|---|
| 315 | |
|---|
| 316 | |
|---|
| 317 | #endif |
|---|