13.12.2012 Views

emWin - SEGGER Microcontroller

emWin - SEGGER Microcontroller

emWin - SEGGER Microcontroller

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

32 CHAPTER Introduction to <strong>emWin</strong><br />

1.6 Screen and coordinates<br />

The screen consists of many dots that can<br />

be controlled individually. These dots are<br />

called pixels. Most of the text and drawing<br />

functions that <strong>emWin</strong> offers in its API to the<br />

user program can write or draw on any<br />

specified pixel.<br />

The horizontal scale is called the X-axis,<br />

whereas the vertical scale is called the Yaxis.<br />

Coordinates are denoted as a pair<br />

consisting of an X- and a Y-value (X, Y).<br />

The X-coordinate is always first in routines<br />

that require X and Y coordinates. The upper<br />

left corner of the display (or a window) has<br />

per default the coordinates (0,0). Positive<br />

X-values are always to the right; positive Y-values are always down. The above graph<br />

illustrates the coordinate system and directions of the X- and Y- axes. All coordinates<br />

passed to an API function are always specified in pixels.<br />

1.7 How to connect the display to the micro controller<br />

<strong>emWin</strong> handles all access to the display. Virtually any display controller can be supported,<br />

independently of how it is accessed. For details, refer to the chapter “Configuration”<br />

on page 1025. Also, get in contact with us if your display controller is not<br />

supported. We are currently writing drivers for all display controllers available on the<br />

market and may already have a proven driver for the display controller that you<br />

intend to use. It is usually very simple to write the routines (or macros) used to<br />

access the display in your application <strong>SEGGER</strong> <strong>Microcontroller</strong> GmbH & Co. KG offers<br />

the service of making these customizations for you, if necessary with your target<br />

hardware.<br />

It does not really matter how the display is connected to the system as long as it is<br />

somehow accessible by software, which may be accomplished in a variety of ways.<br />

Most of these interfaces are supported by a driver which is supplied in source code<br />

form. This driver does not normally require modifications, but is configured for your<br />

hardware by making changes in the file LCDConf.h. Details about how to customize a<br />

driver to your hardware as necessary are provided in the chapter “Display drivers” on<br />

page 907. The most common ways to access the display are described as follows. If<br />

you simply want to understand how to use <strong>emWin</strong>, you may skip this section.<br />

Display with memory-mapped display controller:<br />

The display controller is connected directly to the data bus of the system, which<br />

means the controller can be accessed just like a RAM. This is a very efficient way of<br />

accessing the display controller and is most recommended. The display addresses are<br />

defined to the segment LCDSEG, and in order to be able to access the display the<br />

linker/locator simply needs to be told where to locate this segment. The location<br />

must be identical to the access address in physical address space. Drivers are available<br />

for this type of interface and for different display controllers.<br />

Display with display controller connected to port / buffer<br />

For slower display controllers used on fast processors, the use of port-lines may be<br />

the only solution. This method of accessing the display has the disadvantage of being<br />

somewhat slower than direct bus-interface but, particularly with a cache that minimizes<br />

the accesses to the display, the display update is not slowed down significantly.<br />

All that needs to be done is to define routines or macros which set or read the hardware<br />

ports/buffers that the display is connected to. This type of interface is also supported<br />

by different drivers for the different display controllers.<br />

UM03001 User & Reference Guide for <strong>emWin</strong> V5.18 © 1997 - 2012 <strong>SEGGER</strong> <strong>Microcontroller</strong> GmbH & Co. KG

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!