Setting Orientation External Controller - mchpgfx/legato.docs GitHub Wiki
Setting Orientation for External Display Controller Driver
Set orientation for UI design on LCC Display Driver. Start by launching MPLABX IDE, launch a quickstart Harmony v3 project, launch MHC, launch composer, configure orientation properties, generate, and build and program.
The quickstart application we will use is release for 270 orientation. This guide will transition the application to 90 degree.
Launch MPLABX
Launch MPLABX on your development PC.
Load Quickstart into Workspace
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 initialization for the Memory Access Control register. ILI9488 supports:
| --- | --- |
Orientation | 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 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.
Note: The backgroundPanel widget size should be modified as illustrated:
Generate Harmony3 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 workspace.
Under Project menu, select Rebuild All.
Program Quickstart
Select Run Main Project. This button will build, program, and run the application.
Summary
In this guide, you learned to set a 90 degree orientaion for a external based design. You started with a 270 degree orientation project, configured it for 90 degree orientation and repositioned the widgets, generate, build and program your project.
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