phantom.h
来自「QPSK Tuner details, for conexant chipset」· C头文件 代码 · 共 127 行
H
127 行
#ifndef PHANTOM_H_DEFINED
#define PHANTOM_H_DEFINED
/* phantom.h */
/*+++ *******************************************************************\
*
* Abstract:
*
* Phantom Header data
*
* Created: 3/30/2004
*
* Author: Amarnath Puttur
*
* Copyright and Disclaimer:
*
* ---------------------------------------------------------------
* This software is provided "AS IS" without warranty of any kind,
* either expressed or implied, including but not limited to the
* implied warranties of noninfringement, merchantability and/or
* fitness for a particular purpose.
* ---------------------------------------------------------------
*
* Copyright (c) 2004 Conexant Systems, Inc.
* All rights reserved.
*
\******************************************************************* ---*/
/*******************************************************************************************************
* Compile time flags. 1 enables the features and 0 disables them.
*******************************************************************************************************/
#define PHANTOM_INCLUDE_DISEQC2 1 /* Include Diseqc 2.x code at compile-time if defined */
#define PHANTOM_INCLUDE_BER 1 /* RS or BCH BER/PER APIs */
#define PHANTOM_INCLUDE_DEBUG 0 /* Enable Error/Debug print macro(s) */
/*******************************************************************************************************/
/* standard inclusions */
/*******************************************************************************************************/
#include <string.h> /* ANSI Standard */
#if PHANTOM_INCLUDE_DEBUG
#include "phantom_dbg.h"
#endif // PHANTOM_INCLUDE_DEBUG
#include "phantom_ver.h" /* version info */
#include "phantom_enums.h"
#include "phantom_defs.h"
#include "phantom_struct.h"
#include "phantom_api.h"
#include "phantom_globals.h"
#include "phantom_drv.h" /* bcd headers */
#include "phantom_prototypes.h"
#include "phantom_cmd.h" /* Phantom command interface */
/*******************************************************************************************************/
/* macros */
/*******************************************************************************************************/
#ifndef min
#define min(a,b) ((a) < (b) ? (a) : (b))
#endif
#ifndef max
#define max(a,b) ((a) > (b) ? (a) : (b))
#endif
#if PHANTOM_INCLUDE_DEBUG
#define PHANTOM_DBG_SET_ERROR(a) (PHANTOM_DBG_SetError((a),(__FILE__),(__LINE__)))
#define PHANTOM_DBG_GET_ERROR_MSG(e) (PHANTOM_DBG_GetErrorMessage(e))
#define PHANTOM_DBG_GET_LAST_ERROR() (PHANTOM_DBG_GetLastError())
#define PHANTOM_DBG_GET_ERROR_FILENAME() (PHANTOM_DBG_GetErrorFilename())
#define PHANTOM_DBG_GET_ERROR_LINE_NUM() (PHANTOM_DBG_GetErrorLineNumber())
#define PHANTOM_DBG_VALIDATE_NIM(a) if (PHANTOM_DRIVER_ValidateNim(a) == False) \
{ \
PHANTOM_DBG_SET_ERROR (PHANTOM_BAD_PARM); \
return (False); \
}
/* Verify that index passed points to the correct register record */
#define PHANTOM_DBG_VALIDATE_REG_IDX(regmap,index) if (regmap[index].bit_field != index) \
{ \
PHANTOM_DBG_SET_ERROR (PHANTOM_REG_MATCH_IDX_ERR); \
return (False); \
}
/* Register read-only validation */
#define PHANTOM_DBG_VALIDATE_REG_RO(regmap,index) if (regmap[index].access_level == PHANTOM_REG_RO || \
regmap[index].access_level == PHANTOM_REG_RESERVED) \
{ \
PHANTOM_DBG_SET_ERROR(PHANTOM_REG_HDWR_REG_RO_ERR); \
return (False); \
}
#define PHANTOM_DBG_VALIDATE_REG_WO(regmap,index) if (regmap[index].access_level == PHANTOM_REG_WO || \
regmap[index].access_level == PHANTOM_REG_RESERVED) \
{ \
PHANTOM_DBG_SET_ERROR(PHANTOM_REG_HDWR_REG_WO_ERR); \
return (False); \
}
#else /* PHANTOM_INCLUDE_DEBUG */
/*******************************************************************************************************/
/* Debug macros */
/*******************************************************************************************************/
#define PHANTOM_DBG_SET_ERROR(a) /* do nothing */
#define PHANTOM_DBG_GET_ERROR_MSG(e) /* do nothing */
#define PHANTOM_DBG_GET_LAST_ERROR() /* do nothing */
#define PHANTOM_DBG_GET_ERROR_FILENAME() /* do nothing */
#define PHANTOM_DBG_GET_ERROR_LINE_NUM() /* do nothing */
#define PHANTOM_DBG_VALIDATE_NIM(a) /* do nothing */
#define PHANTOM_DBG_VALIDATE_REG_IDX(regmap,index) /* do nothing */
#define PHANTOM_DBG_VALIDATE_REG_RO(regmap,index) /* do nothing */
#define PHANTOM_DBG_VALIDATE_REG_WO(regmap,index) /* do nothing */
#endif /* PHANTOM_INCLUDE_DEBUG */
/*******************************************************************************************************/
#endif /* #ifndef PHANTOM_H_DEFINED */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?