Direct Insight Ltd embedded platform solutions
  Latest News :  Date:  | Bookmark  
         
 
 
# Menu Links more

get in touch by phone or email email the team

windows embedded CE partner

 

Segger logoSegger - emWin - Memory Devices


Introduction

Memory devices can be used in a variety of situations, mainly to prevent the display from flickering when using drawing operations for overlapping items. The basic idea is quite simple. Without the use of a memory device, drawing operations write directly to the display. The screen is updated as drawing operations are executed, which gives it a flickering appearance as the various updates are made. For example, if you wanted to draw a bitmap in the background and some transparent text in the foreground, you would first have to draw the bitmap and then the text. The effect would be a flickering of the text.
If a memory device is used for such a procedure, however, all drawing operations are executed in memory. The final result is displayed on the screen only when all operations have been carried out, with the advantage of no flickering. This difference can be seen in the example in the following section, which illustrates a sequence of drawing operations both with and without the use of a memory device.
The distinction may be summarized as follows: If no memory device is used, the effects of drawing operations can be seen step by step, with the disadvantage of a flickering display. With a memory device, the effects of all routines are made visible as a single operation. No intermediate steps can actually be seen. The advantage, as explained above, is that display flickering is completely eliminated, and this is often desirable. Memory devices are an additional (optional) software item and are not shipped with the emWin basic package. The software for memory devices is located in the subdirectory Memdev of the GUI directory.

Using memory devices: an illustration

The following table shows screen shots of the same operations handled with and without a memory device. The objective in both cases is identical: a work piece is to be rotated and labeled with the respective angle of rotation (here, 10 degrees). In the first case (without a memory device) the screen is first cleared, then the polygon is redrawn in the new position and a string with the new label is written. In the second case (with a memory device) the same operations are performed in memory, but the screen is not updated during this time. The only update occurs when the routine GUI_MEMDEV_CopyToLCD is called, and this update reflects all the operations at once. Note that the initial states and final outputs of both procedures are identical.

API function Without memory device With memory device
Step 0: Initial state
Step 1: GUI_Clear
Step 2: GUI_DrawPolygon
Step 3: GUI_DispString
Step 4: GUI_MEMDEV_CopyToLCD(only when using memory device)

Basic functions

The following routines are those that are typically used with memory devices. Basic usage is rather simple:

  1. Create the memory device (using GUI_MEMDEV_Create).
  2. Activate it (using GUI_MEMDEV_Select).
  3. Execute drawing operations.
  4. Copy the result into the display (using GUI_MEMDEV_CopyToLCD).
  5. Delete the memory device (if you no longer need it).

In order to be able to use memory devices

Memory devices are enabled by default. In order to optimize performance of the software, support for memory devices can be switched off in the configuration file GUIConf.h with the following line:

  #define GUI_SUPPORT_MEMDEV        0

If this line is in the configuration file and you want to use memory devices, either delete the line or change the define to 1.

API reference: memory devices

The table below lists the available routines of the emWin memory device API.
All functions are listed in alphabetical order within their respective categories. Detailed descriptions of the routines can be found in the sections that follow.

Routine Explanation
Basic functions
GUI_MEMDEV_Create Create the memory device (first step).
GUI_MEMDEV_CopyToLCD Copy contents of memory device to LCD.
GUI_MEMDEV_Delete Free the memory used by the memory device.
GUI_MEMDEV_Select Select a memory device as target for drawing operations.
Advanced features
GUI_MEMDEV_Clear Mark the memory device contents as unchanged.
GUI_MEMDEV_CopyFromLCD Copy contents of LCD to memory device.
GUI_MEMDEV_CopyToLCDAA Copy the contents of memory device antialiased.
GUI_MEMDEV_GetYSize Return the Y-size of memory device.
GUI_MEMDEV_ReduceYSize Reduce Y-size of memory device.
GUI_MEMDEV_SetOrg Change the origin of the memory device on the LCD.
Banding memory device
GUI_MEMDEV_Draw Use a memory device for drawing.
Auto device object functions
GUI_MEMDEV_CreateAuto Create an auto device object.
GUI_MEMDEV_DeleteAuto Delete an auto device object.
GUI_MEMDEV_DrawAuto Use a GUI_AUTODEV object for drawing.

Banding memory device

The size of available memory is normally not enough to cover the whole drawing area. A banding memory device divides the drawing area into bands. One band covers as many lines as possible with the currently available memory.

bullet Take a look at the c-code and download the demo file here.

Auto device object

An auto device object is often preferred for applications such as moving pointers, in which only a small part of the display is updated at a time. The device automatically distinguishes which parts of the display consist of fixed items and which parts consist of moving or changing items. When the drawing function for the auto device object is called for the first time, it draws all items. Each further call updates only the space used by the moving or changing objects. The actual drawing operation uses the banding memory device, but only within the necessary area. The main advantage of using an auto device object is that it saves computation time, since it does not keep updating the entire display.

bullet Take a look at the c-code and download the demo file here.

 

# Return to main emWin page...
# You can download an evaluation version of emWin from our Literature/Download section....

 


buy online
ask a technical question
PDF datasheet
Trial Software

 


Abatron | Adeneo Embedded | ADI Engineering | Blackhawk | Corelis | Domain Technologies | e-con Systems
EMA TimingDesigner | Embedded Planet | Entrek | EPI/Mentor | FlatOak | Intel Software | IntervalZero
Microcross | Microsoft Embedded | Segger | Signum | Sophia | SwiftModule | Tasking | TRITON Modules
Products by Processor | Products by Supplier | Boards & Modules

 

# Segger News #
#

#Tiny RTOS supports STR7 more...

Other News


# NEWS: Tools #
#

#NEW RTX2011 Real-Time Extension for Windows Updated. more...
#New 8-Core processor AMC board reduces system cost and power consumption . more...
#Direct Insight Launches Technology Blog. more...
#IntervalZero RTX 2009 adds SMP support
#TimingDesigner 9.1 adds SDC and  Integration with Altera Quartus II
#Embedded Linux and FPGAs Accelerate Embedded Software Development more...


# 30-day free evaluation #
#

FREE evaluation kitbulletRequest the Segger 30-day free evaluation kit.

#

# Literature Centre #
#

Online Documentation at our Literature Centre...See our Literature Centre for documents and other associated files for this product group.

#

more
         
 
<< Backward | Forward >> | Top of Page  

Copyright © 2001 - Direct Insight Ltd
All trademarks on www.directinsight.co.uk are recognised and are the property of their respective owners.
For enquiries or problems encountered on the website, please contact webmaster@directinsight.co.uk