def.h

来自「stv0297 寄存器 tuner 驱动 5105 方案」· C头文件 代码 · 共 67 行

H
67
字号
#ifndef _DEF_h_
#define _DEF_h_
/************************************************************************/
//#include "COMPIL.H"

/*********** I2C structure definition ***********************************/
typedef enum {OK = 0,NOACK,WRONGADR}	PPSTATE;

/*********** Register structure definition ******************************/
typedef enum {M_NO = 0, M_YES = 1} FLAG ;

/*********** Signal structure *******************************************/
typedef struct
{
	long        	Frequency ;             /* carrier frequency (in Hz)   */ 
	long	        SymbolRate;		/* Symbol Rate (in Baud)       */
	int  		QAMSize;		/* QAM size (16/32/64/128/256) */
	FLAG   		SpectrumInversion;      /* SpectrumInversion(YES or NO)*/ 
}	SIGNAL;

/*********** Status structure *******************************************/
typedef struct
{
	enum       	{ NO_LOCKED = 0, LOCKED = 1 , LOCK_LOSS = 2 } Status;     
	int  		NbLockLoss;				
}	SIGNAL_STATUS;

/*********** Register structure ******************************************/
typedef struct
{
	unsigned char	Addr,		//Address
			Reset,		//Default value
			Value,		//Current value
			Store;          //Stored 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;


				      
#define	NBREG		 86
#define NBFIELD		188

#define UNSIGNED 	0
#define SIGNED		1

#define QAM16	 0
#define QAM32    1
#define QAM64	 4
#define QAM128   2
#define QAM256	 3
/************************************************************************/
			/* MACRO deinitions */
#define MAX(X,Y) ((X)>=(Y)) ? (X) : (Y)
#define MIN(X,Y) ((X)<=(Y)) ? (X) : (Y) 
/************************************************************************/
#endif

⌨️ 快捷键说明

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