📄 csl_vp.h
字号:
/******************************************************************************\* Copyright (C) 1999-2002 Texas Instruments Incorporated.* All Rights Reserved*------------------------------------------------------------------------------* FILENAME...... csl_vp.h* DATE CREATED.. 02/22/2002 * LAST MODIFIED. 05/09/2002*\******************************************************************************/#ifndef _CSL_VP_H_#define _CSL_VP_H_#include <csl_chip.h>#include <csl_irq.h>#include <csl_vphal.h>#if (VP_SUPPORT)/******************************************************************************\* scope and inline control macros\******************************************************************************/#ifdef __cplusplus#define CSLAPI extern "C" far#else#define CSLAPI extern far#endif#undef USEDEFS#undef IDECL#undef IDEF#ifdef _VP_MOD_ #define IDECL CSLAPI #define USEDEFS #define IDEF#else #ifdef _INLINE #define IDECL static inline #define USEDEFS #define IDEF static inline #else #define IDECL CSLAPI #endif#endif/******************************************************************************\* global macro declarations\******************************************************************************//* VP_open() flags */#define VP_OPEN_RESET (0x00000001)/* device identifiers for VP_open() */#define VP_DEV0 (0)#if (_VP_PORT_CNT == 3) #define VP_DEV1 (1) #define VP_DEV2 (2)#endif/* device identifiers for VP_open() */#define VP_PORT0 VP_DEV0#if (_VP_PORT_CNT == 2) #define VP_PORT1 VP_DEV1 #define VP_PORT2 VP_DEV2#endif/******************************************************************************\* global typedef declarations\******************************************************************************//* device handle object */#if (CHIP_DM642) typedef struct { Uint32 allocated; Uint32 eventId; volatile Uint32 *baseAddr; Uint32 ysrcaAddr; Uint32 cbsrcaAddr; Uint32 crsrcaAddr; Uint32 ydstaAddr; Uint32 cbdstAddr; Uint32 crdstAddr; Uint32 ysrcbAddr; Uint32 cbsrcbAddr; Uint32 crsrcbAddr; Uint32 ydstbAddr; } VP_Obj, *VP_Handle;#else typedef struct { Uint32 allocated; Uint32 eventId; volatile Uint32 *baseAddr; Uint32 ysrcaAddr; Uint32 cbsrcaAddr; Uint32 crsrcaAddr; Uint32 ydstaAddr; Uint32 cbdstAddr; Uint32 crdstAddr; } VP_Obj, *VP_Handle;#endif/* device configuration structure */typedef struct { Uint32 vpctl; Uint32 vpie; Uint32 vpis;} VP_ConfigPort;#if (CHIP_DM642) typedef struct { Uint32 vcactl; Uint32 vcastrt1; Uint32 vcastop1; Uint32 vcastrt2; Uint32 vcastop2; Uint32 vcavint; Uint32 vcathrld; Uint32 vcaevtct; Uint32 vcbctl; Uint32 vcbstrt1; Uint32 vcbstop1; Uint32 vcbstrt2; Uint32 vcbstop2; Uint32 vcbvint; Uint32 vcbthrld; Uint32 vcbevtct; Uint32 tsictl; Uint32 tsiclkinitl; Uint32 tsiclkinitm; Uint32 tsistcmpl; Uint32 tsistcmpm; Uint32 tsistmskl; Uint32 tsistmskm; Uint32 tsiticks; } VP_ConfigCapture;#else typedef struct { Uint32 vcactl; Uint32 vcastrt1; Uint32 vcastop1; Uint32 vcastrt2; Uint32 vcastop2; Uint32 vcavint; Uint32 vcathrld; Uint32 vcaevtct; Uint32 tsictl; Uint32 tsiclkinitl; Uint32 tsiclkinitm; Uint32 tsistcmpl; Uint32 tsistcmpm; Uint32 tsistmskl; Uint32 tsistmskm; Uint32 tsiticks; } VP_ConfigCapture;#endiftypedef struct { Uint32 vcactl; Uint32 vcastrt1; Uint32 vcastop1; Uint32 vcastrt2; Uint32 vcastop2; Uint32 vcavint; Uint32 vcathrld; Uint32 vcaevtct; } VP_ConfigCaptureChA;#if (CHIP_DM642) typedef struct { Uint32 vcbctl; Uint32 vcbstrt1; Uint32 vcbstop1; Uint32 vcbstrt2; Uint32 vcbstop2; Uint32 vcbvint; Uint32 vcbthrld; Uint32 vcbevtct; } VP_ConfigCaptureChB;#endiftypedef struct { Uint32 vcactl; Uint32 tsictl; Uint32 tsiclkinitl; Uint32 tsiclkinitm; Uint32 tsistcmpl; Uint32 tsistcmpm; Uint32 tsistmskl; Uint32 tsistmskm; Uint32 tsiticks; } VP_ConfigCaptureTSI;typedef struct { Uint32 vdctl; Uint32 vdfrmsz; Uint32 vdhblnk; Uint32 vdvblks1; Uint32 vdvblke1; Uint32 vdvblks2; Uint32 vdvblke2; Uint32 vdimoff1; Uint32 vdimgsz1; Uint32 vdimoff2; Uint32 vdimgsz2; Uint32 vdfldt1; Uint32 vdfldt2; Uint32 vdthrld; Uint32 vdhsync; Uint32 vdvsyns1; Uint32 vdvsyne1; Uint32 vdvsyns2; Uint32 vdvsyne2; Uint32 vdreload; Uint32 vddispevt; Uint32 vdclip; Uint32 vddefval; Uint32 vdvint; Uint32 vdfbit; Uint32 vdvbit1; Uint32 vdvbit2; } VP_ConfigDisplay;typedef struct { Uint32 pfunc; Uint32 pdir; Uint32 pdout; Uint32 pdset; Uint32 pdclr; Uint32 pien; Uint32 pipol; Uint32 piclr;} VP_ConfigGpio;typedef struct { VP_ConfigPort *port; VP_ConfigCapture *capture; VP_ConfigDisplay *display; VP_ConfigGpio *gpio;} VP_Config;/******************************************************************************\* global variable declarations\******************************************************************************//******************************************************************************\* global function declarations\******************************************************************************/CSLAPI void VP_reset(VP_Handle hVp);CSLAPI void VP_resetAll();CSLAPI VP_Handle VP_open(int devNum, Uint32 flags);CSLAPI void VP_close(VP_Handle hVp);CSLAPI Uint32 VP_getPins(VP_Handle hVp);CSLAPI void VP_setPins(VP_Handle hVp, Uint32 val);CSLAPI void VP_clearPins(VP_Handle hVp, Uint32 val);CSLAPI void VP_resetCaptureChA(VP_Handle hVp);#if (CHIP_DM642) CSLAPI void VP_resetCaptureChB(VP_Handle hVp);#endifCSLAPI void VP_resetDisplay(VP_Handle hVp);/******************************************************************************\* inline function declarations\******************************************************************************/IDECL Uint32 VP_getYsrcaAddr(VP_Handle hVp); IDECL Uint32 VP_getCbsrcaAddr(VP_Handle hVp); IDECL Uint32 VP_getCrsrcaAddr(VP_Handle hVp); IDECL Uint32 VP_getYdstaAddr(VP_Handle hVp); IDECL Uint32 VP_getCbdstAddr(VP_Handle hVp); IDECL Uint32 VP_getCrdstAddr(VP_Handle hVp); #if (CHIP_DM642) IDECL Uint32 VP_getYsrcbAddr(VP_Handle hVp); IDECL Uint32 VP_getCbsrcbAddr(VP_Handle hVp); IDECL Uint32 VP_getCrsrcbAddr(VP_Handle hVp); IDECL Uint32 VP_getYdstbAddr(VP_Handle hVp); #endifIDECL Uint32 VP_getEventId(VP_Handle hVp);/******************************************************************************/IDECL void VP_config(VP_Handle hVp, VP_Config *config);IDECL void VP_configPort(VP_Handle hVp, VP_ConfigPort *config);IDECL void VP_configCapture(VP_Handle hVp, VP_ConfigCapture *config);IDECL void VP_configCaptureChA(VP_Handle hVp, VP_ConfigCaptureChA *config);#if (CHIP_DM642) IDECL void VP_configCaptureChB(VP_Handle hVp, VP_ConfigCaptureChB *config);#endifIDECL void VP_configCaptureTSI(VP_Handle hVp, VP_ConfigCaptureTSI *config);IDECL void VP_configDisplay(VP_Handle hVp, VP_ConfigDisplay *config);IDECL void VP_configGpio(VP_Handle hVp, VP_ConfigGpio *config);IDECL void VP_getConfig(VP_Handle hVp, VP_Config *config);/******************************************************************************\* inline function definitions\******************************************************************************/#ifdef USEDEFS/*----------------------------------------------------------------------------*/IDEF Uint32 VP_getYsrcaAddr(VP_Handle hVp) { return (Uint32)(hVp->ysrcaAddr);}/*----------------------------------------------------------------------------*/IDEF Uint32 VP_getCbsrcaAddr(VP_Handle hVp) { return (Uint32)(hVp->cbsrcaAddr);}/*----------------------------------------------------------------------------*/IDEF Uint32 VP_getCrsrcaAddr(VP_Handle hVp) { return (Uint32)(hVp->crsrcaAddr);}/*----------------------------------------------------------------------------*/IDEF Uint32 VP_getYdstaAddr(VP_Handle hVp) { return (Uint32)(hVp->ydstaAddr);}/*----------------------------------------------------------------------------*/IDEF Uint32 VP_getCbdstAddr(VP_Handle hVp) { return (Uint32)(hVp->cbdstAddr);}/*----------------------------------------------------------------------------*/IDEF Uint32 VP_getCrdstAddr(VP_Handle hVp) { return (Uint32)(hVp->crdstAddr);}#if (CHIP_DM642) /*----------------------------------------------------------------------------*/ IDEF Uint32 VP_getYsrcbAddr(VP_Handle hVp) { return (Uint32)(hVp->ysrcbAddr); } /*----------------------------------------------------------------------------*/ IDEF Uint32 VP_getCbsrcbAddr(VP_Handle hVp) { return (Uint32)(hVp->cbsrcbAddr); } /*----------------------------------------------------------------------------*/ IDEF Uint32 VP_getCrsrcbAddr(VP_Handle hVp) { return (Uint32)(hVp->crsrcbAddr); } /*----------------------------------------------------------------------------*/ IDEF Uint32 VP_getYdstbAddr(VP_Handle hVp) { return (Uint32)(hVp->ydstbAddr); }#endif/*----------------------------------------------------------------------------*/IDEF Uint32 VP_getEventId(VP_Handle hVp) { return (hVp->eventId);}/*----------------------------------------------------------------------------*/#if (CHIP_DM642) IDEF void VP_config(VP_Handle hVp, VP_Config *config) { Uint32 gie; volatile Uint32 *base = (volatile Uint32 *)(hVp->baseAddr); register int x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19; register int x20,x21,x22,x23,x24,x25,x26,x27,x28,x29,x30,x31,x32,x33,x34,x35,x36; register int x37,x38,x39,x40,x41,x42,x43,x44,x45,x46,x47,x48,x49,x50,x51,x52,x53; register int x54,x55,x56,x57,x58,x59,x60,x61; gie = IRQ_globalDisable(); /* the compiler generates more efficient code if the loads */ /* and stores are grouped together rather than intermixed */ x0 = config->port->vpctl; x1 = config->port->vpie; x2 = config->port->vpis; x3 = config->capture->vcastrt1; x4 = config->capture->vcastop1; x5 = config->capture->vcastrt2; x6 = config->capture->vcastop2; x7 = config->capture->vcavint; x8 = config->capture->vcathrld; x9 = config->capture->vcaevtct; x10 = config->capture->vcbstrt1; x11 = config->capture->vcbstop1; x12 = config->capture->vcbstrt2; x13 = config->capture->vcbstop2; x14 = config->capture->vcbvint; x15 = config->capture->vcbthrld; x16 = config->capture->vcbevtct; x17 = config->capture->tsictl; x18 = config->capture->tsiclkinitl; x19 = config->capture->tsiclkinitm; x20 = config->capture->tsistcmpl; x21 = config->capture->tsistcmpm; x22 = config->capture->tsistmskl; x23 = config->capture->tsistmskm; x24 = config->capture->tsiticks; x25 = config->display->vdfrmsz; x26 = config->display->vdhblnk; x27 = config->display->vdvblks1; x28 = config->display->vdvblke1; x29 = config->display->vdvblks2; x30 = config->display->vdvblke2; x31 = config->display->vdimoff1; x32 = config->display->vdimgsz1; x33 = config->display->vdimoff2; x34 = config->display->vdimgsz2; x35 = config->display->vdfldt1; x36 = config->display->vdfldt2; x37 = config->display->vdthrld; x38 = config->display->vdhsync; x39 = config->display->vdvsyns1; x40 = config->display->vdvsyne1; x41 = config->display->vdvsyns2; x42 = config->display->vdvsyne2; x43 = config->display->vdreload; x44 = config->display->vddispevt; x45 = config->display->vdclip; x46 = config->display->vddefval; x47 = config->display->vdvint; x48 = config->display->vdfbit; x49 = config->display->vdvbit1; x50 = config->display->vdvbit2; x51 = config->gpio->pfunc; x52 = config->gpio->pdir;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -