⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hamaro_defs.h

📁 机顶盒Hamaro解调器驱动。包含自动搜台
💻 H
📖 第 1 页 / 共 2 页
字号:
#define HAMARO_GET_TUNER_HANDLE_UNIT(handle) \
   (((handle) & HAMARO_TUNER_HANDLE_UNIT_MASK) >> HAMARO_TUNER_HANDLE_UNIT_SHIFT)
          
#define HAMARO_SET_DEMOD_HANDLE_I2C_ADDR(handle, addr)           \
   (handle) = ((((handle) & ~HAMARO_DEMOD_HANDLE_I2C_ADDR_MASK) | \
                (((addr) << HAMARO_DEMOD_HANDLE_I2C_ADDR_SHIFT) & HAMARO_DEMOD_HANDLE_I2C_ADDR_MASK)) & 0xFF)

#define HAMARO_SET_DEMOD_HANDLE_CLIENT_INFO(handle, value)       \
   (handle) = (((handle) & ~HAMARO_DEMOD_HANDLE_CLIENT_MASK) |   \
               (((value) << HAMARO_DEMOD_HANDLE_CLIENT_SHIFT) & HAMARO_DEMOD_HANDLE_CLIENT_MASK))
       
#define HAMARO_SET_DEMOD_HANDLE_UNIT(handle, unit)               \
   (handle) = (((handle) & ~HAMARO_DEMOD_HANDLE_UNIT_MASK) |     \
               (((unit) << HAMARO_DEMOD_HANDLE_UNIT_SHIFT) & HAMARO_DEMOD_HANDLE_UNIT_MASK))


#define HAMARO_CX2430X_DEMOD_A_I2C_OFFSET			(0x00)
#define HAMARO_CX2430X_DEMOD_B_I2C_OFFSET			(0x80)

/* Obtain the demod's register address offset using the demod handle */
#define HAMARO_GET_CX2430X_I2C_REGISTER_OFFSET(handle)		\
				(HAMARO_GET_DEMOD_HANDLE_UNIT(handle) * HAMARO_CX2430X_DEMOD_B_I2C_OFFSET)

/*******************************************************************************************************/
/* common definitions */
/*******************************************************************************************************/
#define HAMARO_MAX_REGISTER_LEN  4            /* Max length of a multi-byte register field is 4 bytes */
#define HAMARO_MAX_VLIST         20           /* max number of Viterbi code rates in list */
#define HAMARO_MAX_NIMS          5            /* max number of NIMs driver will handle (default is 2) */
#define HAMARO_MAX_ESNOPROB      16           /* max ulongs used to estimate esno */
#define HAMARO_MAX_ESNOTABLE     4096         /* max size of esno est./prob table */
#define HAMARO_MAX_CONSTLIQ      10000        /* max number of I and Q samples to take for GUI display */
#define HAMARO_MAX_HAMARO_ADDR    0xff         /* max allowable cobra address for reg.map test */
#define HAMARO_MAX_HAMARO_NONTEST 0x68         /* max register number (byte-address, NOT regidx) of non-test registers */
#define HAMARO_MAX_HAMARO_REGLEN  4            /* max length of cobra register is 4 bytes */
#define HAMARO_MAX_HAMARO_MPEGREG 12           /* number of MPEG-related reg.map registers */
#define HAMARO_MAX_BCDNO         18           /* max number of bcd digits in bcdno structure */
#define HAMARO_MAX_TUNERSUPPORT  (3+1)        /* max number of tuners supported */
#define HAMARO_MAX_TUNER_RETRY   100          /* max attempts to retry tx to demod-attached tuner */
#define HAMARO_MAX_NO_BINS       7UL          /* max number of bins */
#define HAMARO_MIN_NO_BINS       1UL          /* min number of bins (default setting) */
#define HAMARO_MAX_NO_BINS_CAM   127UL        /* max number of bins for Hamaro */

#define HAMARO_SYMBOL_RATE_BREAKPOINT		 4000UL

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

#define HAMARO_NIM_DEFAULT_MONRATE    5       /* default HAMARO_NIM monitor rate (in ms) */
#define HAMARO_NIM_DEFAULT_XTAL  (10111UL * HAMARO_M)/* default xtal rate */
#define HAMARO_NIM_DEFAULT_FREQ  (1200UL*HAMARO_MM)  /* default tuner freq */
#define HAMARO_NIM_DEFAULT_SYMB  20000UL      /* default symbol rate */

#define HAMARO_NIM_DEFAULT_LNB   10000000UL   /* default search range, user can re-define it.*/

#define HAMARO_LNB_OFFSET_LIMIT  5000000UL    /* min. search range limit, it's one of the chip attributes.*/
#define HAMARO_MAX_LNBMSG        255          /* max length of LNB message buffer (contained within HAMARO_NIM) */
#define HAMARO_MAX_RXBYTES		 8			  /* max number of bytes in receive buffer*/
#define HAMARO_MAX_LNBSTAT       10           /* max number of messages able to be held within LNBMSG struct */
#define HAMARO_MIN_LNBMSGINTERDELAY  25UL     /* required min. delay between messages */
#define HAMARO_MAX_LNBMSGLEN     6            /* max no. of lnb registers contained within the demod */
#define HAMARO_MAX_LNBMSGWAIT    5000UL       /* number of loops allowed to send Diseqc message */
#define HAMARO_MAX_LNBMSGWAITOSW 50000UL      /* number of loops allowed to send Diseqc message when HAMARO_OS_Wait() is employed*/

