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

📄 vportdis.h

📁 在CCS环境下的一个视频采集源代码
💻 H
字号:
#include <std.h>
#include <csl_vp.h>
#include <csl_edma.h>
#include <csl_irq.h>

/////////////////////////////////////////////////////////////
// the following lines are from appnote_mt91001->vportdis.h
/////////////////////////////////////////////////////////////
#define VPORTDIS_VCTL1_HSYNC      0
#define VPORTDIS_VCTL1_HBLNK      1
#define VPORTDIS_VCTL1_AVID       2
#define VPORTDIS_VCTL1_FLD        3

#define VPORTDIS_VCTL2_VSYNC      0
#define VPORTDIS_VCTL2_VBLNK      1                     
#define VPORTDIS_VCTL2_CSYNC      2                     
#define VPORTDIS_VCTL2_FLD        3                     

#define VPORTDIS_VCTL3_CBLNK      0
#define VPORTDIS_VCTL3_FLD        1

/* In display operation, video port outputs      */
/* HCTL/VCTL/FID signals when exc is disabled    */
/* These signals are inputs to video port when   */
/* exc is enabled.                               */
#define VPORTDIS_EXC_DISABLE       0
#define VPORTDIS_EXC_ENABLE        7

#define VPORTDIS_BPK_10BIT_NORMAL  0
#define VPORTDIS_BPK_10BIT_DENSE   1      

#define VPORTDIS_DEFVAL_DISABLE    0
#define VPORTDIS_DEFVAL_ENABLE     1

#define VPORTDIS_RGBX_DISABLE      0
#define VPORTDIS_RGBX_ENABLE       1


typedef struct {
    Int        dmode;
    Int        fldOp;

    Int        scale;      /* 2x scaling enalbel            */
    Int        resmpl;     /* chrominance resampling enable */
    Int        defValEn;   /* default value enable          */
    Int        bpk10Bit;   /* bit-packing mode              */

    Int        vctl1Config;
    Int        vctl2Config;
    Int        vctl3Config;
    Int        extCtl;

    Uint16     frmHSize;
    Uint16     frmVSize;

    Int16      imgHOffsetFld1;
    Int16      imgVOffsetFld1;
    Uint16     imgHSizeFld1;
    Uint16     imgVSizeFld1;

    Int16      imgHOffsetFld2;
    Int16      imgVOffsetFld2;
    Uint16     imgHSizeFld2;
    Uint16     imgVSizeFld2;

    Uint16     hBlnkStart;
    Uint16     hBlnkStop;

    Uint16     vBlnkXStartFld1;
    Uint16     vBlnkYStartFld1;
    Uint16     vBlnkXStopFld1;
    Uint16     vBlnkYStopFld1;
    
    Uint16     vBlnkXStartFld2;
    Uint16     vBlnkYStartFld2;     
    Uint16     vBlnkXStopFld2;     
    Uint16     vBlnkYStopFld2;     
    
    Uint16     xStartFld1;
    Uint16     yStartFld1;     
    
    Uint16     xStartFld2;     
    Uint16     yStartFld2;  /* delayed or early transition ????*/     
    
    Uint16     hSyncStart;
    Uint16     hSyncStop;
    
    Uint16     vSyncXStartFld1;
    Uint16     vSyncYStartFld1;     
    Uint16     vSyncXStopFld1;     
    Uint16     vSyncYStopFld1;     
    
    Uint16     vSyncXStartFld2;
    Uint16     vSyncYStartFld2;     
    Uint16     vSyncXStopFld2;     
    Uint16     vSyncYStopFld2;     
    
    Uint8      yClipLow;
    Uint8      yClipHigh;
    
    Uint8      cClipLow;
    Uint8      cClipHigh;

    Uint8      yDefVal;
    Uint8      cbDefVal;
    Uint8      crDefVal;

    Int        rgbX;      
    Int        incPix; 
    Uint16     thrld;            

    Int        numFrmBufs;    
    Int        alignment;
    Int        mergeFlds;
    Int        segId;            
    Int        edmaPri;    
    Int        irqId;
} VPORTDIS_Params;
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////


/*................................................................ */
/* Function : configVPDispEDMAChannel */
/* */
/* Input(s) : edmaHandle . pointer to EDMA handle. */
/* eventId . EDMA eventId. */
/* tccNum . pointer to transfer complete number. */
/* srcAddr . source address for EDMA transfer. */
/* dstAddr . destination address for EDMA transfer */
/* frameCount . frame count. */
/* elementCount . element count(32.bit element size). */
/* */
/* Output(s): edmaHandle . edma Handle of the given event. */
/* tccNum . transfer complete code for the given */
/* event. */
/* */
/* Description : Configures the given VP display EDMA channel. */
/* The destination address update is fixed because */
/* the displayed data is write to the FIFO. */
/* In this example, the source address mode is */
/* auto.increment. But, in real.time applications */
/* there is lot of flexibility in the way display */
/* buffers can be managed like ping.pong and round */
/* robin,…etc. */
/*................................................................ */
void configVPDispEDMAChannel( EDMA_Handle *edmaHandle,
							  Int32 eventId, Int32 *tccNum,
							  Uint32 srcAddr, Uint32 dstAddr,
							  Uint32 frameCount, Uint32 elementCount);
/*................................................................ */
/* Function : setupVPDispEDMA */
/* Input(s) : portNumber, video port number i.e. 0,1 or 2. */
/* Description : Sets up DMA channels for Y, U, V events for VP */
/* display. */
/*................................................................ */
void setupVPDispEDMA(Int32 portNumber);
/*................................................................ */
/* Function : VPDispIsr */
/* Description : This display ISR clears FRMD to continue display */
/* in this non.continuous mode and also clears other */
/* status bits. */
/*................................................................ */
interrupt void VPDispIsr(void);
/*................................................................ */
/* Function : bt656_display_start */
/* Input(s) : VP_Handle*/
/* Description : Configures given video port for 8.bit BT.656 non. */
/* continuous frame display. */
/*................................................................ */
void bt656_display_start(VP_Handle videohandle);
/*................................................................ */
/* Function : bt656_8bit_ncfd */
/* Input(s) : portNumber, video port number i.e. 0, 1 or 2. */
/* Description : Configures given video port for 8.bit BT.656 non. */
/* continuous frame display. */
/*................................................................ */
VP_Handle bt656_8bit_ncfd(int portNumber);

⌨️ 快捷键说明

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