cx24143_defs.h

来自「QPSK Tuner details, for conexant chipset」· C头文件 代码 · 共 197 行

H
197
字号
/* cx24143_defs.h */

/****************************************************************************

* Conexant QPSK driver  (internal mode)                                                          			 *

* Copyright ? Shenzhen Coship Electronics Co.,LTD.            						 *

* All rights reserved.                                                  								 *

* Author: Sunfugong                                                   								 *

* Create Date:  2005/7/20                                                       						 *

* Update:   2005/8/01  Sunfugong												 *

*****************************************************************************/

#ifndef COBRA_DEFS_H_DEFINED
#define COBRA_DEFS_H_DEFINED

/*******************************************************************************************************/

#ifndef NULL
#define NULL  0
#endif
#ifndef CNULL
#define CNULL  '\0'
#endif

#ifndef TRUE
#define TRUE    1                    /* from msdn: The bool type participates in integral promotions.*/
#define FALSE   0                    /* ... An r-value of type bool can be converted to an r-value */
#endif                               /* ... of type int, with false becoming zero and true becoming one.*/

#ifndef True
#define True    TRUE 
#define False   FALSE
#endif               

/*******************************************************************************************************/
/* common-use types */
/*******************************************************************************************************/
#ifndef BOOL
//typedef int     BOOL;
#include "cs_typedef.h"
#endif  /* BOOL */

/*******************************************************************************************************/
/* common-use equivs */
/*******************************************************************************************************/
typedef int            AGCACC;
typedef unsigned char  INTEROPTS;
typedef unsigned long  SYMBRATE;
typedef unsigned char  VCONO;
typedef BOOL           VCOINIT;

/*******************************************************************************************************/
/* function prototypes passed by application (aka user) */
/*******************************************************************************************************/
typedef unsigned char  SBaddress;
typedef unsigned long  *SBstatus;
typedef unsigned char  (*READ_SB)(unsigned long,SBaddress,SBstatus);         /* type pointer to function to read byte to ser.bus */
typedef void (*WRITE_SB)(unsigned long,SBaddress,unsigned char,SBstatus);    /* type pointer to function to write byte to ser.bus */

/*******************************************************************************************************/
/* common equates */
/*******************************************************************************************************/
#define SPEC_DCII_MUX     SPEC_DCII    /* SPEC_DCII and SPEC_DCII_MUX are the same */
#define INTR_POLLING      INTR_CLEAR   /* Interrupt processing will be polled */
#define SPEC_INV_BOTH     SPEC_INV_ON_BOTH    /*   equiv to search -inv, failing that, search inv */

/*******************************************************************************************************/
/* common definitions */
/*******************************************************************************************************/
#define MAX_VLIST         20           /* max number of Viterbi code rates in list */
#define MAX_NIMS          5            /* max number of NIMs driver will handle (default is 2) */
#define MAX_QPLL_MULT     5            /* max count of QPSK sample-rates to gen when building sample-rates */
#define MAX_BINLIST       8            /* max number of bins in BINLIST structure */
#define MAX_ESNOPROB      16           /* max ulongs used to estimate esno */
#define MAX_ESNOTABLE     4096         /* max size of esno est./prob table */
#define MAX_CONSTLIQ      10000        /* max number of I and Q samples to take for GUI display */
#define MAX_COBRA_ADDR    0xff         /* max allowable cobra address for reg.map test */
#define MAX_COBRA_NONTEST 0x68         /* max register number (byte-address, NOT regidx) of non-test registers */
#define MAX_COBRA_REGLEN  4            /* max length of cobra register is 4 bytes */
#define MAX_COBRA_MPEGREG 12           /* number of MPEG-related reg.map registers */
#define MAX_BCDNO         18           /* max number of bcd digits in bcdno structure */
#define MAX_TUNERSUPPORT  (2+1)        /* max number of tuners supported */
#define MAX_TUNER_RETRY   100          /* max attempts to retry tx to demod-attached tuner */

#define MAX_NO_BINS       7UL          /* max number of bins */
#define MIN_NO_BINS       1UL          /* min number of bins (default setting) */
#ifdef CAMARIC_FEATURES
#define MAX_NO_BINS_CAM   127UL        /* max number of bins for Camaric */
#endif  /* #ifdef CAMARIC_FEATURES */

#define MAX_PNBER_NOTRDY  10L          /* max number of PN BERReadyCount[21:0] not-ready cycles until polarity is swapped */
#define MAX_VERLEN        25           /* max length of driver-version string */

#define NIM_DEFAULT_MONRATE    5       /* default NIM monitor rate (in ms) */
#define NIM_DEFAULT_XTAL  (10111UL * M)/* default xtal rate */
#define NIM_DEFAULT_FREQ  (1200UL*MM)  /* default tuner freq */
#define NIM_DEFAULT_SYMB  20000UL      /* default symbol rate */
#define NIM_DEFAULT_LNB   5000000UL    /* default search range, user can re-define it.*/
#define CS_NIM_DEFAULT_LNB   3000000UL    //2500000UL   /* default search range, user can re-define it.*/
#define LNB_OFFSET_LIMIT  5000000UL    /* min. search range limit, it's one of the chip attributes.*/
#define MAX_LNBMSG        255          /* max length of LNB message buffer (contained within NIM) */
#define MAX_LNBSTAT       10           /* max number of messages able to be held within LNBMSG struct */
#define MIN_LNBMSGINTERDELAY  25UL     /* required min. delay between messages */
#define MAX_LNBMSGLEN     6            /* max no. of lnb registers contained within the demod */
#define MAX_LNBMSGWAIT    5000UL       /* number of loops allowed to send Diseqc message */
#define MAX_LNBMSGWAITOSW 5UL          /* number of loops allowed to send Diseqc message when OS_Wait() is employed*/

