1、1.1C/GUI featuresC/GUI is designed to provide an efficient, processor- and LCD controller-indepen-dent graphical user interface for any application that operates with a graphical LCD. It is compatible with single-task and multitask environments, with a proprietary operating system or with any commer
2、cial RTOS. C/GUI is shipped as source code. It may be adapted to any size physical and virtual display with any LCD con-troller and CPU. Its features include the following:1.1.1GeneralAny 8/16/32-bit CPU; only an ANSI compiler is required.Any (monochrome, grayscale or color) LCD with any controller
3、supported (if the right driver is available).May work without LCD controller on smaller displays.Any interface supported using configuration macros.Display-size configurable.Characters and bitmaps may be written at any point on the LCD, not just on even-numbered byte addresses.Routines are optimized
4、 for both size and speed.Compile time switches allow for different optimizations.For slower LCD controllers, LCD can be cached in memory, reducing access to a minimum and resulting in very high speed.Clear structure.Virtual display support; the virtual display can be larger than the actual display.1
5、.1.2Graphic libraryBitmaps of different color depths supported.Bitmap converter available.Absolutely no floating-point usage.Fast line/point drawing (without floating-point usage).Very fast drawing of circles/polygons.Different drawing modes.1.1.3FontsA variety of different fonts are shipped with th
6、e basic software: 4*6, 6*8, 6*9,8*8, 8*9, 8*16, 8*17, 8*18, 24*32, and proportional fonts with pixel-heights of 8, 10, 13, 16. For more information, see Chapter 25: Standard Fonts.New fonts can be defined and simply linked in.Only the fonts used by the application are actually linked to the resultin
7、g execut-able, resulting in minimum ROM usage.Fonts are fully scalable, separately in X and Y.Font converter available; any font available on your host system (i.e. MicrosoftWindows) can be converted.1.1.4String/value output routinesRoutines to show values in decimal, binary, hexadecimal, any font.R
8、outines to edit values in decimal, binary, hexadecimal, any font.1.1.5Window manager (WM)Complete window management including clipping. Overwriting of areas outside a Windows client area is impossible.Windows can be moved and resized.Callback routines supported (usage optional).WM uses minimum RAM (
9、app. 20 bytes per window).1.1.6Optional widgets for PC look and feelWidgets (window objects, also known as controls) are available. They generally Operate automatically and are simple to use.Touch-screen & mouse supportFor window objects such as the button widget, C/GUI offers touch-screen andMouse
10、support.1.1.7PC tools Simulation plus viewer. Bitmap converter. Font converter1.2 How to connect the LCD to the microcontrollerC/GUI handles all access to the LCD. Virtually any LCD controller can be supported, independently of how it is accessed. For details, please refer to Chapter 20:Low-Level Co
11、nfiguration. Also, please get in contact with us if your LCD controller is not supported. We are currently writing drivers for all LCD controllers available on the market and may already have a proven driver for the LCD controller that you intend to use. It is usually very simple to write the routin
12、es (or macros) used to access the LCD in your application. MIcrium offers the customization services, if necessary with your target hardware.It does not really matter how the LCD is connected to the system as long as it is somehow accessible by software, which may be accomplished in a variety of way
13、s. Most of these interfaces are supported by a driver which is supplied in source code form. This driver does not normally require modifications, but is configured for your hardware by making changes in the file LCDConf.h. Details about how to customize a driver to your hardware as necessary are exp
14、lained in Chapter 22:LCD Drivers. The most common ways to access the LCD are described as follows. If you simply want to understand how to use C/GUI, you may skip this section.1.2.1LCD with memory-mapped LCD controller:The LCD controller is connected directly to the data bus of the system, which mea
15、ns the controller can be accessed just like a RAM. This is a very efficient way of access-ing the LCD controller and is most recommended. The LCD addresses are defined to the segment LCDSEG, and in order to be able to access the LCD the linker/locator simply needs to be told where to locate this seg
16、ment. The location must be identical to the access address in physical address space. Drivers are available for this type of interface and for different LCD controllers.1.2.2LCD with LCD controller connected to port / bufferFor slower LCD controllers used on fast processors, the use of port-lines ma
17、y be the only solution. This method of accessing the LCD has the disadvantage of being some-what slower than direct bus-interface but, particularly with a cache that minimizes the accesses to the LCD, the LCD update is not slowed down significantly. All that needs to be done is to define routines or
18、 macros which set or read the hardware ports/buffers that the LCD is connected to. This type of interface is also supported by different drivers for the different LCD controllers. 1.2.3Proprietary solutions: LCD without LCD controllerThe LCD can also be connected without an LCD controller. In this c
19、ase, the LCD data is usually supplied directly by the controller via a 4- or 8-bit shift register. These pro-prietary hardware solutions have the advantage of being inexpensive, but the disad-vantage of using up much of the available computation time. Depending on the CPU, this can be anything betwe
20、en 20 and almost 100 percent; with slower CPUs, it is really not possible at all. This type of interface does not require a specific LCD driver because C/GUI simply places all the display data into the LCD cache. You must write the hardware-dependent portion that periodically transfers the data in t
21、he cache memory to your LCD. Sample code for transferring the video image into the display is available in both and optimized assembler for M16C and M16C/80.1.3 Configuring The Config folder should contain the configuration files matching your order. The file LCDConf.h normally contains all the defi
22、nitions necessary to adopt C/GUI to your LCD, which is the main task when configuring C/GUI. For details, please see Chapter 20:If C/GUI is not configured correctly, because you did not select the right display res-olution or chose the wrong LCD controller, it will probably not display anything at a
23、ll or display something that does not resemble what you expected. So take care to tai-lor LCDConf.h to your needs. If you do not wish to deal with this process, Micrim can do it for you, as well as test C/GUI in your application with your hardware and your LCD.Types of configuration macrosThe follow
24、ing types of configuration macros exist:1.3.1Binary switches BSwitches can have a value of either 0 or 1, where 0 means deactivated and 1 means activated (actually anything other than 0 would work, but using 1 makes it easier to read a config file). These switches can enable or disable a certain fun
25、ctionality or behavior. Switches are the simplest form of configuration macro.1.3.2Numerical values NNumerical values are used somewhere in the code in place of a numerical constant. Typical examples are in the configuration of the resolution of an LCD.1.3.3Selection switches SSelection switches are
26、 used to select one out of multiple options where only one of those options can be selected. A typical example might be the selection of the type of LCD controller used, where the number selected denotes which source code (in which LCD driver) is used to generate object code.1.3.4Alias AA macro whic
27、h operates like a simple text substitute. An example would be the define U8, in which the preprocessor would replace with unsigned char.1.3.5Function replacements FMacros can basically be treated like regular functions although certain limitations apply, as a macro is still put into the code as simp
28、le text replacement. Function replacements are mainly used to add specific functionality to a module (such as the access to an LCD) which is highly hardware-dependent. This type of macro is always declared using brackets (and optional parameters).1.4 Initializing The routine GUI_Init () initializes
29、the LCD and the internal data structures of C/GUI, and must be called before any other C/GUI function. This is done by placing the following line into the init sequence of your program: GUI_Init ();If this call is left out, the entire graphics system will not be initialized and will there-fore not be ready.1.5 Using C/GUI with target hardwareThe following is just a basic outline of the general steps that should be taken when starting to program with C/GU
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1