Universal Graphic Display Source Code Driver Project

a) Graphic Screens Overview

A typical graphic screen, which may use LCD, E Ink, LED, OLED, Vacuum Fluorescent or some other screen technology, consists of a large array of pixels that are triggered using a X and Y axis matrix of connections.

The actual drive of each pixel is provided by a display controller IC. This may already be built into your screen, may need to be provided by you externally or may be built into the particular microcontroller or processor you are using. This display controller IC will constantly scan the matrix of pixels, turning on or off each pixel based on the data held in the IC’s memory. In its basic form the IC will have a data buffer to which you write data to tell the controller IC which pixels you want on and which you want off and for grayscale and colour displays the intensity of each pixel. This driver is designed to be used with any screen which can be controlled in this way, including screens with the simplest controller IC’s.

b) Driver Features

Main features:

  • Designed for use with color, grayscale and monochrome displays.
  • Use your display in any of the 4 possible orientations.
  • Display .BMP bitmap files of any size anywhere on the screen.
  • Display Unicode text strings using user adjustable monospace or proportional width fonts anywhere on a screen.*
  • Display text strings with left, centre or right alignment. Display a single line of text, or multiple lines contained within a definable region.
  • Design your screen layouts in code or as HTML files using Dreamweaver web authoring software. This driver parses HTML source files.
  • Optional touchscreen support – parsed HTML file links may be passed to your application with screen coordinates so it can dynamically process screen touch events
  • Use the included PC Display Files Converter Application to convert your source font, bitmap, html and css files ready for use in your application.
  • No reliance on special display Controller IC features – generic driver suited to all types of display controllers where data is written per pixel.
  • No requirements to use your display in pre-defined ways – use your display exactly as you want with your user interface implemented exactly as you want it, down to the individual pixel!
  • Fast optimised source code.
  • No reliance on compiler specific libraries.
  • Full source code supplied for you to use and modify as required.

(* N.B. To create new fonts and edit fonts you need to purchase BitFontCreator Pro 3.0 from Iseatech Software)

c) Driver Introduction

Graphic display allow embedded devices to provide rich graphical user interfaces and at ever reducing cost. However successfully using graphic displays comes at the cost of a great deal of complexity. The solution for some engineers is to use an off the shelf GUI module from a vendor which incorporates a processor and proprietary software to provide the graphic display functionality for them, but at a much higher production cost. With colour displays starting at < $10 these days and with typical low cost embedded processors being more than capable enough of driving them paying for GUI modules can be a very false economy. This universal graphic display driver removes much of the complexity of driving graphic displays and allows you to simply display bitmaps of any size and Unicode text strings using user adjustable fonts anywhere on a screen. Once you have this capability using a graphic screen is easy and it’s a simple matter to add any special features you need for your application, such as menus, animated graphics, graphs and more.

Still, designing graphic screen layouts in code, even with a versatile driver, can be a tedious task for more complex projects and a benefit of many GUI modules is that they provide some sort of PC software to facilitate the graphic user interface design. Often this software isn’t particularly friendly or universal, but it’s better than designing from the source code level. This driver takes things one step better and will read HTML files, allowing you to design your screen layouts using Dreamweaver web authoring software if you wish. Not only can this drastically reduce the time and hassle to design user interfaces, it also allows you to design and demonstrate user interface designs before the hardware has even been designed and also allows non programmers to design screen layouts.

The last remaining issue for graphical user interfaces is typically fonts and supporting languages with non ASCII character sets. This driver solves that problem by being designed with full Unicode support and to work with the fonts produced by the great Iseatech Bit Font Creator Pro software. The driver is supplied with several fonts implementing the standard extended ASCII character set which may be used as is. Purchasing Bit Font Creator Pro from Iseatech allows you to edit these included fonts, add new Unicode characters and to also create your own new fonts from any font installed on your Windows PC.

As well as displaying ASCII text strings in standard ‘monospace’ fixed pitch mode (each character takes the same horizontal space regardless of its actual width), this driver also allows you to use font’s created as proportional width. This makes lines of text much more attractive and natural to read and typically allows you to fit additional characters across a screen, as each character only uses as much width as is required to display it. Left, centre or right alignment functions provides the complete toolbox of text display capabilities.

The included Display Files Convert PC application will read all of your source font, bitmap, html and css files and convert them ready for use in your application. It’s output may either be as a standard C header file, allowing all of your source file data to be simply included in your microcontrollers program memory when you compile, or as a binary file for you to store in external flash memory with a generated C header file used by the driver to locate each files start address.

Once you have these capabilities using a graphic screen is easy and it’s a simple matter to add any special user interface features you require for your application, such as menus, animated graphics, graphs and more. One of the great advantages of this driver is that it provides you with very simple but very powerful control over everything you display on the screen, allowing you to implement your display, and any user interface functionality, exactly as you want it down to the individual pixel.

 

This driver can’t quite remove all of the complexity for you as you will still need to configure the screen access functions to suit the particular screen / driver IC you are using. This has been made as simple as possible, and some sample screen models are included for you to copy and modify as required. See the technical manual for more details.

The driver code has been designed using ANSI compliant C compilers. Using the driver with other ANSI compliant C compilers and with other processors / microcontrollers should not present significant problems, but you should ensure that you have sufficient programming expertise to carry out any modifications that may be required to the source code. Embedded-code.com source code is written to be very easy to understand by programmers of all levels. The code is very highly commented with no lazy programming techniques. All function, variable and constant names are fully descriptive to help you modify and expand the code with ease.

The driver and associated files are provided under a licence agreement. Please see www.embedded-code.com/licence.php for full details.

The remainder of this manual provides a wealth of technical information about the driver as well as useful guides to get you going. We welcome any feedback on this manual and the driver.