Graphics Demonstrations
Total Page:16
File Type:pdf, Size:1020Kb
Graphics Demonstrations MPLAB Harmony Integrated Software Framework Copyright (c) 2013-2017 Microchip Technology Inc. All rights reserved. Graphics Demonstrations Graphics Demonstrations This section provides descriptions of the Graphics demonstrations. MPLAB Harmony is available for download from the Microchip website by visiting: http://www.microchip.com/mplabharmony. Once you are on the site, click the Downloads tab to access the appropriate download for your operating system. For additional information on this demonstration, refer to the “Applications Help” section in the MPLAB Harmony Help. Description © 2013-2018 Microchip Technology Inc. MPLAB Harmony v2.05.01 2 Graphics Demonstrations Introduction Introduction Graphics Library Demonstrations Applications Help Description This distribution package contains a variety of Graphics-related firmware projects that demonstrate the capabilities of the MPLAB Harmony Graphics library. This help file describes the hardware requirement and procedures to run these firmware projects on Microchip graphics boards. This help file contains instructions and associated information about MPLAB Harmony Graphics Demonstration applications, which are contained in the MPLAB Harmony Library distribution. Prior to using this demonstration, it is recommended to review the MPLAB Harmony Release Notes for any known issues. A PDF copy of the release notes is provided in the <install-dir>/doc folder of your installation. To know more about MPLAB Harmony Graphics, configuring the library and the APIs provided; refer to the Graphics Library documentation. © 2013-2018 Microchip Technology Inc. MPLAB Harmony v2.05.01 3 Graphics Demonstrations Demonstrations aria_basic_motion Demonstrations This topic provides information on how to run the Graphics Library demonstration applications included in this release. aria_basic_motion This application demonstrates the use of double-buffered frame buffers in internal SRAM through the use of a global palette look-up table that reduces frame buffers to just one byte per pixel for the LCC driver. In addition, basic motion through the use of the Graphic Suite's ImageSequenceWidget is demonstrated. Description This application demonstrates basic motion through the use of Graphics Suite’s ImageSequenceWidget. The demonstration spins a set of 3D images and cycles through a set of battery level image presentations. The demonstration also shows the use of a 480x272x1 (8-bit) frame buffer, in a double buffered configuration, using a 256 custom generated color palette created from colors obtained from the User Interface (UI) designer-based graphic image assets. The demonstration illustrates that two buffers (261 KB total) of internal SRAM is sufficient to produce appealing, low-memory use applications. The following key features of this demonstration application include: • Using motion to show double buffering • Double buffering in internal SRAM • New tool that generates a global palette, so that this can be an easy process without apparent color loss in many graphic schemes Architecture The following figure shows the various software and hardware components used by this application. The aria_basic_motion application uses the MPLAB Harmony Graphics Library to render graphics to the display. The Graphics Library draws the widgets and images as 8-bit indices to an 8-bit frame buffer, which is stored in the internal SRAM of the PIC32 device. Using the DMA, the Low-Cost Controllerless (LCC) Display Driver continuously transfers the frame data to the LCD display. During display refresh, the LCC driver performs a 16-bit color lookup using the indices stored in the refreshable framebuffer. The final RGB565 color is derived from a custom palette Color Look-up Table (CLUT). The global palette is created for the entire application. It is created using the new palette generation tool which is capable of extracting colors from existing User Interface (UI) assets to establish a color array specific to the application with no wasted color positions. © 2013-2018 Microchip Technology Inc. MPLAB Harmony v2.05.01 4 Graphics Demonstrations Demonstrations aria_benchmark The application is touch enabled. It features user touch input through the integrated touch screen on the display panel. Touch input from the touch controller goes through the I2C port, and the Touch System Service acquires the touch input information from the Touch and I2C Drivers. The Touch System Service sends touch events to the Graphics Library, which processes these events and updates the frame data accordingly. In addition, the application uses the Timer System Service and core timer manage clock ticks for image motion control. Demonstration Features • 8-bit Custom Palette created using the new palette tool • 2 Framebuffers (double-buffered UI) • Graphic designer image assets • Internal memory – low memory framebuffer footprint 261 KB • LCC CLUT lookup driver – 8-bit index to 16-bit RGB565 color • Graphics Image Sequence Widget Tools Setup • Enable Graphics Stack • Enable Graphics Controller • Low-Cost Controllerless • Framebuffer Mode – Double-Buffer • Select Palette Mode • Enable Global Palette • Use Harmony Graphics Composer tool • Auto-Calculate Global Palette after creating UI elements Building the Application This section identifies the MPLAB X IDE project name and location and lists and describes the available configurations for the Aria Basic Motion demonstration. Description To build this project, you must open the aria_basic_motion.X project in MPLAB X IDE, and then select the desired configuration. The following tables list and describe the project and supported configurations. The parent folder for these files is <install-dir>/apps/gfx/aria_basic_motion. MPLAB X IDE Project This table lists the name and location of the MPLAB X IDE project folder for the demonstration. Project Name Location aria_basic_motion.X <install-dir>/apps/gfx/aria_basic_motion/firmware MPLAB X IDE Project Configurations This table lists and describes the supported configurations of the demonstration, which are located within ./firmware/src/system_config. Project Configuration BSP Used Description Name pic32mz_ef_sk_meb2 pic32mz_ef_sk+meb2 Demonstration for the PIC32MZ EF Starter Kit with the Multimedia Expansion Board II (MEB II). This application may contain custom code that is marked by the comments // START OF CUSTOM CODE ... and // END OF CUSTOM CODE. If you use the MPLAB Harmony Configurator to regenerate the application code, Important! do not remove or replace the custom code. © 2013-2018 Microchip Technology Inc. MPLAB Harmony v2.05.01 5 Graphics Demonstrations Demonstrations aria_benchmark aria_benchmark This application presents frame update rate metrics on the various rendering operations in the Harmony graphics library. Description This application shows the frame update rates for various operations in the MPLAB Harmony Graphics Library, including string rendering, area fills and image decode and rendering. The benchmarks can be configured for different text sizes, number and size of discrete area fills and different image formats. The instantaneous and averaged frame update rates are shown at real-time on the demo. For microcontrollers with a 2D Graphics Processing Unit (GPU) (e.g., PIC32MZ DA), the GPU can be turned on and off at run-time. Architecture The application continuously uses the graphics library to render text, fill areas, and draw images to the screen. Once a layer is completely rendered to, the graphics library increments a layer swap counter. The application periodically (at one second intervals) samples the layer swap counter, and calculates the difference from the previous sample. This difference is shown as the Frame Update Rate (Hz). The following diagrams show the various software and hardware blocks used in this application: pic32mz_da_sk_extddr_meb2 In this configuration, the frame buffer is located in the external DDR and the GLCD display controller continuously fetches the frame buffer data and writes them to the display panel. pic32mz_da_sk_intddr_meb2 In this configuration, the frame buffer is located in the internal DDR and the GLCD display controller continuously fetches the frame buffer data and writes them to the display panel. © 2013-2018 Microchip Technology Inc. MPLAB Harmony v2.05.01 6 Graphics Demonstrations Demonstrations aria_benchmark pic32mz_ef_sk_meb2 In this configuration, the frame buffer is located in the internal SRAM and the Low-Cost Controllerless (LCC) display driver uses the DMA to continuously fetch the frame buffer data and write them to the display panel. © 2013-2018 Microchip Technology Inc. MPLAB Harmony v2.05.01 7 Graphics Demonstrations Demonstrations aria_benchmark pic32mz_da_sk_noddr_meb2 In this configuration, the frame buffer is located in the internal SRAM and the GLCD display controller continuously fetches the frame buffer data and writes them to the display panel. Demonstration Features • Timer hardware and Timer System Service • Text rendering • Rectangle widget motion and fills • Image rendering of various formats (PNG, RAW RLE 16-bit, RAW 16-bit, JPEG 24-bit, RAW 32-bit predecoded in DDR) Tools Setup Differences • Enable “Timer” in “System Services” in MHC • Set the Heap Size by selecting Device & Project Configuration > Project Configuration > XC32(Global Options) > xc32-ld > General and specifying 204800. This is needed to support decoding of large PNG files. © 2013-2018 Microchip Technology Inc. MPLAB Harmony v2.05.01 8 Graphics Demonstrations Demonstrations