首页 / AMD-FPGA / 帖子

OSD模块停用,提否能提供其他可用例程?

作者 tiaotiaoduoduo 2019-02-19 10411 次浏览 3 条回复 论坛存档
t
tiaotiaoduoduo
2019-02-19
楼主

无标题.png

在申请OSD模块许可时,官方已关闭了申请。

例程中视觉用到OSD模块的,都无法生成bit文件,请问能否提供其他可行的代码。

型号:701A自选套餐:+9V034双目套餐

t
tiaotiaoduoduo
2019-02-21
#1

int mix_init(void)

{

int Status;

Status = XVMix_Initialize(&mix,MIX_DEVICE_ID);

if(Status == XST_SUCCESS){

xil_printf("--XST_SUCCESS:: XV_mix_Initialize ...\r\n" );

}

XVMix_Start(&mix);

return Status;

}

t
tiaotiaoduoduo
2019-03-01
#2

#define H_ACTIVE1 752//640*3

#define V_ACTIVE1 480//480

#define H_STRIDE1 752//640

#define H_ACTIVE0 752//640*3

#define V_ACTIVE0 480//480

#define H_STRIDE0 752//640

// Camera_osd_init();

tpg_init();

mix_init();

// Xil_Out32((VDMA_BASEADDR0 + 0x030), 0x108B);// enable circular mode

Xil_Out32((VDMA_BASEADDR0 + 0x030), 0x8B);// enable circular mode

Xil_Out32((VDMA_BASEADDR0 + 0x0AC), VIDEO_BASEADDR0); // start address

Xil_Out32((VDMA_BASEADDR0 + 0x0B0), VIDEO_BASEADDR1); // start address

Xil_Out32((VDMA_BASEADDR0 + 0x0B4), VIDEO_BASEADDR2); // start address

Xil_Out32((VDMA_BASEADDR0 + 0x0A8), (H_STRIDE0*3)); // h offset (640 * 4) bytes

Xil_Out32((VDMA_BASEADDR0 + 0x0A4), (H_ACTIVE0*3)); // h size (640 * 4) bytes

Xil_Out32((VDMA_BASEADDR0 + 0x0A0), V_ACTIVE0); // v size (480)

Xil_Out32((VDMA_BASEADDR0 + 0x000), 0x8B); // enable circular mode

Xil_Out32((VDMA_BASEADDR0 + 0x05c), VIDEO_BASEADDR0); // start address

Xil_Out32((VDMA_BASEADDR0 + 0x060), VIDEO_BASEADDR1); // start address

Xil_Out32((VDMA_BASEADDR0 + 0x064), VIDEO_BASEADDR2); // start address

Xil_Out32((VDMA_BASEADDR0 + 0x058), (H_STRIDE0*3)); // h offset (640 * 4) bytes

Xil_Out32((VDMA_BASEADDR0 + 0x054), (H_ACTIVE0*3)); // h size (640 * 4) bytes

Xil_Out32((VDMA_BASEADDR0 + 0x050), V_ACTIVE0); // v size (480)

// Xil_Out32((VDMA_BASEADDR1 + 0x030), 0x108B);// enable circular mode

Xil_Out32((VDMA_BASEADDR1 + 0x030), 0x8B);// enable circular mode

Xil_Out32((VDMA_BASEADDR1 + 0x0AC), VIDEO_BASEADDR3); // start address

Xil_Out32((VDMA_BASEADDR1 + 0x0B0), VIDEO_BASEADDR4); // start address

Xil_Out32((VDMA_BASEADDR1 + 0x0B4), VIDEO_BASEADDR5); // start address

Xil_Out32((VDMA_BASEADDR1 + 0x0A8), (H_STRIDE1*3)); // h offset (640 * 4) bytes

Xil_Out32((VDMA_BASEADDR1 + 0x0A4), (H_ACTIVE1*3)); // h size (640 * 4) bytes

Xil_Out32((VDMA_BASEADDR1 + 0x0A0), V_ACTIVE1); // v size (480)

Xil_Out32((VDMA_BASEADDR1 + 0x000), 0x8B); // enable circular mode

Xil_Out32((VDMA_BASEADDR1 + 0x05c), VIDEO_BASEADDR3); // start address