#define HAMARO_MAX_SCE_RAW_BYTES  5           /* number of bytes used to hold SCE data */
#define HAMARO_MAX_SCE_SNAPSHOTS  2           /* number of SCE snapshots to calculate SCE */
#define HAMARO_MAX_SCE_DEADLOCK   5           /* max number of loops to perform while attemptig to retreive SCE bucket */
#define HAMARO_MAX_LNBREAD_LOOP   25          /* max number of loops to perform while awaiting a diseqc rx message */
#define HAMARO_MAX_ECHOREAD_LOOP  25          /* max number of loops to perform while attempting to send echo legacy message */

#define HAMARO_MAX_SWASSIST_HWTIME    20      /* est number of register reads req'd to equal about 50ms */
#define HAMARO_MAX_SWASSIST_RDSTROBE  0       /* div rate at which CX2430X_ACQFULLSYNC will be read */

#define HAMARO_MAX_TUNER_VCOERROR    10UL     /* (VCO edge values below this number, indicate a serious VCO edge-detection error) */
#define HAMARO_TUNER_VCOERROR_ZERO   0UL      /* binary-search to find limits of VCO failed */
#define HAMARO_TUNER_VCOERROR_ONE    1UL      /* initial detection of VCO mid-pt. failed when detecting low-edge */
#define HAMARO_TUNER_VCOERROR_TWO    2UL      /* unable to detect VCO high-edge (starting mid-pt.) because of bad low-edge */
#define HAMARO_TUNER_LDWAIT          1        /* number of ms to wait in order to get correct lock detector status */

/*******************************************************************************************************/
#define HAMARO_ESNO_ADJUSTMENT			0            /* standard esno adjustment */
#define HAMARO_MAX_ESNOTAPS				16           /* taps for FIR filter */
#define HAMARO_MAX_AGC_TABLE_LENGTH		10
/*******************************************************************************************************/
/* default definitions */
/*******************************************************************************************************/
#define HAMARO_DEFAULT_RDIVVAL   HAMARO_RDIV_10      /* used at HAMARO_InitEnvironment() if vcoinit == TRUE */
#define HAMARO_MM                1000000UL    /* (one million) easier to read HAMARO_MM */
#define HAMARO_M                 1000UL       /* (one thousand) easier to read  */
#define HAMARO_BIT_ZERO          0x0UL        /* easier to read that 0 */
#define HAMARO_BIT_ONE           0x1UL        /* (ditto) */

#define HAMARO_MAX_SAMPFRQ_EQLIST                3
#define HAMARO_SAMPLE_FREQ_LT_4MSPS_PLL_MULT     16 
#define HAMARO_SAMPLE_FREQ_NOM_VAL_PLL_MULT      59 

/* #define SAMPLE_FREQ_LT_2MSPS  13481334UL */ /* for symbol rate < 2 MSps */
//#define HAMARO_SAMPLE_FREQ_LT_4MSPS  26666666UL /* for symbol rate < 4 MSps */
#define HAMARO_SAMPLE_FREQ_ENDLIST  0UL       /* end-of-list indicator */
#define HAMARO_LNB_DYN_SEARCH_RANGE 2500000UL /* LNB dynamic search range */
#define HAMARO_LNB_DYN_SEARCH_ACQ_TIME  10    /* LNB dynamic search max acq time (delay based upon i2c tx time) */
#define HAMARO_LNB_DYN_SEARCH_ACQ_DELAY 2     /* LNB dynamic search min delay before retry (share resources!) */
#define HAMARO_LNB_DYN_TRACKING_POLLCNT 5     /* LNB dynamic tracking loop counter (CR 7508) */

#define HAMARO_PLL_LOCK_ABORT_TIME          10  /* (CR 7581) */
#define HAMARO_VIPER_LOCK_TEST_WAIT_TIME    1  
#define HAMARO_TRACKING_STATE_POLLING_TIME  80  /* (CR 7581) */

#define HAMARO_VITNORMTHRESH_1DIV2    (164UL)   /* Viterbi Normalization Threshold optimized for coderate 1/2 */
#define HAMARO_VITNORMTHRESH_2DIV3    (128UL)   /* Viterbi Normalization Threshold optimized for coderate 2/3 */
#define HAMARO_VITNORMTHRESH_DEFAULT  (126UL)   /* Viterbi Normalization Threshold optimized for other coderates */

/*******************************************************************************************************/
/* Macros (to keep backwards compat.) */
/*******************************************************************************************************/
#define HAMARO_Error_filename(n) (HAMARO_GetErrorFilename(n))
#define HAMARO_Error_errline(n)  (HAMARO_GetErrorLineNumber(n))

#if HAMARO_INCLUDE_RATTLER
/*******************************************************************************************************/
/* Marcos for CX24113 (CR 29373)   */
/*******************************************************************************************************/
#define HAMARO_CX24113_PRELOAD_VALUE_FREQ_THRESH1_KHZ      950000000UL    
#define HAMARO_CX24113_PRELOAD_VALUE_FREQ_THRESH2_KHZ      1100000000UL
#define HAMARO_CX24113_PRELOAD_VALUE_FREQ_THRESH3_KHZ      1800000000UL
#define HAMARO_CX24113_PRELOAD_VALUE_FREQ_THRESH4_KHZ      2150000000UL
#endif

/*******************************************************************************************************/
/*******************************************************************************************************/
/*******************************************************************************************************/
#endif  /* #ifndef HAMARO_DEFS_H_DEFINED */
/* CR 9509 : Add an extra newline */

⌨️ 快捷键说明

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