Sunday, March 1, 2020

Getting Started with emWin using Code::Blocks

Hello Everyone, In this blog post, I will show how to use the emWin simulation using CodeBlocks.
emWin is a professional embedded GUI. emWin enables the creation of highly efficient, and high-quality graphical user interfaces on any embedded system. emWin empowers even resource-constrained microcontroller-based systems to run stunning interactive interfaces. emWin is independent of any target, and display.
* Create stunning graphics with a powerful and easy to use API.
* Use any display and any microcontroller.
* Use any ANSI C/C++ development environment.
* Experience the reliability of a proven graphics solution.
* Embedded graphical user interface solution.

emWin license is very costly, but they are offering a free simulation version, which is good for learning emWin framework purposes. Apart from this, we will be using the STM32F769i-DISCO board for the real demonstration of the emWin framework. And we should thank the ST and Segger partnership because they are offering a compiled library version of the emWin library for ST microcontrollers known as STemWin. So, in any case, we don't have to spend money on the license cost for emWin.
To get started we need to have emWin simulation and CodeBlocks, as a first step download the emWin simulation package from the following link.
emWin Simulation Package.
And next, we have to download the CodeBlocks for windows along with the compiler, there is a lot of version of CodeBlocks but we will use the one which is having the C/C++ (MinGW) compiler, and I will use the non-setup version, as I don't want to install any software. CodeBlock can be downloaded by clicking on the following link.
The emWin sample project contains Visual Studio project files and CodeBlocks project files, we aren't using Visual Studio project file and will use only CodeBlocks, so, we have to open the *.cbp format file.
After running the sample project, we will get the following output, this is the sample project from Segger emWin, which demonstrates all the Segger products on this virtual screen.
emWin sample demo project
This project is a little complex to start, as a starting point, we will remove all the project files from the "Application" folder and a new file with a simple code to just display some text on multi-line on this display, as shown on the image below.
Simple Program to display text
The following program is used to display some simple text of the display.

Have a look at this video, to see the above steps.
Now as a next step, we will use some other APIs to display decimal values and change the text color and background color. The following program demonstrates the usage of these APIs.
The following figure shows the output of the simulator.
Display Decimal Value with different color


No comments:

Post a Comment