📄 qhwlib.h
字号:
/****************************************************************************** qhwlib.h : defines for hwlib interfaces* REALmagic Quasar Hardware Library* Created by Aurelia Popa-Radu* Copyright Sigma Designs Inc* Sigma Designs Proprietary and confidential* Created on 8/27/99* Description:*****************************************************************************/#ifndef __QHWLIB_H__#define __QHWLIB_H__#ifdef __cplusplusextern "C"{#endif#include "com.h"// starting from microcode 0x113 we have TEST_VIDEOIN_INTEGRATED // starting from microcode 0x11c we have TEST_REVERSE_VOBU integrated// debug related definesenum{QLOG_TIMING_TYPE = 0x01, /* Timing and performance measurements */QLOG_TRACE_TYPE = 0x02, /* General step point call tracing */QLOG_MEMORY_TYPE = 0x04, /* Memory and object allocation/destruction */QLOG_ERROR_TYPE = 0x08};#define QLOG_TIMING QLOG_TIMING_TYPE, TEXT(__FILE__), __LINE__#define QLOG_TRACE QLOG_TRACE_TYPE, TEXT(__FILE__), __LINE__#define QLOG_MEMORY QLOG_MEMORY_TYPE, TEXT(__FILE__), __LINE__#define QLOG_ERROR QLOG_ERROR_TYPE, TEXT(__FILE__), __LINE__// Use the given level to indicate:typedef enum{ QDebugLevelFatal = 0, // imminent nonrecoverable system failure QDebugLevelError, // serious error, though recoverable QDebugLevelWarning, // warnings of unusual occurances QDebugLevelInfo, // status and other information - normal though // perhaps unusual events. System MUST remain responsive. QDebugLevelTrace, // trace information - normal events // system need not ramain responsive QDebugLevelVerbose, // verbose trace information // system need not remain responsive QDebugLevelMaximum} QDEBUG_LEVEL;#ifdef DEBUG #define QDbgLog(_x_) OSDbgLogInfo _x_ // implement the OSDbgLogInfo in os.c#else #define QDbgLog(_x_)#endif#ifndef MAKEDWORD#define MAKEDWORD(low, high) ((DWORD)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16)))#endif#ifndef max#define max(a,b) (((a) > (b)) ? (a) : (b))#endif#ifndef min#define min(a,b) (((a) < (b)) ? (a) : (b))#endif#define BIT0 0x0001#define BIT1 0x0002#define BIT2 0x0004#define BIT3 0x0008#define BIT4 0x0010#define BIT5 0x0020#define BIT6 0x0040#define BIT7 0x0080#define BIT8 0x0100#define BIT9 0x0200#define BIT10 0x0400#define BIT11 0x0800#define BIT12 0x1000#define BIT13 0x2000#define BIT14 0x4000#define BIT15 0x8000#define PIO0 0#define PIO1 1#define PIO2 2#define PIO3 3#define PIO4 4#define PIO5 5#define PIO6 6#define PIO7 7#define PIO8 8#define PIO9 9#define PIO10 10#define PIO11 11#define PIO12 12#define PIO13 13#define PIO14 14#define PIO15 15// samples of chroma for 4 pixels Cr0Cb0Cr1Cb1#define RED 0xFF80FF80#define GREEN 0x00000000#define BLUE 0x80FF80FF#define WHITE 0x80808080#define BLACK 0x80808080// samples of luma for 4 pixels Y0Y1Y2Y3#define BRIGHT 0xFFFFFFFF#define DARK 0x00000000// flags for time samps validity in IDecoderBoard_SendVideoPayload, ...#define DTS_AVAILABLE_FLAG 0x01#define PTS_AVAILABLE_FLAG 0x02#define PTS_DISCONTINUITY_FLAG 0x04#define CTS_AVAILABLE_FLAG 0x80#define DSI_INFO 0x40 // flag to announce HwLib to parse DSI// flags for DATA_FIFO, PTS_FIFO, PACKETS_FIFO#define VIDEO 0#define AUDIO 1#define SUBPICTURE 2#define OSD 3#define YUV 4#define HWLIB_DATA_TYPE_MASK 7// flags for RmWindow and SCALING#define VID_WIN_REG 0#define SP_WIN_REG 1#define BTN_WIN_REG 2#define OSD_WIN_REG 3#define OSD_HILI_REG 4#define FORCED_HW_UPDATE 0x80000000// flags for ITvEncoder_ProgramTv, IDecoder_QuasarMaster, IDecoder_QuasarSlave#define CCIR_MASK 0x0001#define SYNC_ENABLE_MASK 0x0030#define SYNC_ENABLE_0 0x0000#define SYNC_ENABLE_1 0x0010#define SYNC_ENABLE_2 0x0020#define INVERT_FIELD_MASK 0x1000#define INVERT_FIELD 0x1000#define NO_INVERT_FIELD 0x0000// VID_CTRL3#define USE_VVLD_PIXEL_ENABLE BIT13 // only for EM847x#define INVERT_VVLD BIT14 // only for EM847x// VID_CTRL1#define DIGITAL_DATA_ENABLE BIT12// VID_CTRL2#define VS_ACTIVE_LOW BIT4#define HS_ACTIVE_LOW BIT3#define VS_ACTIVE_HI 0#define HS_ACTIVE_HI 0#define VSHS_ACTIVE_HI (VS_ACTIVE_HI | HS_ACTIVE_HI)#define VSHS_ACTIVE_LOW (VS_ACTIVE_LOW | HS_ACTIVE_LOW)#define USE_GCLK_DIVIDED2 BIT6 // only for EM840x#define USE_VIDEOIN_SYNCS BIT5 // only for EM847x#define USE_VIDEOIN_CK BIT6 // only for EM847x#define DISPLAY_INTERLACED 1#define DISPLAY_NONINTERLACED 0#define TVMASTER 1#define TVSLAVE 0#define RST_DC 0x8000 // flag to reset/stop display controller#define HW_TV_DACS_ENABLE 0x0001 // flag to enable the Tv Dacs#define DIGITAL_AUDIO_IN_CAPTURE 0x0001#define STEREO_AUDIO_IN_CAPTURE 0x0000// EM84xx version_revision defines#define EM8300_Q1 0x0100#define EM8300A_Q2 0x0200#define EM8300B_Q2 0x0201#define EM8400ABC_Q3 0x0302#define EM8400D_Q3 0x0303#define EM8400E_Q3 0x0304#define EM8400F_Q3 0x0305#define EM847XA_Q4 0x0400#define EM847XB_Q4 0x0401#define EM847XC_Q4 0x0402#define EM848XA_Q4 0x0800 // internal rev is 03 even on the label is "A"#define EM85XX_JASPER 0x0500// DeviceId defines#define UNKNOWN_DEVICEID 0xFFFF#define NETSTREAM2000_DEVICEID 0x0013 // decimal 19 - analog overlay#define VENTURA2000_DEVICEID 0x0014 // decimal 20 - digital overlay// BoardVersion defines#define UNKNOWN_BOARD 0xFFFF// analog overlay boards#define NE2000 (0x0000 | NETSTREAM2000_DEVICEID) // 0x0013#define NE2000TV (0x0100 | NETSTREAM2000_DEVICEID) // 0x0113#define NE2000STPC (0x0200 | NETSTREAM2000_DEVICEID) // 0x0213#define ANALOG_PVR (0x0300 | NETSTREAM2000_DEVICEID) // 0x0313#define NE4000 (0x0400 | NETSTREAM2000_DEVICEID) // 0x0413#define NE4000_SIGMATV (0x0500 | NETSTREAM2000_DEVICEID) // 0x0513// digital overlay boards#define VE2000 (0x0000 | VENTURA2000_DEVICEID) // 0x0014#define GALAXY2000 (0x0100 | VENTURA2000_DEVICEID) // 0x0114#define CLARION (0x0200 | VENTURA2000_DEVICEID) // 0x0214#define QUADMASTER (0x0300 | VENTURA2000_DEVICEID) // 0x0314#define QUADSLAVE (0x0400 | VENTURA2000_DEVICEID) // 0x0414#define SYMPHONY (0x0500 | VENTURA2000_DEVICEID) // 0x0514#define PVR_DIGITAL (0x0600 | VENTURA2000_DEVICEID) // 0x0614#define XCARD (0x0700 | VENTURA2000_DEVICEID) // 0x0714#define NEC (0x0800 | VENTURA2000_DEVICEID) // 0x0814#define BROADCAST_LITE (0x0900 | VENTURA2000_DEVICEID) // 0x0914#define BROADCAST (0x0a00 | VENTURA2000_DEVICEID) // 0x0a14#define MELODY (0x0b00 | VENTURA2000_DEVICEID) // 0x0b14#define SONY_HAC (0x0c00 | VENTURA2000_DEVICEID) // 0x0c14#define SONY_HVC (0x0d00 | VENTURA2000_DEVICEID) // 0x0d14#define JASMINE2 (0x0e00 | VENTURA2000_DEVICEID) // 0x0e14#define SYMPHONY2 (0x0f00 | VENTURA2000_DEVICEID) // 0x0f14#define SONY_WEGA (0x1000 | VENTURA2000_DEVICEID) // 0x0f14// identification of the hardware design, through MD pins#define MDCFG_REFERENCE 0x00#define MDCFG_VE2000 0x04#define MDCFG_VE200024 0x0C#define MDCFG_NE2000 0x10#define MDCFG_CLARION 0x14#define MDCFG_NE2000TV 0x18#define MDCFG_ANLG_DIG_PVR 0x1C // ??#define MDCFG_NE2000STPC 0x20#define MDCFG_SYMPHONY 0x2c// possible PCI interrupt reasons - microcode will set the flags in IrqStatus symbol#define DISPLAY_READY_INTERRUPT 0x1000#define OSD_INTERRUPT 0x0800#define VOBU_INTERRUPT 0x0400#define PCR_INTERRUPT 0x0200#define LBC_INTERRUPT 0x0100#define TIMECODE_INTERRUPT 0x0080#define TRANSFER_DONE 0x0040#define CC_INTERRUPT 0x0020#define VSYNC_INTERRUPT 0x0010#define AUDIO_FIFO_THRESHOLD 0x0008#define VIDEO_EVENT_PAUSE 0x0004#define VIDEO_FIFO_THRESHOLD 0x0002#define VIDEO_END_OF_SEQUENCE 0x0001// usual interrupt mask to be set in IrqMask symbol#define IRQMASK ( DISPLAY_READY_INTERRUPT /* issued after VIDEO_PAUSE and VIDEO_STOP, when the last frame waiting for display is displayed */\ | OSD_INTERRUPT /* complete OSD bitmap was received */\ | VOBU_INTERRUPT /* Vobu in VOBUreverse was processed */\ | PCR_INTERRUPT /* programmable timer interrupt for PCR mode */ \ | LBC_INTERRUPT /* interrupt from Mpeg encoder */\ | TIMECODE_INTERRUPT \ | CC_INTERRUPT /* new DVD close caption buffer */\ | VSYNC_INTERRUPT /* display vertical sync */\ | AUDIO_FIFO_THRESHOLD /* audio buffer lower than programmed threshold */\ | VIDEO_EVENT_PAUSE /* video reached frame or PTS required */\ | VIDEO_FIFO_THRESHOLD /* video buffer lower than programmed threshold */\ | VIDEO_END_OF_SEQUENCE /* EOS was decoded */)// audio commands#define AUDIO_NOCMD 0xFFFF#define AUDIO_STOP 0x0000#define AUDIO_PAUSE 0x0001#define AUDIO_PLAY 0x0002#define AUDIO_SET_FORMAT 0x0004#define AUDIO_IN_START 0x0005// video commands#define VIDEO_NOCMD 0xFFFF#define VIDEO_STOP 0x0000#define VIDEO_PAUSE 0x0001#define VIDEO_PLAY 0x0002#define VIDEO_PLAYTOEVENT 0x0003#define VIDEO_PLAYFAST 0x0004#define VIDEO_PLAYNOSKIP 0x0006#define VIDEO_DECODETOEVENT 0x0008#define VIDEO_PLAY_VOBU_REVERSE 0x0009#define VIDEOIN_INIT 0x000a#define VIDEOIN_START 0x000b#define VIDEO_PLAYFAST_REVERSE 0x000c#define VIDEO_BLACKFRAME 0x0010#define VIDEO_BLACKFRAME_UNPACKED 0x0011
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -