vtc
Vitis Drivers API Documentation
vtc Documentation

This is the main header file of Xilinx MVI Video Timing Controller (VTC) device driver. The VTC device detects video signals, independently overrides any one of them, re-generates video signals with +/- delay and with polarity inversion, and generates up to 16 one cycle Frame Sync outputs.

The device has the following main features:

  • Detect video signals:
    • horizontal sync
    • horizontal blank
    • vertical sync
    • vertical blank
    • active video
    • field id
  • Independently override any one signal.
  • Re-generate video signals with +/- delay and with polarity inversion.
  • Generate up to 16 one cycle Frame Sync outputs.

For a full description of VTC features, please see the hardware specification.

Software Initialization & Configuration

The application needs to do following steps in order for preparing the VTC to be ready to process video signal handling.

  • Call XVtc_LookupConfig using a device ID to find the core configuration.
  • Call XVtc_CfgInitialize to initialize the device and the driver instance associated with it.
  • Call XVtc_SetGenerator to set up the video signals to generate, if desired.
  • Call XVtc_SetPolarity to set up the video signal polarity.
  • Call XVtc_SetSource for source selection
  • Call XVtc_SetGeneratorHoriOffset to set up the Generator VBlank/VSync horizontal offsets, if values other than the default are needed
  • Call XVtc_EnableSync, if generator needs to be synced to the detector
  • Call XVtc_Enable to enable/start the VTC device.

Interrupts

The interrupt types supported are:

  • Frame Sync Interrupts 0 - 15
  • Generator interrupt:
    • Generator Active Video Interrupt
    • Generator VBLANK Interrupt
  • Detector interrupt:
    • Detector Active Video Interrupt
    • Detector VBLANK Interrupt
  • Signal Lock interrupt:
    • Active Chroma signal lock
    • Active Video Signal Lock
    • Field ID Signal Lock
    • Vertical Blank Signal Lock
    • Vertical Sync Signal Lock
    • Horizontal Blank Signal Lock
    • Horizontal Sync Signal Lock

Virtual Memory

This driver supports Virtual Memory. The RTOS is responsible for calculating the correct device base address in Virtual Memory space.

Threads

This driver is not thread safe. Any needs for threads or thread mutual exclusion must be satisfied by the layer above this driver.

Asserts

Asserts are used within all Xilinx drivers to enforce constraints on argument values. Asserts can be turned off on a system-wide basis by defining, at compile time, the NDEBUG identifier. By default, asserts are turned on and it is recommended that users leave asserts on during development.

Building the driver

The Vtc driver is composed of several source files. This allows the user to build and link only those parts of the driver that are necessary.

Examples

An example is provided with this driver to demonstrate the driver usage.

Cache Coherency

Alignment

Limitations

BUS Interface

MODIFICATION HISTORY:
Ver   Who    Date     Changes


1.00a xd 08/05/08 First release 1.01a xd 07/23/10 Added GIER Added more h/w generic info into xparameters.h Feed callbacks with pending interrupt info. Added Doxygen & Version support 2.00a xd 05/13/11 1. Renamed to "Video Timing Controller" 2. Added Generator/Detector VBlank/VSync Horizontal offset setup/fetch support 3. Renamed the IP to support to be axi_vtc 4. Supported sync between generator and detector with addition of new XVtc_EnableSync and XVtc_DisableSync functions 5. Renamed XVtc_SetSync to XVtc_SetFSync 6. Renamed XVtc_GetSync to XVtc_GetFSync 7. Removed unnecessary register write in XVtc_Reset 8. Corrected driver name in .mdd file 9. Updated register bit definition (a few fields grow from 12 to 13 bit wide) 2.00a cm 05/25/11 1. Renamed XVtc_SetSkip to XVtc_SetSkipLine 2. Renamed XVtc_GetSkip to XVtc_GetSkipLine 3. Added XVtc_SetSkipPixel 4. Added XVtc_GetSkipPixel 2.00a cm 06/16/12 1. Added missing xil_assert.h include 2.00a cm 07/25/12 1. Removed unused XVtc_IntrSetLockPolarity function 3.00a cm 08/02/12 1. Added the XVtc_Sync_Reset frame sync'ed SW reset function. 3.00a cjm 08/02/12 Converted from xio.h to xil_io.h, translating basic types, MB cache functions, exceptions and assertions to xil_io format. Replaced the following "XExc_Init" -> "Xil_ExceptionInit" "XExc_RegisterHandler" -> "Xil_ExceptionRegister Handler" "XEXC_ID_NON_CRITICAL_INT" -> "XIL_EXCEPTION_ID_INT" "XExceptionHandler" -> "Xil_ExceptionHandler" "XExc_mEnableExceptions" -> "Xil_ExceptionEnable" "XEXC_NON_CRITICAL" -> "XIL_EXCEPTION_NON_CRITICAL" "XExc_DisableExceptions" -> "Xil_ExceptionDisable" "XExc_RemoveHandler" -> "Xil_ExceptionRemoveHandler" "microblaze_enable_interrupts" -> "Xil_ExceptionEnable" "microblaze_disable_interrupts" -> "Xil_Exception Disable"

                      "XCOMPONENT_IS_STARTED" -> "XIL_COMPONENT_IS_STARTED"
                      "XCOMPONENT_IS_READY" -> "XIL_COMPONENT_IS_READY"
                      "XASSERT_NONVOID" -> "Xil_AssertNonvoid"
                      "XASSERT_VOID_ALWAYS" -> "Xil_AssertVoidAlways"
                      "XASSERT_VOID" -> "Xil_AssertVoid"
                      "Xil_AssertVoid_ALWAYS" -> "Xil_AssertVoidAlways"
                      "XAssertStatus" -> "Xil_AssertStatus"
                      "XAssertSetCallback" -> "Xil_AssertCallback"
                      "XASSERT_OCCURRED" -> "XIL_ASSERT_OCCURRED"
                      "XASSERT_NONE" -> "XIL_ASSERT_NONE"
                      "microblaze_disable_dcache" -> "Xil_DCacheDisable"
                      "microblaze_enable_dcache" -> "Xil_DCacheEnable"
                      "microblaze_enable_icache" -> "Xil_ICacheEnable"
                      "microblaze_disable_icache" -> "Xil_ICacheDisable"
                      "microblaze_init_dcache_range" -> "Xil_DCacheInvalidate
                                                                      Range"
                      "XCache_DisableDCache" -> "Xil_DCacheDisable"
                      "XCache_DisableICache" -> "Xil_ICacheDisable"
                      "XCache_EnableDCache" -> "Xil_DCacheEnableRegion"
                      "XCache_EnableICache" -> "Xil_ICacheEnableRegion"
                      "XCache_InvalidateDCacheLine" -> "Xil_DCacheInvalidate
                                                                      Range"
                      "XUtil_MemoryTest32" -> "Xil_TestMem32"
                      "XUtil_MemoryTest16" -> "Xil_TestMem16"
                      "XUtil_MemoryTest8" -> "Xil_TestMem8"
                      "xutil.h" -> "xil_testmem.h"
                      "xbasic_types.h" -> "xil_types.h"
                      "xio.h" -> "xil_io.h"
                      "XIo_In32" -> "Xil_In32"
                      "XIo_Out32" -> "Xil_Out32"
                      "XTRUE" -> "TRUE"
                      "XFALSE" -> "FALSE"
                      "XNULL" -> "NULL"
                      "Xuint8" -> "u8"
                      "Xuint16" -> "u16"
                      "Xuint32" -> "u32"
                      "Xint8" -> "char"
                      "Xint16" -> "short"
                      "Xint32" -> "long"
                      "Xfloat32" -> "float"
                      "Xfloat64" -> "double"
                      "Xboolean" -> "int"
                      "XTEST_FAILED" -> "XST_FAILURE"
                      "XTEST_PASSED" -> "XST_SUCCESS"
