Miosix GUI library

1.00

Introduction

Mxgui is a lightweight and configurable GUI library for 32bit microcontrollers. It can drive monochrome and color displays using microcontrollers with limited amounts of RAM memory and that cannot in general perform double buffering because of that. Its target are microcontroller down to 32KB of FLASH and 8KB of RAM memory.

It is designed to work together with the Miosix kernel, which provide a threadsafe C and C++ standard library as well as posix threads.

Library design

The library is divided in two "levels", named Mxgui level 1 and Mxgui level 2, to address embedded systems with different level of complexity.

Mxgui tools

The library comprehends a set of tools designed to run on a Linux host PC to aid in the design of graphical user interfaces for embedded systems, namely

Getting started

The mxgui library depends on the Miosix kernel, so you should start by downloading the kernel before. You can find it at http://gitorious.org/miosix-kernel . If this is the first time you are downloading Miosix, you need to install the Miosix specific compiler, you can find a guide to do so here: http://www.webalice.it/fede.tft/miosix/miosix_toolchain_1.54_linux.html . Once you have downloaded the Miosix kernel, download the mxgui library in the miosix-kernel directory. A simple way to download both Miosix and mxgui is to use git, like this:

git clone git://gitorious.org/miosix-kernel/miosix-kernel.git
cd miosix-kernel # To download mxgui within the miosix-kernel folder
git clone git://gitorious.org/miosix-kernel/mxgui.git

The miosix-kernel folder is from now named the 'top level directory' of your project.

Now you need to edit the Makefile in the top level directory to tell Miosix that it needs to compile the mxgui library. To do so locate the SUBDIRS variable and append the "mxgui" string, like this:

##
## List here subdirectories which contains makefiles
##
SUBDIRS := miosix mxgui

Also change the SRC variable by replacing testsuite.cpp with main.cpp

Lastly, replace the content of main.cpp with this code:

#include "mxgui/entry.h"
#include "mxgui/display.h"

using namespace mxgui;

ENTRY()
{
    Display& display=Display::instance();
    {
        DrawingContext dc(display);
        dc.write(Point(0,0),"Hello world!");
    }
    for(;;) ; //To prevent application shutdown
}

If you don't have a board such as an stm3210e-eval to test the code, you can test it in the Mxgui simulator.

Examples

Examples on how to use the library are available in the mxgui/examples folder. The range from a simple hello world to a 3D rendering engine. To try the examples, copy the corresponding directory in the top level directory, and edit the Makefile (or CMakeLists.txt if targeting the simulator) accordingly.

Author:
Terraneo Federico