Xil_Out32((VDMA_BASEADDR1 + 0x060), VIDEO_BASEADDR4); // start address

Xil_Out32((VDMA_BASEADDR1 + 0x064), VIDEO_BASEADDR5); // start address

Xil_Out32((VDMA_BASEADDR1 + 0x058), (H_STRIDE1*3)); // h offset (640 * 4) bytes

Xil_Out32((VDMA_BASEADDR1 + 0x054), (H_ACTIVE1*3)); // h size (640 * 4) bytes

Xil_Out32((VDMA_BASEADDR1 + 0x050), V_ACTIVE1); // v size (480)

t
tiaotiaoduoduo
2019-03-01
#3

/*

* mix_init.c

*

* Created on: 2019Äê2ÔÂ18èÕ

* Author: Administrator

*/

#include "xparameters.h"

#include "xv_mix_hw.h"

#include "xv_mix.h"

#include "xv_mix_l2.h"

#include "mix_init.h"

/*

* Device related constants. Defined in xparameters.h

*/

#define MIX_DEVICE_ID XPAR_V_MIX_0_DEVICE_ID

/*

* OSD Device related data structures

*/

XV_Mix_l2 mix;

XV_mix_Config *MixCfgPtr;

XVidC_VideoWindow win_lay2;

XVidC_VideoWindow win_lay1;

/***************************************************************************

* This is the main loop of the application

***************************************************************************/

int mix_init(void)

{

int Status;

u16 Camera_width = 752;

u16 Camera_height = 480;

/* Layer 0/1 property definition */

int Layer1AlphaValue1 = 0xFF;

int Layer1AlphaValue2 = 0x80;

Status = XVMix_Initialize(&mix,MIX_DEVICE_ID);

if(Status == XST_SUCCESS){

xil_printf("--XST_SUCCESS:: XV_mix_Initialize ...\r\n" );

}

// XVMIX_LAYER_1

XVMix_SetLayerAlpha(&mix,XVMIX_LAYER_1,Layer1AlphaValue1);

win_lay1.StartX=0;

win_lay1.StartY=0;

win_lay1.Width=Camera_width;

win_lay1.Height=Camera_height;

XVMix_SetLayerWindow(&mix,XVMIX_LAYER_1,&win_lay1,0);

XVMix_LayerEnable(&mix, XVMIX_LAYER_1);

// XVMIX_LAYER_2

XVMix_SetLayerAlpha(&mix,XVMIX_LAYER_2,Layer1AlphaValue2);

win_lay2.StartX=1280-Camera_width;

win_lay2.StartY=0;

win_lay2.Width=Camera_width;

win_lay2.Height=Camera_height;

XVMix_SetLayerWindow(&mix,XVMIX_LAYER_2,&win_lay2,0);

XVMix_LayerEnable(&mix, XVMIX_LAYER_2);

XVMix_Start(&mix);

return 0;

}

/*

* tpg_init.c

*

* Created on: 2019Äê2ÔÂ28èÕ

* Author: Administrator

*/

#include "xparameters.h"

#include "xv_tpg_hw.h"

#include "xv_tpg.h"

#include "tpg_init.h"

/*

* Device related constants. Defined in xparameters.h

*/

#define TPG_DEVICE_ID XPAR_V_TPG_0_DEVICE_ID

/*

* OSD Device related data structures

*/

XV_tpg tpg;

/***************************************************************************

* This is the main loop of the application

***************************************************************************/

int tpg_init(void)

{

int Status;

Status = XV_tpg_Initialize(&tpg,TPG_DEVICE_ID);

if(Status == XST_SUCCESS){

xil_printf("--XST_SUCCESS:: XV_tpg_Initialize ...\r\n" );

}

XV_tpg_Set_width(&tpg,1280);

XV_tpg_Set_height(&tpg,720);

XV_tpg_Set_bckgndId(&tpg,XTPG_BKGND_SOLID_BLACK);

XV_tpg_EnableAutoRestart(&tpg);

XV_tpg_Start(&tpg);

return 0;

}

这是论坛时期的原帖存档,只读。新的讨论请到 提问, 沉淀下来的内容会进 知识库 和 方案库。