4.00a cjm    02/07/13 Removed Unused Functions
                      XVtc_IntrEnableGlobal
                      XVtc_IntrDisableGlobal
5.00a cjm    08/07/13 Replaced XVTC_RESET with (XVTC_CTL)
                      Replaced XVTC_RESET_RESET_MASK with
                      (XVTC_CTL_RESET_MASK)
                      Replaced XVTC_SYNC_RESET_MASK with (XVTC_CTL_SRST_MASK)
5.00a cjm    10/30/13 Replaced XVtc_RegUpdate with XVtc_RegUpdateEnable
                      Added XVtc_RegUpdateDisable
                      Removed type parameter from XVtc_Enable
                      Added XVtc_EnableGenerator to enable only the Generator
                      Added XVtc_EnableDetector to enable only the Detector
5.00a cjm    11/01/13 Added Timing, VideoMode and Signal Conversion
                      Functions:
                      XVtc_ConvVideoMode2Timing
                      XVtc_ConvTiming2Signal
                      XVtc_ConvSignal2Timing
                      XVtc_ConvTiming2VideoMode
                      Added Timing and Video Mode Set/Get Functions:
                      XVtc_SetGeneratorTiming
                      XVtc_SetGeneratorVideoMode
                      XVtc_GetGeneratorTiming
                      XVtc_GetGeneratorVideoMode
                      XVtc_GetDetectorTiming
                      XVtc_GetDetectorVideoMode
6.0   adk    19/12/13 Updated as per the New Tcl API's.
6.1   adk    23/08/14 Implemented XVtc_SelfTest in
                      xvtc_selftest.c.
                      Modified prototype of XVtc_GetVersion API.
7.0   vns    02/25/15 Added Interlaced field to XVtc_Signal structure,
                      Removed XVtc_RegUpdate as there are is one more API,
                      XVtc_RegUpdateEnable with same functionality but
                      provided backward compatability.
                      Modifications from xvtc.c file are:
                      Modified HActiveVideo value to 1920 for
                      XVTC_VMODE_1080I mode.
                      Removed Major, Minor and Revision parameters from
                      XVtc_GetVersion.
                      Modified return type of XVtc_GetVersion from
                      void to u32.
                      Added progressive and interlaced mode switching feature.
                      Modified XVtc_SetGenerator, XVtc_GetGenerator,
                      XVtc_GetDetector, XVtc_ConvTiming2Signal and
                      XVtc_ConvSignal2Timing APIs
                      Modifications from xvtc_hw.h file are:
                      Removed XVTC_ERR_FIL_MASK macro because it is  not
                      present in latest product guide.
                      Modified register offsets from XVTC_* to XVTC_*_OFFSET
                      for consistency.
                      Added backward compatibility macros.
                      Modifications from xvtc_intr.c and xvtc_sinit.c files
                      are:
                      updated doxygen tags.
                      Modifications from xvtc_selftest.c file are:
                      First Release.
                      Implemented following function:
                      XVtc_SelfTest.
7.1   vns    10/14/15 Added InterlacedMode feild to XVtc_SourceSelect
                      structure
7.2   sk     08/16/16 Used UINTPTR instead of u32 for Baseaddress as part of
                      adding 64 bit support. CR# 867425.
                      Changed the prototype of XVtc_CfgInitialize API.
      ms     03/17/17 Added readme.txt file in examples folder for doxygen
                      generation.
8.2     rg     08/12/20 Implemented XVtc_SetAdaptiveSyncMode,
                                    XVtc_DisableAdaptiveSync and
                                    XVtc_SetVfpStretchLimit API's.