en.radzio.dxp.pl

STemWin
STemWin library is customized version of Segger emWin library dedicated for use only with STMicroelectronics STM32 microcontrollers. Library is distributed in binary form for most popular compilers (Keil/ARM, IAR and GCC). Library can be used with any STM32 microcontroller and is not limited onluyfor F429/439 series, but with this MCUs can achieve highest performance. Library can be downloaded form ST website.

STemWin directory content:

STemWin

Config directory content:

STemWin

Lib directory content:

STemWin

Due to STemWin flash usage any serious application that use this library exceeds 32kB of Flash memory, so we can't use demo version of Keil uVision. I'm using Eclipse IDE with bleeding-edge-toolchain. Project is based on stm32f4_blink_led (with some modifications for using with STM32F429) by Freddie Chopin.

Eclipse project tree :

STemWin

Required modifications in Freddie's makefile :

STemWin

LCDConf.c
In this file user must define configuration of LCD driver. Most important parameters are :

Display size in pixels.

//
// Physical display size
//

#define XSIZE_PHYS 640
#define YSIZE_PHYS 480

Type of color conversion :

//
// Color conversion
//

#define COLOR_CONVERSION GUICC_M565

display driver :

//
// Display driver
//

#define DISPLAY_DRIVER GUIDRV_LIN_16

For memory frame buffer proper driver is GUIDRV_LIN.

And most important - location of frame buffer in memory space (start address of SDRAM) :

#ifndef VRAM_ADDR
  #define VRAM_ADDR 0xD0000000 // TBD by customer: This has to be the frame buffer start address
#endif

GUIConf.c
In GUIConf.c file only thing do define is size of memory buffer available for GUI (but not frame buffer, just operational memory).

//
// Define the available number of bytes available for the GUI
//

#define GUI_NUMBYTES (48*1024)

Source code of main function :

int main(void)
{
  RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN | RCC_AHB1ENR_GPIOBEN | RCC_AHB1ENR_GPIOCEN |
                  RCC_AHB1ENR_GPIODEN | RCC_AHB1ENR_GPIOEEN | RCC_AHB1ENR_GPIOFEN |
                  RCC_AHB1ENR_GPIOGEN;

  /* REQUIRED for STemWin */
  RCC->AHB1ENR |= RCC_AHB1ENR_CRCEN;
  /* SDRAM initialization */
  SDRAM_Init();
  /* LTDC initialization */
  TFTLCD_Init();
  /* GUI initialization */
  GUI_Init();
  /* Set color */
  GUI_SetColor(GUI_RED);
  /* Display text */
  GUI_DispStringAt("Hello world!", 8, 8);
  /* Set color */
  GUI_SetColor(GUI_BLUE);
  /* Display text */
  GUI_DispStringAt("Hello world!", 8, 16);
  /* Set color */
  GUI_SetColor(GUI_GREEN);
  /* Display text */
  GUI_DispStringAt("Hello world!", 8, 24);
  /* Set color */
  GUI_SetColor(GUI_CYAN);
  /* Display text */
  GUI_DispStringAt("http://en.radzio.dxp.pl/", 8, 32);
  /* Endless loop */
  while(1);
}

Download
  STemWinTest.zip

 

 

 

 

 
(c) Radosław Kwiecień