MPLAB® Harmony Graphics Suite > Advanced Topics > Porting Aria Applications to Legato
MPLAB® Harmony Graphics Suite
Porting Aria Applications to Legato

Microchip Harmony Graphics Suite Legato graphics library is a result of an on going effort to make graphics applications and development more easy to use and high performance.. 

When porting Aria-related code to Legato library, application developers should be aware that the graphics development infrastructure has undergone considerable changes in Legato. 

The table below details items to consider and the impact they have when porting an application using the Aria graphics library to the Legato graphics library. 

 

Project Graph Component Changes

 

There are a few changes in MHC that affect the Aria applications. These are: 

 

Aria 
Legato 
Discussion 
Aria Graphics Library component 
Legato Graphics Library component 
The Aria component should be removed from the project graph. Select Legato instead. 
Aria Display Driver components 
LE Display Driver components 
The Aria display driver component should be removed. Select an LE display driver component instead. 
GFX Core Hardware Abstraction Layer component 
GFX Core LE component for display management purposes 
The HAL is no longer needed. The GFX Core LE is enabled on selection of a LE display driver. 

 

Middleware Folder Changes

 

There are a few folder changes which affect Aria applications. These are: 

 

Aria 
Legato 
Discussion 
middleware/aria  
middleware/legato 
The aria folder is not used for Legato applications. All related support files will exist in the legato folder. This includes library and drivers and templates. 

 

Generated GFX File Changes

 

There are a few changes which effect the content of generated files. These are: 

 

Aria 
Legato 
Discussion 
Application specific files are scattered under the config folder in various locations. 
Application specific files are located in the config/<your config>/gfx/legato/generate 
All Legato applications will generate fonts, images, screen and app support files to a single folder named "generate". 
The UI design is hidden in the harmony.prj file 
The UI design is stored in a single zip file named: <your_config>_design.zip. 
This file is selected when invoking Graphics Designer 
LA and la are used as prefixes 
LE and le are used as prefixes 
The prefix LA or la is not used in Legato. Use LE or le prefix items instead. 
no cache used 
,legato_generate_cache.zip 
Faster code generator.
Aria generates all files on every generate. Legato will cache previously generated files that have not been modified. Legato only generates files that have been modified or new. 

 

Generated Harmony File Changes

 

There are a few changes to the content of generated files that should be noted. These are: 

 

Aria 
Legato 
Discussion 
In definitions.h
#include "gfx/hal/gfx.h
#include "gfx/legato/.generated/le_gen_harmony.h
The Aria HAL is not needed. MHC will generate code to include legato generated harmony files. 
In initialization.c
uses GFX_Initialize(); Implicit call to the driver. 
In initializaiton.c
uses DRV_<name>_Initialize(); Explicit call to the driver. 
An implicit call to the driver is not needed. MHC will generate code to make an explicit driver init call instead.

For example: DRV_LCC_Initialize(); 
In tasks.c
GFX_Update();
Aria_Tasks() 
In task.c
DRV_<name>_Update();
Legato_Tasks(); 
An implicit call to run the driver and library task machines are not needed. MHC will generate code to make an explicit driver and library task call instead.

For example: DRV_LCC_Initialize(); 

 

Driver Interface Changes

 

There are a few changes which effect Aria driver interface. These are: 

 

Aria 
Legato 
Discussion 
Implicit driver calls are used through out the library. Leverages the HAL for hardware abstraction. 
Introduces gfx_driver thin abstraction. The library and driver agree upon a common interface. Drivers can be used in a standalone mode. 
Tight coupling of Aria and driver is not needed. Use loose-coupling gfx_driver instead.

This supports 3rd-Party graphics libraries that want to leverage the harmony device drivers. 
 
 
 

 

Widgets and Screen Changes

 

Widgets and screens have a new declaration and calling mechanism. More facilities for speciality in Legato: These are: 

 

Aria 
Legato 
Discussion 
Widgets have a header with static functions definitions. 
Widgets have a header with extensible virtual function definitions 
Aria's static function implementation is limited. Legato's virtual function notation allows for functionality extensibility without requiring a API change. 
laWidget_SetVisible((laWidget*)aButton, LA_FALSE) 
aButton->fn->setVisible(aButton, LE_FALSE); 
When porting to Legato, note that same functionality is called differently.
 
str = laString_CreateFromID(string_FileNotFound2);
laLabelWidget_SetText(aLabel, str); 
aLabel->fn->setString(aLabel, (leString*)&ts_FileNotFound1); 
When porting to Legato, note that same functionality is called differently. 
laProgressBarWidget_SetValue(aProgressBar, 0); 
aProgressBar->fn->setValue(aProgressBar, 0); 
When porting to Legato, note that same functionality is called differently. 
UI screens are managed by the Aria library, 
UI screens are managed by either Legato library or application. 
UI screens have default Legato library management. Legato provides extensibility by allowing redefinition in the application code. 

 

 

Memory Use Changes

 

Memory use was found to be problematic in Aria during heavy heap usage and debugging. Legato addresses heap allocation and dynamic memory as follows: 

 

Aria 
Legato 
Discussion 
Extensive use of heap memory. Dynamic allocation of memory is employed over static allocation. 
Extensive use of staic memory. Static allocation of memory is employed over dynamic allocation. 
Static allocation provides more manageability of memory use, runtime protection and debugging.
 
Requires a minimum of 4096 bytes. 
Requires a heap space minimum of 512 bytes 
Uses scratch buffers and static library managed memory pools. 
Dynamic Widget creation from heap 
Dynamic Widget creation from static memory pool 
Widgets are transient. They are created and deleted as new screens are rendered. 
Topics
Name 
Description 
Legato graphics library of the MPLAB Harmony Graphics Suite brings in some changes to the way applications are developed. This topic is ports an Aria quickstart application Legato.

For step-by-step instructions on porting applications from Aria to Legato, refer to Porting aria_quickstart_mzef_cu_wqvga to Legato 
MPLAB® Harmony Graphics Suite