Setting Orientation External Controller - automaate/gfx.sandbox GitHub Wiki
Setting Orientation for LE External Controller (ILI9488)
Set orientation for a ILI9488 external display controller based design. You’ll start by launching MPLABX IDE, launch a quickstart Harmony v3 project, launch MHC, launch composer, configure orientation properties, generate, and build and program.
You will transition a quickstart application at 0 degree orientation. This guide will transition the application to 90 degree orientation.
Launch MPLABX IDE
Launch MPLABX on your development PC.
Load Quickstart into IDE
Load the quickstart project. You have the option of loading any MPLABX project. In this example we will load
legato_qs_e54_cult_cpro_parallel.X
Under File menu, select Open Project.
In the file dialog, select project .X file. In our example, we will use: legato_qs_e54_cult_cpro_parallel.X.
Launch MHC
This is an external controller based design. For many external controllers orientation is managed by a set of control register commands. These commands are also called flip or rotate. The LE External Controller component supports the sending of orientation commands to the display controller. This project uses an external ILI9488 display controller. You will change the ILI9488 controller initialization for orientation using the Memory Access Control register.
The table below describes the ILI9488 memory access control support for orientation:
Orientation Mode | Memory Access Control Value |
---|---|
Portrait 0 Degree | 0x48 |
Landscape 90 Degree | 0x28 |
Portrait 180 Degree | 0x88 |
Landscape 270 Degree | 0xE8 |
To change the memory access control, launch MHC from MPLABX.
MHC can also be launched in stand-alone mode. Go to MHC folder directory (/<Harmonypath>/mhc/) and double click the runmhc.bat file.
Click the LE External Controller component. Click Configuration Options and expand Initialization Settings. Expand CMD[3] and Number of Parameters. Set PARAM[0] to 0xE8.
Launch Composer
Composer will be used to set the UI display size to landscape. There is no need to change the library settings, otherwise the library will attempt to override the display controller. Composer settings should remain at 0 orientation. The display controller is now responsible for orientation.
Open Project Settings
Open Project Settings Panel. Select Project, click on Project Settings.
Select Display Settings tab. Set width to 480 and height to 320. See illustration:
Select Library Settings tab. Input Orientation to 0 and **Software Rendering Orientation to 0. See illustration:
Rearrange pre-configured graphics UI design
Reposition the existing landscape UI widgets to align to the new portrait orientation. An example is illustrated below:
Note: The backgroundPanel widget size should be modified as illustrated:
Generate Harmony v3 code and project files
Save configuration and generaton project. MHC will generate all required projects files including a skeleton application code. These files are located in the project.
Build Quickstart
Build the quickstart project.
On the MPLABX menu tab, select .
Program Quickstart
Select Run Main Project. This button will build, program, and run the application.
Summary
In this guide, you learned to set 270 degree orientation using the LE External Controller component for an external ILI9488 display controller quickstart project. You started with a 0 degree orientation, configured it for 270 degree orientation and repositioned the widgets. The steps were to launch MPLABX IDE, open an existing quickstart ILI9488 display controller based Harmony v3 project, launch MHC, open Composer and set 270 degree orientation, modify UI design, generate, build and program your project.
Next Step
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