#define MAX_SCE_RAW_BYTES  5           /* number of bytes used to hold SCE data */
#define MAX_SCE_SNAPSHOTS  2           /* number of SCE snapshots to calculate SCE */
#define MAX_SCE_DEADLOCK   5           /* max number of loops to perform while attemptig to retreive SCE bucket */
#define MAX_LNBREAD_LOOP   25          /* max number of loops to perform while awaiting a diseqc rx message */
#define MAX_ECHOREAD_LOOP  25          /* max number of loops to perform while attempting to send echo legacy message */

#define MAX_SWASSIST_HWTIME    20      /* est number of register reads req'd to equal about 50ms */
#define MAX_SWASSIST_REPCOUNT  600     /* max attempts to acquire a DCII 5/22,1/2,3/5 CR signal */
#define MAX_SWASSIST_RDSTROBE  0       /* div rate at which CX24130_ACQFULLSYNC will be read */

#define MAX_TUNER_VCOERROR    10UL     /* (VCO edge values below this number, indicate a serious VCO edge-detection error) */
#define TUNER_VCOERROR_ZERO   0UL      /* binary-search to find limits of VCO failed */
#define TUNER_VCOERROR_ONE    1UL      /* initial detection of VCO mid-pt. failed when detecting low-edge */
#define TUNER_VCOERROR_TWO    2UL      /* unable to detect VCO high-edge (starting mid-pt.) because of bad low-edge */

#define DCII_SWACQLOOP        (100)    /* max loops performed when attemting SW lock to DC2 */

#ifdef  DCII_DEFAULT_SMOOTHCLK
#define DCII_HARD_SMOOTHCLK   7        /* DCII MPGCLKSMOOTHEN divider setting */
#endif

/*******************************************************************************************************/
#ifdef OPTIMAL_FS_CODE                 /* Fs optimization */
#define MAX_PLL_MULT       59          /* max PLLMult settings */
#define MAX_OPT_SAMPLECLK  (100UL*MM)  /* max sample clock rate */
#endif  /* #ifdef OPTIMAL_FS_CODE */

/*******************************************************************************************************/
#define ESNO_ADJUSTMENT   0            /* standard esno adjustment */
#define MAX_ESNOTAPS      16           /* taps for FIR filter */

/*******************************************************************************************************/
/* default definitions */
/*******************************************************************************************************/
#define DEFAULT_RDIVVAL   RDIV_10      /* used at API_InitEnvironment() if vcoinit == TRUE */
#define MM                1000000UL    /* (one million) easier to read MM */
#define M                 1000UL       /* (one thousand) easier to read  */
#define BIT_ZERO          0x0UL        /* easier to read that 0 */
#define BIT_ONE           0x1UL        /* (ditto) */
#define SAMPLE_FREQ_NOM_VAL  99425000UL/* nom value */
#define SAMPLE_DCII_NOM_VAL  96026000UL/* DCII nom value */
/* #define SAMPLE_FREQ_LT_2MSPS  13481334UL */ /* for symbol rate < 2 MSps */
#define SAMPLE_FREQ_LT_4MSPS  26963000UL /* for symbol rate < 4 MSps */
#define SAMPLE_FREQ_ENDLIST  0UL       /* end-of-list indicator */
#define LNB_DYN_SEARCH_RANGE 2500000UL /* LNB dynamic search range */
#define LNB_DYN_SEARCH_ACQ_TIME  10    /* LNB dynamic search max acq time (delay based upon i2c tx time) */
#define LNB_DYN_SEARCH_ACQ_DELAY 2     /* LNB dynamic search min delay before retry (share resources!) */
#define LNB_DYN_TRACKING_POLLCNT 5     /* LNB dynamic tracking loop counter (CR 7508) */

#define PLL_LOCK_ABORT_TIME          10  /* (CR 7581) */
#define TRACKING_STATE_POLLING_TIME  80  /* (CR 7581) */

#define VITNORMTHRESH_1DIV2    (164UL)   /* Viterbi Normalization Threshold optimized for coderate 1/2 */
#define VITNORMTHRESH_2DIV3    (128UL)   /* Viterbi Normalization Threshold optimized for coderate 2/3 */
#define VITNORMTHRESH_DEFAULT  (254UL)   /* Viterbi Normalization Threshold optimized for other coderates */

/*******************************************************************************************************/
/* Macros (to keep backwards compat.) */
/*******************************************************************************************************/
//#define API_Error_filename(n) (API_GetErrorFilename(n))
//#define API_Error_errline(n)  (API_GetErrorLineNumber(n))

/*******************************************************************************************************/
// MOVE IT FROM COBRA_VER.H
#define VERSION_MAJOR 2
#define VERSION_RELEASE 5
#define VERSION_BUILD 3
#define VERSION_MINOR 0

#define PRODUCT_NAME_STRING        ("CX24130")               /* 130 */
#define PRODUCT_NAME_STRING_ALT    ("CX24121")               /* 121 */

#define PRODUCT_NAME_STRING_CAM64  ("CX24123")               /* 123 */
#define PRODUCT_NAME_STRING_CAM80  ("CX24123C")              /* 123C (Cobra-compat) */
#define PRODUCT_NAME_STRING_UCOB80 ("CX24130U")              /* 130U (UMC Cobra-compat) */
#define PRODUCT_NAME_STRING_CAMARO ("CX2415X")               /* Camaro */

#define PRODUCT_VERSION_STRING "2.5.3.0"
#define FILE_VERSION_STRING "2,5,3,0"
/*******************************************************************************************************/
#endif  /* #ifndef COBRA_DEFS_H_DEFINED */
/* CR 9509 : Add an extra newline */

⌨️ 快捷键说明

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