Getting Started With STemWin Library -

2y ago
19 Views
2 Downloads
1.37 MB
46 Pages
Last View : 2m ago
Last Download : 3m ago
Upload by : Julia Hutchens
Transcription

AN4323Application noteGetting started with STemWin LibraryIntroductionA partnership with Segger Microcontroller GmbH & Co. KG enables STMicroelectronics toprovide STemWin Library, a product based on Segger’s emWin graphic library.The STemWin Library is a professional graphical stack library enabling the building up ofgraphical user interfaces (GUIs) with any STM32, LCD/TFT display and LCD/TFT controller,taking advantage of STM32 hardware acceleration whenever possible.The STemWin Library is a comprehensive solution with rich features, such as JPG, GIF andPNG decoding, many widgets (checkboxes, buttons ), and a VNC server. It allows a localdisplay to be displayed remotely, and also professional tools (such as GUIBuilder) to createdialog boxes by a drag and drop font converter.This graphic library is fully integrated inside the STM32Cube firmware packages (such asSTM32CubeF2, STM32CubeF3 and STM32CubeF4). It can be downloaded free from theSTMicroelectronics web site (http://www.st.com/stm32cube)Table 1. Applicable softwareTypeMCUs EmbeddedSoftwareApril 2018Part numbersSTemWin, STM32CubeF0, STM32CubeF1, STM32CubeF2,STM32CubeF3, STM32CubeF4, STM32CubeF7, STM32CubeL1,STM32CubeL4 and STM32CubeH7AN4323 Rev 51/46www.st.com1

ContentsAN4323Contents1General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62Library and package presentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.1Licensing information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.2Library description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.3Package organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.4Delivered binaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93Supported boards and examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124How to use STemWin Library step by step . . . . . . . . . . . . . . . . . . . . . . 144.14.1.1GUIConf.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154.1.2LCDConf.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154.1.3Hardware acceleration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154.1.4GUI X.c or GUI X OS.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174.2GUI initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174.3Core functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174.3.1Image file display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174.3.2Bidirectional text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184.3.3Alpha blending . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184.3.4Sprites and cursors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184.4Memory devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194.5Antialiasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204.6Window Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204.7Widget library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204.8VNC server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214.92/46Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144.8.1Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224.8.2Process description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244.9.1Fonts included in STemWin library . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244.9.2How to add a new font . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274.9.3Language support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33AN4323 Rev 5

AN4323Contents4.105GUIBuilder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374.10.1Basic usage of the GUIBuilder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384.10.2Creation routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384.10.3User-defined code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384.10.4Callback routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384.11Porting GUI on a different resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394.12How to add a new effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394.13How to add a new widget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40Performance and footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415.1LCD driver performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415.2STemWin footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426FAQs (frequently asked questions) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45AN4323 Rev 53/463

List of tablesAN4323List of tablesTable 1.Table 2.Table 3.Table 4.Table 5.Table 6.Table 7.Table 8.Table 9.Table 10.Table 11.4/46Applicable Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Supported LCD controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Supported boards and examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Hardware acceleration API list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Font API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26Speed test list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41Speed test for the FlexColor and Lin drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41Module footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42Widget footprint. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43FAQs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45AN4323 Rev 5

AN4323List of figuresList of figuresFigure 1.Figure 2.Figure 3.Figure 4.Figure 5.Figure 6.Figure 7.Figure 8.Figure 9.Figure 10.Figure 11.Figure 12.Figure 13.Figure 14.Figure 15.Figure 16.Figure 17.Figure 18.Figure 19.Figure 20.Figure 21.Figure 22.Figure 23.Figure 24.Figure 25.STemWin layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Project tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9Structure of the STemWin application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13STemWin initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Alpha blending effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18Animated sprites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18Cursors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Scaling and rotation effect using memdev . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Shape antialiasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20Widget examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21VNC server usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22VNC client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23Font converter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28Type font and encoding option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29font, style and size choice. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29Creation of the font C file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30Disable/Enable font characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31Characters range choice. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31Creation of different texts of the application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33Read pattern file menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34Missing characters codes of the used font . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34Pattern characters enabled. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35Creation of UTF-8 pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36Conversion of the UTF-8 pattern to "C" code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36The GUIBuilder application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38AN4323 Rev 55/465

General information1AN4323General informationThe STemWin supports Arm (a)-based devices.2Library and package presentationThe STemWin Library package includes a set of firmware libraries and software tools usedto build advanced and professional GUI-based applications.2.1Licensing information STemWin Library GUI files are provided in object format and licensed under MCD-STImage Software License Agreement V2 (the “License”); you may not use this packageexcept in compliance with the License. You may obtain a copy of the License at:www.st.com. STemWin Library configuration and header files are provided in source format andlicensed under MCD-ST Liberty Software License Agreement V2 (the “License”); youmay not use this package except in compliance with the License. You may obtain acopy of the License at: www.st.com.Unless required by applicable law or agreed to in writing, software distributed under theLicense is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONSOF ANY KIND, either express or implied. See the License for the specific languagegoverning permissions and limitations under the License.2.2Library descriptionFigure 1 shows how STemWin is structured internally and how it can be implemented in acomplete project.a. Arm is a registered trademark of Arm Limited (or its subsidiaries) in the US and/or elsewhere.6/46AN4323 Rev 5

AN4323Library and package presentationFigure 1. STemWin layers1. The CRC module (in RCC peripheral clock enable register) should be enabled before using the library.STemWin Library includes two optimized drivers: Direct linear access (LIN) driver. This kind of driver is used for example onSTM32F429, STM32F769, STM32H743 and any STM32 based on the LCD TFTDisplay Controller (LTDC) or LTDC/DSI (Display Serial Interface) hardware. FlexColor (indirect access) driver for serial and parallel bus external LCD controllers.Refer to Table 2 for a list of all supported display controllers.Note:It is still possible to support any other LCD type just by implementing its own “custom” driver.In addition to the main application, the user has to set and customize two essential interfacefiles: LCD configuration file (LCDConf.c)–LCD Display initialization and configuration–LCD Display driver link and customizing–Additional hardware capability managementGUI configuration file (GUIConf.c)–GUI managementAN4323 Rev 57/4645

Library and package presentationAN4323Table 2. Supported LCD controllersDriver8/46Supported LCD controllersSupportedbits/pixelsGUIDRV LinThis driver supports every display controller with linearaddressable video memory with a direct (full bus) interface. Thismeans that the video RAM is directly addressable by the address1, 2, 4, 8,lines of the CPU.16, 24, 32The driver contains no controller-specific code. So it can also beused for solutions without display controller which require a driverwhich only manages the video RAM.GUIDRV FlexColorEpson S1D19122FocalTech FT1509Himax HX8353, HX8325A, HX8357, HX8340, HX8347,HX8352A, HX8352B, HX8301Hitachi HD66772Ilitek ILI9320, ILI9325, ILI9328, ILI9335, ILI9338, ILI9340,ILI9341, ILI9342, ILI9163, ILI9481, ILI9486, ILI9488, ILI9220,ILI9221LG Electronics LGDP4531, LGDP4551, GDP452516, 18Novatek NT39122OriseTech SPFD5408, SPFD54124C, SPFD5414DRaio RA8870, RA8875Renesas R61505, R61516, R61526, R61580Samsung S6E63D6, S6D0117Sitronix ST7628, ST7637, ST7687, ST7735, ST7712Solomon SSD1284, SSD1289, SSD1298, SSD1355, SSD2119,SSD1963, SSD1961, SSD1351Syncoam SEPS525AN4323 Rev 5

AN43232.3Library and package presentationPackage organizationFigure 2 shows the project tree.Figure 2. Project tree2.4Delivered binariesSTemWin Library is distributed by ST as an object code library locked to STM32 products.The library is compiled for CM0 and CM3 cores: With and without OS support. With Size optimization Using ABGR and ARGB formatThe library is compiled for CM4 and CM7 cores:Note: With and without OS support. With size and time optimization Using ABGR and ARGB format The FPU is enabled.The library is compiler-dependent (IAR, Arm, GCC).AN4323 Rev 59/4645

Library and package presentationAN4323The library is also compiled for WIN32 simulation Note:Using ABGR and ARGB formatIn the STM32CubeFW relative to a given core, only binary files generated for this core andsimulation one are included in the package.To summarize, 74 binary files are generated and split as follow:For a CMx (CM0 and CM3) core there are 12 binaries:10/46 STemWinXY CMx GCC.a STemWinXY CMx GCC ARGB.a STemWinXY CMx IAR.a STemWinXY CMx IAR ARGB.a STemWinXY CMx Keil.lib STemWinXY CMx Keil ARGB.lib STemWinXY CMx OS GCC.a STemWinXY CMx OS GCC ARGB.a STemWinXY CMx OS IAR.a STemWinXY CMx OS IAR ARGB.a STemWinXY CMx OS Keil.lib STemWinXY CMx OS Keil ARGB.libAN4323 Rev 5

AN4323Library and package presentationFor a CMx (CM4 and CM7) core there are 24 binaries: STemWinXY CMx GCC.a STemWinXY CMx GCC ARGB.a STemWinXY CMx GCC ot.a STemWinXY CMx GCC ot ARGB.a STemWinXY CMx IAR.a STemWinXY CMx IAR ARGB.a STemWinXY CMx IAR ot.a STemWinXY CMx IAR ot ARGB.a STemWinXY CMx Keil.lib STemWinXY CMx Keil ARGB.lib STemWinXY CMx Keil ot.lib STemWinXY CMx Keil ot ARGB.lib STemWinXY CMx OS GCC.a STemWinXY CMx OS GCC ARGB.a STemWinXY CMx OS GCC ot.a STemWinXY CMx OS GCC ot ARGB.a STemWinXY CMx OS IAR.a STemWinXY CMx OS IAR ARGB.a STemWinXY CMx OS IAR ot.a STemWinXY CMx OS IAR ot ARGB.a STemWinXY CMx OS Keil.lib STemWinXY CMx OS Keil ARGB.lib STemWinXY CMx OS Keil ot.lib STemWinXY CMx OS Keil ot ARGB.libThen user add the simulation binaries: STemWinXY WIN32.lib STemWinXY WIN32 ARGB.libAN4323 Rev 511/4645

Supported boards and examples3AN4323Supported boards and examplesTable 3 lists the supported boards and examples.Table 3. Supported boards and examplesSTM32 Series/boardLCD interfaceLCD lorFigure 3 shows the architecture of a given STemWin application.12/46FlexColorAN4323 Rev 5

AN4323Supported boards and examplesFigure 3. Structure of the STemWin applicationThe “Target” folder contains the two interface files described in Section 2.2: GUIConf.c/.h LCDConf.c/.hA STemWin application can be built using or not an OS. On the application architecturepresented above it’s a non OS case.AN4323 Rev 513/4645

How to use STemWin Library step by step4AN4323How to use STemWin Library step by stepThis section provides an overview of the main features of STemWin Library, as well as themain settings and configuration steps. For further details, refer to the Segger’s emWin UserManual.4.1ConfigurationThe configuration is basically divided into two parts: GUI configuration and LCDconfiguration. The GUI configuration covers the configuration of default colors and fonts and ofavailable memory. The LCD configuration is more hardware-dependent and enables the user to define thedifferent graphical parameters, the display driver, the color conversion routines to beused and the drawing accelerated function if the STM32 support Chrom-ART.When a new LCD controller needs to be supported, two essential files must becreated/modified: GUIConf.c and LCDConf.c.The stack initialization done by calling “GUI Init()” function is based on these 2 files asshown in Figure 4.Figure 4. STemWin initialization14/46AN4323 Rev 5

AN43234.1.1How to use STemWin Library step by stepGUIConf.cIn this file, the user should implement the GUI X Config() function which is the very firstroutine called during the initialization process. Its main task is to set up the availablememory for the GUI and to then assign it to the dynamic memory management system.This operation is done via the GUI ALLOC AssignMemory() function: it passes a pointer toa memory block and its size (in bytes) to the memory manager.Note:The memory must be accessible and must be 8-, 16- and 32-bit wide. Memory access ischecked during initialization.4.1.2LCDConf.cThe main function here is LCD X Config(), called immediately after GUI X Config() hasbeen executed. LCD X Config() allows creating and configuring a display driver for eachlayer by calling: GUI DEVICE CreateAndLink(), which creates the driver device and links it to thedevice chain; LCD SetSizeEx() and LCD SetVSizeEx(), to set the display size configuration; Other driver-specific configuration routines such as:–GUIDRV FlexColor Config(), in association with the usage of the FlexColordriver;–LCD SetVRAMAddrEx(), required in case of linear addressable memory.As mentioned in Section 2.2, STemWin Library comes with two optimized drivers,GUIDRV Lin and GUIDRV FlexColor, which cover all the LCDs embedded in ST EVALboards.For more details about usage of these drivers, please visit Segger’s website:http://www.segger.comIn general, when a new LCD type needs to be supported, the user should check if the sameLCD controller is already supported, then he just has to update the already existingLCDConf.c.Another function, LCD X DisplayDriver(), is called by the display driver for severalpurposes, for example when using advanced features like multiple buffers, smooth scrollingor virtual pages. To support the corresponding task, the routine needs to be adapted to thedisplay controller.If the used display controller is not supported, user can easily create his own driver just byadapting the GUIDRV Template.c file located under the CubeFW on this path“Middlewares\ST\STemWin\Config”.Actually this template file contains the complete functionality needed for a display driver.The main routines that need to be adapted are SetPixelIndex() and GetPixelIndex(). If thedisplay is not readable, a display data cache should be implemented instead of using theGetPixelIndex() function.4.1.3Hardware accelerationIn order to decrease the CPU load and speed up many drawing operations, ST had includeda Hardware acceleration IP known as the Chrom-ART in many STM32 products.AN4323 Rev 515/4645

How to use STemWin Library step by stepAN4323EmWin on the other side provide a list of API functions that can be accelerated.The table below shows currently implemented HW acceleration API functions on the“LCDConf.c”.Table 4. Hardware acceleration API listFunctionDescriptionGUICC M1555I SetCustColorConv()GUICC M565 SetCustColorConv()GUICC M4444I SetCustColorConv()Function to set color conversion routines for theaccording fixed palette modesGUICC M888 SetCustColorConv()GUICC M8888I SetCustColorConv()LCD DEVFUNC COPYBUFFERId function to set a custom defined routine forcopying buffersLCD DEVFUNC FILLRECTId function to set a custom defined routine forfilling rectanglesLCD DEVFUNC COPYRECTId function to set a custom defined routine forcopying rectangular areasLCD DEVFUNC DRAWBMP 8BPPId function to set a custom routine for drawing8bpp bitmapsLCD DEVFUNC DRAWBMP 16BPPId function to set a custom routine for drawing16bpp bitmapsLCD DEVFUNC DRAWBMP 32BPPId function to set a custom routine for drawing32bpp bitmapsGUI SetFuncAlphaBlending()Function to set up a custom defined function fordoing alpha blending operationsGUI SetFuncGetpPalConvTable()Function to set up palette conversion of a bitmapinto index valuesGUI SetFuncMixColorsBulk()Function to set up bulk blending operationsGUI AA SetpfDrawCharAA4()Function to set up drawing 4bpp alpha charactersGUI MEMDEV SetDrawMemdev16bppFunc()Function to set up drawing 16bpp bitmaps into16bpp memory devices.GUI SetFuncDrawAlpha()Function to set up 2 accelerations, first fordrawing memory devices with alpha value intoanother memory device and the second fordrawing bitmaps with alpha value.Remarks:16/46 Note that not all STM32 products supports HW acceleration. On the currently delivered “LCDConf.c” some acceleration API are not yetimplemented.AN4323 Rev 5

AN43234.1.4How to use STemWin Library step by stepGUI X.c or GUI X OS.c GUI X.c for single task execution:“Single task” means that the project uses STemWin only from within one single task. Themain purpose is to supply STemWin with a timing base. OS TimeMS needs to beincremented each ms. GUI X OS.c for multitask execution:If STemWin is used in a multitasking system, this file contains additional routines requiredfor synchronizing tasks.All the functions of this file are using the CMSIS-RTOS API which is a generic RTOSinterface for Arm Cortex -M processor-based devices, which provides a standardized APIfor software components that require RTOS functionality.4.2GUI initializationTo initialize the STemWin internal data structures and variables, GUI Init() should be used.Note that before initializing the GUI, the CRC module (in RCC peripheral clock enableregister) should be enabledA simple “Hello world” program illustrates this initialization, as shown below.“Hello world” example:void Main(void) {int xPos, yPos;HAL RCC CRC CLK ENABLE();GUI Init();xPos LCD GetXSize() / 2;yPos LCD GetYSize() / 3;GUI SetFont(GUI FONT COMIC24B ASCII);GUI DispStringHCenterAt("Hello world!", xPos, yPos);while(1);}4.3Core functions4.3.1Image file displaySTemWin currently supports the BMP, JPEG, GIF and PNG file formats. The library includesrich APIs for each one of these image formats (fully documented in the STemWin UserManual). An approximation of the memory resources needed for each image type is given inSection 5: Performance and footprint.AN4323 Rev 517/4645

How to use STemWin Library step by step4.3.2AN4323Bidirectional textDrawing Arabic or Hebrew text with STemWin is quite easy and is supported automaticallyin each text-based function. It only needs to be enabled once by using the followingcommand:GUI UC EnableBIDI()4.3.3Alpha blendingAlpha blending is a method combining the alpha channel with other layers in an image inorder to create the appearance of semi-transparency (see Figure 5).Figure 5. Alpha blending effectThe user can enable automatic alpha blending using the following command:GUI EnableAlpha()He can also give an alpha value to determine how much of a pixel should be visible and howmuch of the background should show through:GUI SetUserAlpha()4.3.4Sprites and cursorsA sprite is an image which can be shown above all other graphics on the screen.A sprite preserves the screen area it covers. It can be moved or removed at any time, fullyrestoring the screen content. Animation by use of multiple images is also possible.Figure 6. Animated spritesSprites can be animated (Figure 6) by calling GUI SPRITE CreateAnim().18/46AN4323 Rev 5

AN4323How to use STemWin Library step by stepNote that sprites manage the background automatically.STemWin also includes a system-wide cursor (Figure 7), which can also be animated byusing GUI CURSOR SetAnim(). Cursors are actually based on sprites.Figure 7. CursorsAlthough the cursor always exists, it is hidden by default. It is not visible until a call is madeto show it (GUI CURSOR Show()), and may be hidden again at any point(GUI CURSOR Hide()).4.4Memory devicesA memory device is a hardware-independent destination device for drawing operations.If a memory device is created (by calling GUI MEMDEV Create()) then validated (bycalling GUI MEMDEV Select()), all drawing operations are executed in memory. The finalresult is displayed on the screen only when all operations have been finished. This action isdone by calling GUI MEMDEV CopyToLCD().Memory devices can be used: to prevent flickering effect (due to direct drawing on the display), as containers for decompressed images, for rotating (GUI MEMDEV Rotate()) and scaling operations (Figure 8), for fading operations, for window animations, for transparency effects.Figure 8. Scaling and rotation effect using memdevSince memory devices need a considerable amount of memory (see component “MemoryDevice” in Table 8), it is advised to use an external memory if available.AN4323 Rev 519/4645

How to use STemWin Library step by step4.5AN4323AntialiasingAntialiasing smoothes curves and diagonal lines by “blending” the background color with theforeground one. This is done by adding intermediate colors between object andbackground.Shape antialiasingSTemWin supports antialiased drawing of: Text (Font Converter is required to create AA fonts) Arcs (GUI AA DrawArc()) Circles (GUI AA FillCircle()) Lines (GUI AA DrawLine()) Polygons (GUI AA DrawPolyOutline() and GUI AA FillPolygon())Figure 9. Shape antialiasing4.6Window ManagerWindow Manager can be described as: A management system for a hierarchic window structure:– A callback mechanism-based system:– Communication is based on an event-driven callback mechanism. All drawingoperations should be done within the WM PAINT event.The foundation of the widget library:–4.7Each layer has its own desktop window. Each desktop window can have its ownhierarchic tree of child windows.All widgets are based on the functions of the Window Manager.Widget libraryWidgets (Window Gadget) are windows with object-type properties. They require theWindow Manager.A list of all widgets available in STemWin Library can be found at: http://www.segger.comOnce a widget is created, it is treated just like any other window. The Window Managerensures that it is properly displayed (and redrawn) whenever necessary.20/46AN4323 Rev 5

AN4323How to use STemWin Library step by stepFigure 10. Widget examplesWidget creationCreating a widget can be done with one line of code.There are basically two ways of creating a widget: Direct creation:Creation functions exist for each widget: – WIDGET CreateEx(): creation without user data.– WIDGET CreateUser(): creation with user data.Indirect creation:“Indirect” means here using a dialog box creation function and aGUI WIDGET CREATE INFO structure which contains a pointer to the indirect creationroutine:–4.8 WIDGET CreateIndirect(): creation by dialog box creation function.VNC serverVNC stands for “Virtual Network Computing”. The VNC server is used to connect theembedded target to a network PC via TCP/IP, which allows to: view the LCD content on the distant PC monitor, and to control the embedded environment using the mouse.In other words, the display contents of the embedded device are visible on the screen of themachine running the client (for example, a network PC); the mouse and keyboard can thenbe used to control the target.AN4323 Rev 521/4645

How to use STemWin Library step by stepAN4323Figure 11. VNC server usage4.8.122/46Requirements An STM32 device with embedded Ethernet IP, s

main settings and configuration steps. For furt her details, refer to the Segger’s emWin User Manual. 4.1 Configuration The configuration is basically divided into two parts: GUI configuration and LCD configuration. The GUI configuration covers the configurat

Related Documents:

Biacore T200 Getting Started 28-9840-98 Edition AB 5 Biacore T200 Getting Started Biacore T200 Getting Started Introduction This Getting Started handbook is designed as a self-study guide to introduce you to the basic operations of BiacoreTM T200, Biacore T200 Control Software and Biacore T200 Evaluation Software.

2 - the library building is a public library recognized by the state library agency as a public library; 3 - the library building serves an area of greater than 10 percent poverty based on U.S.Census . Falmouth Area Library 5,242.00 Fennville District Library 16,108.00 Ferndale Public Library 16,108.00 Fife Lake Public Library 7,054.00 Flat .

3 07/2021 Dublin Public Library – SW f Dudley-Tucker Library – See Raymond Gilsum Public library [via Keene] Dummer Public Library [via White Mountains Community College, Berlin] NE t,r Dunbar Free Library – See Grantham Dunbarton Public Library – SW f Durham Public Library – SW w, f East Andover (William Adams Batchelder Library [via

Mar 03, 2021 · Kent District Library Loutit District Library Monroe County Library System West Bloomfield Township Public Library MINNESOTA Hennepin County Library Saint Paul Public Library . Jersey City Free Public Library Newark Public Library Paterson Free Public Library

Getting Started applies to the "PCS 7 Engineering Toolset V 6.0". Preface Process Control System PCS 7, Getting Started - Part 1 iv A5E00164244-01 Guide to the Manual Getting Started explains the individual steps required to create the "color_gs" project. You will find the most important background information required to

Getting Started with SIMOTION SCOUT TIA Getting Started Valid as of Version 4.5 11/2016 Preface Fundamental safety instructions 1 Getting Started with SIMOTION SCOUT TIA 2 Prepare the configuration 3 Create a project 4 Create SIMOTION device and configure online communication 5 Start SIMOTION SCOUT TIA 6 Download the project to the target system 7

6 – ABSYNTH 5 – Getting Started 1.2 The ABSYNTH 5 Documentation 1.2.1 In this Manual What you are holding in your hands right now is the Getting Started Manual which will give you an overview of ABSYNTH 5’s main features and functions. This Getting Started Manual is divided into four parts:

Copyright 2013-2014 by Object Computing, Inc. (OCI). AngularJS ui-router All rights reserved. State Configuration . template, templateUrl or templateProvider .