Tutorial: Integrate an emWin Application with the redBlocks Simulator (Step 1)

It is best to start with a C based redBlocks example application. Therefore, start the redBlocks Workbench and select the following menu item "File -> New -> Project". In the "New Project" Dialog select "redBlocks Project" and continue to the next step. Leave the path to the redBlocks library unmodified in step 2 of the wizard and continue to the third step. There you need to specify an appropriate "Project name" (e.g. "emWin_Demo") and select the "Project type" "HelloWorldC" before continuing to step 4 of the wizard. Do not modify the preset values there and finish the project creation wizard.

Now you have created an example application that has the same functionality as developed during the tutorial "Building a HelloWorld Application", but uses the C Simulation API according to the concepts described here.

During the next steps we will replace the code of this example with the Washing Machine Example, you can download from the Segger emWin Samples Page. You may klick here to directly download the sources from the Segger server. Please unpack the sources to directory "emWin_Demo/src/WashingMachine" (assuming you named your project "emWin_Demo").

Now open the file "emWin_Demo/sources" and add the following lines to the INCLUDE_DIRS variable (ATTENTION: Make sure that the line above your additional  lines ends with a \):

INCLUDE_DIRS = \
 ...
 $(REL_REDBLOCKS_SRC_DIR)/third_party/emWin/inc \
 $(REL_REDBLOCKS_SRC_DIR)/third_party/emWin/Config

This is necessary, in order to tell the compiler, where the emWin header files are located.

Now we must make the linker include the emWin library and tell it where it is located. This is done by the following assignment in "emWin_Demo/Makefile":

LINKER_FLAGS += -lemWin -L$(REL_REDBLOCKS_SRC_DIR)/third_party/emWin

During the next step in this tutorial we will configure a display with touch functionality within the redBlocks Simulator, i.e. we will create the graphical frontend for our SiL environment that replaces the real hardware.