Changing UI Orientation - mchpgfx/legato.docs GitHub Wiki
Changing UI Orientation
Changing UI Orientation is the starting point for learning to produce a Microchip Harmony Graphics Suite UI design at 0, 90, 180 or 270 degrees. The default orientation for many designs is the physical hardware orientation of the display as manufactored.
The UI orientation does not always have to represent the physical orientation of the display. For example, the UI orientation of a portrait hardware display will have a short width and longer height. The UI orientation of a landscape hardware display will have a longer width and a shorter height. It is possible to change UI rendering to support an orientation that does not match the physical hardware. This guide will help to illustrate the required changes.
Orientation setting is configured through MHC and the Graphics Composer utilities, and is ultimately controlled by the Legato library and/or specific display controllers. No coding is required to configure the UI orientation for Microchip supported hardware.
Software Method
Orientation for LCC, LCDC and GLCD integrated controllers is only managed in software through the Legato library. The settings are configured via the Graphics Composer.
Hardware Method
Orientation for an external controller can be managed in hardware through the settings in the MHC LE External Controller component. If no hardware facilities are used, the orientation management fallback is the software method above.
Changes to orientation are not dynamic. These changes are set at initialization and are not runtime accessible.
MHC - Microchip Harmony Configurator
MHC, the primary tool used to configure a Harmony project, provides components and tools to configure the display configuration. These are:
- GFX Core LE Component
- Graphics Composer UI Designer
- LE External Controller Component
GFX Core LE
The GFX Core LE component, located in the project graph, contains Display Settings. These settings define the physical layout of the display and its orientation; it is the factory setting of the display. Note: Do not change display settings when configuring UI orientation.
The following image illustrates a physical display of size 480x272 with default orientation of 0 degrees. This is considered a landscape WQVGA display.
Graphics Composer (Software Method)
MGS Harmony Composer provides software orientation support for UI designs using display drivers that have no orientation support. For example, the LCC, GLCD and LCDC integrated controllers have no orientation support. Therefore, orientation changes are accomplished using Graphics Composer.
Graphics Composer also supports changing the touch input orientation. As the UI changes, the touch would also need to be aligned to respond to touch events.
To set orientation via graphics composer you will launch graphics composer.
All settings can be found under Project->Project Settings menu option. You will use will the Library Settings and Display Settings options.
LE External Controller Component (Hardware Method)
LE External Controller component contain configuration settings for a variety of display drivers. This component supports orientation for ILI9488 and SSD1963 display controllers. Configuring orientation all supported controllers are detailed in the how-to guides below.
To set orientation via an LE display driver component. Click the LE Display Driver Component. For example, the image below illustrates the Configuration Options for ILI9488 External Controller Component.
For specific controller configuration see the How-To guides below.
How-To Guides
The guides below demonstrate orientation configuration by leveraging an existing released application to illustrate how to change orientation.
- LCC Display Driver - 90 degree orientation (Software Method)
- GLCD Display Driver - 90 degree orientation (Software Method))
- External Controller (ILI9488) - 270 degree orientation (Hardware Method)
If you are new to MPLAB® Harmony, you should probably start with these tutorials:
- MPLAB® Harmony v3 software framework
- MPLAB® Harmony v3 Configurator Overview
- Create a New MPLAB® Harmony v3 Project
Is this page helpful? Send feedback