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

📄 vpe.h

📁 WinCE 3.0 BSP, 包含Inter SA1110, Intel_815E, Advantech_PCM9574 等
💻 H
字号:
/*
 * $Workfile: Vpe.h $
 * $Revision: 2 $
 * $Date: 4/07/00 9:13a $
 * $Modtime: 4/07/00 8:56a $
 * $Author: Sarma $
 *   DESCRIPTION: 
 *       Direct Draw VPE header
 *
 * Copyright (c) 1998 National Semiconductor Corporation.
 * All Rights Reserved.
 *
 * This software is the confidential and proprietary information of National 
 * Semiconductor Corporation. ("Confidential Information").
 * You shall not disclose such Confidential Information and shall use it only
 * in accordance with the terms of the license agreement you entered into
 * with National Semiconductor Corporation.
 * This code is supplied as is.
 *
 */

/*
 *$Log: /CE/Platform/Nsc/Drivers/Video/gxvideo/ddraw/Vpe.h $
 * 
 * 2     4/07/00 9:13a Sarma
 * Removed Cyrix Corporation from the legal/confidentail information. Also
 * added for files not containing this info.
 * 
 *$History: Vpe.h $
 * 
 * *****************  Version 2  *****************
 * User: Sarma        Date: 4/07/00    Time: 9:13a
 * Updated in $/CE/Platform/Nsc/Drivers/Video/gxvideo/ddraw
 * Removed Cyrix Corporation from the legal/confidentail information. Also
 * added for files not containing this info.
 *
*/

#ifdef DD_SUPPORT
// TODO - check these
// Configuration register settings
#define CONF_BASE_ADDR  0x00009000
#define CBA_OFFSET      0x3e

//jp
#define BASE_ADDR_MASK  0x00800000

#define REG_CFG_PMR     0x30
#define     PMR_VPSEL   0x00100000

#define REG_CFG_MCR     0x34
#define     MCR_EMMARST 0x00000001
#define     MCR_VPMODE  0x00000010
#define     MCR_VPOUTM  0x00000020

// VIP Support registers - Refer to pg. 325-329 in MPC2 spec. v0.3
#define REG_VIP_CONFIG              0x00000000
#define     VIP_MODE_MASK           0xfffffffc
#define     VIP_MODE_B              0x00000001
#define     VIP_MODE_C              0x00000002
#define     VIP_SYNC_MASK           0xfffffff3
#define     VIP_SYNC_EDGE1          0x00000000
#define     VIP_SYNC_EDGE2          0x00000004
#define     VIP_SYNC_EDGE3          0x00000008
#define     VIP_SYNC_EDGE4          0x0000000c
#define     VIP_SYNCEDGE_MASK       0xffffffef
#define     VIP_SYNCEDGE_FALL       0x00000000
#define     VIP_SYNCEDGE_RISE       0x00000010
// The default setting for the foll. VP levels are negative active.
#define     VIP_VP_VALID            0x00010000
#define     VIP_VP_ACTIVE           0x00020000
#define     VIP_VP_HREF             0x00040000
#define     VIP_VP_VSYNC            0x00080000
#define     VIP_VBLANK              0x00100000
#define     VIP_VBIMODE_MASK        0xfffeffff
#define     VIP_VBIMODE_656ANC      0x00000000
#define     VIP_VBIMODE_656TSK      0x00010000
#define     VIP_VBITASK_MASK        0xfffdffff
#define     VIP_VBITASK_A           0x00000000
#define     VIP_VBITASK_B           0x00020000

#define REG_VIP_CONTROL             0x00000004
#define     VIP_RUNMODE_MASK        0xfffffffc
#define     VIP_RUNMODE_CLINE       0x00000000
#define     VIP_RUNMODE_CFIELD      0x00000001
#define     VIP_RUNMODE_NFIELD      0x00000002
#define     VIP_CAPTURE_VIDEO       0x00000100
#define     VIP_CAPTURE_VBI         0x00000200
#define     VIP_AUTOFLIP            0x00000400
#define     VIP_SMI_FIELD           0x00010000
#define     VIP_SMI_LINE            0x00020000

#define REG_VIP_STATUS              0x00000008
#define     VIP_STATUS_RUN          0x00000001
#define     VIP_STATUS_VIDEO        0x00000100
#define     VIP_STATUS_VBI          0x00000200
#define     VIP_STATUS_SMI_FIELD    0x00010000
#define     VIP_STATUS_SMI_LINE     0x00020000
#define     VIP_STATUS_ODD_FIELD    0x01000000

#define REG_VIP_CURRENT_LINE        0x00000010
#define     VIP_CURRENTLINE_MASK    0x000003ff

#define REG_VIP_LINE_TARGET         0x00000014
#define     VIP_LINETARGET_MASK     0x000003ff

#define REG_VIP_VIDEO_ODD_BASE      0x00000020
#define REG_VIP_VIDEO_EVEN_BASE     0x00000024
#define REG_VIP_VIDEO_PITCH         0x00000028

