/* * $Id: Cas2BRoutines.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_2B_ROUTINES_H #define _CASCADE_2B_ROUTINES_H #include "Cas2BGeneralDefinitions.h" #include "TunerDTT7611.h" #include "TdquTuner.h" #include "TunerDTT7612.h" #include "ThomsonT2000Tuner.h" #include "TD6650TTuner.h" #include "DTT7600Tuner.h" #include "Mt2121Tuner.h" #include "TdquTuner.h" #include "SN761662Tuner.h" #include "VP13HRTuner.h" #include "TunerFQD1236.h" //----------------------------------------------------------------------------------------------------------- // Function name : Cas2BChannelChange // 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_2B_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 // this parameter has to be set only for the VSB and QAM Annex B recievers //----------------------------------------------------------------------------------------------------------- unsigned int __stdcall Cas2BChannelChange(CAS_2B_CHANNEL_CHANGE_PARAMETERS stChannelChangeParameters ); //----------------------------------------------------------------------------------------------------------- // Function name : __stdcall SetChannel // Description : This function sets the tuner PLL frequencyand sends channel change command to the cascade2B 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_2B_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, TUNER_DTT7612, TUNER_THOMSON_T_2000, TUNER_XCEIVE_XC3028,TUNER_DTT760x,TUNER_MT2121 or TUNER_TDQU // - 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 (not valid for TUNER_THOMSON_T_2000). // - TYPE_TUNER_AGC_MODE iAgcMode - determines the agc mode can be digital or analog(not valid for TUNER_TDQU). // - TYPE_TUNER_INPUT_SELECTION iInputSelection - determines the input selection terrestrial or cable (valid only for TUNER_THOMSON_T_2000). // - BOOLEAN bLoadFirmware - Determines if the tuner will be loaded with the firmware data before the frequency is set. The tuner can only be loaded after a code was loaded the // Cascade device and a run flag was sent(valid only for TUNER_XCEIVE_XC3028). // - TYPE_TUNER_FIRMAWARE_MODE iFirmwareMode - Determines which firmaware will be loaded to the tuner when bLoadFirmware == TRUE, can be analog or digital(valid only for TUNER_XCEIVE_XC3028). // - BOOLEAN bIsFMTrapOn - Used in VP13HR tuner. Usualy TRUE when terrestrial mode and FALSE in Cables. // 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. // 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_2B_CHANNEL_CHANGE_PARAMETERS* pstChannelChangeParameters - this parameter is a pointer the a struct that holds all the parameters needed for a // Cascade2B 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 __stdcall SetChannel(CAS_2B_TUNER_PARAMETERS stTunerParameters,unsigned short usDelay,CAS_2B_CHANNEL_CHANGE_PARAMETERS* pstChannelChangeParameters); //----------------------------------------------------------------------------------------------------------- // Function name : IsLocked // Description : This function reads the cascade 2B device transmit register number 0 and // extracts the lock/unlock flag (bit 8) from it. // Return type : LOCK_STATUS // Argument : int * piError - retrieves error description if failed //----------------------------------------------------------------------------------------------------------- LOCK_STATUS __stdcall IsLocked(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : IsNtscChannelDetected // Description : This function reads the cascade 2B device transmit register number 0 and // extracts the NTSC channel detection flag (bit 14) from it - only for VSB. // Return type : BOOLEAN __stdcall TRUE NTSC channel is detected // Argument : int * piError - retrieves error description if failed //----------------------------------------------------------------------------------------------------------- BOOLEAN __stdcall IsNtscChannelDetected(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : __stdcall GetMode // Description : This function reads the cascade 2B 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 - retrieves error description if failed //----------------------------------------------------------------------------------------------------------- unsigned char __stdcall GetMode(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : __stdcall GetRfInverseSpectrum // Description : This function reads the cascade 2B 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 retrieves error description if failed //----------------------------------------------------------------------------------------------------------- unsigned char __stdcall GetRfInverseSpectrum(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetSymbolRateFrequencyOffset // Description : This function reads the cascade 2B device transmit register number 3 and calculates the symbol rate frequency according to // the formula: // For VSB8tr - transmit 3 register value * 0.8211 // For ITUB 64 - transmit 3 register value * 0.77167 // For ITUB 256 - transmit 3 register value * 0.81794 // Return type : NUMERATOR_DENOMINATOR __stdcall returns the claculated value as a numerator/denominator value // (see the claculation formula above) // Argument : CAS_2B_TYPE_RECEIVER_MODE iReceiverMode can be CAS_2B_RECEIVER_MODE_VSB_8_TR, CAS_2B_RECEIVER_MODE_ITUB_64 or CAS_2B_RECEIVER_MODE_ITUB_256 // Argument : int * piError retrieves error description if failed //----------------------------------------------------------------------------------------------------------- NUMERATOR_DENOMINATOR __stdcall GetSymbolRateFrequencyOffset(CAS_2B_TYPE_RECEIVER_MODE iReceiverMode,int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetDiMode // Description : This function reads the cascade 2B device transmit register number 0 and // extracts the di mode fields (bits 10-13) from it. This function is valid only for ITUB receiver mode // Return type : TYPE_ITUB_DE_INTERLEAVER_MODE __stdcall an enum of the di modes // Argument : int * piError retrieves error description if failed //----------------------------------------------------------------------------------------------------------- TYPE_ITUB_DE_INTERLEAVER_MODE __stdcall GetDiMode(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetSnrAfterEqualization // Description : This function returns the SNR value after equalization from the cascade device. // Return type : unsigned short returns the snr value // Argument : CAS_2B_TYPE_RECEIVER_MODE iReceiverMode can be CAS_2B_RECEIVER_MODE_VSB_8_TR or CAS_2B_RECEIVER_MODE_ITUB_64 or CAS_2B_RECEIVER_MODE_ITUB_256 // Argument : int * piError - retrieves error description if failed //----------------------------------------------------------------------------------------------------------- unsigned short __stdcall GetSnrAfterEqualization(CAS_2B_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 __stdcall // Argument : CAS_2B_TYPE_RECEIVER_MODE iReceiverMode can be CAS_2B_RECEIVER_MODE_VSB_8_TR or CAS_2B_RECEIVER_MODE_ITUB_64 or CAS_2B_RECEIVER_MODE_ITUB_256 // Argument : int * piError - retrieves error description if failed //----------------------------------------------------------------------------------------------------------- NUMERATOR_DENOMINATOR __stdcall GetPer(CAS_2B_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 __stdcall returns the calculated value as a numerator/denominator value // (see the calculation formula above) // Argument : int * piError - retrieves error description if failed //----------------------------------------------------------------------------------------------------------- NUMERATOR_DENOMINATOR __stdcall 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 - retrieves error description if failed //----------------------------------------------------------------------------------------------------------- unsigned char Get1SecSer(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : Get10SecSer // Description : This function returns the Segment Error Rate of the last 10 second. // Return type : unsigned char the Segment Error Rate value of the last 10 second. // Argument : int * piError - retrieves error description if failed //----------------------------------------------------------------------------------------------------------- unsigned char Get10SecSer(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : __stdcall GetEqualizerFeedForwardTaps // Description : This function returns the feed forward taps vector, the received 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 occurred // 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 __stdcall GetEqualizerFeedForwardTaps(unsigned short* pusaReceivedFfTaps); //----------------------------------------------------------------------------------------------------------- // Function name : __stdcall 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 occurred. // Argument : CAS_2B_TYPE_RECEIVER_MODE iReceiverMode can be CAS_2B_RECEIVER_MODE_VSB_8_TR or CAS_2B_RECEIVER_MODE_ITUB_64 or CAS_2B_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 __stdcall GetEqualizerFeedBackTaps(CAS_2B_TYPE_RECEIVER_MODE iReceiverMode,unsigned short* pusaReceivedFbTaps); //----------------------------------------------------------------------------------------------------------- // Function name : __stdcall GetConstellationSamples // Description : This function returns the constellation samples // Return type : unsigned int - 0 if successful other value indicates an error occurred. // Argument : unsigned short usNumberOfConstellationSamples - this parameter will hold the pusaConstellationSamples buffer size and will determine how many // 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 __stdcall GetConstellationSamples(unsigned short usNumberOfConstellationSamples,unsigned short* pusaConstellationSamples); //----------------------------------------------------------------------------------------------------------- // Function name : __stdcall SendVsbMessage // Description : This function sends receive 1 commands for VSB receiver // Return type : unsigned int - 0 if successful other value indicates an error occurred. // 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 __stdcall SendVsbMessage(TYPE_VSB_CHANNEL_CONDITION iVsbChannelCondition,TYPE_VSB_NTSC_REJECTION_FILTER iVsbNtscRegectionFilter,TYPE_MPEG_OUTPUT_MODE iMpegOutputMode,TYPE_TUNER_PHASE_NOISE iTunerPhaseNoise); //----------------------------------------------------------------------------------------------------------- // Function name : __stdcall SendItubMessage // Description : This function sends receive 1 commands for ITUB receiver // Return type : unsigned int - 0 if successful other value indicates an error occurred. // 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 __stdcall 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 __stdcall struct returns the calculated value as a numerator/denominator value (see the calculation formula above). // Argument : int * piError - retrieves error description if failed //----------------------------------------------------------------------------------------------------------- NUMERATOR_DENOMINATOR __stdcall GetAgcIfCommand(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetAGCSensor // Description : this function returns the Agc sensor value as a ratio value that is inserted in a struct // NUMERATOR_DENOMINATOR where the numerator is the Agc sensor value and the denominator // is 32768 // Return type : NUMERATOR_DENOMINATOR __stdcall struct returns the calculated value as a numerator/denominator value (see the calculation formula above). // Argument : int * piError - retrieves error description if failed //----------------------------------------------------------------------------------------------------------- NUMERATOR_DENOMINATOR __stdcall GetAGCSensor(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetDSPFirmwareVersion // Description : this function returns the DSP firmware version as an array of 6 numbers // Return type : CAS_2B_CODE_VERSION __stdcall struct that holds the code version numbers. // Argument : int * piError - retrieves error description if failed //----------------------------------------------------------------------------------------------------------- CAS_2B_CODE_VERSION __stdcall GetDSPFirmwareVersion(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : __stdcall GetHardwareVersion // Description : This function returns the hardware version number // Return type : unsigned char - the hardware version number. // Argument : int * piError - retrieves error description if failed //----------------------------------------------------------------------------------------------------------- unsigned char __stdcall GetHardwareVersion(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetCarrierOffset // Description : This function returns the calculated value of the carrier offset according to the formula // ((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 __stdcall calculated carrier offset in Khz // Argument : CAS_2B_TYPE_RECEIVER_MODE iReceiverMode - valid only for CAS_2B_RECEIVER_MODE_VSB_8_TR,CAS_2B_RECEIVER_MODE_ITUB_64,CAS_2B_RECEIVER_MODE_ITUB_256. // Argument : int * piError - retrieves error description if failed //----------------------------------------------------------------------------------------------------------- long __stdcall GetCarrierOffset(CAS_2B_TYPE_RECEIVER_MODE iReceiverMode,int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetNtscCarrierOffset // Description : This function returns the calculated value of the NTSC carrier offset according to the formula // ((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 __stdcall calculated NTSC carrier offset in Khz // Argument : CAS_2B_TYPE_RECEIVER_MODE iReceiverMode - valid only for CAS_2B_RECEIVER_MODE_VSB_8_TR. // Argument : int * piError - retrieves error description if failed //----------------------------------------------------------------------------------------------------------- long __stdcall GetNtscCarrierOffset(CAS_2B_TYPE_RECEIVER_MODE iReceiverMode,int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetChecksumFlag // Description : This function returns the checksum flag that was calculated when the code and data were // loaded. // Return type : __stdcall CHECKSUM_STATUS CHECKSUM_STATUS_INCORRECT (0) CHECKSUM_STATUS_CORRECT (1) // Argument : int * piError - retrieves error description if failed //----------------------------------------------------------------------------------------------------------- CHECKSUM_STATUS __stdcall GetChecksumFlag(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : __stdcall ResetChecksum // Description : This function sets the checksum register value to 0. // Return type : unsigned int 0 if successful other value indicates an error occurred. //----------------------------------------------------------------------------------------------------------- unsigned int __stdcall ResetChecksum(void); //----------------------------------------------------------------------------------------------------------- // Function name : __stdcall SendCodeAndData // Description : This routine sends code and RAM DATA buffers to the Cascade DSP. // in order to send the code and data to the cascade the user must open binary code and data files as binary type // 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 // set it with a value. // // This routine also checks compatibility to Cas2B. If the loaded code does not support it will load automatically the // the latest code for Cas2B. // Return type : int 0 if successful other value indicates an error occurred. // 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 __stdcall SendCodeAndData(unsigned char * pucCodeToSend,unsigned long ulCodeBufferSize,unsigned char * pucDataToSend,unsigned long ulDataBufferSize); //---------------------------------------------------------------------------------------------- // Function name : SendCas2BRunFlag // 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 occurred. //---------------------------------------------------------------------------------------------- int __stdcall SendCas2BRunFlag(void); //---------------------------------------------------------------------------------------------- // Function name : __stdcall 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 occurred. // Argument : CAS_2B_CHANNEL_SCAN_PARAMETERS stChannelScanParameters - this struct holds all the channel scan settings // this struct holds the following fields: // - TYPE_CHANNEL_SCAN_RECEIVER_MODE_PRIORITY iReceiverModeFirstPriority - can be vsb or itub 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 or itub the function will try to lock // for each checked frequency second on the receiver mode that is stated in iReceiverModeSecondPriority. // - BOOLEAN bNtscCheck - if set to TRUE the function will check for each frequency if the NTSC detection flag is set by the cascade device. // - 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 essential // for the application to work correctly. 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_2B_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 or itub was found // in the checked frequency. // - long lNtscCarrierOffset - this fields will hold the cascade device NTSC carrier offset in KHz. this value will be set only when a signal of NTSC 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 or 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 or 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 or itub was found // in the checked frequency. // - NUMERATOR_DENOMINATOR stSymbolRateoffset - this field will hold the cascade device symbol rate offset value in ppm. this value will be set only when a signal of vsb or 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. // - BOOLEAN bNtscSignalDetected - This field is set to TRUE when a NTSC signal is detected by the cascade device. // 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 __stdcall PerformChannelScan(CAS_2B_CHANNEL_SCAN_PARAMETERS stChannelScanParameters, CAS_2B_CHANNEL_SCAN_RESULT *pstaChannelScanResults,unsigned long* pulaInputFrequenciesTable); //----------------------------------------------------------------------------------------------------------- // Function name : SetReceiveRegister // Description : This function sets the selected receive register value // Return type : int __stdcall - 0 if successful other value indicates an error occurred. // Argument : unsigned char usReceiveRegisterNumber - The receive register number (can be 0-7). // Argument : unsigned short usReceiveRegisterValue - The value to set into the selected receive register //----------------------------------------------------------------------------------------------------------- int __stdcall SetReceiveRegister(unsigned char usReceiveRegisterNumber,unsigned short usReceiveRegisterValue); //----------------------------------------------------------------------------------------------------------- // Function name : __stdcall GetTransmitRegisterValue // Description : This function returns the value of the selected transmit register (selected by ucTransmitRegiterNumber) // Return type : unsigned short - The value of the selected transmit register. // Argument : unsigned char ucTransmitRegiterNumber - The number of the transmit register which its value is needed (can be 0 -31). // Argument : int * piError - retrieves error description if failed. //----------------------------------------------------------------------------------------------------------- unsigned short __stdcall GetTransmitRegisterValue(unsigned char ucTransmitRegiterNumber,int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetSignalQuality // Description : This function returns the signal quality as a precent value (range 0 - 100), based on the following calculation: // For VSB 8tr - SNRSignalQuality = (SNR_value_read_from_the_Cascade2B_device - 10)/20 * 100 // For ITUB 64- SNRSignalQuality = (SNR_value_read_from_the_Cascade2B_device - 20)/10 * 100 // For ITUB 256- SNRSignalQuality = (SNR_value_read_from_the_Cascade2B_device - 25)/10 * 100 // // SERSignalQuality = (1 - (1_Sec_SER_Value_read_from_the_Cascade2B_device/50))*100 // SignalQuality = minimum(SNRSignalQuality,SERSignalQuality) // Return type : unsigned char the signal quality as a precent value (range 0 - 100). // Argument : CAS_2B_TYPE_RECEIVER_MODE iReceiverMode - valid only for CAS_2B_RECEIVER_MODE_VSB_8_TR,CAS_2B_RECEIVER_MODE_ITUB_64,CAS_2B_RECEIVER_MODE_ITUB_256 // Argument : int * piError retrieves error description if failed. //----------------------------------------------------------------------------------------------------------- unsigned char GetSignalQuality(CAS_2B_TYPE_RECEIVER_MODE iReceiverMode,int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetSignalStrength // Description : This function returns the signal strength as a precent value (range 0 - 100) only for VSB receiver type, based on the following calculation: // // For VSB 8tr - if AGC_IF_Command_value_read_from_the_Cascade2B_device > 0.4 // SignalStrength = 20 + ((AGC_IF_Command_value_read_from_the_Cascade2B_device-0.5)/0.2)*80 // else // SignalStrength = ((AGC_Sensor_value_read_from_the_Cascade2B_device - 0.1)/0.15) * 20 // Return type : unsigned char the signal strength as a precent value (range 0 - 100). // Argument : int * piError retrieves error description if failed. //----------------------------------------------------------------------------------------------------------- unsigned long GetSignalStrength(int * piError, TYPE_AGC_AMPLIFIER iAGCAmplifierType); //----------------------------------------------------------------------------------------------------------- // Function name : Cas2BOOBChannelChange // Description : This routine controls the OOB channel - freq, mode and power down mode. // Return type : unsigned int - zero if success otherwise nonzero // Argument : CAS_2B_OOB_CHANNEL_CHANGE_PARAMETERS stOOBChannelChangeParameters //----------------------------------------------------------------------------------------------------------- unsigned int __stdcall Cas2BOOBChannelChange(CAS_2B_OOB_CHANNEL_CHANGE_PARAMETERS stOOBChannelChangeParameters); //----------------------------------------------------------------------------------------------------------- // Function name : IsOOBLocked // Description : This function reads the cascade 2B device transmit register number 18 and // extracts the lock/unlock flag (bit 2) from it. // Return type : LOCK_STATUS // Argument : int * piError - retrieves error description if failed //----------------------------------------------------------------------------------------------------------- LOCK_STATUS __stdcall IsOOBLocked(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetOOBAgcIfCommand // Description : this function returns the OOB Agc IF Command value as a ratio value that is inserted in a struct // NUMERATOR_DENOMINATOR where the numerator is the OOB Agc IF Command value and the denominator // is 256 // Return type : NUMERATOR_DENOMINATOR __stdcall struct returns the calculated value as a numerator/denominator value. // Argument : int * piError - retrieves error description if failed //----------------------------------------------------------------------------------------------------------- NUMERATOR_DENOMINATOR __stdcall GetOOBAgcIfCommand(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetOOBCarrierOffset // Description : This function returns the calculated value of the carrier offset according to the formula // ((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 __stdcall calculated carrier offset in Khz // Argument : TYPE_FDC_MODE iFDCMode - valid only for OOB_FDC_MODE_3_088, OOB_FDC_MODE_1_544, OOB_FDC_MODE_2_048 // Argument : int * piError - retrieves error description if failed //----------------------------------------------------------------------------------------------------------- long __stdcall GetOOBCarrierOffset(TYPE_FDC_MODE iFDCMode, int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetOOBSnr // Description : This function returns the OOB SNR value from the cascade device. // Return type : unsigned short returns the snr value // Argument : int * piError - retrieves error description if failed //----------------------------------------------------------------------------------------------------------- unsigned short __stdcall GetOOBSnr(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetAudioChannelState // Description : This function returns the left or right channel state // Return type : TYPE_AUDIO_CHANNEL_STATE - the channel state can be mono, left, right, mono-2 or mute. // Argument : TYPE_AUDIO_CHANNEL iAudioChannel - the channel type can be left or right. // Argument : int * piError- retrieves error description if failed. //----------------------------------------------------------------------------------------------------------- TYPE_AUDIO_CHANNEL_STATE __stdcall GetAudioChannelState(TYPE_AUDIO_CHANNEL iAudioChannel,int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : IsStereoDetected // Description : This function checks whether the device has a stereo detection indication. // Return type : BOOLEAN - TRUE stereo is detected, FALSE stereo in not detected. // Argument : int * piError- retrieves error description if failed. //----------------------------------------------------------------------------------------------------------- BOOLEAN __stdcall IsStereoDetected(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : IsBilingualSapDetected // Description : This function checks whether the device has a Bilingual/SAP detection indication. // Return type : BOOLEAN - TRUE Bilingual/SAP is detected, FALSE Bilingual/SAP in not detected. // Argument : int * piError- retrieves error description if failed. //----------------------------------------------------------------------------------------------------------- BOOLEAN __stdcall IsBilingualSapDetected(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetDeviationSensitivityMode // Description : This function returns the deviation/sensitivity mode. // Return type : TYPE_AUDIO_DEVIATION_SENSITIVITY_MODE can be very high deviation,high deviation, normal // or low deviation. // Argument : int * piError - retrieves error description if failed. //----------------------------------------------------------------------------------------------------------- TYPE_AUDIO_DEVIATION_MODE __stdcall GetDeviationSensitivityMode(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetAudioStandard // Description : This function returns the detected audio standard. // Return type : TYPE_AUDIO_STANDARD can be BTC, Korea or Radio FM. // Argument : int * piError - retrieves error description if failed. //----------------------------------------------------------------------------------------------------------- TYPE_AUDIO_STANDARD __stdcall GetAudioStandard(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetMasterSlaveMode // Description : this fumction returns the master/slave mode // Return type : TYPE_AUDIO_MASTER_SLAVE_MODE __stdcall can be TYPE_AUDIO_SLAVE_MODE or TYPE_AUDIO_MASTER_MODE // Argument : int * piError - retrieves error description if failed. //----------------------------------------------------------------------------------------------------------- TYPE_AUDIO_MASTER_SLAVE_MODE __stdcall GetMasterSlaveMode(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetSclToWsRatio // Description : this function returns the Scl To Ws Ratio // Return type : TYPE_SCL_TO_WS_RATIOcan be TYPE_SCL_TO_WS_RATIO_32, TYPE_SCL_TO_WS_RATIO_48, TYPE_SCL_TO_WS_RATIO_64, TYPE_SCL_TO_WS_RATIO_UNDEFINED // Argument : int * piError - retrieves error description if failed. //----------------------------------------------------------------------------------------------------------- TYPE_SCL_TO_WS_RATIO __stdcall GetSclToWsRatio(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetIISOuputRate // Description : this function returns the IIS Ouput Rate // Return type : TYPE_IIS_OUT_RATE can be TYPE_IIS_OUT_RATE_48, TYPE_IIS_OUT_RATE_96, TYPE_IIS_OUT_RATE_44_1, TYPE_IIS_OUT_RATE_88_2, TYPE_IIS_OUT_RATE_32, TYPE_IIS_OUT_RATE_UNDEFINED // Argument : int * piError - retrieves error description if failed. //----------------------------------------------------------------------------------------------------------- TYPE_IIS_OUT_RATE __stdcall GetIISOuputRate(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetIISMode // Description : this function returns the IIS mode // Return type : TYPE_IIS_MODE can be TYPE_IIS_MODE_IIS, TYPE_IIS_MODE_LJ, TYPE_IIS_MODE_RJ // Argument : int * piError - retrieves error description if failed. //----------------------------------------------------------------------------------------------------------- TYPE_IIS_MODE __stdcall GetIISMode(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetSoundCh1AGC // Description : this function returns the Sound Ch1 AGC command // Return type : NUMERATOR_DENOMINATOR - struct returns the calculated value as a numerator/denominator value. // Argument : int * piError - retrieves error description if failed. //----------------------------------------------------------------------------------------------------------- NUMERATOR_DENOMINATOR __stdcall GetSoundCh1AGC(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetSoundLeftOutputGain // Description : this function gets the left output gain // Return type : NUMERATOR_DENOMINATOR - struct returns the calculated value as a numerator/denominator value. // Argument : int * piError - retrieves error description if failed. //----------------------------------------------------------------------------------------------------------- NUMERATOR_DENOMINATOR __stdcall GetSoundLeftOutputGain(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : GetSoundRightOutputGain // Description : this function gets the right output gain // Return type : NUMERATOR_DENOMINATOR - struct returns the calculated value as a numerator/denominator value. // Argument : int * piError - retrieves error description if failed. //----------------------------------------------------------------------------------------------------------- NUMERATOR_DENOMINATOR __stdcall GetSoundRightOutputGain(int * piError); //----------------------------------------------------------------------------------------------------------- // Function name : SendAudioMessage // Description : This function sends the audio message parameters to the appropriate receive register. // It is advisable to call the InitAudioMessageStructToDefault before calling this function in order to // initialize the stAudiomessageParameters fields to default values and than change the appropriate struct fields // Return type : int __stdcall the error description if failed. // Argument : unsigned char ucReceiveRegisterNumber - can be 1-4. // Argument : CAS_2B_AUDIO_MESSAGE_PARAMETERS stAudiomessageParameters this struct holds the message // parameters that needs to be set for each receive register: // For receive1 set the following fields: // bAudioLeftChannelMute, bAudioRightChannelMute, bAudioForcedMonoMode, iNRSwithc, iStereoMode // iBilingualMode, bDeEmphasisOn, bDbxOn,iHighDeviationMode,bCh1PllPiIntegratorReset,bCh2PllPiIntegratorReset. // For receive2 set the following fields: // usLeftOutputGain, usRightOutputGain. // For receive3 set the following fields: // iSclToWsDivisionFactor, iIisOutRate, iIisMode, iMasterSlaveMode. //----------------------------------------------------------------------------------------------------------- int __stdcall SendAudioMessage(unsigned char ucReceiveRegisterNumber, CAS_2B_AUDIO_MESSAGE_PARAMETERS stAudiomessageParameters); //----------------------------------------------------------------------------------------------------------- // Function name : InitAudioMessageStructToDefault // Description : This function initializes the audio message parameters struct fields to default values. // Return type : void __stdcall // Argument : CAS_2B_AUDIO_MESSAGE_PARAMETERS* pstAudiomessageParameters a pointer to the audio message parameters struct. //----------------------------------------------------------------------------------------------------------- void __stdcall InitAudioMessageStructToDefault(CAS_2B_AUDIO_MESSAGE_PARAMETERS* pstAudiomessageParameters); //----------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------- // //internal usage functions // //----------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------- unsigned char _stdcall CalcLog(unsigned short usReceivedWord); unsigned char _stdcall GetLogFromTable(unsigned char ucValueToLog); //----------------------------------------------------------------------------------------------------------- // Function name : SetTunerDTT760xATSC // Description : controls the Thomson DTT760xATSC tuner // Return type : int: CASCADE_SUCCESS - if setting the tuner succeded. other values indicate about the failure reason. // Argument : TYPE_TUNERDTT760xATSC_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 : TYPE_TUNERDTT760xATSC_REF_DIVIDER_RATIO TunerSet: Determines the reference divider ratio for the tuner // the default value is TUNERDTT760xATSC_REF_DIVIDER_RATIO_62_5 // Argument : TYPE_TUNERDTT760xATSC_AGC iAgc: Determines the AGC value for the tuner, the default value is TUNERDTT760xATSC_AGC_94 // Argument : BOOLEAN bUseExternalAgc: Determines if the tuner will use external AGC (TRUE) or not (FALSE) // the default value is FALSE // Argument : TYPE_TUNERDTT760xATSC_CHARGE_PUMP iChargePump: Determines the charge pump value the default value is // TUNERDTT760xATSC_CHARGE_PUMP_60 // Argument : TYPE_TUNERDTT760xATSC_AGC_TIME_CONSTANT iAgcTimeConstant: Determines the AGC time constant value, the default // value is TUNERDTT760xATSC_AGC_TIME_CONSTANT_50_MS //----------------------------------------------------------------------------------------------------------- int SetTunerDTT760xATSC(TYPE_TUNER_SET_OPTION TunerSet, void* pvTunerSet, CHANNEL_TABLE_TYPE iChannelTable, TYPE_TUNERDTT760xATSC_REF_DIVIDER_RATIO iRefDividerRatio , TYPE_TUNERDTT760xATSC_AGC iAgc, BOOLEAN bUseExternalAgc, TYPE_TUNERDTT760xATSC_CHARGE_PUMP iChargePump, TYPE_TUNERDTT760xATSC_AGC_TIME_CONSTANT iAgcTimeConstant); //----------------------------------------------------------------------------------------------------------- // 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 __stdcall 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 __stdcall 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); //----------------------------------------------------------------------------------------------------------- // Function name : SetTunerThomsonT2000 // Description : Controls the Thomson T2000 tuner // Return type : int __stdcall 0 - Succeeded to set the tuner, other value - Did not succeed to set the tuner // Argument : TYPE_TUNER_THOMSON_T2000_SET_OPTION iTunerSet Determines how to set the tuner PLL frequency // by channel, by center frequency or by picture carrier. // Argument : void* pvTunerSet The value to set according to TunerSet. // Argument : TYPE_TUNER_THOMSON_T2000_AGC_SELECTION iAgcSelection can be internal or external // Argument : TYPE_TUNER_THOMSON_T2000_INPUT_SELECTION iInput terrestrial or cable // Argument : TYPE_THOMSON_T2000_REF_DIVIDER_RATIO iRefDividerRatio can be 166.6 or 62.5 or 50 // Argument : TYPE_TUNER_THOMSON_T2000_MODE iMode can be digital or analog //----------------------------------------------------------------------------------------------------------- int __stdcall SetTunerThomsonT2000( TYPE_TUNER_SET_OPTION iTunerSet, void* pvTunerSet, TYPE_TUNER_THOMSON_T2000_AGC_SELECTION iAgcSelection, TYPE_TUNER_THOMSON_T2000_INPUT_SELECTION iInput, TYPE_THOMSON_T2000_REF_DIVIDER_RATIO iRefDividerRatio, TYPE_TUNER_THOMSON_T2000_MODE iMode ); //----------------------------------------------------------------------------------------------------------- // Function name : SetTunerTD6650T // Description : Controls the Philips TD6650T tuner // Return type : int __stdcall 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_TD6650T_REF_DIVIDER_RATIO iReferenceDividerRatio - Determines the reference divider ratio for the tuner. // Argument : TYPE_TD6650T_AGC_TOP iAGCTakeOverPoint - Determines the AGC value for the tuner. // Argument : TYPE_TD6650T_ATC iAtc - Determines the AGC time constant value value for the tuner. //----------------------------------------------------------------------------------------------------------- int __stdcall SetTunerTD6650T(TYPE_TUNER_SET_OPTION TunerSet, void* pvTunerSet, CHANNEL_TABLE_TYPE iChannelTable, TYPE_TD6650T_REF_DIVIDER_RATIO iReferenceDividerRatio , TYPE_TD6650T_AGC_TOP iAGCTakeOverPoint, TYPE_TD6650T_ATC iAtc); //----------------------------------------------------------------------------------------------------------- // Function name : SetTunerXC3028 // Description : Controls the Exeive XC3028 tuner. // PAY ATTENTION - 1. If you have chosen to load the tuner firmaware the function sends 3 data buffers XC3028Init0, // XC3028Init1 and XC3028Dtv6Oren1 for digital mode or XC3028MnNtscPal for analog mode. // When the XC3028Dtv6Oren1 or XC3028MnNtscPal data buffer is loaded, the delay between setting // the CLOCK to low and setting the CLOCK to high in I2C acknoledge routine (between the 8'th and 9'th of each byte) // , must be to at least 1 milli second. // 2. When setting the tuner frequency the delay between setting the CLOCK to low and setting the CLOCK to high // in I2C acknoledge routine (between the 8'th and 9'th of each byte) , must be to at least 1 milli second. // Return type : int __stdcall 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 : BOOLEAN bLoadFirmware - Determines if the tuner will be loaded with the firmware data before the frequency is set. The tuner can only be loaded after a code was loaded the // Cascade device and a run flag was sent. // Argument : TYPE_TUNER_FIRMAWARE_MODE iFirmwareMode - Determines which firmware will be loaded to the tuner when bLoadFirmware == TRUE, can be analog or digital. //----------------------------------------------------------------------------------------------------------- int __stdcall SetTunerXC3028(TYPE_TUNER_SET_OPTION TunerSet, void* pvTunerSet,BOOLEAN bLoadFirmware,TYPE_TUNER_FIRMAWARE_MODE iFirmwareMode); //----------------------------------------------------------------------------------------------------------- // Function name : SetTunerMT2121 // Description : Controls the Philips MT2121 tuner // Return type : int __stdcall 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 : unsigned long ulTunerSet: 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_TUNER_MT2121_REF_DIVIDER_RATIO iReferenceDividerRatio - Determines the reference divider ratio for the tuner (31.25,50,62.5). //----------------------------------------------------------------------------------------------------------- int __stdcall SetTunerMT2121(TYPE_TUNER_SET_OPTION TunerSet, unsigned long ulTunerSet, CHANNEL_TABLE_TYPE iChannelTable, TYPE_TUNER_MT2121_REF_DIVIDER_RATIO iReferenceDividerRatio); //----------------------------------------------------------------------------------------------------------- // Function name : SetTunerTdqu // Description : Controls the Alps TDQU tuner // Return type : int __stdcall 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 : unsigned long ulTunerSet: 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_TUNER_TDQU_REF_DIVIDER_RATIO iReferenceDividerRatio - According to the enum parameters of TYPE_TUNER_TDQU_REF_DIVIDER_RATIO // Argument : TYPE_TUNER_TDQU_CHARGE_PUMP iChargePump - According to the enum parameters of TYPE_TUNER_TDQU_CHARGE_PUMP. // Argument : TYPE_TUNER_TDQU_AGST iAgst - According to the enum parameters of TYPE_TUNER_TDQU_AGST. //----------------------------------------------------------------------------------------------------------- int __stdcall 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); //----------------------------------------------------------------------------------------------------------- // Function name : SetTunerSN761662 // Description : Controls the Alps TDQU tuner // Return type : int __stdcall 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 : unsigned long ulTunerSet: 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_TUNER_SN761662TUNER_REF_DIVIDER_RATIO iReferenceDividerRatio - According to the enum parameters of TYPE_TUNER_TDQU_REF_DIVIDER_RATIO // Argument : TYPE_SN761662TUNER_ATC iATC - According to the enum parameters of TYPE_SN761662TUNER_ATC. // Argument : TYPE_SN761662TUNER_CP iCP - According to the enum parameters of TYPE_SN761662TUNER_CP. // Argument : TYPE_SN761662TUNER_IFOSW iIFOSW - According to the enum parameters of TYPE_SN761662TUNER_IFOSW. // Argument : TYPE_SN761662TUNER_AGC_TOP_LEVEL_0_LEVEL_1 iAGCTop - According to the enum parameters of TYPE_SN761662TUNER_AGC_TOP_LEVEL_0_LEVEL_1. // Argument : TYPE_SN761662TUNER_RFAGC_SHIFT_XTALOUT_CONTROL iRFAGCShiftXtalOut - According to the enum parameters of TYPE_SN761662TUNER_RFAGC_SHIFT_XTALOUT_CONTROL. //----------------------------------------------------------------------------------------------------------- int __stdcall SetTunerSN761662(TYPE_TUNER_SET_OPTION TunerSet, unsigned long ulTunerSet, CHANNEL_TABLE_TYPE iChannelTable, TYPE_SN761662TUNER_REF_DIVIDER_RATIO iRefDividerRatio,TYPE_SN761662TUNER_ATC iATC, TYPE_SN761662TUNER_CP iCP,TYPE_SN761662TUNER_IFOSW iIFOSW,TYPE_SN761662TUNER_AGC_TOP_LEVEL_0_LEVEL_1 iAGCTop, TYPE_SN761662TUNER_RFAGC_SHIFT_XTALOUT_CONTROL iRFAGCShiftXtalOut); //----------------------------------------------------------------------------------------------------------- // Function name : SetTunerVP13HR // Description : Controls the VP13HR tuner // Return type : int __stdcall 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 : unsigned long ulTunerSet: 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_TUNER_VP13HR_REF_DIVIDER_RATIO iReferenceDividerRatio - According to the enum parameters of TYPE_TUNER_TDQU_REF_DIVIDER_RATIO // Argument : BOOLEAN bIsFMTrap - FM trap mode - TRUE only in analog mode. //----------------------------------------------------------------------------------------------------------- int __stdcall SetTunerVP13HR(TYPE_TUNER_SET_OPTION TunerSet, unsigned long ulTunerSet, CHANNEL_TABLE_TYPE iChannelTable, TYPE_TUNER_VP13HR_REF_DIVIDER_RATIO iRefDividerRatio, BOOLEAN bIsFMTrap, BOOLEAN bIsAFTReq); int __stdcall GetChipData(TYPE_CHANNEL_SCAN_RECEIVER_MODE_PRIORITY iReceiverModePriority,LOCK_TYPE iLockType,CAS_2B_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 : LOCK_TYPE returns lock type can be unlocked,digital,analog or digital and analog // Argument : unsigned long ulNumberofTries the number of times that the function will try to check if the device is locked // Argument : BOOLEAN bWithNtscCheck check if the device has NTSC signal detection //----------------------------------------------------------------------------------------------------------- LOCK_TYPE __stdcall CheckIfLocked(unsigned long ulNumberOfTries,BOOLEAN bWithNtscCheck, unsigned long ulDelay); //----------------------------------------------------------------------------------------------------------- // Function name : BeforeTunerSendBytes // Description : Opens the i2c bus so the tuner gets the bytes that are sent on the i2c bus // Return type : BOOLEAN TRUE if succeeded to open the i2c bus //----------------------------------------------------------------------------------------------------------- BOOLEAN BeforeTunerSendBytes(void); //----------------------------------------------------------------------------------------------------------- // Function name : AfterTunerSendBytes // Description : Closes the i2c bus so the tuner doesnt gets the bytes that are sent on the i2c bus // Return type : BOOLEAN TRUE if succeeded to open the i2c bus //----------------------------------------------------------------------------------------------------------- BOOLEAN AfterTunerSendBytes(void); CAS_2B_TYPE_RECEIVER_MODE GetReceiveMode(int *piError); LOCK_STATUS __stdcall IsFECLocked(int * piError); unsigned short __stdcall GetStatusReg(int *piError); unsigned short __stdcall GetChecksum(int *piError); #endif