WebRadioApp  0.1
ewmain.c File Reference

This file implements a generic framework for running Embedded Wizard generated GUI applications on a dedicated target with or without the usage of an operating system. The module ewmain contains three major functions that are used within every Embedded Wizard GUI application: EwInit() - EwProcess() - EwDone(). These functions represent the lifecycle of the entire GUI application. More...

#include "ewconfig.h"
#include "ewmain.h"
#include "Core.h"
#include "Graphics.h"
#include "ew_bsp_clock.h"
#include "ew_bsp_event.h"
#include "ew_bsp_display.h"
#include "ew_bsp_touch.h"
#include "DeviceDriver.h"
Include dependency graph for ewmain.c:

Macros

#define CHECK_HANDLE(handle)
 

Functions

int EwInit (void)
 EwInit() is responsible to initialize the system, to configure the display, to get access to the desired input devices (like keyboard or touch), to initialize the Embedded Wizard Runtime Environment / Graphics Engine, to create an instance of the application class and to initialize all needed peripheral components. More...
 
void EwDone (void)
 EwDone() is responsible to shutdown the application and to release all used resources. More...
 
int EwProcess (void)
 EwProcess() implements one cycle of the main loop. This function has to be called in an (endless) loop and contains typically the following steps: More...
 
void EwPrintSystemInfo (void)
 This function prints system and configuration information - very helpful in case of any support issues. More...
 
Helper Functions

helper functions used within this module

static void EwUpdate (XViewport *aViewport, CoreRoot aApplication)
 The function EwUpdate performs the screen update of the dirty area. More...
 
static XEnum EwGetKeyCommand (void)
 The function EwGetKeyCommand reads the next key code from the console and translates it into an Embedded Wizard key code. The mapping between the key code from the console and the resulting Embedded Wizard key code can be adapted to the needs of your application. More...
 

Variables

static CoreRoot RootObject
 
static XViewportViewport
 
static XDisplayInfo DisplayInfo
 

Detailed Description

This file implements a generic framework for running Embedded Wizard generated GUI applications on a dedicated target with or without the usage of an operating system. The module ewmain contains three major functions that are used within every Embedded Wizard GUI application: EwInit() - EwProcess() - EwDone(). These functions represent the lifecycle of the entire GUI application.

Author
Kevin Bello (k.bel.nosp@m.lo@t.nosp@m.um.de) EwInit() is responsible to initialize the system, to configure the display, to get access to the desired input devices (like keyboard or touch), to initialize the Embedded Wizard Runtime Environment / Graphics Engine, to create an instance of the application class and to initialize all needed peripheral components.

EwProcess() implements one cycle of the main loop. This function has to be called in an (endless) loop and contains typically the following steps:

  1. Processing data from your device driver(s)
  2. Processing key events
  3. Processing cursor or touch screen events
  4. Processing timers
  5. Processing signals
  6. Updating the screen
  7. Triggering the garbage collection

EwDone() is responsible to shutdown the application and to release all used resources.

Important: Please be aware that every Embedded Wizard GUI application requires the execution in a single GUI task! If you are working with an operating system and your software is using several threads/tasks, please take care to access your GUI application only within the context of your GUI thread/task. Use operating system services to exchange data or events between the GUI thread/task and other worker threads/tasks.

In order to keep this framework independent from the particular GUI application, the application class and the screen size are taken from the generated code. In this manner, it is not necessary to modify this file when creating new GUI applications. Just set the attributes 'ScreenSize' and 'ApplicationClass' of the profile in the Embedded Wizard IDE.

For more information concerning the integration of an Embedded Wizard generated GUI application into your main application, please see https://doc.embedded-wizard.de/main-loop

Version
0.1
Date
2021-04-16