#define REG_VIP_VBI_ODD_BASE        0x00000040
#define REG_VIP_VBI_EVEN_BASE       0x00000044
#define REG_VIP_VBI_PITCH           0x00000048

// GUIDs supported by MPC2

// Defined a NEW GUID for the EMMA-Dhruva connection
//#if defined( _WIN32 ) && (!defined( _NO_COM ) || defined( DEFINE_GUID ))
// {786E14A0-0D19-11d3-889F-0060082F62FD}
//DEFINE_GUID(DDVPTYPE_EMMA, 0x786E14A0L, 0xD19, 0x11D3, 0x88, 0x9F, 0x0, 0x60, 0x8, 0x2F, 0x62, 0xFD);
//#endif
//#include "emmaguid.h"
#define VPTYPE_EMMA 0x786E14A0L, 0x0D19, 0x11D3, 0x88, 0x9F, 0x0, 0x60, 0x8, 0x2F, 0x62, 0xFD

GUID    DDVPTYPE_EMMA={VPTYPE_EMMA};

#define INVALID_GUID    -1
const GUID *guids[] =
{
    &DDVPTYPE_CCIR656,
    &DDVPTYPE_E_HREFH_VREFH,
    &DDVPTYPE_E_HREFH_VREFL,
    &DDVPTYPE_E_HREFL_VREFH,
    &DDVPTYPE_E_HREFL_VREFL,
    &DDVPTYPE_EMMA
//  &DDVPTYPE_BROOKTREE,
//  &DDVPTYPE_PHILIPS
};
#define MAX_VP_TYPES    (sizeof(guids)/sizeof(void*))

#define CCIR656     0
#define HREFH_VREFH 1
#define HREFH_VREFL 2
#define HREFL_VREFH 3
#define HREFL_VREFL 4
#define EMMA_ID     5
//#define BROOKTREE   6
//#define PHILIPS     7

const DDPIXELFORMAT InputFormatsEMMA[] =
{
    {sizeof(DDPIXELFORMAT),DDPF_FOURCC, mmioFOURCC('E','M','M','A'),8,(DWORD)-1,(DWORD)-1,(DWORD)-1}
//    {sizeof(DDPIXELFORMAT),DDPF_FOURCC, mmioFOURCC('Y','U','Y','2'),8,(DWORD)-1,(DWORD)-1,(DWORD)-1},
//    {sizeof(DDPIXELFORMAT),DDPF_FOURCC, mmioFOURCC('U','Y','V','Y'),8,(DWORD)-1,(DWORD)-1,(DWORD)-1}
//    {sizeof(DDPIXELFORMAT),DDPF_FOURCC, mmioFOURCC('E','M','M','A'),8,(DWORD)-1,(DWORD)-1,(DWORD)-1}
};
const DDPIXELFORMAT InputFormats[] =
{
//    {sizeof(DDPIXELFORMAT),DDPF_FOURCC, mmioFOURCC('E','M','M','A'),8,(DWORD)-1,(DWORD)-1,(DWORD)-1},
//    {sizeof(DDPIXELFORMAT),DDPF_FOURCC, mmioFOURCC('Y','U','Y','2'),8,(DWORD)-1,(DWORD)-1,(DWORD)-1},
    {sizeof(DDPIXELFORMAT),DDPF_FOURCC, mmioFOURCC('U','Y','V','Y'),8,(DWORD)-1,(DWORD)-1,(DWORD)-1}
//    {sizeof(DDPIXELFORMAT),DDPF_FOURCC, mmioFOURCC('E','M','M','A'),8,(DWORD)-1,(DWORD)-1,(DWORD)-1}
};
#define MAX_INPUT_FORMATS (sizeof(InputFormats)/sizeof(DDPIXELFORMAT))
#define MAX_INPUT_FORMATS_EMMA (sizeof(InputFormatsEMMA)/sizeof(DDPIXELFORMAT))

#define INPUTFORMAT_YUY2    0
#define INPUTFORMAT_UYVY    1
#define INPUTFORMAT_EMMA    0
//#define INPUTFORMAT_EMMA    2

// debugging support 
#ifdef DEBUG
#define TRACE   DPF
// SAS #define assert(test) ((test) ? (void) 0 : DPF("* FAILURE * assertion %s: %s line %d",#test,__FILE__,__LINE__))
#define assert(test) ((test) ? (void) 0 : DEBUGMSG(1, (TEXT("* FAILURE * assertion %s: %s line %d"),#test,__FILE__,__LINE__)))
#else
#define DPF     1 ? (void)0 : (void)
#define TRACE   1 ? (void)0 : (void)
#define assert  1 ? (void)0 : (void)
#endif

// Macros
#define RoundUp(x,y) ((x+(y-1)) & ~(y-1)) // round x up to nearest y

#endif //DD_SUPPORT

⌨️ 快捷键说明

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