SEGGER emWin Audio Player Tutorial: Step 6
Step 6: Configure SEGGER emWin Graphics Library
Step 6.1: Enable the SEGGER emWin Graphics Library
Step 6.2: Enable the SEGGER emWin Touch and GUI Wrappers
Next Step >
1
In MPLAB® Harmony Configurator's (MHC's) Options tab, expand the Third Party Libraries > Graphics selection tree.
2
Check the Use SEGGER emWin Graphics Library? box.
Upon enabling the Graphics Library, MHC will automatically enable the Graphics Display and a Graphics Driver based on the Board Support Package (BSP) selected. For your BSP, MHC has automatically configured the Newhaven 4.3-inch 480x272 (WQVGA) with PCAP display and the Low-Cost Controllerless (LCC) driver.
1
Expand the SEGGER emWin Graphics Library selection.
2
Check the Use SEGGER emWin Touch Wrapper? box. The SEGGER emWin widgets respond to Pointer Input Devices (PID). To do this, the location of the touch needs to be registered (provided) to the SEGGER emWin Graphics Library. The MPLAB Harmony Touch System Service will send a message on the touch event containing the description of the event and the coordinates of the touch input. The messages from the Touch System Service need to be decoded and passed to the SEGGER emWin Graphics Library. The implementation of decoding the touch message and registering the touch input with the SEGGER emWin Graphics Library is provided by the SEGGER emWin Touch Wrapper Library.
3
Expand emWin Touch Wrapper and verify that SYS_MSG_0 is selected for System Message Service Instance. This indicates that the touch wrapper will receive touch messages from the touch system service using a messaging system service instance 0.
4
Check the Use SEGGER emWin GUI Wrapper? box. The GUI Wrapper can be used for integrating the dialog code generated by the emWin GUI Builder utility with MPLAB Harmony. This wrapper also initializes the SEGGER emWin Graphics Library and maintains the state machine of the wrapper. It generates the templates for GUI and LCD configuration files required by the emWin application.
5
Expand emWin GUI Wrapper.
6
Set the Memory Block Size to 10000. This will register a block of 10000 bytes of memory with the SEGGER emWin Graphics Library.
Instead of using malloc() and free(), the internal memory management of emWin Graphics Library uses this block for memory allocation. It is not used as a frame buffer. This memory is primarily used by the mem device in the emWin Graphics Library. This memory block is passed to the GUI_ALLOC_AssignMemory function within the GUIConf.c file. Please note the size is in bytes and must be 8-, 16-, or 32-bit accessible.
7
Retain the Number of Screens at 1 as your application has only one screen. The Number of Screens configuration value is used to define the array size of the dialog creation function (one for each screen). This array is used by the GUI Wrapper to call the appropriate dialog creation function based on the array index.