/* * $Id: Cas2ARoutines.h,v 1.1 2011/07/08 03:43:59 megakiss Exp $ * $Revision: 1.1 $ * $DateTime: 2005/08/24 19:03:17 $ * $Change: 28028 $ * $Author: megakiss $ */ #ifndef _CASCADE_2A_ROUTINES_H #define _CASCADE_2A_ROUTINES_H #include "Cas2AGeneralDefinitions.h" #include "TunerDTT7611.h" #include "TunerDTT7612.h" #include "TdquTuner.h" //----------------------------------------------------------------------------------------------------------- // Function name : Cas2AChannelChange // Description : Performs Channel change operation for the Cascade with all options for VSB, // QAM Annex B . // Return type : unsigned int: 0 - If CC succeeded, a number greater than zero - if CC did not succeeded - when error in communication or the number // will indicate the error occured // cannot read expected mode after CC // Argument : CAS_2A_CHANNEL_CHANGE_PARAMETERS stChannelChangeParameters : This struct holds the channel change specific // parameters for a certain receiver. the struct parameters are: // // - TYPE_RECEIVER_MODE iReceiverMode: Describes to which receiver mode to change if needed. // - TYPE_CARRIER_ACQUISITION iCarrierAcquisition: Describes the carrier acquisition - normal, wide. // this parameter has to be set only for the VSB and QAM Annex B recievers // - TYPE_INVERSE_SPECTRUM iInverseSpectrum: Describes if inverse spectrum is on or off // this parameter has to be set only for the VSB recievers // - TYPE_NTSC_SIGNAL_DETECTION iNtscSignalDetection: Describes if the ntsc signal detection is vsb or ntsc //----------------------------------------------------------------------------------------------------------- unsigned int Cas2AChannelChange(CAS_2A_CHANNEL_CHANGE_PARAMETERS stChannelChangeParameters ); //----------------------------------------------------------------------------------------------------------- // Function name : SetChannel // Description : This function sets the tuner PLL frequencyand sends channel change command to the cascade2A DSP right after the // tuner freuency was set. This function can perform set tuner PLL frequencyand operation by passing the parameters // usDelay = 0 and pstChannelChangeParameters = NULL // Return type : unsigned int - 0 If CC succeeded, a number greater than zero - if CC did not succeeded. // Argument : CAS_2A_TUNER_PARAMETERS stTunerParameters - this struct holds the parameters for the set tuner PLL frequencyand operation // The struct fields are: // - TUNER_TYPE iTunerType - set the tuner type TUNER_DTT7611, or TUNER_DTT7612 // - TYPE_TUNER_SET_OPTION iTunerSet - Determines how to set the tuner PLL frequency // by channel, by center frequency(Khz) or by picture carrier(Khz). // - unsigned long ulSetValue - holds the value to set according to iTunerSet channel, or center frequency(Khz) or by picture carrier(Khz). // - CHANNEL_TABLE_TYPE iChannelTableType - determines which channel table will be selected to get the tuner pll frequency from the channel number. // this field in needed only when the iTunerSet = TUNER_SET_CHANNEL is selected. // - TYPE_TUNER_AGC_MODE iAgcMode - determines which channel table will be selected to get the tuner pll frequency from the channel number. // // Argument : unsigned short usDelay - this parameter is used determine the delay between the set tuner PLL frequency operation and the cascade2A DSP channel change command. // 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 // will be influenced by the processor speed. // Set the usDelay value to 0 when only a set tuner PLL frequency operation takes place. // Argument : CAS_2A_CHANNEL_CHANGE_PARAMETERS* pstChannelChangeParameters - this parameter is a pointer the a struct that holds all the parameters needed for a // Cascade2A DSP channel change operation. Set the pstChannelChangeParameters value to NULL when only a set tuner PLL frequency operation takes place. // The struct fields are: // - TYPE_RECEIVER_MODE iReceiverMode: Describes to which receiver mode to change if needed. // - TYPE_CARRIER_ACQUISITION iCarrierAcquisition: Describes the carrier acquisition - normal, wide. // this parameter has to be set only for the VSB and QAM Annex B recievers // - TYPE_INVERSE_SPECTRUM iInverseSpectrum: Describes if inverse spectrum is on or off // this parameter has to be set only for the VSB recievers //----------------------------------------------------------------------------------------------------------- unsigned int SetChannel(CAS_2A_TUNER_PARAMETERS stTunerParameters,unsigned short usDelay,CAS_2A_CHANNEL_CHANGE_PARAMETERS* pstChannelChangeParameters); //----------------------------------------------------------------------------------------------------------- // Function name : IsLocked // Description : This function reads the cascade 2A device transmit register number 0 and // extracts the lock/unlock flag (bit 8) from it. // Return type : LOCK_STATUS // Argument : int * piError - retrives error description if failed //----------------------------------------------------------------------------------------------------------- LOCK_STATUS IsLocked(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetMode // Description : This function reads the cascade 2A device transmit register number 0 and // extracts the Transmitting Method field (bits 0-7) from it. // Return type : unsigned char - the Transmitting Method number // Argument : int * piError - retrives error description if failed //----------------------------------------------------------------------------------------------------------- unsigned char GetMode(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetRfInverseSpectrum // Description : This function reads the cascade 2A device transmit register number 0 and // extracts the inverse spectrum field (bit 15) from it. // Return type : unsigned char 0 indicates no inverse RF spectrum 1 indicates inverse RF spectrum // Argument : int * piError retrives error description if failed //----------------------------------------------------------------------------------------------------------- unsigned char GetRfInverseSpectrum(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetSymbolRateFrequencyOffset // Description : // Return type : NUMERATOR_DENOMINATOR // Argument : CAS_2A_TYPE_RECEIVER_MODE iReceiverMode // Argument : int * piError retrives error description if failed //----------------------------------------------------------------------------------------------------------- NUMERATOR_DENOMINATOR GetSymbolRateFrequencyOffset(CAS_2A_TYPE_RECEIVER_MODE iReceiverMode,int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetDiMode // Description : returns the de interleaver mode // Return type : TYPE_ITUB_DE_INTERLEAVER_MODE // Argument : int * piError retrives error description if failed //----------------------------------------------------------------------------------------------------------- TYPE_ITUB_DE_INTERLEAVER_MODE GetDiMode(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetSnrAfterEqualization // Description : This function returns the SNR values from the cascade device it can return the SNR value // before and after equalization. // Return type : unsigned short returns the snr value // Argument : CAS_2A_TYPE_RECEIVER_MODE iReceiverMode can be CAS_2A_RECEIVER_MODE_VSB_8_TR or CAS_2A_RECEIVER_MODE_ITUB_64 or CAS_2A_RECEIVER_MODE_ITUB_256 // Argument : int * piError - retrives error description if failed //----------------------------------------------------------------------------------------------------------- unsigned short GetSnrAfterEqualization(CAS_2A_TYPE_RECEIVER_MODE iReceiverMode,int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetPer // Description : This function returns the packet error rate as a ratio value that is inserted in a struct // NUMERATOR_DENOMINATOR where the numerator is the number of uncorrected RS packets and the denominator // is the number of RS packets // Return type : NUMERATOR_DENOMINATOR // Argument : CAS_2A_TYPE_RECEIVER_MODE iReceiverMode can be CAS_2A_RECEIVER_MODE_VSB_8_TR or CAS_2A_RECEIVER_MODE_ITUB_64 or CAS_2A_RECEIVER_MODE_ITUB_256 // Argument : int * piError - retrives error description if failed //----------------------------------------------------------------------------------------------------------- NUMERATOR_DENOMINATOR GetPer(CAS_2A_TYPE_RECEIVER_MODE iReceiverMode,int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetBer // Description : This function returns the BER values from the cascade device the BER calculation is // BER = (BERCorrected + 4*7 BERFailed)/(7*122 * BERLimit) where: // ERCorrected - 'Corrected' bits counter for BER calculation before RS. // BERFailed - 'UnCorrected' RS packets. // BERLimit = Total RS packets counter. // This function is valid only for ITUB receiver mode // Return type : NUMERATOR_DENOMINATOR returns the claculated value as a denominator/numerator value // (see the claculation formula above) // Argument : int * piError - retrives error description if failed //----------------------------------------------------------------------------------------------------------- NUMERATOR_DENOMINATOR GetBer(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : Get1SecSer // Description : This function returns the Segment Error Rate of the last 1 second; // Return type : unsigned char the Segment Error Rate value of the last 1 second. // Argument : int * piError - retrives error description if failed //----------------------------------------------------------------------------------------------------------- unsigned char Get1SecSer(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetEqualizerFeedForwardTaps // Description : This function returns the feed forward taps vector, the recieved vector length for // VSB is 96(only real data), for ITUB is 96 (48 real 48 image). // Return type : unsigned int - 0 if successful other value indicates an error occured // Argument : unsigned short* pusaReceivedFfTaps - A pointer to a buffer that will hold the received data. // The buffer memory must be allocated before calling this function //----------------------------------------------------------------------------------------------------------- unsigned int GetEqualizerFeedForwardTaps(unsigned short* pusaReceivedFfTaps); //----------------------------------------------------------------------------------------------------------- // Function name : GetEqualizerFeedBackTaps // Description : This function returns the feed back taps vector, the recieved vector length for // VSB is 384(only real data), for ITUB is 96 (48 real 48 image). // Return type : unsigned int - 0 if successful other value indicates an error occured // Argument : CAS_2A_TYPE_RECEIVER_MODE iReceiverMode can be CAS_2A_RECEIVER_MODE_VSB_8_TR or CAS_2A_RECEIVER_MODE_ITUB_64 or CAS_2A_RECEIVER_MODE_ITUB_256 // Argument : unsigned short* pusaReceivedFbTaps - A pointer to a buffer that will hold the received data. // The buffer memory must be allocated before calling this function. //----------------------------------------------------------------------------------------------------------- unsigned int GetEqualizerFeedBackTaps(CAS_2A_TYPE_RECEIVER_MODE iReceiverMode,unsigned short* pusaReceivedFbTaps); //----------------------------------------------------------------------------------------------------------- // Function name : GetConstellationSamples // Description : This function returns the constellation samples // Return type : unsigned int - 0 if successful other value indicates an error occured // Argument : unsigned short usNumberOfConstellationSamples - this parameter will hold the pusaConstellationSamples buffer size and will determine how mny // samples will be retrieved from the chip. The maximum size can be 4096. // Argument : unsigned short* pusaConstellationSamples - A pointer to a buffer that will hold the received data. // The buffer memory must be allocated before calling this function. //----------------------------------------------------------------------------------------------------------- unsigned int GetConstellationSamples(unsigned short usNumberOfConstellationSamples,unsigned short* pusaConstellationSamples); //----------------------------------------------------------------------------------------------------------- // Function name : SendVsbMessage // Description : This function sends receive 1 commands for VSB receiver // Return type : unsigned int - 0 if successful other value indicates an error occured // Argument : TYPE_VSB_CHANNEL_CONDITION iVsbChannelCondition - can be VSB_CHANNEL_CONDITION_AUTO or VSB_CHANNEL_CONDITION_STATIC or VSB_CHANNEL_CONDITION_DYNAMIC // or VSB_CHANNEL_CONDITION_FAST_DYNAMIC. // Argument : TYPE_VSB_NTSC_REJECTION_FILTER iVsbNtscRegectionFilter - can be VSB_NTSC_REJECTION_FILTER_AUTO or VSB_NTSC_REJECTION_FILTER_OFF or VSB_NTSC_REJECTION_FILTER_ON. // Argument : TYPE_MPEG_OUTPUT_MODE iMpegOutputMode - can be MPEG_SERIAL_OUTPUT_MODE_PARALLEL or MPEG_SERIAL_OUTPUT_MODE_SERIAL. // Argument : TYPE_TUNER_PHASE_NOISE iTunerPhaseNoise - can be TUNER_PHASE_NOISE_NORMAL or TUNER_PHASE_NOISE_HIGH. //----------------------------------------------------------------------------------------------------------- unsigned int SendVsbMessage(TYPE_VSB_CHANNEL_CONDITION iVsbChannelCondition,TYPE_VSB_NTSC_REJECTION_FILTER iVsbNtscRegectionFilter,TYPE_MPEG_OUTPUT_MODE iMpegOutputMode,TYPE_TUNER_PHASE_NOISE iTunerPhaseNoise); //----------------------------------------------------------------------------------------------------------- // Function name : SendItubMessage // Description : This function sends receive 1 commands for ITUB receiver // Return type : unsigned int // Argument : TYPE_ITUB_DE_INTERLEAVER_MODE iItubDeInterlieverMode - can be ITUB_DE_INTERLEAVER_MODE_AUTOMATIC or // ITUB_DE_INTERLEAVER_MODE_X_Y where X Y couples are 128,1 or 128,2 or 64,2 or 128,3 or 32,4 or 128,4 or 16,8 or 8,16 // Argument : TYPE_MPEG_OUTPUT_MODE iMpegOutputMode - can be MPEG_SERIAL_OUTPUT_MODE_PARALLEL or MPEG_SERIAL_OUTPUT_MODE_SERIAL. // Argument : TYPE_TUNER_PHASE_NOISE iTunerPhaseNoise - can be TUNER_PHASE_NOISE_NORMAL or TUNER_PHASE_NOISE_HIGH. //----------------------------------------------------------------------------------------------------------- unsigned int SendItubMessage(TYPE_ITUB_DE_INTERLEAVER_MODE iItubDeInterlieverMode,TYPE_MPEG_OUTPUT_MODE iMpegOutputMode,TYPE_TUNER_PHASE_NOISE iTunerPhaseNoise); //----------------------------------------------------------------------------------------------------------- // Function name : GetAgcIfCommand // Description : this function returns the Agc IF Command value as a ratio value that is inserted in a struct // NUMERATOR_DENOMINATOR where the numerator is the Agc IF Command value and the denominator // is 32768 // Return type : NUMERATOR_DENOMINATOR // Argument : int * piError - retrives error description if failed //----------------------------------------------------------------------------------------------------------- NUMERATOR_DENOMINATOR GetAgcIfCommand(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetDSPFirmwareVersion // Description : this function returns the DSP firmware version as an array of 6 numbers // Return type : CAS_2A_CODE_VERSION // Argument : int * piError - retrives error description if failed //----------------------------------------------------------------------------------------------------------- CAS_2A_CODE_VERSION GetDSPFirmwareVersion(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetHardwareVersion // Description : returns the hardware version number // Return type : unsigned char - the hardware version number. // Argument : int * piError - retrives error description if failed //----------------------------------------------------------------------------------------------------------- unsigned char GetHardwareVersion(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetCarrierOffset // Description : This function returns the calculated value of the carrier offset according to the formaula // ((X/32768)*(symbol rate * pow(10,6)/2))/1000 // X is the value that is retrieved from the cascade device // the value is calculated in a proximity way. // Return type : long calculated carrier offset in Khz // Argument : CAS_2A_TYPE_RECEIVER_MODE iReceiverMode // Argument : int * piError - retrives error description if failed //----------------------------------------------------------------------------------------------------------- long GetCarrierOffset(CAS_2A_TYPE_RECEIVER_MODE iReceiverMode,int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetChecksumFlag // Description : returns the checksum flag that was calculated when the code and data were // loaded. // Return type : CHECKSUM_STATUS CHECKSUM_STATUS_INCORRECT (0) CHECKSUM_STATUS_CORRECT (1) // Argument : int * piError - retrives error description if failed //----------------------------------------------------------------------------------------------------------- CHECKSUM_STATUS GetChecksumFlag(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : ResetChecksum // Description : this function sets the checksum register value to 0. // Return type : unsigned int //----------------------------------------------------------------------------------------------------------- unsigned int ResetChecksum(); //----------------------------------------------------------------------------------------------------------- // Function name : SendCodeAndData // Description : this function sends a compiled DSP code file and compiled RAM DATA file (these files are binary type files // that are supplied by Oren Semiconductor will be named Xc.iic (for code) Xd.iic (for data) ) // in order to send the code or data to the cascade the user must open these files as binary files // and read the file data to a data buffer (type unsigned char). // the user must follow the following instruction: // 1. Allocate a buffer with the size . // 2. Copy the binary data from the file to the buffer starting from cell index 1. // 3. The cell in index 0 will be used by the function SendCascadeCodeOrData so the user doesnt have to. // fill it with a value. // Return type : int 0 if successful other value indicates an error occured // Argument : unsigned char * pucCodeToSend A pointer the buffer that holds the code to send (the code starts from cell index 1). // Argument : unsigned long ulCodeBufferSize the code to send size . // Argument : unsigned char * pucDataToSend A pointer the buffer that holds the data to send (the data starts from cell index 1). // Argument : unsigned long ulDataBufferSize the data to send size . //----------------------------------------------------------------------------------------------------------- int SendCodeAndData(unsigned char * pucCodeToSend,unsigned long ulCodeBufferSize,unsigned char * pucDataToSend,unsigned long ulDataBufferSize); //---------------------------------------------------------------------------------------------- // Function name : SendCas2ARunFlag // Description : this function sends the cascade a run flag which result in the cascade // device will start to execute the loaded code // Return type : int 0 if successful other value indicates an error occured //---------------------------------------------------------------------------------------------- int SendCas2ARunFlag(); //---------------------------------------------------------------------------------------------- // Function name : PerformChannelScan // Description : This function performs an automatic channel search. the function tries to lock the cascade device // on each of the frequencies that were set by the user. and if it succeeds it gathers information from the // cascade device according to the receiver lock. // Return type : unsigned int 0 if successful other value indicates an error occured // Argument : CAS_2A_CHANNEL_SCAN_PARAMETERS stChannelScanParameters - this file holds all the channel scan settings // this struct holds the following fields: // - TYPE_CHANNEL_SCAN_RECEIVER_MODE_PRIORITY iReceiverModeFirstPriority - can be vsb itub or ntsc the function will try to lock // for each checked frequency first on the receiver mode that is stated in iReceiverModeFirstPriority. // - TYPE_CHANNEL_SCAN_RECEIVER_MODE_PRIORITY iReceiverModeSecondPriority - can be none vsb itub or ntsc the function will try to lock // for each checked frequency second on the receiver mode that is stated in iReceiverModeSecondPriority. // - TYPE_CHANNEL_SCAN_RECEIVER_MODE_PRIORITY iReceiverModeThirdPriority - can be none vsb itub or ntsc the function will try to lock // for each checked frequency third on the receiver mode that is stated in iReceiverModeThirdPriority. // - TYPE_CHANNEL_SCAN_FREQUENCY_OPTION iChannelScanFrequencyOption - this field will tell the application what frequencies input database // to use in the scanning operation there are three options. // 1. according to preser frequency tables (SCAN_ACCORDING_TO_TABLE) // 2. according to frequency range that is set by the user (SCAN_ACCORDING_TO_FREQUENCY). // 3. according to user defined frequency table (SCAN_ACCORDING_TO_INPUT_TABLE). // - CHANNEL_TABLE_TYPE iChannelTableType - this field tells the function which frequency table to use. set this field only when // the SCAN_ACCORDING_TO_TABLE option is selected. // - unsigned long ulStartFrequency - this field will hold the start frequency value (KHz) for the channel scan operation // set this field only when the SCAN_ACCORDING_TO_FREQUENCY option is selected. // - unsigned long ulEndFrequency - this field will hold the last frequency value (KHz) for the channel scan operation // set this field only when the SCAN_ACCORDING_TO_FREQUENCY option is selected. // - unsigned long ulStepSize - this field will hold the increment frequency value (KHz) that will be added to the frequenct for each cycle // of the channel scan operation. set this field only when the SCAN_ACCORDING_TO_FREQUENCY option is selected. // - unsigned short usInputFrequencyTableSize - this field will hold the input frequencies data buffer size. set this field // only when the SCAN_ACCORDING_TO_INPUT_TABLE option is selected. // - BOOLEAN bPerformCascadeChannelChange - set this field to TRUE if you want the application to perform channel change // operation for the cascade device for eacy channel scan cycle. // - unsigned long ulDelay - this field will be use by the function to create delays between cascade IIC operations. this delay is eesential // for the application to work correctly. the each time the delay is used it is decremented in a while loop until its value reaches to 0. // the delay time will be influenced by the proccessor spped (recomended value is 750000). // - TYPE_CARRIER_ACQUISITION iCarrierAcquisition - determines the carrier acquisition that will be set by the cascade channel change // operation. // - TUNER_TYPE iTunerType - set the tuner type. // - unsigned long ulNumberOfTries - this field determines how many time the application will check the lock status for each frequency (this parameter is // used only on vsb and itub receiver modes). // - unsigned short usResultsBufferSize - this filed tells the application what is the size of the result buffer pointed by pstaChannelScanResults. // Argument : CAS_2A_CHANNEL_SCAN_RESULT *pstaChannelScanResults - this struct will hold the data that was read from the cascade device for each checked frequency // the struct fileds are: // - unsigned long ulFrequency - holds the checked frequency value in KHz. // - long lCarrierOffset - this fields will hold the cascade device carrier offset in KHz. this value will be set only when a signal of vsb ot itub was found // in the checked frequency. // - unsigned short usSnr - this field will hold the cascade device SNR value in db. this value will be set only when a signal of vsb ot itub was found // in the checked frequency. // - NUMERATOR_DENOMINATOR stAgcIfCommand - this field will hold the cascade device agc if command value. this value will be set only when a signal of vsb ot itub was found // in the checked frequency. // - BOOLEAN bRfInverseSpectrum - this field will hold the cascade device inverse spectrum (TRUE == inverse). this value will be set only when a signal of vsb ot itub was found // in the checked frequency. // - NUMERATOR_DENOMINATOR stSymbolRateoffset - this field will hold the cascade device isymbol rate offset value in ppm. this value will be set only when a signal of vsb ot itub was found // in the checked frequency. // - TYPE_ITUB_DE_INTERLEAVER_MODE iDiMode - this field will hold the cascade device de interliever mode. this value will be set only when a signal of itub was found // in the checked frequency. // - TYPE_CHANNEL_SCAN_RECEIVER_MODE_LOCK iReceiverKodeLock - this field will tell which kind of signal was found for each frequency. // Argument : unsigned long* pulaInputFrequenciesTable - this pointer will point to the frequencies buffer that were set by the user in SCAN_ACCORDING_TO_INPUT_TABLE mode for other modes set the pointer to NULL. //---------------------------------------------------------------------------------------------- unsigned int PerformChannelScan(CAS_2A_CHANNEL_SCAN_PARAMETERS stChannelScanParameters, CAS_2A_CHANNEL_SCAN_RESULT *pstaChannelScanResults,unsigned long* pulaInputFrequenciesTable); //----------------------------------------------------------------------------------------------------------- // Function name : SetReceiveRegister // Description : This function sets the selected recieve register value // Return type : int - 0 if successful other value indicates an error occured // Argument : unsigned char usReceiveRegisterNumber - The receivee register number (can be 0-7). // Argument : unsigned short usReceiveRegisterValue - The value to set into the selected recive register //----------------------------------------------------------------------------------------------------------- int SetReceiveRegister(unsigned char usReceiveRegisterNumber,unsigned short usReceiveRegisterValue); //----------------------------------------------------------------------------------------------------------- // Function name : GetTransmitRegisterValue // Description : This function returns the value of the selected transmit register (selected by ucTransmitRegiterNumber) // Return type : unsigned short - The value of the seleceted transmit register // Argument : unsigned char ucTransmitRegiterNumber - The number of the transmit register which its value is needed (can be 0 -31) // Argument : int * piError - retrives error description if failed //----------------------------------------------------------------------------------------------------------- unsigned short GetTransmitRegisterValue(unsigned char ucTransmitRegiterNumber,int * piError); //----------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------- // //internal usage functions // //----------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------- unsigned char CalcLog(unsigned short usReceivedWord); unsigned char GetLogFromTable(unsigned char ucValueToLog); //----------------------------------------------------------------------------------------------------------- // Function name : SetTunerDTT7611 // Description : controls the Thomson DTT7611 tuner // Return type : INT: 0 - Succeeded to set the tuner, other value - Did not succeed to set the tuner // Argument : TYPE_TUNER_SET_OPTION TunerSet: Determines how to set the tuner PLL frequency // by channel, by center frequency(Khz) or by picture carrier(Khz). // Argument : void* pvTunerSet: The value to set according to TunerSet. // Argument : CHANNEL_TABLE_TYPE iChannelTableType - determines which channel table will be selected to get the tuner pll frequency from the channel number. // Argument : TYPE_TUNERDTT7611_REF_DIVIDER_RATIO: Determines the reference divider ratio for the tuner // Argument : TYPE_TUNERDTT7611_AGC: Determines the AGC value for the tuner // Argument : TYPE_TUNER_AGC_MODE: Determines if the tuner will internal AGC digital or analog // the default value is TUNERDTT7611_AGC_MODE_EXTERNAL // Argument : CHARGE_PUMP: Determines the charge pump value // Argument : TYPE_TUNERDTT7611_AGC_TIME_CONSTANT: Determines the AGC time constant value, //----------------------------------------------------------------------------------------------------------- int SetTunerDTT7611(TYPE_TUNER_SET_OPTION TunerSet, void* pvTunerSet, CHANNEL_TABLE_TYPE iChannelTable, TYPE_TUNERDTT7611_REF_DIVIDER_RATIO iRefDividerRatio, TYPE_TUNERDTT7611_AGC iAgc, TYPE_TUNER_AGC_MODE iAgcMode, CHARGE_PUMP iChargePump, TYPE_TUNERDTT7611_AGC_TIME_CONSTANT iAgcTimeConstant); //----------------------------------------------------------------------------------------------------------- // Function name : SetTunerDTT7612 // Description : controls the Thomson DTT7612 tuner // Return type : INT: 0 - Succeeded to set the tuner, other value - Did not succeed to set the tuner // Argument : TYPE_TUNER_SET_OPTION TunerSet: Determines how to set the tuner PLL frequency // by channel, by center frequency(Khz) or by picture carrier(Khz). // Argument : void* pvTunerSet: The value to set according to TunerSet. // Argument : CHANNEL_TABLE_TYPE iChannelTableType - determines which channel table will be selected to get the tuner pll frequency from the channel number. // Argument : TYPE_TUNERDTT7612_REF_DIVIDER_RATIO: Determines the reference divider ratio for the tuner // Argument : TYPE_TUNERDTT7612_AGC: Determines the AGC value for the tuner // Argument : TYPE_TUNER_AGC_MODE: Determines if the tuner will internal AGC digital or analog // Argument : CHARGE_PUMP: Determines the charge pump value // Argument : TYPE_TUNERDTT7612_AGC_TIME_CONSTANT: Determines the AGC time constant value, //----------------------------------------------------------------------------------------------------------- int SetTunerDTT7612(TYPE_TUNER_SET_OPTION TunerSet, void* pvTunerSet, CHANNEL_TABLE_TYPE iChannelTable, TYPE_TUNERDTT7612_REF_DIVIDER_RATIO iRefDividerRatio, TYPE_TUNERDTT7612_AGC iAgc, TYPE_TUNER_AGC_MODE iAgcMode, CHARGE_PUMP iChargePump, TYPE_TUNERDTT7612_AGC_TIME_CONSTANT iAgcTimeConstant); //----------------------------------------------------------------------------------------------------------- int SetTunerTdqu(TYPE_TUNER_SET_OPTION TunerSet, unsigned long ulTunerSet, CHANNEL_TABLE_TYPE iChannelTable, TYPE_TUNER_TDQU_REF_DIVIDER_RATIO iReferenceDividerRatio,TYPE_TUNER_TDQU_CHARGE_PUMP iChargePump,TYPE_TUNER_TDQU_AGST iAgst); int GetChipData(unsigned int iReceiverModePriority, CAS_2A_CHANNEL_SCAN_RESULT* pstChannelScanResult); //----------------------------------------------------------------------------------------------------------- // Function name : CheckIfLocked // Description : this function checks if the cascade device is locked on the signal it tries to lock for ulNumberofTries // Return type : BOOLEAN returns TRUE if the cascade device is locked // Argument : unsigned long ulNumberofTries the number of times that the function will try to check if the device is locked //----------------------------------------------------------------------------------------------------------- BOOLEAN CheckIfLocked(unsigned long ulNumberofTries); #endif