Library installation
uGLCD library is packed into two installation files using Package Manager (one with main lib and drivers, and separate one with fonts), so it's installation/deinstallation is straightforward with the same program. Just follow the instructions from Help of Package Manager, and the library will be installed in Packages subdirectory of compiler installation directory and available for those PIC18 processors that you chose during installation (all PIC18s are checked in the packages, but one may choose only one or few processors).
Elements of the library (main lib, hardware units, and fonts) will be visible in the Library Manager for every chosen processor. Work with the library follows the same rules as with other libraries. Please read the "Library use" chapter from Help for details.
Mentioned above Help file, uGLCDlib.chm, that comes with the library is automatically placed by the Package Manager in directory ...Packages\uGLCD\help. To invoke it, double-click on a library item in Library Manager - a window will open with path to the Help file where you may run it. (Unfortunately, there is no other mechanism built in compiler's IDE for user libs help.) Another choice is to place a shortcut to the Help file on desktop.
Two programs for PC (Bitmap2Array, uGLCDfonts) are included in the archive - their purpose is explained below and in Help file.
Short description
The library consists of two parts - the main, precompiled lib file, uGLCDlib.mcl, and hardware dependent part, for example, uGLCD_KS107.mpas. The latter contains all low-level functions for communication with specific GLCD (in this case, one with KS107/8 controller). It's possible, therefore, to modify it, for example for work with GLCD connected by a serial interface, like SPI. One may also write own hardware driver taking the supplied drivers as examples.
The library draws text and graphics on GLCD screen using coordinates x (0..GLCDmaxX) and y (0..GLCDmaxY), where (0,0) corresponds to left-top display corner, and GLCDmaxX, GLCDmaxY are constants declared in the hardware-dependent library part.
To save program memory space and ease programming effort, the font files format has been changed, compared to mE fonts, or fonts produced by GLCD Font Creator Mikroelektronika Edition. A PC program, called uGLCDfonts may be used to change the format of fonts produced by the latter to one applicable to uGLCD lib. The new format encapsulates additional information about font type, size and offset, thus freeing the programmer from specifying these details whenever a font is declared.
The library contains definitions of text, draw and plot styles and properties. Properties may be set and read with appropriate routines while the styles are set of constants used with appropriate text or graphics drawing routines.
Images may be stored in ROM (and RAM) in a 'packed' form substantially reducing required memory. A PC program, called Bitmap2Array (included in the package), may be used to convert bitmaps to screens and icons. It may produce regular or 'packed' version of graphics array. Naturally, appropriate library routines perform the 'unpacking' while drawing on GLCD.
It's possible to redirect all text and graphics drawing functions to a virtual screen(s) located in RAM if the hardware-dependent unit has been compiled with RAMdraw switch (uncommented respective DEFINE directive). There are routines that allow to switch on and off the RAM screen redirection as well as to move data between virtual and real screen. With write-only displays use of virtual screen is the only choice for advanced drawing.
Library Routines
To allow quick estimate of the extent of the library, routines of the main lib unit are listed below. The hardware parts of the library (drivers fo particular GLCD model) may contain other user routines besides those needed by the main unit for communication with the GLCD. One of them will always be uGLCD_Init that has to be called to initialize GLCD and needed variables. (All library routine names start with 'uGLCD_' but this part was removed for clarity in the list below.)Set_Transparency Get_Transparency Set_Add_Column Get_Add_Column Set_Aspect_ratio Get_Aspect_ratio Set_Clipped Get_Clipped SetRAMdraw CancelRAMdrawText
Set_Font Is_Fixed_Width Font_Height Char_Width Text_Width Write_Char Write_Text Text_EraseGraphics
Fill Image Image_Packed Area Area2RAM RAM2Area Screen2RAM RAM2Screen Screen2GLCD Icon Icon_RAM Invert_Icon ShiftHor GetPixel SetPixel Dot Line H_Line V_Line Rectangle RoundRect Rectangle_Round_Edges Box Full_Box Box_Patt Square Ellipse Circle FillArea Button ButtonDown ButtonUp