예제 #1
0
파일: main.c 프로젝트: Tassadus/hdl
int main()
{
	init_platform();

    // Specify configuration for hardware design.
    demo.ali3_resolution = VIDEO_RESOLUTION_WXGA;
    demo.ali3_width  = vres_get_width(VIDEO_RESOLUTION_WXGA);
    demo.ali3_height = vres_get_height(VIDEO_RESOLUTION_WXGA);
    demo.uDeviceId_VDMA_FrameBuffer = XPAR_AXIVDMA_0_DEVICE_ID;
    demo.uBaseAddr_MEM_FrameBuffer  = XPAR_DDR_MEM_BASEADDR + 0x10000000;
    demo.uNumFrames_FrameBuffer     = XPAR_AXIVDMA_0_NUM_FSTORES;
    //
    demo.uBaseAddr_IIC_Touch        = XPAR_IIC_0_BASEADDR;
    //
    demo.uDeviceId_IRQ_Touch        = XPAR_PS7_SCUGIC_0_DEVICE_ID;
    demo.uInterruptId_IRQ_Touch     = XPS_FPGA0_INT_ID;

    // Initialize the PS GPIO controls.
    if (ps_gpio_polled_init(&demo) != 0)
    {
    	xil_printf("Failed to initialize PS GPIO driver\n\r");
    }

	// Wait while the display powers up fully before accessing any hardware.
    sleep(1);
	
    // Initialize hardware design for the display.
    zed_ali3_controller_demo_init(&demo);

    // Initialize Serial Console.
    start_avnet_console_serial_application();

    // Wait while peripherals become calibrated and configured.
    sleep(1);

    // Check for calibration request.
    zed_ali3_controller_demo_check_calibrate_request(&demo);

    // Display the logo screen to show that the system is configured.
    zed_ali3_controller_demo_logo(&demo);

    while (1)
    {
        // Process user input from Serial Console.
        transfer_avnet_console_serial_data();

        // Process user input from the touch screen.
        zed_ali3_controller_demo_touch_process(&demo);

        // Process user input from the board hardware.
        zed_ali3_controller_demo_board_process(&demo);
    }

    cleanup_platform();

    return 0;
}
Xint32 vres_detect( Xuint32 width, Xuint32 height )
{
  Xint32 i;
  Xint32 resolution = -1;

  for ( i = 0; i < NUM_VIDEO_RESOLUTIONS; i++ )
  {
     if ( width == vres_get_width(i) && height == vres_get_height(i) )
     {
        resolution = i;
        break;
     }
  }  
  return resolution;
}
예제 #3
0
Xint32 vres_detect( Xuint32 width, Xuint32 height )
{
  Xint32 i;
  Xint32 resolution = -1;

  for ( i = 0; i < NUM_VIDEO_RESOLUTIONS; i++ )
  {
     if ( width == vres_get_width(i) && height == vres_get_height(i) )
     {
        //xil_printf( "Detected Video Resolution = %s\r\n", vres_get_name(i) );
        resolution = i;
        break;
     }
  }  
  return resolution;
}