Graphical User Interface
with Graphic Library
Version 3.14
Manual Rev. 1
www.micrium.com
Empowering Embedded Systems
µC/GUI
Micriµm
2
User's & reference manual for µC/GUI © 2002 Micriµm Inc.
Disclaimer
Specifications written in this manual are believed to be accurate, but are not guaran-
teed to be entirely free of error. Specifications in this manual may be changed for
functional or performance improvements without notice. Please make sure your man-
ual is the latest edition. While the information herein is assumed to be accurate,
Micriµm Inc. (the distributor) assumes no responsibility for any errors or omissions
and makes no warranties. The distributor specifically disclaims any implied warranty
of fitness for a particular purpose.
Copyright notice
The latest version of this manual is available as PDF file in the download area of our
website at www.micirum.com. You are welcome to copy and distribute the file as well
as the printed version. You may not extract portions of this manual or modify the PDF
file in any way without the prior written permission of SEGGER MICROCONTROLLER
SYSTEME GmbH (the manufacturer). The software described in this document is fur-
nished under a license and may only be used or copied in accordance with the terms
of such a license.
© 2002 Micrium Inc., Weston, Florida 33327-1848, U.S.A.
Trademarks
Names mentioned in this manual may be trademarks of their respective companies.
Brand and product names are trademarks or registered trademarks of their respec-
tive holders.
Registration
Please register the software via email. This way we can make sure you will receive
updates or notifications of updates as soon as they become available.
For registration please provide the following information:
• Company name and address
•Your name
• Your job title
• Your email address and telephone number
• Name and version of the product
Please send this information to: register@micirum.com
Contact address
Micrium Inc.
949 Crestview Circle
Weston, FL 33327-1848
U.S.A.
Phone : +1 954 217 2036
FAX : +1 954 217 2037
WEB : www.Micrium.com
www.uCOS-II.com
Email: support@micirum.com
User's & reference manual for µC/GUI © 2002 Micriµm Inc.
3
1 Introduction to µC/GUI ...................................................................................................15
1.1 µC/GUI and µC/GUI b/w ...........................................................................15
1.2 Purpose of this document .........................................................................15
1.3 Assumptions ...........................................................................................15
1.4 How to use this manual ............................................................................16
1.5 Typographic conventions for syntax ...........................................................16
1.6 Features.................................................................................................16
1.7 Samples and demos.................................................................................18
1.8 Screen and coordinates ............................................................................18
1.9 How to connect the LCD to the microcontroller ............................................18
1.10 Data types..............................................................................................19
1.11 Types of configuration macros...................................................................20
2 Getting Started...............................................................................................................21
2.1 Recommended directory structure..............................................................22
2.2 Configuring µC/GUI..................................................................................23
2.3 Using µC/GUI with your target system........................................................23
2.4 C files to include in the project ..................................................................23
2.5 Creating a library.....................................................................................24
3 Simulator........................................................................................................................25
3.1 Understanding the simulator .....................................................................26
3.2 Using the simulator..................................................................................26
3.3 The Viewer .............................................................................................27
3.4 Device simulation and other advanced features ...........................................27
Hardkey simulation..................................................................................29
4 Tutorial: Using µC/GUI with Target Hardware ...............................................................31
4.1 Basics ....................................................................................................31
4.2 How to use µC/GUI ..................................................................................32
4.3 The "Hello world" sample program .............................................................32
4.4 Adding functionality to the "Hello world" program ........................................33
5 Displaying Text ..............................................................................................................35
5.1 API reference: text ..................................................................................35
5.2 Basic routines .........................................................................................36
5.3 Routines to display text ............................................................................36
GUI_DispChar .........................................................................................36
GUI_DispCharAt ......................................................................................37
GUI_DispChars........................................................................................38
GUI_DispString .......................................................................................38
GUI_DispStringAt ....................................................................................39
Table of Contents
4
User's & reference manual for µC/GUI © 2002 Micriµm Inc.
GUI_DispStringAtCEOL............................................................................. 39
GUI_DispStringInRect.............................................................................. 39
GUI_DispStringLen .................................................................................. 40
5.4 Selecting text drawing modes ................................................................... 40
GUI_SetTextMode ................................................................................... 41
5.5 Selecting text alignment........................................................................... 42
GUI_GetTextAlign ................................................................................... 42
GUI_SetLBorder...................................................................................... 42
GUI_SetTextAlign.................................................................................... 43
5.6 Setting the current text position................................................................ 43
GUI_GotoXY, GUI_GotoX, GUI_GotoY ........................................................ 43
5.7 Retrieving the current text position............................................................ 44
GUI_GetDispPosX.................................................................................... 44
GUI_GetDispPosY.................................................................................... 44
5.8 Routines to clear a window or parts of it..................................................... 45
GUI_Clear .............................................................................................. 45
GUI_DispCEOL........................................................................................ 45
6 Displaying Values ..........................................................................................................47
6.1 API reference: values .............................................................................. 48
6.2 Displaying decimal values......................................................................... 48
GUI_DispDec .......................................................................................... 48
GUI_DispDecAt ....................................................................................... 49
GUI_DispDecMin ..................................................................................... 50
GUI_DispDecShift.................................................................................... 50
GUI_DispDecSpace.................................................................................. 51
GUI_DispSDec ........................................................................................ 51
GUI_DispSDecShift.................................................................................. 52
6.3 Displaying floating-point values................................................................. 52
GUI_DispFloat ........................................................................................ 52
GUI_DispFloatFix .................................................................................... 54
GUI_DispFloatMin.................................................................................... 54
GUI_DispSFloatFix................................................................................... 55
GUI_DispSFloatMin.................................................................................. 55
6.4 Displaying binary values........................................................................... 56
GUI_DispBin........................................................................................... 56
GUI_DispBinAt........................................................................................ 57
6.5 Displaying hexadecimal values.................................................................. 57
GUI_DispHex.......................................................................................... 57
GUI_DispHexAt....................................................................................... 58
7 Fonts..............................................................................................................................59
7.1 API reference: fonts ................................................................................ 60
7.2 Selection of a font ................................................................................... 60
GUI_GetFont .......................................................................................... 60
GUI_SetFont........................................................................................... 61
7.3 Font-related functions.............................................................................. 62
GUI_GetCharDistX................................................................................... 62
GUI_GetFontDistY ................................................................................... 62
GUI_GetFontInfo..................................................................................... 62
GUI_GetFontSizeY................................................................................... 63
GUI_GetStringDistX................................................................................. 63
GUI_GetYDistOfFont ................................................................................ 63
GUI_GetYSizeOfFont................................................................................ 63
User's & reference manual for µC/GUI © 2002 Micriµm Inc.
5
GUI_IsInFont ..........................................................................................64
7.4 Character sets.........................................................................................64
ASCII.....................................................................................................64
ISO 8859-1 Western Latin character set .....................................................65
Unicode..................................................................................................67
7.5 Adding fonts ...........................................................................................67
7.6 FEDIT.EXE font converter/editor ................................................................67
8 2-D Graphic Library........................................................................................................69
8.1 API reference: graphics ............................................................................70
8.2 Drawing modes .......................................................................................71
GUI_SetDrawMode ..................................................................................71
8.3 Basic drawing routines .............................................................................72
GUI_ClearRect ........................................................................................72
GUI_DrawPixel ........................................................................................72
GUI_DrawPoint........................................................................................73
GUI_FillRect............................................................................................73
GUI_InvertRect .......................................................................................74
8.4 Drawing bitmaps .....................................................................................74
GUI_DrawBitmap.....................................................................................74
GUI_DrawBitmapExp................................................................................75
GUI_DrawBitmapMag ...............................................................................76
8.5 Drawing lines ..........................................................................................76
GUI_DrawHLine.......................................................................................77
GUI_DrawLine.........................................................................................77
GUI_DrawLineRel ....................................................................................77
GUI_DrawLineTo .....................................................................................78
GUI_DrawPolyLine ...................................................................................78
GUI_DrawVLine.......................................................................................78
8.6 Drawing polygons ....................................................................................79
GUI_DrawPolygon....................................................................................79
GUI_EnlargePolygon ................................................................................79
GUI_FillPolygon.......................................................................................80
GUI_MagnifyPolygon ................................................................................81
GUI_RotatePolygon..................................................................................82
Example.................................................................................................82
8.7 Drawing circles........................................................................................84
GUI_DrawCircle.......................................................................................84
GUI_FillCircle ..........................................................................................85
8.8 Drawing ellipses ......................................................................................86
GUI_DrawEllipse......................................................................................86
GUI_FillEllipse .........................................................................................86
8.9 Drawing arcs...........................................................................................87
GUI_DrawArc ..........................................................................................87
9 Bitmap Converter...........................................................................................................91
9.1 Converting the image...............................................................................92
9.2 Supported bitmap input formats ................................................................92
9.3 Supported output formats.........................................................................92
9.4 Compressed bitmaps................................................................................92
9.5 Image conversion ....................................................................................93
9.6 Using a custom palette.............................................................................93
File format for custom palette ...................................................................93
Custom palette sample file........................................................................93
评论1