tpg
Xilinx Vitis Drivers API Documentation
tpg Documentation

This header file contains identifiers and register-level driver functions (or macros) that can be used to access the Xilinx Test Pattern Generator (TPG) core instance.The TPG core provides a wide variety of tests patterns enabling you to debug and assess video system color, quality, edge, and motion performance.

The Test Pattern Generator core produces the following patterns in RGB, YCbCr 444, or YCbCr 422 video format.

  • Video input pass through
  • Horizontal ramp
  • Vertical ramp
  • Temporal ramp
  • Flat fields (red, green, blue, black and white)
  • Combined vertical and horizontal ramp
  • Color bars
  • Tartan bars
  • Zone plate
  • Cross hairs
  • Cross hatch
  • Solid box
  • Motion effect for ramps, zone plate, and solid box

Initialization & Configuration

The device driver enables higher layer software (e.g., an application) to communicate to the TPG core.

XTpg_CfgInitialize() API is used to initialize the TPG core. The user needs to first call the XTpg_LookupConfig() API which returns the Configuration structure pointer which is passed as a parameter to the XTpg_CfgInitialize() API.

Interrupts

The driver provides an interrupt handler XTpg_IntrHandler for handling the interrupt from the TPG core. The users of this driver have to register this handler with the interrupt system and provide the callback functions by using XTpg_SetCallBack API.

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 XTpg driver is composed of several source files. This allows the user to build and link only those parts of the driver that are necessary.

MODIFICATION HISTORY:
Ver   Who    Date     Changes


1.00a se 10/01/12 Initial creation. 2.0a se 02/12/14 Cleaned up comments, updated masks and registers. 2.0 adk 19/12/13 Updated as per the New Tcl API's. 3.0 adk 02/19/14 Changed the file name from "tpg.h" to "xtpg.h" Register offsets, TPG_In32, TPG_In32, TPG_ReadReg, TPG_WriteReg and bit definitions of tpg.h file were moved to xtpg_hw.h file.

                      Removed the following bit definitions :
                      TPG_CTL_CS_MASK.
                      Defined the following handler types as enum values:
                      XTPG_HANDLER_PROCSTART ,XTPG_HANDLER_FRAMEDONE and
                      XTPG_HANDLER_ERROR.
                      Defined the following enums:
                      XTpg_BackgroundPattern, XTpg_ComponentMask and
                      XTpg_BayerPhaseCombination.
                      Defined the following range macros
                      XTPG_MOTION_SPEED_MIN, XTPG_MOTION_SPEED_MAX,
                      XTPG_VSIZE_FIRST, XTPG_VSIZE_LAST, XTPG_HSIZE_FIRST,
                      XTPG_HSIZE_LAST.
                      Added the following function macros:
                      XTpg_Enable, XTpg_Disable, XTpg_Start, XTpg_Stop,
                      XTpg_RegUpdateEnable, XTpg_RegUpdateDisable,
                      XTpg_Reset, XTpg_SyncReset, XTpg_IntrEnable,
                      XTpg_IntrDisable, XTpg_StatusGetPending,
                      XTpg_IntrGetPending, XTpg_IntrClear.
                      Removed following function macros:
                      TPG_Enable, TPG_Disable, TPG_RegUpdateEnable,
                      TPG_RegUpdateDisable, TPG_Reset, TPG_FSyncReset
                      TPG_ClearStatus, TPG_ClearReset.
                      Added the following structures
                      XTpg and XTpg_Config.
                      Implemented XTpg_LookupConfig in xtpg_sinit.c
                      Implemented XTpg_SelfTest in xtpg_selftest.c
                      Implemented XTpg_IntrHandler, XTpg_SetCallBack in
                      xtpg_intr.c.
                      Added the register offsets and bit masks for the
                      registers and added backward compatibility for
                      macros.in xtpg_hw.h.
                      Modification history from xtpg.c file:
                      Changed the file name form "tpg.c" to "xtpg.c".
                      Implemented the following functions:
                      XTpg_CfgInitialize, XTpg_Setup, XTpg_GetVersion,
                      XTpg_SetActiveSize, XTpg_GetActiveSize,
                      XTpg_SetBackground, XTpg_GetBackground,
                      XTpg_EnableCrossHair, XTpg_DisableCrossHair,
                      XTpg_EnableBox, XTpg_DisableBox, XTpg_SetComponentMask,
                      XTpg_GetComponentMask, XTpg_EnableStuckPixel,
                      XTpg_DisableStuckPixel, XTPg_EnableNoise,
                      XTPg_DisableNoise, XTpg_EnableMotion,
                      XTpg_DisableMotion, XTpg_SetMotionSpeed,
                      XTpg_GetMotionSpeed, XTpg_SetCrosshairPosition,
                      XTpg_GetCrosshairPosition, XTpg_SetZPlateHStart,
                      XTpg_GetZPlateHStart, XTpg_SetZPlateHSpeed,
                      XTpg_GetZPlateHSpeed, XTpg_SetZPlateVStart,
                      XTpg_GetZPlateVStart, XTpg_SetZPlateVSpeed,
                      XTpg_GetZPlateVSpeed, XTpg_SetBoxSize, XTpg_GetBoxSize,
                      XTpg_SetBoxColor, XTpg_GetBoxColor,
                      XTpg_SetStuckPixelThreshold,
                      XTpg_GetStuckPixelThreshold, XTpg_SetNoiseGain,
                      XTpg_GetNoiseGain, XTpg_SetBayerPhase,
                      XTpg_GetBayerPhase, XTpg_SetPattern, XTpg_GetPattern.
      ms     03/17/17 Added readme.txt file in examples folder for doxygen
                      generation.
      ms     04/10/17 Modified filename tag in examples to include them in
                      doxygen examples.
3.1   ms     05/22/17 Updated the parameter naming from
                      XPAR_TPG_NUM_INSTANCES to XPAR_XTPG_NUM_INSTANCES
                      to avoid  compilation failure as the tools are
                      generating XPAR_XTPG_NUM_INSTANCES in the xtpg_g.c
                      for fixing MISRA-C files.