Skip to content

Infineon/mtb-t2g-example-graphics-emptytemplate

Repository files navigation

Graphics Empty Template for graphics middleware

This code example is a minimal starter graphics application template for TRAVEO™ T2G Cluster MCU devices. User can use this template as a base to create their own graphics example with Graphics middleware and display image via TRAVEO™ T2G Virtual Display Tool.

The drivers used or available in this code example are listed below.

Note: The above document are available on the myInfineon Collaboration Platform (MyICP). If not already available, please create a myInfineon account on www.infineon.com. Then, contact traveo@infineon.com and request access to TRAVEO™ T2G myICP.

Requirements

Supported toolchains (make variable 'TOOLCHAIN')

  • GNU Arm® Embedded Compiler v14.2.1 (GCC_ARM) – Default value of TOOLCHAIN

Device

The device used in this code example (CE) is:

Board

The board used for testing is:

Scope of work

In this example, it will provide initialization setting for graphics environment as commonly setting.

Introduction

Graphics Subsystem

The graphics subsystem is designed to fit into the TRAVEO™ T2G Cluster MCU (TVII-C-2D) devices. It connects to the CPU subsystem by an AXI master and slave port, and serves external interfaces for video input and output. This subsystem is a family of graphic cores and subsystems to cope with block image transfer (blit) and drawing operations for 2D graphic acceleration along with the video capture input and display output processing. It is implemented as a set of building blocks with unified concept and standardized interfaces.

Features

  • Graphics core for rendering 2D
    • Image size up to 1600 x 800 pixels
    • All standard blit operations
    • Image scaling and rotation by any angle
    • Perspective correction for 3D effects (2.5D)
    • Compressed source images (lossless or lossy)
    • Accelerator for vector drawing (Bezier curve rasterization)
    • Command sequencer to minimize CPU interaction
    • Can render on-the-fly to display (except vector drawing)
  • Display and composition engines
    • Two independent video output streams (such as cluster and HUD)
    • 220 MHz pixel clock, 2880 x 1080 active pixels, RGB format
    • Five transparent layers in total (alpha blending)
    • 26 windows in total (individual setup and frame buffers)
    • Four independent layer composition streams (safety)
    • One layer can be warped on-the-fly (HUD)
    • One layer can be upscaled on-the-fly
    • Gamma correction and dithering
    • CRC check on eight regions per display (safety)
  • Capture engine for one video input stream
    • 220 MHz pixel clock, 2880 x 1080 active pixels (See device datasheet for the formats supported)
    • Frame rate conversion via ring buffer in video RAM
    • Downscaling (only if display does not upscale)
    • Feed-through on-the-fly to display with graphics overlay
  • Video I/O interfaces (with maximum supported pixel clock frequencies)
    • Two FPD-link outputs (110 MHz) or 1 dual-channel output (220 MHz)
    • Two TTL outputs 24 bpp parallel (80 MHz) One TTL input 24 bpp parallel (80 MHz) or 8-/10-bit ITU 656 (40 MHz)
    • One MIPI CSI-2 input, maximum four lanes(220 MHz)
  • JPEG decoder
    • JPEG image decompression from source to destination buffer in memory
    • Sequential 8-bit per sample Huffman decoding
    • Color formats YUV, gray scale, and RGB
    • YUV sub-sampling formats 4:4:4, 4:2:2, 4:2:0, and 4:1:1
    • Any image size between 1×1 and 16384×16384 pixels
    • Video performance up to 2880×1080 at 60 Hz
    • Packed destination buffers for YUV 4:4:4, gray, and RGB (8 and 24 bpp)
    • Semi-planar destination buffers for YUV 4:2:2, 4:1:1, and 4:2:0 (8 and 16 bpp)
    • Chroma up-conversion to 4:4:4 for all formats by sample replication

More details can be found in:

Hardware setup

This CE has been developed for:

Figure 1. KIT_T2G_C-2D-6M_LITE (Top View)


No changes are required from the board's default settings.

Figure 1B. KIT_T2G_C-2D-4M_LITE (Top View)


No changes are required from the board's default settings.

Implementation

This code example is a minimal starter graphics application template for TRAVEO™ T2G Cluster MCU devices. User can use this template as a base to create their own graphics example with Graphics middleware and display image via TRAVEO™ T2G Virtual Display Tool. In this code example it will provide initialization setting for graphics environment as commonly setting.

Initialize Graphics Environment

Initialization of the Graphics environment with most commonly used settings and called in function Cy_GfxEnv_FastInit().

  • Calling Cy_GfxEnv_Init() to Initialize the environment of graphics.The parameters are setting by stcGfxEnvCfg which is structure cy_gfxenv_stc_cfg_t and this seting parameters can be found in the file cy_gfx_env.c.The initialization configuration structure for the GFX environment can be found in the file cy_gfx_env.h.

Enable Graphics Subsystem Power Switch

Enable the Graphics Subsystem Power Switch by function Cy_PD_Enable().

Configure Graphics Interrupt

The configuration of the graphics interrupt is called in function ConfigureVideoSSInterrupt().

  • First, calling the function Cy_SysInt_Init to initializes the referenced interrupt by setting the priority and the interrupt vector.
  • Then, call NVIC_ClearPendingIRQ to clear the pending interrupt.
  • Finally, call NVIC_EnableIRQ to enable the interrupt.

Note

  • ResourceGenerator

    • The empty template is included the tool ResourceGenerator, the tool can be found in the file \graphics_support\08_tool.
      • The ResourceGenerator is an image conversion command line tool that can read a png file and convert it into a uint8 data array.
  • Usage for ResourceGenerator

    • The basic syntax for the usage of the ResourceGenerator is given below

      *ResourceGenerator.exe <srcFilename.png> [srcFilename2.png srcFilename3.png ...] [options ...]*
      

The ResourceGenerator tool is provided as is. It is not officially supported.

More information please check readme.txt it can be found in file graphics_support\08_tool\basic_graphics\bin\windows.

Run and Test

This code example only runs the commonly seting for initialization of graphics environment.

Note: You need to download TRAVEO™ T2G Virtual Display Tool in advance. Because graphics example uses the FX3 controller to display.

After code compilation, perform the following steps to flashing the device:

  1. Connect the board to your PC using the provided USB cable through the KitProg3 USB connector.
  2. Program the board using one of the following:
    • Select the code example project in the Project Explorer.
    • In the Quick Panel, scroll down, and click [Project Name] Program (KitProg3_MiniProg4).
  3. After programming, the code example starts automatically the User LED1 blinking.
  • You can debug the example to step through the code. In the IDE, use the [Project Name] Debug (KitProg3_MiniProg4) configuration in the Quick Panel. For details, see the "Program and debug" section in the Eclipse IDE for ModusToolbox™ software user guide.

References

Relevant Application notes are:

  • AN235305 - Getting started with TRAVEO™ T2G family MCUs in ModusToolbox™

ModusToolbox™ is available online:

ModusToolbox™ Graphics middleware is available online:

Associated TRAVEO™ T2G MCUs can be found on:

More code examples can be found on the GIT repository:

For additional trainings, visit our webpage:

For questions and support, use the TRAVEO™ T2G T2G Forum: