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

📄 stv299.h

📁 这是DVB tuner驱动部分和其它相关的源码和一些技术资料文档.
💻 H
字号:
/*****************************************************************************File Name   : stv299.hDescription : Low-level STV0299 access routines.Copyright (C) 2000 STMicroelectronicsReference   :*****************************************************************************//* Define to prevent recursive inclusion */#ifndef __STV0299_H#define __STV0299_H/* Includes --------------------------------------------------------------- */#include "def.h"                        /* Local definitions */#include "stcommon.h"#include "tnr.h"/* Exported Constants ----------------------------------------------------- */#define STV0299_NO_ERROR               ST_NO_ERROR#define STV0299_ERROR_BAD_PARAMETER    ST_ERROR_BAD_PARAMETER/* Maximum signal quality */#define STV0299_MAX_SIGNAL_QUALITY     100/* Maximum signal quality */#define STV0299_MAX_BER                200000/* REGISTER BIT ASSIGNMENTS *//* STV0299 Register VSTATUS */#define STV0299_VSTATUS_PR_1_2  (4)     /* Basic 1/2 */#define STV0299_VSTATUS_PR_2_3  (0)     /* Punctured 2/3 */#define STV0299_VSTATUS_PR_3_4  (1)     /* Punctured 3/4 */#define STV0299_VSTATUS_PR_5_6  (2)     /* Punctured 5/6 */#define STV0299_VSTATUS_PR_7_8  (3)     /* Punctured 7/8 (Mode A) or 6/7 (Mode B) *//* STV0299 Register VENRATE (0x09) Puncture rate enable */#define STV0299_VENRATE_E0_MSK  (0x01)  /* Enable Basic Puncture Rate 1/2 */#define STV0299_VENRATE_E1_MSK  (0x02)  /* Enable Puncture Rate 2/3 */#define STV0299_VENRATE_E2_MSK  (0x04)  /* Enable Puncture Rate 3/4 */#define STV0299_VENRATE_E3_MSK  (0x08)  /* Enable Puncture Rate 5/6 */#define STV0299_VENRATE_E4_MSK  (0x10)  /* Enable Puncture Rate 6/7 Mode B                                           or 7/8 Mode A *//* Obtain TNR device handle from 299 control block */#define TNR_HANDLE(x)           (x->TunerHandle)/* Exported Variables ----------------------------------------------------- *//* Exported Types --------------------------------------------------------- *//*********** Register structure definition ******************************/typedef enum {NO = 0, YES = 1} FLAG;/*********** New register structure *************************************/typedef struct{	unsigned char	Addr,					/*	Address	*/					Reset,					/*	Default value	*/					Value;					/*	Current value	*/	char 			Name[30];				/*	Name	*/}	REGISTER;typedef struct{	int				Reg;					/*	Register index	*/	unsigned char 	Pos,					/*	Bit position	*/					Bits,					/*	Bit width	*/					Type,					/*	Signed or unsigned	*/				 	Mask;					/*	Mask compute with width and position	*/	char 			Name[30];				/*	Name	*/}   FIELD;/*	Signal type enum	*/typedef enum{    BWTOONARROW = 0,    BWOK,    NOAGC1,    AGC1SATURATION,    AGC1OK,    NOTIMING,    ANALOGCARRIER,    TIMINGOK,    NOAGC2,    AGC2OK,    NOCARRIER,    CARRIEROK,    NODATA,    FALSELOCK,    DATAOK,    OUTOFRANGE,    RANGEOK} SIGNALTYPE;/*	Puncture Rate enum	*/typedef enum{	    PR2_3=0,    PR3_4,    PR5_6,    PR7_8,    PR1_2,    PRUNKNOWN} PUNCTURERATE;/*	Polarization enum	*/typedef enum {    NOPOLARIZATION=0,    HORIZONTAL,    VERTICAL,    H_V,    V_H} POLARIZATION;/*	Search result structure	*/    typedef struct{    SIGNALTYPE	SignalType;    POLARIZATION Polarization;    PUNCTURERATE PunctureRate;    long Frequency;    long SymbolRate; } SEARCHRESULT;/*	Scan direction enum	*/typedef enum {    SCANUP=1,    SCANDOWN=-1} SCANDIR; /*	AGC2 gain and frequency structure	*/typedef struct{    int NbPoints;    int Gain[3];    long Frequency[3];} AGC2TIMINGOK;	/*	Search parameters structure	*/         typedef struct{    SIGNALTYPE State;    long Frequency,    BaseFreq,    SymbolRate,    MasterClock,    Mclk,    RollOff,    SearchRange,    SubRange,    TunerStep,    TunerOffset,    TunerBW,    TunerIF;    short int	DerotFreq,    DerotPercent,    DerotStep,    Direction,    Tagc1,    Tagc2,    Ttiming,    Tderot,    Tdata,    SubDir;} SEARCHPARAMS;typedef struct{    long            RegExtClk;    REGISTER        RegMap[NBREG];    FIELD           FieldMap[NBFIELD];    int             RegNbI2cAccess;    int             RegCarrierOffset;    int             RegTimingOffset;    FLAG            RegTrigger;    int             lastAGC2Coef;    int             ScanMode;    SEARCHPARAMS    Params;    SEARCHRESULT    Result;    TNR_Handle_t    TunerHandle;    void            *I2CHandle;} STV0299_ControlBlock_t;/* Exported Macros -------------------------------------------------------- *//* Delay calling task for a period of microseconds */#define STV0299_Delay(micro_sec) task_delay((unsigned int) \                                  (((micro_sec) + 999) / 1000) * \                                  ST_GetClocksPerSecond() / 1000)/* Exported Functions ----------------------------------------------------- */#endif /* __STV0299_H *//* End of stv299.h */

⌨️ 快捷键说明

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