Introduction

Microchip Graphics Library
Contents | Index | Home
Next
Introduction

This document explains how to get started with Microchip Graphics Library solution. It presents the available resources and where to obtain these resources. It also includes the Application Programming Interface (API) of the Microchip Graphics Library.

The Microchip Graphics Library is highly modular and is optimized for Microchip’s 16-bit microcontrollers. Additionally, the library is free for Microchip customers, easy to use, and has an open documented interface for new driver support, which requires creation of only one C file.

The Microchip Graphics Library Software Version 3.04.02 supports the following features:

  • Configurable graphic resolution
  • Up to 16-bit or 65K colors
  • 2D objects such as line, circle, text, rectangle, polygon, bar
  • 3D objects such as buttons, meter, dial, list box, edit box, check box, radio buttons, window, group box, slider.
  • Image, animation
  • Variety of user input device such as touch screen, keypad etc...
  • Multiple fonts
  • Unicode fonts
  • PIC24 support, PIC32 support
Introduction
Microchip Graphics Library Version 3.04.02 - April 3, 2012
Copyright © 2012 Microchip Technology, Inc. All rights reserved


Software License Agreement.txt

Contents | Index | Home
Previous | Next
Software License Agreement.txt

MICROCHIP IS WILLING TO LICENSE THE ACCOMPANYING SOFTWARE AND DOCUMENTATION TO YOU ONLY ON THE CONDITION THAT YOU ACCEPT ALL OF THE FOLLOWING TERMS. TO ACCEPT THE TERMS OF THIS LICENSE, CLICK "I ACCEPT" AND PROCEED WITH THE DOWNLOAD OR INSTALL. IF YOU DO NOT ACCEPT THESE LICENSE TERMS, CLICK "I DO NOT ACCEPT," AND DO NOT DOWNLOAD OR INSTALL THIS SOFTWARE.

NON-EXCLUSIVE SOFTWARE LICENSE AGREEMENT

This Nonexclusive Software License Agreement ("Agreement") is a contract between you, your heirs, successors and assigns ("Licensee") and Microchip Technology Incorporated, a Delaware corporation, with a principal place of business at 2355 W. Chandler Blvd., Chandler, AZ 85224-6199, and its subsidiary, Microchip Technology (Barbados) II Incorporated (collectively, "Microchip") for the accompanying Microchip software including, but not limited to, Graphics Library Software, IrDA Stack Software, MCHPFSUSB Stack Software, Memory Disk Drive File System Software, mTouch(TM) Capacitive Library Software, Smart Card Library Software, TCP/IP Stack Software, MiWi(TM) DE Software, Security Package Software, and/or any PC programs and any updates thereto (collectively, the "Software"), and accompanying documentation, including images and any other graphic resources provided by Microchip ("Documentation").

  1. Definitions. As used in this Agreement, the following capitalized terms will have the meanings defined below: a. "Microchip Products" means Microchip microcontrollers and Microchip digital signal controllers. b. "Licensee Products" means Licensee products that use or incorporate Microchip Products. c. "Object Code" means the Software computer programming code that is in binary form (including related documentation, if any), and error corrections, improvements, modifications, and updates. d. "Source Code" means the Software computer programming code that may be printed out or displayed in human readable form (including related programmer comments and documentation, if any), and error corrections, improvements, modifications, and updates. e. "Third Party" means Licensee?s agents, representatives, consultants, clients, customers, or contract manufacturers. f. "Third Party Products" means Third Party products that use or incorporate Microchip Products.
  2. Software License Grant. Microchip grants strictly to Licensee a non-exclusive, non-transferable, worldwide license to: a. use the Software in connection with Licensee Products and/or Third Party Products; b. if Source Code is provided, modify the Software; provided that Licensee clearly notifies Third Parties regarding the source of such modifications; c. distribute the Software to Third Parties for use in Third Party Products, so long as such Third Party agrees to be bound by this Agreement (in writing or by "click to accept") and this Agreement accompanies such distribution; d. sublicense to a Third Party to use the Software, so long as such Third Party agrees to be bound by this Agreement (in writing or by "click to accept"); e. with respect to the TCP/IP Stack Software, Licensee may port the ENC28J60.c, ENC28J60.h, ENCX24J600.c, and ENCX24J600.h driver source files to a non-Microchip Product used in conjunction with a Microchip ethernet controller; f. with respect to the MiWi (TM) DE Software, Licensee may only exercise its rights when the Software is embedded on a Microchip Product and used with a Microchip radio frequency transceiver or UBEC UZ2400 radio frequency transceiver which are integrated into Licensee Products or Third Party Products. For purposes of clarity, Licensee may NOT embed the Software on a non-Microchip Product, except as described in this Section.
  3. Documentation License Grant. Microchip grants strictly to Licensee a non-exclusive, non-transferable, worldwide license to use the Documentation in support of Licensee's authorized use of the Software
  4. Third Party Requirements. Licensee acknowledges that it is Licensee?s responsibility to comply with any third party license terms or requirements applicable to the use of such third party software, specifications, systems, or tools. This includes, by way of example but not as a limitation, any standards setting organizations requirements and, particularly with respect to the Security Package Software, local encryption laws and requirements. Microchip is not responsible and will not be held responsible in any manner for Licensee?s failure to comply with such applicable terms or requirements.
  5. Open Source Components. Notwithstanding the license grant in Section 1 above, Licensee further acknowledges that certain components of the Software may be covered by so-called "open source" software licenses ("Open Source Components"). Open Source Components means any software licenses approved as open source licenses by the Open Source Initiative or any substantially similar licenses, including without limitation any license that, as a condition of distribution of the software licensed under such license, requires that the distributor make the software available in source code format. To the extent required by the licenses covering Open Source Components, the terms of such license will apply in lieu of the terms of this Agreement. To the extent the terms of the licenses applicable to Open Source Components prohibit any of the restrictions in this Agreement with respect to such Open Source Components, such restrictions will not apply to such Open Source Component.
  6. Licensee Obligations. Licensee will not: (a) engage in unauthorized use, modification, disclosure or distribution of Software or Documentation, or its derivatives; (b) use all or any portion of the Software, Documentation, or its derivatives except in conjunction with Microchip Products, Licensee Products or Third Party Products; or (c) reverse engineer (by disassembly, decompilation or otherwise) Software or any portion thereof. Licensee may not remove or alter any Microchip copyright or other proprietary rights notice posted in any portion of the Software or Documentation. Licensee will defend, indemnify and hold Microchip and its subsidiaries harmless from and against any and all claims, costs, damages, expenses (including reasonable attorney's fees), liabilities, and losses, including without limitation: (x) any claims directly or indirectly arising from or related to the use, modification, disclosure or distribution of the Software, Documentation, or any intellectual property rights related thereto; (y) the use, sale and distribution of Licensee Products or Third Party Products; and (z) breach of this Agreement.
  7. Confidentiality. Licensee agrees that the Software (including but not limited to the Source Code, Object Code and library files) and its derivatives, Documentation and underlying inventions, algorithms, know-how and ideas relating to the Software and the Documentation are proprietary information belonging to Microchip and its licensors ("Proprietary Information"). Except as expressly and unambiguously allowed herein, Licensee will hold in confidence and not use or disclose any Proprietary Information and will similarly bind its employees and Third Party(ies) in writing. Proprietary Information will not include information that: (i) is in or enters the public domain without breach of this Agreement and through no fault of the receiving party; (ii) the receiving party was legally in possession of prior to receiving it; (iii) the receiving party can demonstrate was developed by the receiving party independently and without use of or reference to the disclosing party's Proprietary Information; or (iv) the receiving party receives from a third party without restriction on disclosure. If Licensee is required to disclose Proprietary Information by law, court order, or government agency, License will give Microchip prompt notice of such requirement in order to allow Microchip to object or limit such disclosure. Licensee agrees that the provisions of this Agreement regarding unauthorized use and nondisclosure of the Software, Documentation and related Proprietary Rights are necessary to protect the legitimate business interests of Microchip and its licensors and that monetary damage alone cannot adequately compensate Microchip or its licensors if such provisions are violated. Licensee, therefore, agrees that if Microchip alleges that Licensee or Third Party has breached or violated such provision then Microchip will have the right to injunctive relief, without the requirement for the posting of a bond, in addition to all other remedies at law or in equity.
  8. Ownership of Proprietary Rights. Microchip and its licensors retain all right, title and interest in and to the Software and Documentation including, but not limited to all patent, copyright, trade secret and other intellectual property rights in the Software, Documentation, and underlying technology and all copies and derivative works thereof (by whomever produced). Licensee and Third Party use of such modifications and derivatives is limited to the license rights described in this Agreement.
  9. Termination of Agreement. Without prejudice to any other rights, this Agreement terminates immediately, without notice by Microchip, upon a failure by Licensee or Third Party to comply with any provision of this Agreement. Upon termination, Licensee and Third Party will immediately stop using the Software, Documentation, and derivatives thereof, and immediately destroy all such copies.
  10. Warranty Disclaimers. THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. MICROCHIP AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR THE ACCURACY, RELIABILITY OR APPLICATION OF THE SOFTWARE OR DOCUMENTATION. MICROCHIP AND ITS LICENSORS DO NOT WARRANT THAT THE SOFTWARE WILL MEET REQUIREMENTS OF LICENSEE OR THIRD PARTY, BE UNINTERRUPTED OR ERROR-FREE. MICROCHIP AND ITS LICENSORS HAVE NO OBLIGATION TO CORRECT ANY DEFECTS IN THE SOFTWARE.
  11. Limited Liability. IN NO EVENT WILL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER ANY LEGAL OR EQUITABLE THEORY FOR ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT LIMITED TO INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS. The aggregate and cumulative liability of Microchip and its licensors for damages hereunder will in no event exceed $1000 or the amount Licensee paid Microchip for the Software and Documentation, whichever is greater. Licensee acknowledges that the foregoing limitations are reasonable and an essential part of this Agreement.
  12. General. THIS AGREEMENT WILL BE GOVERNED BY AND CONSTRUED UNDER THE LAWS OF THE STATE OF ARIZONA AND THE UNITED STATES WITHOUT REGARD TO CONFLICTS OF LAWS PROVISIONS. Licensee agrees that any disputes arising out of or related to this Agreement, Software or Documentation will be brought exclusively in either the U.S. District Court for the District of Arizona, Phoenix Division, or the Superior Court of Arizona located in Maricopa County, Arizona. This Agreement will constitute the entire agreement between the parties with respect to the subject matter hereof. It will not be modified except by a written agreement signed by an authorized representative of Microchip. If any provision of this Agreement will be held by a court of competent jurisdiction to be illegal, invalid or unenforceable, that provision will be limited or eliminated to the minimum extent necessary so that this Agreement will otherwise remain in full force and effect and enforceable. No waiver of any breach of any provision of this Agreement will constitute a waiver of any prior, concurrent or subsequent breach of the same or any other provisions hereof, and no waiver will be effective unless made in writing and signed by an authorized representative of the waiving party. Licensee agrees to comply with all import and export laws and restrictions and regulations of the Department of Commerce or other United States or foreign agency or authority. The indemnities, obligations of confidentiality, and limitations on liability described herein, and any right of action for breach of this Agreement prior to termination, will survive any termination of this Agreement. Any prohibited assignment will be null and void. Use, duplication or disclosure by the United States Government is subject to restrictions set forth in subparagraphs (a) through (d) of the Commercial Computer-Restricted Rights clause of FAR 52.227-19 when applicable, or in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013, and in similar clauses in the NASA FAR Supplement. Contractor/manufacturer is Microchip Technology Inc., 2355 W. Chandler Blvd., Chandler, AZ 85224-6199.

If Licensee has any questions about this Agreement, please write to Microchip Technology Inc., 2355 W. Chandler Blvd., Chandler, AZ 85224-6199 USA. ATTN: Marketing.

Copyright (c) 2012 Microchip Technology Inc. All rights reserved.

License Rev. No. 05-012412

Software License Agreement.txt


Release Notes

Contents | Index | Home
Previous | Next
Release Notes

Microchip Graphics Library Release Notes

Version 3.04.02 (2012-04-03)

This library provides support for the display modules with built in graphics controller and displays connected to external graphics controller. Documentation for the Microchip Graphics Library can be found in this file:

  • Graphics Library Help.chm

Version Log

New:

  • No new items on this release.

Changes:

  • Structure of this help file is modified. Section names that list APIs now has the API in the name.

Fixes:

  • Fix BarGradient() and BevelGradient() when USE_NONBLOCKING_CONFIG config is enabled.
  • Added missing GbSetText() function in GroupBox widget.
  • Fix SetPalette() to work with palette stored in external memory.

Deprecated Items:

  • TYPE_MEMORY - replaced by GFX_RESOURCE
  • EXTDATA - replaced by GFX_EXTDATA
  • BITMAP_FLASH - replaced by IMAGE_FLASH
  • BITMAP_RAM - replaced by IMAGE_RAM
  • BITMAP_EXTERNAL - replaced by GFX_EXTDATA
  • EEPROM.h and EEPROM.c are replaced by the following files:
    • MCHP25LC256.c - source code
    • MCHP25LC256.h - header file
    • in the HardwareProfile.h add #define USE_MCHP25LC256 to use the new driver.

Migration Changes:

  • none

Known Issues:

  • Extended glyph for certain font (such as Thai) when used with Static text widget is clipped. Future version will add additional vertical text alignment to the static text widget
  • Anti-aliasing and extended glyph features are not supported when using PIC24FJ256DA210 CHRGPU.
  • SPI flash programming on the Epson S1D13517 PICtail board Rev 1.1 is not always reliable, the S1D13517 demo no longer uses external memory flash in the example.
  • When using PIC24FJ256GB210 PIM with Explorer 15 board with a 5v Lumex LCD display, the S1D13517 demo does not run correctly.

Application Notes

  • AN1136 How to Use Widgets in Microchip Graphics Library
  • AN1182 Fonts in the Microchip Graphics Library
  • AN1227 Using a Keyboard with the Microchip Graphics Library
  • AN1246 How to Create Widgets in Microchip Graphics Library
  • AN1368 Developing Graphics Applications using PIC MCU with Integrated Graphics Controller

PIC Family

This version of the library supports PIC24, dsPIC and PIC32 Family.

Development Tools

This graphics library release (v3.04) was tested with IDEs MPLAB v8.83 and MPLAB X 1.00; compilers C30 v3.31c and C32 v2.02a.

There is a known compatibility issue between the graphics library and C30 v3.25. using C30 3.25 is not recommended for graphics library development.

Display Modules

The display driver layer of the library is organized to easily switch from one display driver to another. Use of customized display driver is allowed and in the Display Device Driver Layer section. Following graphics controllers are supported in this version:

Display Module | Interface | File Names
Microchip Graphics Display Driver - customizable driver for RGB Glass. Currently used in PIC24FJ256DA210 device family. | RGB | mchpGfxDrv.c, mchpGfxDrv.h
Microchip Low-Cost Controllerless (LCC) Graphics Display Driver - customizable driver for RGB Glass. Currently used for selected PIC32MX device families. | RGB | mchpGfxLCC.c, mchpGfxLCC.h
Samsung S6D0129/S6D0139 | 8/16 bit PMP | drvTFT001.c, drvTFT001.h
LG LGDP4531 | 8/16 bit PMP | drvTFT001.c, drvTFT001.h
Renesas R61505U/R61580 | 8/16 bit PMP | drvTFT001.c, drvTFT001.h
Orise Technology SPDF5408 | 8/16 bit PMP | drvTFT001.c, drvTFT001.h
Epson S1D13517 | 8/16 bit PMP | S1D13517.c, S1D13517.h
Solomon Systech SSD1926 | 8/16 bit PMP | SSD1926.c, SSD1926.h
Solomon Systech SSD1289 | 8/16 bit PMP | drvTFT002.c, drvTFT002.h
Solomon Systech SSD1339 for OLED displays | 8 bit PMP | SSD1339.c, SSD1339.h
Solomon Systech SSD1303 for OLED displays | 8 bit PMP | SH1101A_SSD1303.c, SH1101A_SSD1303.h
Solomon Systech SSD1305 for OLED displays | 8 bit PMP | SSD1305.c, SSD1305.h
Solomon Systech SSD2119 | 8/16 bit PMP | drvTFT002.c, drvTFT002.h
Sino Wealth SH1101A for OLED displays | 8 bit PMP | SH1101A_SSD1303.c, SH1101A_SSD1303.h
Sitronix ST7529 | 8 bit PMP | ST7529.c, ST7529.h
Hitech Electronics HIT1270 | 8 bit PMP | HIT1270.c, HIT1270.h
Ilitek ILI9320 | 8/16 bit PMP | drvTFT001.c, drvTFT001.h
Himax HX8347 | 8/16 bit PMP | HX8347.c, HX8347.h
UltraChip UC1610 | 8 bit PMP | UC1610.c, UC1610.h

Please refer to Adding New Device Driver section to get more information on adding support for another LCD controller.

Widgets

In this version the following widgets are implemented:

  • Analog Clock
  • Button
  • Chart
  • Checkbox
  • Dial
  • Digital Meter
  • Edit Box
  • Grid
  • Group Box
  • List Box
  • Meter
  • Picture Control
  • Progress Bar
  • Radio Button
  • Slider / Scroll Bar
  • Static Text
  • Text Entry
  • Window

This version of the library supports touch screen, side buttons and a variety of key pad configurations as a user input device.

Required Resources

The library utilizes the following estimated MCU resources (in # of bytes):

Module | Heap for PIC24F | Heap for PIC32 | RAM for PIC24F | RAM for PIC32 | ROM for PIC24F | ROM for PIC32
Primitives Layer | 0 | 0 | 68 | 53 | 3375 | 8868
GOL | 20 (per style scheme) | 24 (per style scheme) | 32 | 28 | 2076 | 5400
Button | 28 (per instance) | 44 (per instance) | 8 | 12 | 1002 | 2748
Chart | 48 (per instance) | 76 (per instance) | 94 | 104 | 11427 | 26364
Check Box | 22 (per instance) | 36 (per instance) | 2 | 4 | 894 | 2320
Dial | 30 (per instance) | 40 (per instance) | 8 | 12 | 1065 | 3228
Digital Meter | 28 (per instance) | 56 (per instance) | 2 | 4 | 1125 | 2202
Edit Box | 26 (per instance) | 40 (per instance) | 2 | 4 | 822 | 2332
Group Box | 24 (per instance) | 36 (per instance) | 8 | 12 | 903 | 2164
List Box | 28 (per instance), 12 (per item) | 44 (per instance) | 6 | 12 | 1809 | 2580
Meter | 52 (per instance) | 68 (per instance) | 36 | 40 | 2778 | 6788
Picture Control | 22 (per instance) | 36 (per instance) | 10 | 12 | 645 | 1512
Progress Bar | 24 (per instance) | 36 (per instance) | 12 | 16 | 1050 | 2452
Radio Button | 26 (per instance) | 44 (per instance) | 14 | 20 | 993 | 2632
Slider / Scroll Bar | 32 (per instance) | 44 (per instance) | 20 | 24 | 2094 | 5720
Static Text | 22 (per instance) | 36 (per instance) | 8 | 12 | 747 | 1884
Text Entry | 34 (per instance), (24 per key) | 52 (per instance) | 22 | 28 | 2484 | 6376
Window | 24 (per instance) | 40 (per instance) | 2 | 4 | 804 | 1996

The heap is a dynamic memory requirement. It is released when screen is destroyed. Please consider screen with maximum number of objects to calculate worse case RAM requirement. If for worse case you have 6 buttons, 2 sliders and 2 edit box on screen that utilizes three style schemes then worse case dynamic memory requirement will be 6*28 + 2*32 + 2*26 + 3*20; 344 bytes. The RAM requirement in column 4 doesn’t change based on number of instances. If object is included in code then it will take fix amount of RAM irrespective of its usage.

Each font may require 7 – 10KB of program memory. This is for English fonts. This requirement may change for other languages with additional characters.

Images require additional memory. The memory requirement for images depends on color depth and size.

The fonts and images can be stored in internal memory or external memory. The external memory can be anything serial EEPROM, parallel Flash, SD card etc. The application provides physical interface code for these devices.

Previous Versions Log

v3.04 (2012-02-15)

New:

  • Font Table is updated to version 2 to accommodate anti-alias font, and extended glyph.
    • Added anti-aliasing support for fonts (2bpp). See Primitive demo for an example.
    • Added extended-glyph support for fonts. See demo in the AppNote demo - AN1182, This demo now includes Hindi and Thai font.
  • Added 32-bit CRC code for resources to be placed in external memory. This CRC value can be used to verify if the data in external memory is valid or not. Refer to Graphics Resource Converter release notes for details. Demos that uses external memory as a resource are now checking the CRC value, and if invalid, automatically requests for external memory resource programming.
  • Added new demos specific to PIC24FJ256DA210:
    • Elevator Demo - This demo shows an elevator status monitor that indicates the current location of the elevator car.
    • RCCGPU-IPU Demo - formerly PIC24F_DA Demo. This demo shows how RCCGPU and IPU modules are used.
    • Color Depth Demo - This demos shows how 1bpp, 4bpp and 8 bpp color depths applications are implemented.
    • Remote Control Demo - This demo shows how a universal remote control can be implemented using RF4CE communication protocol. This demo also integrates the MRF24J40MA (a certified 2.4 GHz IEEE 802.15.4 radio transceiver module) for sending RF4CE messages to the paired device.
  • Added driver for Solomon Systech 132x64 OLED/PLED Display Controller SSD1305

Changes:

  • Modified Resistive Touch Screen calibration. Now the calibration stores the 8 touch points to support large touch panels.
  • Modified 4-wire Resistive Touch Screen driver to support build time setting of single samples and auto-sampling of resistive touch inputs.
  • Naming of internal and external resource files (files that defined fonts and images) in most demos are now standardized to use the same naming convention.
  • Support for Graphics PICTail v2 (AC164127) is now discontinued.
  • Merged "JPEG" demo and "Image Decoders" demo to "Image Decoder" demo.
  • Graphics Resource Converter upgrade (Version 3.17.47) - refer to "Graphics Resource Converter Help.pdf" located in <Install Directory>\Microchip Solutions\Microchip\Graphics\bin\grc for details.
  • External Memory Programmer upgrade (Version 1.00.01) - refer to "External Memory Programmer Help.pdf" located in <Install Directory>\Microchip Solutions\Microchip\Graphics\bin\memory_programmer for details.

Fixes:

  • Fix PushRectangle() issue where one line of pixel is not being updated.
  • Fix TextEntry widget issue where the string is not displayed when the allocated string buffer length is equal to the maximum string length set in the widget.
  • Fonts maximum character height is now set to 2^16.

Deprecated Items:

  • TYPE_MEMORY - replaced by GFX_RESOURCE
  • EXTDATA - replaced by GFX_EXTDATA
  • BITMAP_FLASH - replaced by IMAGE_FLASH
  • BITMAP_RAM - replaced by IMAGE_RAM
  • BITMAP_EXTERNAL - replaced by GFX_EXTDATA
  • EEPROM.h and EEPROM.c are replaced by the following files:
    • MCHP25LC256.c - source code
    • MCHP25LC256.h - header file
    • in the HardwareProfile.h add #define USE_MCHP25LC256 to use the new driver.

Migration Changes:

  • For existing code that wants to use the new anti-aliased fonts or extended glyph features: regenerate the font tables using the "Graphics Resource Converter" with the check box for the required feature set to be enabled. For anti-aliased fonts, add the macro #define USE_ANTIALIASED_FONTS in the GraphicsConfig.h

Known Issues:

  • Extended glyph for certain font (such as Thai) when used with Static text widget is clipped. Future version will add additional vertical text alignment to the static text widget
  • Anti-aliasing and extended glyph features are not supported when using PIC24FJ256DA210 CHRGPU.
  • SPI flash programming on the Epson S1D13517 PICtail board Rev 1.1 is not always reliable, the S1D13517 demo no longer uses external memory flash in the example.
  • When using PIC24FJ256GB210 PIM with Explorer 15 board with a 5v Lumex LCD display, the S1D13517 demo does not run correctly.

v3.03 (v3.02)

New:

  • Added custom video playback from SD Card in SSD1926 Demo. Video frames are formatted to RGB565 format.
  • Added support for 1bpp, 4bpp and 8 bpp color depth on Chart widget.
  • Added support for Display Boards from Semitron
    • Seiko 35QVW1T
    • Seiko 43WVW1T

Changes:

  • Maximum font height is now 256 pixels.
  • Modified EditBox behavior
    • Caret is now by default enabled.
    • Caret can now be shown even if USE_FOCUS is disabled.
    • Applications can now respond to touchscreen event on EditBoxes when USE_FOCUS is disabled.
  • Modified resistive touchscreen calibration sequence.
  • Graphics Resource Converter upgrade (Version 3.8.21) - refer to "Graphics Resource Converter Help.pdf" located in <Install Directory>\Microchip Solutions\Microchip\Graphics\bin\grc for details.
  • External Memory Programmer upgrade (Version 1.00.01) - refer to "External Memory Programmer Help.pdf" located in <Install Directory>\Microchip Solutions\Microchip\Graphics\bin\memory_programmer for details.

Fixes:

  • Fix Low Cost Controller display driver issue when run with Resistive Touch Screen driver that uses single samples.
  • Fix issue on PIC24FJ256DA210 display driver PutImage()'s issue when using palette on 4 bpp and 1 bpp images.
  • Fix issue on PIC24FJ256DA210 display driver PutImage()'s missing lines when the image last pixel row or column falls on the edge of the screen.
  • Fix Resistive Touch Screen driver issue on rotated screens.
  • Fix GetImageHeight() GetImageWidth() issues for images that are RLE compressed.
  • EPMP module is now disabled when memory range defined for display buffer is located in internal memory.
  • Add default color definitions in gfxcolors.h for 1bpp, 4bpp 8bpp and 16 bpp. Added back legacy colors.
  • Fix HX8347 driver WritePixel() macro when using 16bit PMP mode.
  • Fix PIC24FJ256DA210 display driver issue on source data (continuous and discontinuous data) when doing block copies of memory using RCCGPU.

Deprecated Items:

  • TYPE_MEMORY - replaced by GFX_RESOURCE
  • EXTDATA - replaced by GFX_EXTDATA
  • BITMAP_FLASH - replaced by IMAGE_FLASH
  • BITMAP_RAM - replaced by IMAGE_RAM
  • BITMAP_EXTERNAL - replaced by GFX_EXTDATA
  • EEPROM.h and EEPROM.c are replaced by the following files:
    • MCHP25LC256.c - source code
    • MCHP25LC256.h - header file
    • in the HardwareProfile.h add #define USE_MCHP25LC256 to use the new driver.

Migration Changes:

  • EditBox widget's caret behavior is now by default enabled when USE_FOCUS is set. To disable, ignore all messages for the edit box by returning a zero when in GOLMsgCallback().

Known Issues:

  • PutImage() does not work when using PIC24FJ256DA210 and look up table is used on images located at EDS memory with color depth less than 8bpp.
  • External Memory Programmer utility does not work with Graphics PICTail v2 (AC164127)
  • When using PIC24FJ256GB210 PIM with Explorer 15 board with a 5v Lumex LCD display, the S1D13517 demo does not run correctly.
  • Font tables are limited to 256 pixel character height.

v3.02

New:

  • Added custom video playback from SD Card in SSD1926 Demo. Video frames are formatted to RGB565 format.
  • Added support for 1bpp, 4bpp and 8 bpp color depth on Chart widget.
  • Added support for Display Boards from Semitron
    • Seiko 35QVW1T
    • Seiko 43WVW1T

Changes:

  • Maximum font height is now 256 pixels.
  • Modified EditBox behavior
    • Caret is now by default enabled.
    • Caret can now be shown even if USE_FOCUS is disabled.
    • Applications can now respond to touchscreen event on EditBoxes when USE_FOCUS is disabled.
  • Modified resistive touchscreen calibration sequence.
  • Graphics Resource Converter upgrade (Version 3.8.21) - refer to "Graphics Resource Converter Help.pdf" located in <Install Directory>\Microchip Solutions\Microchip\Graphics\bin\grc for details.
  • External Memory Programmer upgrade (Version 1.00.01) - refer to "External Memory Programmer Help.pdf" located in <Install Directory>\Microchip Solutions\Microchip\Graphics\bin\memory_programmer for details.

Fixes:

  • Fix issue on PIC24FJ256DA210 display driver PutImage()'s missing lines when the image last pixel row or column falls on the edge of the screen.
  • Fix Resistive Touch Screen driver issue on rotated screens.
  • Fix GetImageHeight() GetImageWidth() issues for images that are RLE compressed.
  • EPMP module is now disabled when memory range defined for display buffer is located in internal memory.
  • Add default color definitions in gfxcolors.h for 1bpp, 4bpp 8bpp and 16 bpp. Added back legacy colors.
  • Fix HX8347 driver WritePixel() macro when using 16bit PMP mode.
  • Fix PIC24FJ256DA210 display driver issue on source data (continuous and discontinuous data) when doing block copies of memory using RCCGPU.

Deprecated Items:

  • TYPE_MEMORY - replaced by GFX_RESOURCE
  • EXTDATA - replaced by GFX_EXTDATA
  • BITMAP_FLASH - replaced by IMAGE_FLASH
  • BITMAP_RAM - replaced by IMAGE_RAM
  • BITMAP_EXTERNAL - replaced by GFX_EXTDATA
  • EEPROM.h and EEPROM.c are replaced by the following files:
    • MCHP25LC256.c - source code
    • MCHP25LC256.h - header file
    • in the HardwareProfile.h add #define USE_MCHP25LC256 to use the new driver.

Migration Changes:

  • EditBox widget's caret behavior is now by default enabled when USE_FOCUS is set. To disable, ignore all messages for the edit box by returning a zero when in GOLMsgCallback().

Known Issues:

  • PutImage() does not work when using PIC24FJ256DA210 and look up table is used on images located at EDS memory with color depth less than 8bpp.
  • External Memory Programmer utility does not work with Graphics PICTail v2 (AC164127)
  • When using PIC24FJ256GB210 PIM with Explorer 15 board with a 5v Lumex LCD display, the S1D13517 demo does not run correctly.
  • Font tables are limited to 256 pixel character height.

v3.01 (v3.00)

New:

  • Graphics External Memory Programmer ported to java version.
    • Two options to program boards:
      • UART option if the board supports UART interface
      • USB option if the board support USB device interface
    • when installing the USB drivers for the programmer utility Use the drivers located in "<install directory>\Microchip\Utilities\USB Drivers\MPLABComm"
    • For detailed usage, please refer to the External Programmer help file
  • Added Analog Clock widget.
  • Added new driver Epson S1D13517 display driver with additional driver features:
    • Gradient
    • Alpha Blending
    • 16/24 bits per pixel (bpp)
  • Added new Graphics PICtail Plus Epson S1D13517 Board (AC164127-7)
  • Added new Graphics Display Truly 5.7" 640x480 Board (AC164127-8)
  • Added new Graphics Display Truly 7" 800x480 Board (AC164127-9)
  • Added 24bpp support.
  • Added a specific PIC24FJ256DA210 demo, PIC24F_DA
  • Graphics Resource Converter - refer to the Graphics Resource Converter help file for release note information.
  • New PIC32MX Low-Cost Controllerless Graphics PICTail Board (AC164144)
  • Added Run Length Encoding (RLE) compression for bitmap images.
    • RLE4 - compression for 4-bit palette (16 color) images
    • RLE8 - compression for 8-bit palette (256 color) images
  • Added Transparency feature for PutImage() functions in Primitive Layer. For Driver Layer, this feature is enabled in the following drivers:
    • mchpGfxDrv - Microchip Graphics Controller Driver
    • SSD1926 - Solomon Systech Display Controller Driver
  • Added new demo for Graphics PICtail Plus Epson S1D13517 Board (S1D13517 Demo)
  • Added AR1020 Resistive Touch Screen Controller beta support.
  • Added support for MikroElektronika "mikroMMB for PIC24" board.
  • Added DisplayBrightness() function for display drivers that have an option to control the display back light.
  • MPLAB X demo project support (BETA)
    • Tested with MPLAB X Beta 6
    • Each demo project contains multiple configuration schemes
  • The graphics object layer uses a default scheme structure. If the application wishes to use a different default scheme, the application will need to define GFX_SCHEMEDEFAULT in GraphicsConfig header file.

Changes:

  • Relocated all Graphics Demo projects under Graphics directory (<install directory>/Graphics).
  • Works with Graphics Display Designer version 2.1
  • Works with Graphics Resource Converter version 3.3
  • Removed IPU decoding from the Primitive demo
  • Removed ImageFileConverter application from Image Decoder demo
    • Use Graphics Resource Converter to generate output for the demo.
  • Shorten file name by using abbreviated names
    • Refer to abbreviations.htm in the Microchip help directory for details
  • Change the "Alternative Configurations" directory in the demos to "Configs"
  • Changed the "Precompiled Demos" directory in the demos to "Precompiled Hex"
  • Combined all application note demos (AN1136, AN1182, AN1227 and AN1246) into one demo project (AppNotes).
  • Modified External Memory and JPEG demos to include USB device mode to program external flash memory.
  • Moved the location of the COLOR_DEPTH setting from the HardwareProfile.h to the GraphicsConfig.h
  • Removed USE_DRV_FUNCTIONNAME (example USE_DRV_LINE to implement the Line() function in the driver) option to implement Primitive Layer functions in the Driver Layer. The Primitive Layer functions are now modified to have weak attributes, so when the driver layer implements the same function, the one in the driver will be used at build time.
  • Modified HardwareProfile.h for Graphics demo boards and development Platforms.
    • When using Resistive Touch Screen: add macro USE_TOUCHSCREEN_RESISTIVE
    • When using AR1020 as the touch screen controller: add macro USE_TOUCHSCREEN_AR1020
    • When using SPI Flash Memory (SST25VF016) in Graphics Development Boards: add macro USE_SST25VF016
    • When using Parallel Flash Memory (SST39LF400) in PIC24FJ256DA210 Development Board: add macro USE_SST39LF400
    • When using Parallel Flash Memory (SST39LF400) in PIC24FJ256DA210 Development Board: add macro USE_SST39LF400
    • Added function pointers for Non-Volatile Memories when used in the Demos.
      • NVM_SECTORERASE_FUNC - function pointer to sector erase function.
      • NVM_WRITE_FUNC - function pointer to write function.
      • NVM_READ_FUNC - function pointer to read function.
  • Display Driver Layer architecture is changed. Refer to Adding New Device Driver for new requirements.
  • Modified Resistive Touch Driver calibration
  • In the PIC24FJ256DA210 driver, CopyWindow() is modified to CopyBlock().

Fixes:

  • Fixed issue on vertical Progress Bar rendering.
  • Updated demos Google map and JPEG to use the proper GFX_RESOURCE identifiers for JPEG resources
  • HX8347 driver now compiles and works with 'mikroMMB for PIC24'
  • Bug fixes in the digital meet and cross hair widgets
  • Removed references to the PIC24 configuration bit COE_OFF.
  • Fixed issue on PutImage() when using PIC24FJ256DA210 and look up table is used on images located at internal or external SPI flash with color depth less than 8bpp.
  • Fixed issue on Line() in the SSD1926 and mchpGfxDrv driver files. The stored coordinates after a successful rendering of a line will be at the end point (x2,y2).

Deprecated Items:

  • TYPE_MEMORY - replaced by GFX_RESOURCE
  • EXTDATA - replaced by GFX_EXTDATA
  • BITMAP_FLASH - replaced by IMAGE_FLASH
  • BITMAP_RAM - replaced by IMAGE_RAM
  • BITMAP_EXTERNAL - replaced by GFX_EXTDATA

Migration Changes:

  • DisplayDriver.c is not used to select the display driver (the file is not a part of the graphics library release package).
    • The application should include the driver(s) in the project. Multiple driver files can be included in one project because the hardware profile will define the driver and only that driver's source code will be used.
      • For example, a project may be designed to use the Microchip's PIC24FJ256DA210 graphics controller and the SSD1926 depending on the hardware profile used. The project will include the following source files, SSD1926.c and mchpGfxDrv.c, among the graphics source files. The hardware profile will contain the following macros, GFX_USE_DISPLAY_CONTROLLER_SSD1926 and GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210, to select the SSD1926 and Microchip's PIC24FJ256DA210 graphics controller, respectively.
  • When using PIC24FJ256DA210, the driver files are now changed to:
    • mchpGfxDrv.c - source code
    • mchpGfxDrv.h - header file
    • mchpGfxDrvBuffer.c - source code that declares display buffer, work areas and cache areas for IPU operations in EDS.
  • The touch screen drivers in the "Board Support Package" directory are renamed to:
    • TouchScreenResistive.c - internal resistive touch source code
    • TouchScreenResistive.h - internal resistive touch header file
    • TouchScreenAR1020.c - external AR1020 touch source code
    • TouchScreenAR1020.h - external AR1020 touch header file
    • The two original files (TouchScreen.c and TouchScreen.h) are still needed since they are defining common interfaces to resistive touch drivers.
    • When using the internal resistive touch module, the project will contain TouchScreenResistive.c and TouchScreen.c. All modules that reference touch screen APIs will include TouchScreen.h header file.
    • When using the external AR1020 touch module, the project will contain TouchScreenAR1020.c and TouchScreen.c. All modules that reference touch screen APIs will include TouchScreen.h header file.
    • The touch screen initialization routine API has changed. The new TouchInit API has four parameters passed. Please refer to the API definition for more details.
  • When using the Potentiometer on the graphics development boards, include in your project the following files found in the "Board Support Package" directory :
    • TouchScreenResistive.c - source code
    • TouchScreenResistive.h - header file
    • Potentiometer.h - contains the APIs for the A/D interface.
  • EEPROM.h and EEPROM.c are going to be deprecated. Use the two new files:
    • MCHP25LC256.c - source code
    • MCHP25LC256.h - header file
    • in the HardwareProfile.h add #define USE_MCHP25LC256 to use the new driver.
  • A SPI driver has been created to support projects with multiple devices on one SPI channel.
    • Projects will need to include the source file drv_spi.c in projects that use devices on a SPI channel.
  • SPI Flash initialization routines will need to pass a DRV_SPI_INIT_DATA structure. This structure defines the SPI control and bit rate used by the SPI Flash module.
  • The COLOR_DEPTH macro has been moved from the hardware profile header file to the GraphicsConfig.h header file.
  • For project migration please refer the graphics demos for examples.

Known Issues:

  • PutImage() does not work when using PIC24FJ256DA210 and look up table is used on images located at EDS memory with color depth less than 8bpp.
  • PutImage() of when using PIC24FJ256DA210 for 8bpp images is missing the last row and last column of the bitmap when the image is from external memory, look up table is used and the screen is rotated 90 degrees.
  • When compiling the Analog Clock source code with C30 v3.24 the optimization setting must be set to 0 (none).
  • External Memory Programmer utility does not work with Graphics PICTail v2 (AC164127)
  • When using PIC24FJ256GB210 PIM with Explorer 15 board with a 5v Lumex LCD display, the S1D13517 demo does not run correctly.
  • Font tables are limited to 256 pixel character height. For fonts generated for external memory, the maximum height limitation is 128 pixels.

v2.11

New:

  • Graphics Resource Converter (GRC) ported to java version.
  • Added support for Inflate Processing Unit (IPU) and Character Processing Unit (CHRGPU)of the Microchip Graphics Module implemented in PIC24FJ256DA210.
  • Added new "Google Map Demo" for PIC32MX795F512L and PIC24FJ256DA210 device.
  • Added SST39LF400 Parallel Flash Memory driver in "Board Support Package". This is the driver for the parallel flash on the "PIC24FJ256DA210 Development Board".
  • Added demo support for PIC32 MultiMedia Expansion Board (DM320005).
  • Added GFX_IMAGE_HEADER structure. This structure defines how the image(s) are accessed and processed by the Graphics Library.
  • Added a third option (#define XCHAR unsigned char) on the XCHAR usage. This is provided as an option to use characters with IDs above 127 and below 256. With this option, European fonts that uses characters with character IDs above 127 and below 256 can now be generated and used in the library.
  • Added a scheme to replace the default font GOLFontDefault in the library with any user defined fonts. Refer to "Changing the default Font" for details.

Changes:

  • Added compile switches to all drivers in "Board Support Package" for options to compile out when not used in specific projects.
  • Replaced TYPE_MEMORY with GFX_RESOURCE type enumeration and expanded the enumeration for graphics resources (such as images and fonts). GFX_RESOURCE type will determine the source and the data format of the resource (compressed or uncompressed).
  • Changes on the macros used on the "Graphics JPEG Demo":
Copy Code
// Valid values of the first field for JPEG_FLASH and JPEG_EXTERNAL structures
#define FILE_JPEG_FLASH     2   // the JPEG file is located in internal flash
#define FILE_JPEG_EXTERNAL  3   // the JPEG file is located in external memory

to

Copy Code
// Valid values of the first field for JPEG_FLASH and JPEG_EXTERNAL structures
#define FILE_JPEG_FLASH     0   // the JPEG file is located in internal flash
#define FILE_JPEG_EXTERNAL  1   // the JPEG file is located in external memory
  • Added function pointers to GOL structure OBJ_HEADER. These function pointers makes it easier to add user created objects in the Graphics Library.
    • DRAW_FUNC - function pointer to object drawing function.
    • FREE_FUNC - function pointer to object free function. Only for objects that needs free routines to effectively free up memory used by the object create function.
    • MSG_FUNC - function pointer to object message function.
    • MSG_DEFAULT_FUNC - function pointer to object default message function.
  • Merged "Graphics External Memory Demo" and "Graphics External Memory Programmer" into one demo "Graphics External Memory Programmer and Demo".

Fixes:

  • TouchScreen driver now checks display orientation and adjusts the touch to be aligned to the display orientation.
  • Fixed GOLFocusNext() issue on list that does not contain an object that can be focused.
  • Removed redundant code in GOLRedrawRec().
  • Added an option in XCHAR to use unsigned char.

Deprecated Items:

  • TYPE_MEMORY - replaced by GFX_RESOURCE
  • EXTDATA - replaced by GFX_EXTDATA
  • BITMAP_FLASH - replaced by IMAGE_FLASH
  • BITMAP_RAM - replaced by IMAGE_RAM
  • BITMAP_EXTERNAL - replaced by GFX_EXTDATA

Migration Changes:

  • To use drivers located in "Board Support Package" directory, add the USE_DRIVERNAME macro in application code (in the demos these are added in the HardwareProfile.h) to include the drivers. Refer to the specific driver code for the correct USE_DRIVERNAME macro name.
  • The new version of the Graphics Resource Converter generates graphics application resources (fonts and images) using the new GFX_IMAGE_HEADER structure for images and new GFX_RESOURCE type defines to specify location of the resources. Because of this, some structures are deprecated and replaced with more appropriate structures. To remove the deprecation warnings, regenerate the fonts and images files using the new Graphics Resource Converter.

Known Issues:

  • Graphics SSD1926 JPEG and SD Card Demo does not support Graphics Display Powertip 4.3" 480x272 Board (PH480272T_005_I11Q). As is, there's not enough spare memory space to carry out the hardware JPEG decoding operation by the SSD1926. A potential work around is to reduce the active display area size to reserve more memory space for the JPEG decoding operation.
  • SSD1926 hardware acceleration for eclipse is disabled due to missing pixels at Angle 0.
  • PIC32MX460 PIM (not Starter Kit) does not support 16-bit PMP mode with Graphics PICtail™ Plus Board Version 3 (SSD1926) Board. It only supports 8-bit PMP mode. This is due to pin mapping conflicts on the boards.
  • This version of Graphics Library is not compatible with Graphics Display Designer v2.0.0.9c

v2.10

New:

  • Added new demo "Graphics Object Layer Palette Demo" for PIC24FJ256DA210 device.
  • Added support for PIC32MX795F512L device.
  • Added documentation for the Grid object.
  • Added Vertical Mode to Progress Bar.
  • Added MicrochipGraphicsModule display driver.
  • Added "Board Support Package" directory. This contains common hardware drivers for Microchip demo boards.
  • Added OBJ_MSG_PASSIVE as a translated message on the slider to detect a touch screen release message. This has no effect on the state of the slider. Applications that does not qualify for touch press and touch move event must now qualify the messages for the slider object to avoid processing messages for touch release.

Changes:

  • To improve speed modified gfxpmp.c and gfxepmp.c to be inline functions in gfxpmp.h and gfxepmp.h respectively.
  • Changed HX8347A.c to HX8347.c (both the D and A driver version is implemented in the new file). To select set the DISPLAY_CONTROLLER to be HX8347A or HX8347D in the hardware profile.
  • Modified malloc() and free() to be defined by macros in GraphicsConfig.h file. For applications using Operating System, the macros can be redefined to match the OS malloc and free functions. The default settings are:
    • #define GFX_malloc(size) malloc(size)
    • #define GFX_free(ptr) free(ptr)
  • Merged GOL Demo English and Chinese demo into one demo.
  • Removed the macro "GRAPHICS_HARDWARE_PLATFORM". This is specific to Microchip demo boards.
  • Abstracted the timer from the touch screen driver.
  • Moved the following hardware drivers to the "Board Support Package" directory
    • Touch screen driver: TouchScreen.c and TouchScreen.h files.
    • SPI Flash driver: SST25VF016.c and SST25VF016.h files.
    • Graphics PICtail Version 2 Parallel Flash driver: SST39VF040.c and SST39VF040.h files.
    • Explorer 16 SPI EEPROM Flash driver: EEPROM.c and EEPROM.h files.
    • Graphics PICtail Version 2 Beeper driver: Beep.c and Beep.h files.
  • Revised the Seiko 3.5" 320x240 display panel schematic to revision B. Corrected the pin numbering on the hirose connector. See "Schematic for Graphics Display Seiko 3.5in 320x240 Board Rev B.pdf" file on the \Microchip Solutions\Microchip\Graphics\Documents\Schematics directory.

Fixes:

  • Fixed TextEntry object issue on output string maximum length.
  • Fixed Slider increment/decrement issue on Keyboard messages.
  • Fixed GOLGetFocusNext() bug when none of the objects in the list can be focused.

Migration Changes:

  • pmp interface files are converted to header files and functions are now inline functions to speed up pmp operations. Projects must be modified to:
    • include gfxpmp.h and gfxepmp.h source files in the project.
    • gfxepmp.c file is retained but will only contain the definition of the EPMP pmp_data.
  • Converted the macro: #define GRAPHICS_HARDWARE_PLATFORM HARDWARE_PLATFORM where HARDWARE_PLATFORM is one of the supported hardware platforms defined in the section Graphics Hardware Platform to just simply #define HARDWARE_PLATFORM.
  • Since the timer module is abstracted from the touch screen driver in the "Board Support Package", the timer or the module that calls for the sampling of the touch screen must be implemented in the application code. Call the function TouchProcessTouch() to sample the touch screen driver if the user has touched the touch screen or not.

Example:

Copy Code
// to indicate the hardware platform used is the
// Graphics PICtail™ Plus Board Version 3
#define GFX_PICTAIL_V3
  • Projects which uses the following hardware drivers will need to use the latest version of the drivers located in the "Board Support Package" directory.
    • Touch screen driver: TouchScreen.c and TouchScreen.h files.
    • SPI Flash driver: SST25VF016.c and SST25VF016.h files.
    • Graphics PICtail Version 2 Parallel Flash driver: SST39VF040.c and SST39VF040.h files.
    • Explorer 16 SPI EEPROM Flash driver: EEPROM.c and EEPROM.h files.
    • Graphics PICtail Version 2 Beeper driver: Beep.c and Beep.h files.
  • In the TouchScreen driver, the timer initialization and timer interrupt sub-routine (ISR) are abstracted out of the driver. The initialization and the ISR should be defined in the application code. the TouchProcessTouch() function in the driver should be called in the ISR to process the touch.

Known Issues:

  • Graphics SSD1926 JPEG and SD Card Demo does not support Graphics Display Powertip 4.3" 480x272 Board (PH480272T_005_I11Q). As is, there's not enough spare memory space to carry out the hardware JPEG decoding operation by the SSD1926. A potential work around is to reduce the active display area size to reserve more memory space for the JPEG decoding operation.
  • SSD1926 hardware acceleration for eclipse is disabled due to missing pixels at Angle 0.
  • PIC32MX460 PIM (not Starter Kit) does not support 16-bit PMP mode with Graphics PICtail™ Plus Board Version 3 (SSD1926) Board. It only supports 8-bit PMP mode. This is due to pin mapping conflicts on the boards.
  • This version of Graphics Library is not compatible with Graphics Display Designer v2.0.0.9c

v2.01

Changes:

  • Modified drivers for abstraction of pmp and epmp interfaces. they have a common header file DisplayDriverInterface.h.
  • DisplayDriverInterface.h is added to the Graphics.h file.
  • DelayMs() API is abstracted from the driver files. TimeDelay.c and TimeDelay.h is added.

Fixes:

  • Fixed background color bug in StaticText and Digital Meter object.
  • Fixed ListBox LbSetFocusedItem() bug on empty lists.
  • Graphics SSD1926 JPEG and SD Card Demo is fixed to support SD card of size 2GB or bigger

Migration Changes:

  • pmp interface is abstracted from the driver. Projects must be modified to:
    • include gfxpmp.c and gfxepmp.c source files in the project.
  • DelayMs() is abstracted from the drivers.
    • Add TimeDelay.c source file in the project.
    • Add TimeDelay.h header file in the project.

v2.00

Changes:

  • "Graphics PICtail Board Memory Programmer" has been renamed to "Graphics External Memory Programmer".
  • "Bitmap & Font Converter" utility has been renamed to "Graphics Resource Converter".
  • Font format has changed. The bit order has been reversed. Necessary for cross compatibility.
  • Added 2 new directories in each demo
    • Precompiled Demos - this directory contains all pre-compiled demos for all hardware and PIC devices supported by the demo.
    • Alternative Configurations - this directory contains all the Hardware Profiles for all hardware and PIC devices supported by the demo.
  • Moved all hardware and display parameters from GraphicsConfig.h to HardwareProfile.h.HardwareProfile.h references a hardware profile file in "Alternative Configurations" directory based on the PIC device selected.

Fixes:

  • Fixed BtnSetText() bug when using Multi-Line Text in Buttons.
  • Fixed SDSectorWrite() function in SSD1926_SDCard.c in the "Graphics SSD1926 JPEG and SD Card Demo".

Migration Changes:

  • Move all hardware and display parameters from GraphicsConfig.h to HardwareProfile.h
    • panel type, display controller, vertical and horizontal resolution, front and back porches, synchronization signal timing and polarity settings etc.
  • GRAPHICS_PICTAIL_VERSION,1,2,250,3 options are now deprecated, new usages are:
    • #define GRAPHICS_HARDWARE_PLATFORM GFX_PICTAIL_V1
    • #define GRAPHICS_HARDWARE_PLATFORM GFX_PICTAIL_V2
    • #define GRAPHICS_HARDWARE_PLATFORM GFX_PICTAIL_V3
  • The font format has changed, run Graphics Resource Converter to regenerate font files, the bit order is reversed. No legacy support is provided. Primitive/Driver layers now expects the new format.
  • The initialization sequence of GOLInit() relative to the flash memory initialization is sensitive due to the sharing of hardware resources, i.e. SPI or PMP. Care should be taken to make sure the peripheral and I/O port settings are correct when accessing different devices.
  • A number of configuration options have been moved from GraphicsConfig.h to HardwareProfile.h, this is required to maintain a more logical flow.
  • HardwareProfile.h now points to one of many Alternative Configuration files, each one specific to a certain hardware board setup.
  • DelayMs routine in SH1101A-SSD1303.c/h is now a private function, no public API is exposed. In future releases, DelayMS will be removed from all drivers and be replaced by an independent module.
  • GenericTypeDefs.h has been updated with new definitions, this should not impact any legacy codes.

v1.75b

Changes:

  • None.

Fixes:

  • Fixed Line2D() bug in SSD1926.c.
  • Fixed remainder error in JPEG decoding in JpegDecoder.c.
  • Fixed pinout labels for reference design schematic "Schematic for Graphics Display Powertip 4.3in 480x272 Board Rev 2.pdf".

Migration Changes:

  • None.

v1.75 Release (July 10, 2009)

Changes:

  • Added 2D acceleration support for controllers with accelerated primitive drawing functions.
  • Added Digital Meter Widget for fast display refresh using fixed width fonts.
  • Added support for selected PIC24H Family of devices.
  • Added support for selected dsPIC33 Family of devices.
  • Updated all primitive functions to return success or fail status when executed. This is used to evaluate if the primitive function has finished rendering.
  • Updated Solomon Systech SSD1926 driver to use 2D accelerated functions.
  • New Display Controller Driver supported:
    • Ilitek ILI9320
    • Solomon Systech SSD1289
    • Himax HX8347
    • Renesas R61580
  • New demos are added:
    • PIC24F Starter Kit Demo
    • PIC24H Starter Kit Demo 1
    • Graphics JPEG Demo using internal and external flash memory for image storage
    • Graphics SSD1926 JPEG and SD Card Demo using SD Card for image storage
  • Added JPEG support to "Font and Bitmap Converter Utility".
  • Modified Button Widget for new options:
    • Use multi-line text (set USE_BUTTON_MULTI_LINE)
    • Detect continuous touch screen press event using messaging
  • Added Touch Screen event EVENT_STILLPRESS to support continuous press detection.
  • New reference design schematics added:
    • Schematic for Graphics Display DisplayTech 3.2in 240x320 Board.pdf
    • Schematic for Graphics Display Newhaven 2.2in 240x320 with HX8347.pdf
    • Schematic for Graphics Display Seiko 3.5in 320x240 Board.pdf
    • Schematic for Graphics Displays DisplayTech and Truly 3.2in 240x320 with SSD1289.pdf
    • Schematic for ILI9320.pdf

Fixes:

  • Fixed dimension calculation for quarter sized meter.

Migration Changes:

  • When using accelerated primitive functions while USE_NONBLOCKING_CONFIG is enabled, the accelerated primitive must be checked if it succesfully rendered. Refer to the coding example for details.
  • Replaced LGDP4531_R61505_S6D0129_S6D0139_SPFD5408.c and LGDP4531_R61505_S6D0129_S6D0139_SPFD5408.h files with drvTFT001.c and drvTFT001.h respectively.

v1.65 Release (March 13, 2009)

Changes:

  • Added support for the new Graphics PICtail™ Plus Daughter Board (AC164127-3). This new board comes in two components: the controller board and the display board. The display board uses RGB type displays driven by the controller board. This configuration allows easy replacement of the display glass.
  • Added application note AN1246 "How to Create Widgets".
  • New Display Controller Driver supported
    • UltraChip UC1610
  • New demos are added
    • Graphics AN1246 Demo showing the TextEntry Widget.
    • Graphics Multi-App Demo showing USB HID, USB MSD and SD MSD demos using the Microchip Graphics Library.
  • Modified Meter Widget for new options:
    • Set Title and Value Font at creation time
  • Added GOLGetFocusPrev() for focus control on GOL Objects.
  • Added work spaces to demo releases.
  • Graphics PICtail™ Plus Board 1 is obsolete. All references to this board is removed from documentation.
  • New reference design schematics added:
    • Schematic for Graphics Display Ampire 5.7in 320x240 Board Rev A.pdf
    • Schematic for Graphics Display Powertip 3.5in 320x240 Board Rev B.pdf
    • Schematic for Graphics Display Powertip 4.3in 480x272 Board Rev B.pdf
    • Schematic for Graphics Display Truly 3.5in 320x240 Board Rev A.pdf
    • Schematic for Truly TOD9M0043.pdf

Fixes:

  • Fixed drawing bug on TextEntry Widget
  • Added missing documentation on Chart and Text Entry Widgets

Migration Changes:

  • none

v1.60 Release (December 3, 2008)

Changes:

  • Added TextEntry Widget.
  • Modified Meter Widget for new options:
    • Define different fonts for value and title displayed.
    • Add option for resolution of one decimal point when displaying values.
    • Add color options to all six arcs of the Meter.
    • Meter range is not defined by a minimum value and a maximum value.
  • Added feature to a the Button Widget to allow cancelling of press by moving away the touch and releasing from the Button's face.
  • Added font sizes options of 3,4,5,6 & 7 in Font & Bitmap Converter Utility when converting fonts from TTF files.
  • Enhanced the architecture of the Display Device Driver Layer.

Fixes:

  • Fixed Font & Bitmap Converter Utility generation of reference strings to be set to const section.
  • Fixed panel rendering to always draw the panel face color even if bitmaps are present.

Migration Changes:

  • Added the following files in the Display Device Driver Layer to easily switch from one display driver to another.
    • DisplayDriver.h
    • DisplayDriver.c
  • Modified implementation of GraphicsConfig.h file to support new Display Device Driver Layer architecture.
  • Moved the definitions of pins used in device drivers implemented in all the demos to HardwareProfile.h file.
    • EEPROM Driver
    • Touch Screen Driver
    • Beeper Driver
    • Flash Memory Driver
    • Display Drivers
  • Modified GOL.c and GOL.h to include processing of TextEntry object when enabled by application.

v1.52 Release (August 29, 2008)

Changes:

  • Added Chart Widget.
  • Added Property State for Window Widget. Text in Title Area can now be centered.
  • Added Supplementary Library for Image Decoders.
  • Added documentation of Default Actions on widgets.
  • Replaced USE_MONOCHROME compile switch with COLOR_DEPTH to define color depth of the display.
  • Added GOL_EMBOSS_SIZE to be user defined in GraphicsConfig.h.
  • Simplified initialization code for SSD1906 driver.

Fixes:

  • Fixed touch screen algorithm.
  • Fixed file path error in Font & Bitmap Converter Utility.

Migration Changes:

  • USE_GOL must be defined when using any Widgets.
  • New include directory paths are added to demo projects:
    • ..\..\..\Your Project Directory Name
    • ..\..\Include
  • Moved all driver files to new directory
    • C files from ..\Microchip\Graphics to ..\Microchip\Graphics\Drivers
  • GOL_EMBOSS_SIZE can now be defined by the user in GraphicsConfig.h. If user does not define this in GraphicsConfig.h the default value in GOL.h is used.

v1.4 Release (April 18, 2008)

Changes:

  • Added full support for PIC32 families.
  • Added Application Note demo on fonts.
  • Added images for end designs using PIC devices.

Fixes:

  • Fixed GetPixel error in SSD1906 Driver.
  • Fixed SST39VF040 parallel flash driver reading instability.
  • Fixed error in 64Kbytes rollover in utility conversion of bitmaps and SST39VF040 parallel flash driver.
  • Fixed milli-second delay on PIC32.
  • Fixed compile time option errors for PIC32.
  • Fixed Graphics Object Layer Demo error in PIC32 when time and date are set.
  • Fixed Picture widget bug in detecting touchscreen in translating messages.

v1.3 Release (March 07, 2008)

Changes:

  • none

Fixes:

  • Fixed an inaccurate ADC reading problem with some Explorer 16 Development Boards that uses 5V LCD display.
  • Editbox allocation of memory for text is corrected.
  • Fix slider SetRange() bug.
  • Set PIC32 configuration bits related to PLL to correct values.
  • Touch screen portrait mode bug is fixed.

v1.2 Release (February 15, 2008)

Changes:

  • Added support for Graphics PICtail Plus Board Version 2
  • Added support for foreign language fonts
  • Version 1.2 of the font and bitmap utility
    • Support for multi-language scripts
    • Support for generating font table from installed fonts
    • Support to reduce font table size by removing unused characters
    • Support to select between C30 and C32 compiler when generating bitmaps and font tables.
  • Added Chinese version of Graphics Object Layer Demo.
  • New Display Controller Drivers supported
    • Solomon Systech SSD1906
    • Orise Technology SPDF5408
  • Replaced USE_UNICODE compile switch to USE_MULTIBYTECHAR compile switch to define XCHAR as 2-byte character.
  • Added compile switches
    • GRAPHICS_PICTAIL_VERSION - sets the PICtail board version being used.
    • USE_MONOCHROME – to enable monochrome mode.
    • USE_PORTRAIT - to enable the portrait mode of the display without changing the display driver files.
  • Added beta support for PIC32 device

Fixes:

  • Specification changes to List Box widget. Bitmap is added to List Box items.
  • Fixed List Box LbDelItemsList() error in not resetting item pointer to NULL when items are removed.
  • Editbox allocation of memory for text is corrected.
  • Static Text multi-byte character failure is fixed.
  • Bar() function erroneous call to MoveTo() is removed since it causes the drawing cursor to be displaced.
  • Removed SCREEN_HOR_SIZE and SCREEN_VER_SIZE macros from documentation. Maximum X and Y sizes are to be obtained by GetMaxX( ) and GetMaxY( ) macros.

v1.0 Release (November 1, 2007)

Changes:

  • Edit Box, List Box, Meter, Dial widgets are added.
  • Button is modified. New options for the object are added.
  • Modified OBJ_REMOVE definition to OBJ_HIDE (example BTN_REMOVE to BTN_HIDE).
  • Modified GOLPanelDraw() function to include rounded panels.
  • External memory support for the fonts and bitmaps is implemented.
  • SSD1339 and LGDP4531 controllers support is added.
  • Bevel(), FillBevel() and Arc() functions are added.
  • Modified Graphics Object Layer Demo.
  • Added Graphics External Memory Demo & Graphics PICtailTM Board Memory Programmer Demo.
  • Added Graphics Application Note (AN1136- How to use widgets.) Demo.

Fixes: none

v0.93 Beta release (August 29, 2007)

Changes: none

Fixes:

  • In demo code the bitmap images couldn’t be compiled without optimization. bmp2c.exe utility output is changed to fix this bug.
  • In demo code “volatile” is added for global variables used in ISRs.

v0.92 Beta release (July 25, 2007)

Changes:

  • Keyboard and side buttons support is added.
  • Keyboard focus support is added.
  • PutImage() parameters are changed. Instead of pointer to the bitmap image the pointer to BITMAP_FLASH structure must be passed.
  • GOLSuspend() and GOLResume() are removed.
  • GOLMsg() doesn’t check object drawing status. It should be called if GOL drawing is completed.
  • GOLStartNewList() is replaced with GOLNewList().
  • Line() function calls are replaced with Bar() function calls for vertical and horizontal lines.
  • Parameter “change” is removed for SldIncVal() and SldDecVal() .
  • Some optimization and cleanup.
  • Slider API is changed:
    • SldSetVal() is changed to SldSetPos()
    • SldGetVal() is changed to SldGetPos()
    • SldIncVal() is changed to SldIncPos()
    • SldDecVal() is changed to SldDecPos()
    • SldCreate() input parameter are changed:
      • “delta” changed to “res”

Fixes:

  • PutImage().
  • Line().
  • FillCircle().
  • For vertical slider the relation between thumb location and slider position is changed. For position = 0 thumb will be located at the bottom. For position = range it will be at the top.

v0.9 Beta release (July 06, 2007)

Changes:

  • Background color support is removed.
  • Non-blocking configuration for graphics primitives is added.
  • GetImageWidth(), GetImageHeight() are added.
  • OutText(), OutTextXY() and GetTextWidth() functions are terminated by control characters (< 32).
  • Graphics Objects Layer (GOL) is added.
  • Button, Slider, Checkbox, Radio Button, Static Text, Picture control, Progress Bar, Window, Group Box are implemented.
  • Touch screen support is added.

Fixes:

  • ReadFlashByte().
  • GetTextWidth().

v0.1 (June 05, 2007)

Changes:

  • Initial release includes driver and graphic primitive layers only.
  • Only driver for Samsung S6D0129 controller is available.

Fixes:

  • None.

Known Issues

None

Release Notes


Getting Started

Contents | Index | Home
Previous | Next
Getting Started
Directory Structure

The Microchip Graphics Library installation follows the standard directory structure for all Microchip library solutions. Installing the library will give the following structure:

One of the demo subdirectories (example: Graphics or Combo) may become "Your Applications Directory" that will contain your application source code. You can add code and modules here that will use and interact with the library. The library specific folders are the following:

  • The Microchip folder will contain the library components.
  • The Help sub-folder under Microchip folder will contain this document (Graphics Library Help.chm file).
  • The Graphics sub-folder under the Microchip folder is where the C files, documentation and utilities are located.
    • Inside this Graphics sub-folder are the directories for the Drivers, Documents, GDD, Images and bin directories. It will also contain the directory for the Image Decoders source files.
    • The GDD (Graphics Display Designer) directory contains the GDD project template. Use this to start projects using the Graphics Display Designer.
    • The bin directory contains the Graphics Resource Converter utility and External Memory Programmer both implemented in java.
  • The Include sub-folder under the Microchip folder will contain common header files to all Microchip library solutions.
  • Another Graphics directory is included in the Include sub folder. This will hold the Graphics Library header files as well as the header files for the Image Decoders.
  • The Board Support Package folder will contain hardware specific drivers that are common to the Microchip Demo Boards (such as Explorer 16, display panels or PICtail™ Plus Daughter Boards).

All subdirectories and files under the Microchip directory should not be modified. In case your project will use more than one Microchip library solution, this directory will contain all the library files you install. Thus, it is important to maintain the files in this directory. The Microchip Solutions directory may become your "MyProjects" directory that will contain all your projects using the different Microchip solutions.

How to Get Started

There are various ways to get started with Microchip Graphics Library:

  1. Obtain Development Boards from the "Getting Started" section of the Microchip graphics website ( [image] www.microchip.com/graphics):
    1. Explorer 16 Starter Kit (DV164003) with any of the Graphics PICtail™ Plus Daughter Boards.
    2. PIC24FJ256DA210 Development Board (DV164039) with any of the individual Graphics Display Boards.
    3. A PIC32 Starter Kit and Graphics LCD Controller PICtail™ Plus SSD1926 Board (AC164127-5) with any of the individual Graphics Display Boards.
    4. A PIC32 Starter Kit and Graphics PICtail Plus Epson S1D13517 Board (AC164127-7) with any of the individual Graphics Display Boards.
    5. A PIC32 Starter Kit and Multi-Media Expansion Board (DM320005).
  2. Graphics PICtail™ Plus Daughter Board available:
    • AC164127-3 - Graphics PICtail Plus Daughter Board with Truly 3.2" Display Kit

  • AC164127-5 - Graphics LCD Controller PICtail Plus SSD1926 Board. This board is the same board used in AC164127-3 PIctail Plus and Display Panel combo shown above.

.

  • AC164127-7 - Graphics PICtail Plus Epson S1D13517 Board.

  • AC164144 - Low-Cost Controllerless (LCC) Graphics PICtail Plus Daughter Board.

  3. Graphics Display Boards available:
    • AC164127-4 - Graphics Display Truly 3.2" 240x320 Board

  • AC164127-6 - Graphics Display Powertip 4.3" 480x272 Board

  • AC164127-8 - Graphics Display Truly 5.7" 640x480 Board

  • AC164127-9 - Graphics Display Truly 7" 800x480 Board

  • AC164139 - Graphics Display Prototype Board

  4. Refer to Web Seminar 4 on “Microchip Graphics Library Architecture” from the "Training and Support" section for an overview of the structure and the different layers of the library. It also gives a brief information on how to use the library.
  5. Refer to Microchip's Regional Training Center class on Graphics Library:
    • HIF 2131 – Designing with Microchip Graphics Library
  6. For a much detailed look on the usage, you can refer to the following application notes from the "Training and Support" section.
    • AN1136 How to Use Widgets in Microchip Graphics Library. This application note introduces the basic functions needed to create and manage Widgets.
    • AN1182 Fonts in the Microchip Graphics Library. This application note describes the format of the Microchip Graphics Library's font image. It also tells how to reduce the number of characters in a font and automate the creation of the character arrays referring to an application's strings.
    • AN1227 Using a Keyboard with the Microchip Graphics Library. This application note describes how to implement a keyboard-based GUI.
    • AN1246 How to Create Widgets in Microchip Graphics Library. This application note serves as a useful guide in creating customized Widgets. The essential components of a Widget are enumerated and described in this document. This application note also outlines the process of integrating the new Widget into the Graphics Library in order to utilize the already implemented routines for processing messages and rendering Widgets.
    • AN1368 Developing Graphics Applications using PIC MCUs with Integrated Graphics Controller. This application note is intended for engineers who are designing their first graphic application. It describes the basic definitions and jargons of graphics applications and it helps the engineer to understand the theory, necessary decision factors, hardware considerations, available microcontrollers and development tools.
  7. Finally, you can obtain the free licensed Microchip Graphics library also from the "Getting Started" section.

How to Build Projects for the PIC24FJ256DA210 Development Board

  1. In the application specific HardwareProfile.h file of your project set the hardware platform to PIC24FJ256DA210 Development Board:
Copy Code
#define PIC24FJ256DA210_DEV_BOARD
  2. In the the same application specific HardwareProfile.h file of your project, set the correct display controller and the display panel combination. Selecting the correct display panel will choose the correct parameter settings for the display. Examples of these parameters are horizontal and vertical resolution, display orientation, vertical and horizontal pulse width, and front and back porch settings.
    • When using the Truly 3.2" display on AC164127-4 board
Copy Code
// set the display controller
#define GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210
// set the display panel
#define GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E
  • When using the Powertip 4.3" display on AC164127-6 board
Copy Code
// set the display controller
#define GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210
// set the display panel
#define GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q
  3. In the the same application specific HardwareProfile.h file of your project, set following (Refer to each demo hardware profiles for examples):
Copy Code
// set the PMP interface
#define USE_16BIT_PMP
// set the Graphics Clock Divider that generates the Pixel clock.
// Refer to display data sheet for pixel clock frequency requirement
// and Family Reference Manual - Oscillator for details on GCLK divider (GCLKDIV).
#define GFX_GCLK_DIVIDER 38
// set the display buffer start address.
#define GFX_DISPLAY_BUFFER_START_ADDRESS 0x00020000ul
// set the EPMP CS1 base address if using external memory on EPMP CS 1 space and its size
#define GFX_EPMP_CS1_BASE_ADDRESS 0x00020000ul
#define GFX_EPMP_CS1_MEMORY_SIZE  0x40000ul
// set the EPMP CS2 base address if using external memory on EPMP CS 1 space and its size
#define GFX_EPMP_CS2_BASE_ADDRESS 0x00080000ul
#define GFX_EPMP_CS2_MEMORY_SIZE  0x80000ul
  4. In the the project's GraphicsConfig.h set the color depth to the desired bpp value (Refer to each demo hardware profiles for examples):
Copy Code
// set the color depth used
#define COLOR_DEPTH 16

How to Build Projects for Graphics PICtail™ Plus Board Version 3:

  1. In the application specific HardwareProfile.h file of your project set the hardware platform to Graphics PICtail™ Plus Board Version 3:
Copy Code
#define GFX_PICTAIL_V3
  2. In the the same application specific HardwareProfile.h file of your project, set the correct display controller and the display panel combination. Selecting the correct display panel will choose the correct parameter settings for the display. Examples of these parameters are horizontal and vertical resolution, display orientation, vertical and horizontal pulse width, and front and back porch settings.
    • When using the Truly 3.2" display on AC164127-4 board
Copy Code
// set the display controller
#define GFX_USE_DISPLAY_CONTROLLER_SSD1926
// set the display panel
#define GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E
  • When using the Powertip 4.3" display on AC164127-6 board
Copy Code
// set the display controller
#define GFX_USE_DISPLAY_CONTROLLER_SSD1926
// set the display panel
#define GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q
  3. In the the same application specific HardwareProfile.h file of your project, set following (Refer to each demo hardware profiles for examples):
Copy Code
// set the hardware platform
#define EXPLORER_16
// set the PMP interface
#define USE_8BIT_PMP
  4. In the the project's GraphicsConfig.h set the color depth to the desired bpp value (Refer to each demo hardware profiles for examples):
Copy Code
// set the color depth used
#define COLOR_DEPTH 16

How to Build Projects for Graphics PICtail™ Plus Epson S1D13517 Board

  1. In the application specific HardwareProfile.h file of your project set the hardware platform to Graphics PICtail™ Plus Epson S1D13517 Board:
Copy Code
#define GFX_PICTAIL_V3E
  2. In the the same application specific HardwareProfile.h file of your project, set the correct display controller and the display panel combination. Selecting the correct display panel will choose the correct parameter settings for the display. Examples of these parameters are horizontal and vertical resolution, display orientation, vertical and horizontal pulse width, and front and back porch settings.
    • When using the Truly 3.2" display on AC164127-4 board
Copy Code
// set the display controller
#define GFX_USE_DISPLAY_CONTROLLER_S1D13517
// set the display panel
#define GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E
  • When using the Powertip 4.3" display on AC164127-6 board
Copy Code
// set the display controller
#define GFX_USE_DISPLAY_CONTROLLER_S1D13517
// set the display panel
#define GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q
  3. In the the same application specific HardwareProfile.h file of your project, set following (Refer to each demo hardware profiles for examples):
Copy Code
// set the hardware platform
#define EXPLORER_16
// set the PMP interface
#define USE_8BIT_PMP
// set the display panel
#define GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E
  4. In the the project's GraphicsConfig.h set the color depth to the desired bpp value (Refer to each demo hardware profiles for examples):
Copy Code
// set the color depth used
#define COLOR_DEPTH 16

Low-Cost Controllerless (LCC) Graphics PICtail Plus Daughter Board:

  1. In the application specific HardwareProfile.h file of your project set the hardware platform to Low-Cost Controllerless (LCC) Graphics PICtail Plus Daughter Board:
Copy Code
#define GFX_PICTAIL_LCC
  2. In the the same application specific HardwareProfile.h file of your project, set the correct display controller and the display panel combination. Selecting the correct display panel will choose the correct parameter settings for the display. Examples of these parameters are horizontal and vertical resolution, display orientation, vertical and horizontal pulse width, and front and back porch settings.
    • When using the Truly 3.2" display on AC164127-4 board
Copy Code
// set the display controller
#define GFX_USE_DISPLAY_CONTROLLER_DMA
// set the display panel
#define GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E
  • When using the Powertip 4.3" display on AC164127-6 board
Copy Code
// set the display controller
#define GFX_USE_DISPLAY_CONTROLLER_DMA
// set the display panel
#define GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q
  3. In the the same application specific HardwareProfile.h file of your project, set following (Refer to each demo hardware profiles for examples):
Copy Code
// set the hardware platform
#define EXPLORER_16  // or you can use PIC_SK if using Starter Kits
// set the PMP interface
#define USE_8BIT_PMP
  4. In the the project's GraphicsConfig.h set the color depth to the desired bpp value (Refer to each demo hardware profiles for examples):
Copy Code
// set the color depth used
#define COLOR_DEPTH 16

How to Build Projects for the Multimedia Expansion Board

  1. In the application specific HardwareProfile.h file of your project set the hardware platform to Graphics PICtail™ Plus Epson S1D13517 Board:
Copy Code
#define MEB_BOARD
  2. In the application specific HardwareProfile.h file of your project, set the correct display controller.
Copy Code
#define GFX_USE_DISPLAY_CONTROLLER_SSD1926
  3. In the the same application specific HardwareProfile.h file of your project, set following (Refer to each demo hardware profiles for examples):
Copy Code
// set the PMP interface
#define USE_8BIT_PMP
// set the Starter Kit used
#define PIC32_GP_SK // use generic PIC32 Starter Kit
 or
#define PIC32_USB_SK // use PIC32 USB Starter Kit
or
#define PIC32_ETH_SK // use PIC32 Ethernet Starter Kit
  4. In the the project's GraphicsConfig.h set the color depth to the desired bpp value (Refer to each demo hardware profiles for examples):
Copy Code
// set the color depth used
#define COLOR_DEPTH 16

Demo Projects

The Microchip Graphics Library documentation has several components that covers installation, customization and usage of the library. Several demo projects are included in the installation to help you get started. Detailed information on each demo project is available from the "Getting Started" help file located in each of the demo folders.

Schematics

The library installation also includes schematics of currently supported controllers and glass. These can be found in the ../<install directory>/Microchip/Graphics/Documents/Schematics directory.

  • Schematic for Graphics Display Ampire 5.7in 320x240 Board Rev A.pdf
  • Schematic for Graphics Display Powertip 3.5in 320x240 Board Rev B.pdf
  • Schematic for Graphics Display Powertip 4.3in 480x272 Board Rev B.pdf
  • Schematic for Graphics Display Truly 3.2in 240x320 Board Rev 4.pdf
  • Schematic for Graphics Display Truly 3.5in 320x240 Board Rev A.pdf
  • Schematic for Graphics LCD Controller PICtail SSD1926 Board Rev 2.pdf
  • Schematic for Solomon Systech SSD1906.pdf
  • Schematic for Truly GG1N1291UTSW-W-TP-E.pdf
  • Schematic for Truly TFT-G240320UTSW-92W-TP.pdf
  • Schematic for Truly TOD9M0043.pdf
  • Schematic for Microtips MTF-T022BHNLP.pdf
  • Schematic for Densitron TSR67802.pdf
  • Schematic for Graphics Display DisplayTech 3.2in 240x320 Board.pdf
  • Schematic for Graphics Display Newhaven 2.2in 240x320 with HX8347.pdf
  • Schematic for Graphics Display Seiko 3.5in 320x240 Board.pdf
  • Schematic for Graphics Displays DisplayTech and Truly 3.2in 240x320 with SSD1289.pdf
  • Schematic for ILI9320.pdf
  • Schematic for Graphics Display Prototype Board Rev 1.pdf
  • Schematic for Graphics Display Truly 5.7in 640x480 Board Rev 2.pdf
  • Schematic for Graphics Display Truly 7in 800x480 Board Rev 2.pdf
  • Schematic for Graphics LCD Controller PICTail Plus S1D13517 Rev 1.1.pdf
  • Schematic for Low-Cost Controllerless (LCC) Graphics Board Rev 1.pdf
  • Schematic for PIC24FJ256DA210 Development Board Rev 1.1.pdf

Images

The library allows displaying 1bpp, 4bpp, 8bpp, 16bpp and 24bpp images. They can be located in program flash space or external memory. To convert the bitmap format file (BMP extension) or JPEG format file into source C file containing data array for internal memory or Intel hex file for external memory the “Graphics Resource Converter” included in the library installation can be used. Refer to the utility help file for details on usage.

Fonts

The library operates with 8-bit character encoded strings. It covers languages defined in IS0 8859 standards. East Asian and any other languages support is available for UNICODE encoded fonts. Font can be stored in internal flash as an array in const section (this limits font image size by 32Kbytes) or can be located in external memory. To convert the font file into source C file containing data array for internal memory or Intel hex file for external memory the “Graphics Resource Converter” utility can be used. The utility allows importing raster font files (FNT extension) or true font files (TTF extension). Refer to the help built in the utility for details. Raster font files can be extracted from MS Windows bitmap font package file (FNT extension) or converted from true type font file (TTF extension) with a third party font editor. One such freeware editor Fony is available at [image] http://hukka.furtopia.org/. Another example is [image] http://fontforge.sourceforge.net.

The utility also allows reducing the generated fonts to include only the characters that the application will use. This can be done by using font filtering. Please refer to application note "AN1182: Fonts in the Microchip Graphics Library" from the "Training and Support" section of the Microchip graphics website for details of implementing reduced fonts.

How to use the API Documentation

This help file includes the API description of the library. The way the API is structured is similar to the library layers.

  1. The Device Driver Layer presents all the API included to initialize and use the display controller and the glass. This section also contains information on how to add new Device Driver.
  2. The Graphics Primitive Layer is a hardware independent layer that contains the API for basic rendering functions. Use this section to render basic shapes like lines, rectangles, filled circle etc.
  3. The Graphics Object Layer contains the API specific to each Widget type. Use this section to create and manage Widgets as well as pages or screens of different Widgets. Messaging and rendering of Widgets are also included in this section.

Updates and News

Refer to the Microchip graphics website [image] www.microchip.com/graphics for the latest version of the Microchip Graphics Library, webinars, application notes, FAQs and latest news and updates.

Getting Started


Demo Projects

Contents | Index | Home
Previous | Next
Demo Projects
Topics

Summary of demo projects that comes with the installation of the Microchip Graphics Library.

Topics
Name | Description
Demo Summary | This is the current list of demo projects released with the Graphics Library.
Microchip Application Library Abbreviations | Summary of Microchip Applications Library Abbreviations used.
Demo Compatibility Matrix | Refer to the Demo Compatibility matrix located in the <install directory>/Microchip/Graphics/Documents/Getting Started/Getting Started - Demo Compatibility Matrix.htm for details.
Links
Topics
Demo Projects


Demo Summary

Contents | Index | Home
Previous | Up | Next
Demo Summary
Demo Name | Description (see Note)
Primitive Layer | Shows how primitive functions are used.
Object Layer | Shows how objects are used with user messages interacting with objects.
Object Layer Palette | The same as the Object Layer demo but uses the Color Look Up Table of the Microchip Graphics Module.
External Memory | A simple demo showing how images and fonts from external memory are used in a graphics application.
Multi-App | A demo showing USB Framework, Memory Disk Drive, Image Decoders and Graphics libraries and stacks are integrated into one application.
SSD1926 | A demo showing the Solomon Systech Controller JPEG decoder module on the Graphics LCD Controller PICtail™ Plus SSD1926 Board (AC164127-5) and Multi-Media Expansion Board (DM320005) displaying JPEG images from an SD Card.
S1D13517 | A demo showing the different features of the Epson S1D13517 Controller in the Graphics PICtail Plus Epson S1D13517 Board (AC164127-7)
Color Depth | Demo showing how the graphics module in PIC24FJ256DA210 is used in applications using color depths of 1, 4 and 8 BPP. (Location: <install_dir>/Graphics/PIC24F DA/Color Depth)
Elevator | A mock up of Elevator Monitor showing the location of the elevator car and the direction it is moving. (Location: <install_dir>/Graphics/PIC24F DA/Elevator)
RCCGPU-IPU | A demo showing how Rectangle Copy Graphical Processing Unit (RCCGPU) and Inflate Processing Unit (IPU) of the Graphics Module in PIC24FJ256DA10 is used. (Location: <install_dir>/Graphics/PIC24F DA/RCCGPU-IPU)
Remote Control | This is a demo showing how to create a universal remote control device with Graphical Interface using RF4CE protocol. (Location: <install_dir>/Combo/Remote Control)
AppNotes | A collection of application notes demo - Demo for Application Note AN1136 - Demo for Application Note AN1182 - Demo for Application Note AN1227 - Demo for Application Note AN1246
Image Decoders | A demo showing the Image Decoder library rendering bitmaps and jpeg images.
PIC24F Starter Kit | Demo for the PIC24F Starter Kit. (Location: <install_dir>/PIC24F Starter Kit)
PIC24H Starter Kit | Demo for the PIC24H Starter Kit. (Location: <install_dir>/PIC24H Starter Kit)
Google Map | A demo showing the TCPIP Stack and Graphics Library combined in an application. (Location: <install_dir>/Combo/Google Map)

Note:

Unless otherwise specified, the demos are located in <install_dir>/Graphics.

where: install_dir - is the directory location of the MLA installation.

Links
Demo Projects
Demo Projects > Demo Summary


Microchip Application Library Abbreviations

Contents | Index | Home
Previous | Up | Next
Microchip Application Library Abbreviations

Microchip Application Library Configuration File and Project Name Abbreviations. A summary of the abbreviations used can be found at <Install Directory>/Microchip/Help/Abbreviations.htm

Links
Demo Projects
Demo Projects > Microchip Application Library Abbreviations


Demo Compatibility Matrix

Contents | Index | Home
Previous | Up | Next
Demo Compatibility Matrix

Refer to the Demo Compatibility matrix located in the <install directory>/Microchip/Graphics/Documents/Getting Started/Getting Started - Demo Compatibility Matrix.htm for details.

Links
Demo Projects
Demo Projects > Demo Compatibility Matrix


Library Architecture

Contents | Index | Home
Previous | Next
Library Architecture
Topics

The Microchip Graphics Library structure is shown in the following figure.

Microchip Graphics Library Architecture

  1. Application Layer – This is the program that utilizes the Graphics Library.
  2. User Message Interface- This layer should be implemented by user to provide messages for the library.
  3. Graphics Object Layer – This layer renders the widgets controls such as button, slider, window and so on.
  4. Graphics Primitives Layer – This layer implements the primitive drawing functions.
  5. Device Display Driver – This layer is dependent on the display device being used.
  6. Graphics Display Module – This is the display device being used.

The library provides two configurations (Blocking and Non-Blocking).

For Blocking configuration, all draw functions are blocking calls that delay the execution of program until rendering is done. For Non-Blocking configuration, draw functions do not wait for the drawing completion and release control to the program. In this configuration, a draw function should be called repeatedly until the rendering of that particular draw function is complete. This allows efficient use of microcontroller CPU time since it can perform other tasks if the rendering is not yet done.

Topics
Name | Description
Graphics Object Layer | Describes the Graphics Object Layer (GOL) structure and its components.
Graphics Primitive Layer | Describes the Graphics Primitive Layer structure and its components.
Display Device Driver Layer | Describes the Display Driver Layer structure and its components.
Links
Topics
Library Architecture


Graphics Object Layer

Contents | Index | Home
Previous | Up | Next
Graphics Object Layer
Topics

The Graphics Object Layer (GOL) implements the Widgets and the Graphics Library managed messaging and rendering. All Widget drawing are based on the Primitive Layer rendering functions.

The Graphics Object Layer organization is shown on the figure below:

Topics
Name | Description
Object Rendering | Describes the difference between the Blocking or Non-Blocking configuration when rendering Objects.
Links
Library Architecture, Topics
Library Architecture > Graphics Object Layer


Object Rendering

Contents | Index | Home
Previous | Up | Next
Object Rendering

The library can render objects in a Blocking or a Non-Blocking manner. The Non-Blocking configuration is implemented by the use of drawing state machine. Each drawing functions groups the rendering steps into states. Every time a rendering step is executed, the drawing state is updated. Before each step is executed, the display device is checked if it is still busy with the previous rendering operation. If it is busy it returns a non-zero value. This indicates that the draw function must be called again to complete the rendering. The drawing function can be called several times until rendering is completed.

State Machine Controlled Rendering

For Blocking configuration linear flow of rendering is executed. Display device always return a non-busy status.

The GOL level uses the active object linked list for drawing of objects. Each object’s state in the list is parsed to determine if the object needs to be redrawn or not. The drawing order is from the head to the tail of the list. This sequence is executed by GOLDraw() function. The figure below explains the rendering loop of the GOLDraw() function.

GOL Object Rendering Loop

The loop shows two exit points in the sequence. First is when the end of the list is reached and the second is when an OBJDraw() returns a NOT DONE status. Reaching the end of the list is a normal exit. This means that all the state machines of the draw functions of each object have reset to default. Exiting with a NOT DONE status means that the latest executed draw function was pended and the object is not yet fully rendered. To complete the rendering, GOLDraw() function should be called again. The next call to GOLDraw() will pickup the rendering on the last object that returned a not DONE status. This operation makes the rendering functions non-blocking and gives opportunity to release control to program without waiting for the rendering completion.

When all objects in the active object linked list are drawn GOLDraw() calls user defined GOLDrawCallback() function. User drawing can be done in this callback function. If the function returns a zero, drawing of GOL objects in the active list is suspended. In this case color, clipping region, line type and graphic cursor will not be modified by GOL. If it returns a 1 drawing control is returned to GOL. GOLDraw() resume rendering of objects in the current active list. Inside the GOLDrawCallback() function, the active object list is not used by GOLDraw(). It is safe to perform modification of the list. Please refer to Configuration Settings to set Blocking or Non-Blocking configuration.

Links
Graphics Object Layer
Library Architecture > Graphics Object Layer > Object Rendering


Graphics Primitive Layer

Contents | Index | Home
Previous | Up | Next
Graphics Primitive Layer

This is a hardware independent layer that contains basic rendering functions. These functions can be implemented in the device driver layer if the display device supports hardware acceleration of the function.

The Primitive Layer organization is shown on the figure below:

Links
Library Architecture
Library Architecture > Graphics Primitive Layer


Display Device Driver Layer

Contents | Index | Home
Previous | Up | Next
Display Device Driver Layer

The Device Driver Layer is the layer that comprises the selection of the display driver file based on the settings specified in the HardwareProfile.h file implemented on the application layer.

The Device Driver Layer organization is shown on the figure below:

An option to use a customized driver is also supported by this scheme. The application need only to define custom display macro in the HardwareProfile header file. This macro must be unique to the display driver. For example the display macro for the SSD1926 driver is GFX_USE_DISPLAY_CONTROLLER_SSD1926. It is recommended that the application keep the same format when naming the display macro, GFX_USE_DISPLAY_CONTROLLER_<DRIVER NAME>.

Links
Library Architecture
Library Architecture > Display Device Driver Layer


Library API

Contents | Index | Home
Previous | Next
Library API
Topics

The Microchip Graphics Library is implemented in layers. This section describes the APIs for each layer as well as the Graphics Library Configuration. In addition Advanced Display Device Driver Layer APIs that exists in specific drivers are also described.

Topics
Name | Description
Graphics Library Configuration | The Graphics Library can be customized by adding or specifying the compile time options located in the application code named GraphicsConfig.h or the HardwareProfile.h files. The following compile time options are supported by the library.
Graphics Object Layer API | Description of Graphics Object Layer API.
Graphics Primitive Layer API | Description of Graphics Primitive Layer API.
Display Device Driver Layer API | Description of Display Device Driver Layer API.
Links
Topics
Library API


Graphics Library Configuration

Contents | Index | Home
Previous | Up | Next
Graphics Library Configuration
Topics
Topics
Name | Description
Graphics Object Layer Configuration | The following compile time options configures the Graphics Library's Object Layer.
Graphics Primitive Layer Configuration | The following compile time options configures the Graphics Library's Primitive Layer.
Display Device Driver Layer Configuration | The following compile time options configures the Graphics Library's Display Device Driver Layer. The choices are based on the specific hardware used. See Hardware Profile for more options.
Application Configuration |
Hardware Profile | These functions and macros are used to determine hardware profile settings on the chosen PIC microcontroller and hardware such as demo boards used.
Links
Library API, Topics
Library API > Graphics Library Configuration


Graphics Object Layer Configuration

Contents | Index | Home
Previous | Up | Next
Graphics Object Layer Configuration
Topics

The following compile time options configures the Graphics Library's Object Layer.

Topics
Name
Description
Input Device Selection
The Graphics Library comes with two pre-defined user interface. These are the:

  • Keyboard interface
  • Touchscreen interface

Enabling one or both requires the declaration of the compile switch macros in the GraphicsConfig.h file.
GOL widgets which supports the enabled input device's messages will respond to the user inputs.
For Example:
When using Button Widget.
#define USE_TOUCHSCREEN - will enable the buttons response to user touch on the button widget. The button will automatically be drawn with a pressed state when pressed and release state when user removes the touch on the screen.

The compile option selects the input devices used by... more

Focus Support Selection
This compile option allows keyboard input focus. GOLSetFocus(), GOLGetFocus(), GOLCanBeFocused(), GOLGetFocusNext() functions will be available. Focus is also changed by touch screen.
The USE_FOCUS option is located in the GraphicsConfig.h header file.
Graphics Object Selection
These compile options selects objects used. Remove definitions for unused objects to reduce code size.
The USE_GOL and USE_OBJECT options are located in the GraphicsConfig.h header file. USE_GOL should be included if any of the objects are to be used.
Links
Graphics Library Configuration, Topics
Library API > Graphics Library Configuration > Graphics Object Layer Configuration


Input Device Selection

Contents | Index | Home
Previous | Up | Next
Input Device Selection
Macros

The Graphics Library comes with two pre-defined user interface. These are the:

  • Keyboard interface
  • Touchscreen interface

Enabling one or both requires the declaration of the compile switch macros in the GraphicsConfig.h file.

GOL widgets which supports the enabled input device's messages will respond to the user inputs.

For Example:

When using Button Widget.

#define USE_TOUCHSCREEN - will enable the buttons response to user touch on the button widget. The button will automatically be drawn with a pressed state when pressed and release state when user removes the touch on the screen.

The compile option selects the input devices used by GOL widgets. Remove or comment out the macro declarations for unused input devices to reduce code size.

Macros
Name
Description
USE_KEYBOARD
Input devices macros that defines the messages that Objects will process. The following definitions indicate the usage of the different input devices:

  • USE_TOUCHSCREEN - enables the touch screen support.
  • USE_KEYBOARD - enables the key board support.

Define in GraphicsConfig.h

USE_TOUCHSCREEN
Input devices macros that defines the messages that Objects will process. The following definitions indicate the usage of the different input devices:

  • USE_TOUCHSCREEN - enables the touch screen support.
  • USE_KEYBOARD - enables the key board support.

Define in GraphicsConfig.h

Links
Graphics Object Layer Configuration, Macros
Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Input Device Selection


USE_KEYBOARD Macro

Contents | Index | Home
Previous | Up | Next
USE_KEYBOARD Macro
C
#define USE_KEYBOARD
Overview

Input devices macros that defines the messages that Objects will process. The following definitions indicate the usage of the different input devices:

  • USE_TOUCHSCREEN - enables the touch screen support.
  • USE_KEYBOARD - enables the key board support.

Define in GraphicsConfig.h

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Input Device Selection > USE_KEYBOARD Macro


USE_TOUCHSCREEN Macro

Contents | Index | Home
Previous | Up | Next
USE_TOUCHSCREEN Macro
C
#define USE_TOUCHSCREEN
Overview

Input devices macros that defines the messages that Objects will process. The following definitions indicate the usage of the different input devices:

  • USE_TOUCHSCREEN - enables the touch screen support.
  • USE_KEYBOARD - enables the key board support.

Define in GraphicsConfig.h

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Input Device Selection > USE_TOUCHSCREEN Macro


Focus Support Selection

Contents | Index | Home
Previous | Up | Next
Focus Support Selection
Macros

This compile option allows keyboard input focus. GOLSetFocus(), GOLGetFocus(), GOLCanBeFocused(), GOLGetFocusNext() functions will be available. Focus is also changed by touch screen.

The USE_FOCUS option is located in the GraphicsConfig.h header file.

Macros
Name | Description
USE_FOCUS | Keyboard control on some objects can be used by enabling the GOL Focus (USE_FOCUS)support. Define this in GraphicsConfig.h
Links
Graphics Object Layer Configuration, Macros
Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Focus Support Selection


USE_FOCUS Macro

Contents | Index | Home
Previous | Up | Next
USE_FOCUS Macro
C
#define USE_FOCUS
Overview

Keyboard control on some objects can be used by enabling the GOL Focus (USE_FOCUS)support. Define this in GraphicsConfig.h

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Focus Support Selection > USE_FOCUS Macro


Graphics Object Selection

Contents | Index | Home
Previous | Up | Next
Graphics Object Selection
Macros

These compile options selects objects used. Remove definitions for unused objects to reduce code size.

The USE_GOL and USE_OBJECT options are located in the GraphicsConfig.h header file. USE_GOL should be included if any of the objects are to be used.

Macros
Name | Description
USE_ANALOGCLOCK | Enable Analog Clock Object.
USE_BUTTON | Enable Button Object.
USE_BUTTON_MULTI_LINE | Enable Multi-Line Button Object
USE_CHECKBOX | Enable Checkbox Object.
USE_DIGITALMETER | Enable DigitalMeter Object.
USE_EDITBOX | Enable Edit Box Object.
USE_GROUPBOX | Enable Group Box Object.
USE_LISTBOX | Enable List Box Object.
USE_METER | Enable Meter Object.
USE_PICTURE | Enable Picture Object.
USE_PROGRESSBAR | Enable Progress Bar Object.
USE_RADIOBUTTON | Enable Radio Button Object.
USE_ROUNDDIAL | Enable Dial Object.
USE_SLIDER | Enable Slider or Scroll Bar Object.
USE_STATICTEXT | Enable Static Text Object.
USE_WINDOW | Enable Window Object.
USE_CUSTOM | Enable Custom Control Object (an example to create customized Object).
USE_GOL | Enable Graphics Object Layer.
USE_TEXTENTRY | Enable TextEntry Object.
Links
Graphics Object Layer Configuration, Macros
Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Graphics Object Selection


USE_ANALOGCLOCK Macro

Contents | Index | Home
Previous | Up | Next
USE_ANALOGCLOCK Macro
C
#define USE_ANALOGCLOCK
Description

Enable Analog Clock Object.

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Graphics Object Selection > USE_ANALOGCLOCK Macro


USE_BUTTON Macro

Contents | Index | Home
Previous | Up | Next
USE_BUTTON Macro
C
#define USE_BUTTON
Description

Enable Button Object.

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Graphics Object Selection > USE_BUTTON Macro


USE_BUTTON_MULTI_LINE Macro

Contents | Index | Home
Previous | Up | Next
USE_BUTTON_MULTI_LINE Macro
C
#define USE_BUTTON_MULTI_LINE
Description

Enable Multi-Line Button Object

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Graphics Object Selection > USE_BUTTON_MULTI_LINE Macro


USE_CHECKBOX Macro

Contents | Index | Home
Previous | Up | Next
USE_CHECKBOX Macro
C
#define USE_CHECKBOX
Description

Enable Checkbox Object.

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Graphics Object Selection > USE_CHECKBOX Macro


USE_DIGITALMETER Macro

Contents | Index | Home
Previous | Up | Next
USE_DIGITALMETER Macro
C
#define USE_DIGITALMETER
Description

Enable DigitalMeter Object.

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Graphics Object Selection > USE_DIGITALMETER Macro


USE_EDITBOX Macro

Contents | Index | Home
Previous | Up | Next
USE_EDITBOX Macro
C
#define USE_EDITBOX
Description

Enable Edit Box Object.

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Graphics Object Selection > USE_EDITBOX Macro


USE_GROUPBOX Macro

Contents | Index | Home
Previous | Up | Next
USE_GROUPBOX Macro
C
#define USE_GROUPBOX
Description

Enable Group Box Object.

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Graphics Object Selection > USE_GROUPBOX Macro


USE_LISTBOX Macro

Contents | Index | Home
Previous | Up | Next
USE_LISTBOX Macro
C
#define USE_LISTBOX
Description

Enable List Box Object.

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Graphics Object Selection > USE_LISTBOX Macro


USE_METER Macro

Contents | Index | Home
Previous | Up | Next
USE_METER Macro
C
#define USE_METER
Description

Enable Meter Object.

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Graphics Object Selection > USE_METER Macro


USE_PICTURE Macro

Contents | Index | Home
Previous | Up | Next
USE_PICTURE Macro
C
#define USE_PICTURE
Description

Enable Picture Object.

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Graphics Object Selection > USE_PICTURE Macro


USE_PROGRESSBAR Macro

Contents | Index | Home
Previous | Up | Next
USE_PROGRESSBAR Macro
C
#define USE_PROGRESSBAR
Description

Enable Progress Bar Object.

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Graphics Object Selection > USE_PROGRESSBAR Macro


USE_RADIOBUTTON Macro

Contents | Index | Home
Previous | Up | Next
USE_RADIOBUTTON Macro
C
#define USE_RADIOBUTTON
Description

Enable Radio Button Object.

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Graphics Object Selection > USE_RADIOBUTTON Macro


USE_ROUNDDIAL Macro

Contents | Index | Home
Previous | Up | Next
USE_ROUNDDIAL Macro
C
#define USE_ROUNDDIAL
Description

Enable Dial Object.

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Graphics Object Selection > USE_ROUNDDIAL Macro


USE_SLIDER Macro

Contents | Index | Home
Previous | Up | Next
USE_SLIDER Macro
C
#define USE_SLIDER
Description

Enable Slider or Scroll Bar Object.

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Graphics Object Selection > USE_SLIDER Macro


USE_STATICTEXT Macro

Contents | Index | Home
Previous | Up | Next
USE_STATICTEXT Macro
C
#define USE_STATICTEXT
Description

Enable Static Text Object.

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Graphics Object Selection > USE_STATICTEXT Macro


USE_WINDOW Macro

Contents | Index | Home
Previous | Up | Next
USE_WINDOW Macro
C
#define USE_WINDOW
Description

Enable Window Object.

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Graphics Object Selection > USE_WINDOW Macro


USE_CUSTOM Macro

Contents | Index | Home
Previous | Up | Next
USE_CUSTOM Macro
C
#define USE_CUSTOM
Description

Enable Custom Control Object (an example to create customized Object).

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Graphics Object Selection > USE_CUSTOM Macro


USE_GOL Macro

Contents | Index | Home
Previous | Up | Next
USE_GOL Macro
C
#define USE_GOL
Description

Enable Graphics Object Layer.

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Graphics Object Selection > USE_GOL Macro


USE_TEXTENTRY Macro

Contents | Index | Home
Previous | Up | Next
USE_TEXTENTRY Macro
C
#define USE_TEXTENTRY
Description

Enable TextEntry Object.

Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Graphics Object Selection > USE_TEXTENTRY Macro


Graphics Primitive Layer Configuration

Contents | Index | Home
Previous | Up | Next
Graphics Primitive Layer Configuration
Topics

The following compile time options configures the Graphics Library's Primitive Layer.

Topics
Name | Description
Image Compression Option | These compile options to set if the images used for OutImage() are RLE compressed or IPU compressed.
Font Type Selection | This compile option selects if the support for unicode fonts, unsigned char or the default signed char type fonts. There are three types of font (characters) that can be used in the Graphics Library. This gives the user the option to implement multi-language application or use the default signed char type.
Advanced Font Features Selection | This compile option enables the advanced font features.
Gradient Bar Rendering | This compile option enables the usage of the Gradient Bar and Bevel function in the Primitive Layer.
Transparent Color Feature in PutImage() | This compile option enables the transparent color feature in PutImage().
External Memory Buffer | see EXTERNAL_FONT_BUFFER_SIZE
Links
Graphics Library Configuration, Topics
Library API > Graphics Library Configuration > Graphics Primitive Layer Configuration


Image Compression Option

Contents | Index | Home
Previous | Up | Next
Image Compression Option
Macros

These compile options to set if the images used for OutImage() are RLE compressed or IPU compressed.

Macros
Name | Description
USE_COMP_IPU | To enable support for DEFLATE compressed images for PutImage(). When this macro is enabled, the PutImage() function will be able to process images generated by the Graphics Resource Converter (GRC) that are compressed using the DEFLATE algorithm. PutImage() will need the IPU module of the Microchip Graphics Module to decompress. Enable this feature only when the driver features the IPU module (example: PIC24FJ2456DA210). Define this in GraphicsConfig.h
USE_COMP_RLE | To enable support for RLE compressed images for PutImage(). When this macro is enabled, the PutImage() function will be able to process images generated by the Graphics Resource Converter (GRC) that are RLE compressed. Define this in GraphicsConfig.h
Links
Graphics Primitive Layer Configuration, Macros
Library API > Graphics Library Configuration > Graphics Primitive Layer Configuration > Image Compression Option


USE_COMP_IPU Macro

Contents | Index | Home
Previous | Up | Next
USE_COMP_IPU Macro
C
#define USE_COMP_IPU
Overview

To enable support for DEFLATE compressed images for PutImage(). When this macro is enabled, the PutImage() function will be able to process images generated by the Graphics Resource Converter (GRC) that are compressed using the DEFLATE algorithm. PutImage() will need the IPU module of the Microchip Graphics Module to decompress. Enable this feature only when the driver features the IPU module (example: PIC24FJ2456DA210). Define this in GraphicsConfig.h

Library API > Graphics Library Configuration > Graphics Primitive Layer Configuration > Image Compression Option > USE_COMP_IPU Macro


USE_COMP_RLE Macro

Contents | Index | Home
Previous | Up | Next
USE_COMP_RLE Macro
C
#define USE_COMP_RLE
Overview

To enable support for RLE compressed images for PutImage(). When this macro is enabled, the PutImage() function will be able to process images generated by the Graphics Resource Converter (GRC) that are RLE compressed. Define this in GraphicsConfig.h

Library API > Graphics Library Configuration > Graphics Primitive Layer Configuration > Image Compression Option > USE_COMP_RLE Macro


Font Type Selection

Contents | Index | Home
Previous | Up | Next
Font Type Selection
Macros

This compile option selects if the support for unicode fonts, unsigned char or the default signed char type fonts.

There are three types of font (characters) that can be used in the Graphics Library. This gives the user the option to implement multi-language application or use the default signed char type.

Define in GraphicsConfig.h | XCHAR type | Description
#define USE_MULTIBYTECHAR | #define XCHAR unsigned short | Enable support for multi-byte fonts such as Unicode fonts.
#define USE_UNSIGNED_XCHAR | #define XCHAR unsigned char | Enable support for character range of 0-255.
none of the two are defined | #define XCHAR char | Character range is set to 0-127.

Note: Only one of the two or none at all are defined in GraphicsConfig.h.

- #define USE_MULTIBYTECHAR

- #define USE_UNSIGNED_XCHAR

- when none are defined, XCHAR defaults to type char.

See XCHAR for details.

Macros
Name | Description
USE_MULTIBYTECHAR | To enable support for unicode fonts, USE_MULTIBYTECHAR must be defined. This sets the XCHAR definition (0-2^16 range). See XCHAR for details. Define this in GraphicsConfig.h
USE_UNSIGNED_XCHAR | To enable support for unsigned characters data type for fonts, USE_UNSIGNED_XCHAR must be defined. This sets the XCHAR definition (0-255 range). See XCHAR for details. Define this in GraphicsConfig.h
Links
Graphics Primitive Layer Configuration, Macros
Library API > Graphics Library Configuration > Graphics Primitive Layer Configuration > Font Type Selection


USE_MULTIBYTECHAR Macro

Contents | Index | Home
Previous | Up | Next
USE_MULTIBYTECHAR Macro
C
#define USE_MULTIBYTECHAR
Overview

To enable support for unicode fonts, USE_MULTIBYTECHAR must be defined. This sets the XCHAR definition (0-2^16 range). See XCHAR for details. Define this in GraphicsConfig.h

Library API > Graphics Library Configuration > Graphics Primitive Layer Configuration > Font Type Selection > USE_MULTIBYTECHAR Macro


USE_UNSIGNED_XCHAR Macro

Contents | Index | Home
Previous | Up | Next
USE_UNSIGNED_XCHAR Macro
C
#define USE_UNSIGNED_XCHAR
Overview

To enable support for unsigned characters data type for fonts, USE_UNSIGNED_XCHAR must be defined. This sets the XCHAR definition (0-255 range). See XCHAR for details. Define this in GraphicsConfig.h

Library API > Graphics Library Configuration > Graphics Primitive Layer Configuration > Font Type Selection > USE_UNSIGNED_XCHAR Macro


Advanced Font Features Selection

Contents | Index | Home
Previous | Up | Next
Advanced Font Features Selection
Macros

This compile option enables the advanced font features.

Macros
Name | Description
USE_ANTIALIASED_FONTS | To enable support for Anti-aliased fonts. Use this feature if the font table generated through the "Graphics Resource Converter" tool has the anti-aliasing enabled. Define this in GraphicsConfig.h
Links
Graphics Primitive Layer Configuration, Macros
Library API > Graphics Library Configuration > Graphics Primitive Layer Configuration > Advanced Font Features Selection


USE_ANTIALIASED_FONTS Macro

Contents | Index | Home
Previous | Up | Next
USE_ANTIALIASED_FONTS Macro
C
#define USE_ANTIALIASED_FONTS
Overview

To enable support for Anti-aliased fonts. Use this feature if the font table generated through the "Graphics Resource Converter" tool has the anti-aliasing enabled. Define this in GraphicsConfig.h

Library API > Graphics Library Configuration > Graphics Primitive Layer Configuration > Advanced Font Features Selection > USE_ANTIALIASED_FONTS Macro


Gradient Bar Rendering

Contents | Index | Home
Previous | Up | Next
Gradient Bar Rendering
Macros

This compile option enables the usage of the Gradient Bar and Bevel function in the Primitive Layer.

Macros
Name | Description
USE_GRADIENT | To enable support for Gradient bars and bevel primitives. Define this in GraphicsConfig.h.
Links
Graphics Primitive Layer Configuration, Macros
Library API > Graphics Library Configuration > Graphics Primitive Layer Configuration > Gradient Bar Rendering


USE_GRADIENT Macro

Contents | Index | Home
Previous | Up | Next
USE_GRADIENT Macro
C
#define USE_GRADIENT
Overview

To enable support for Gradient bars and bevel primitives. Define this in GraphicsConfig.h.

Library API > Graphics Library Configuration > Graphics Primitive Layer Configuration > Gradient Bar Rendering > USE_GRADIENT Macro


Transparent Color Feature in PutImage()

Contents | Index | Home
Previous | Up | Next
Transparent Color Feature in PutImage()
Macros

This compile option enables the transparent color feature in PutImage().

Macros
Name | Description
USE_TRANSPARENT_COLOR | To enable support for transparent color in PutImage(). Enabling this macro enables the use of a transparent color (set by TransparentColorEnable()) in rendering images by PutImage(). When a pixel in the image matches the transparent color set, the pixel is not rendered to the screen. This is useful in rendering rounded icons or images to the screen with a complex background. Define this in GraphicsConfig.h
Links
Graphics Primitive Layer Configuration, Macros
Library API > Graphics Library Configuration > Graphics Primitive Layer Configuration > Transparent Color Feature in PutImage()


USE_TRANSPARENT_COLOR Macro

Contents | Index | Home
Previous | Up | Next
USE_TRANSPARENT_COLOR Macro
C
#define USE_TRANSPARENT_COLOR
Overview

To enable support for transparent color in PutImage(). Enabling this macro enables the use of a transparent color (set by TransparentColorEnable()) in rendering images by PutImage(). When a pixel in the image matches the transparent color set, the pixel is not rendered to the screen. This is useful in rendering rounded icons or images to the screen with a complex background. Define this in GraphicsConfig.h

Library API > Graphics Library Configuration > Graphics Primitive Layer Configuration > Transparent Color Feature in PutImage() > USE_TRANSPARENT_COLOR Macro


External Memory Buffer

Contents | Index | Home
Previous | Up | Next
External Memory Buffer

see EXTERNAL_FONT_BUFFER_SIZE

Links
Graphics Primitive Layer Configuration
Library API > Graphics Library Configuration > Graphics Primitive Layer Configuration > External Memory Buffer


Display Device Driver Layer Configuration

Contents | Index | Home
Previous | Up | Next
Display Device Driver Layer Configuration
Macros

The following compile time options configures the Graphics Library's Display Device Driver Layer. The choices are based on the specific hardware used.

See Hardware Profile for more options.

Macros
Name
Description
USE_ALPHABLEND
To enable support for Alpha Blending. Use this feature only if the display driver used can support alpha blending. Define this in GraphicsConfig.h
USE_DOUBLE_BUFFERING
To enable support for double buffering. Use this feature only if the display driver used can support double buffering. Define this in GraphicsConfig.h
GFX_LCD_TYPE
Sets the type of display glass used. Define this in the Hardware Profile.

  • #define GFX_LCD_TYPE GFX_LCD_TFT - sets type TFT display
  • #define GFX_LCD_TYPE GFX_LCD_CSTN - sets type color STN display
  • #define GFX_LCD_TYPE GFX_LCD_MSTN - sets type mon STN display
  • #define GFX_LCD_TYPE GFX_LCD_OFF - display is turned off

STN_DISPLAY_WIDTH
Sets the STN glass data width. Define this in the Hardware Profile.

  • #define STN_DISPLAY_WIDTH STN_DISPLAY_WIDTH_4 - use 4-bit wide interface
  • #define STN_DISPLAY_WIDTH STN_DISPLAY_WIDTH_8 - Use 8-bit wide interface
  • #define STN_DISPLAY_WIDTH STN_DISPLAY_WIDTH_16 - Use 16-bit wide interface

Links
Graphics Library Configuration, Macros
Library API > Graphics Library Configuration > Display Device Driver Layer Configuration


USE_ALPHABLEND Macro

Contents | Index | Home
Previous | Up | Next
USE_ALPHABLEND Macro
C
#define USE_ALPHABLEND
Overview

To enable support for Alpha Blending. Use this feature only if the display driver used can support alpha blending. Define this in GraphicsConfig.h

Library API > Graphics Library Configuration > Display Device Driver Layer Configuration > USE_ALPHABLEND Macro


USE_DOUBLE_BUFFERING Macro

Contents | Index | Home
Previous | Up | Next
USE_DOUBLE_BUFFERING Macro
C
#define USE_DOUBLE_BUFFERING
Overview

To enable support for double buffering. Use this feature only if the display driver used can support double buffering. Define this in GraphicsConfig.h

Library API > Graphics Library Configuration > Display Device Driver Layer Configuration > USE_DOUBLE_BUFFERING Macro


GFX_LCD_TYPE Macro

Contents | Index | Home
Previous | Up | Next
GFX_LCD_TYPE Macro
Macros
C
#define GFX_LCD_TYPE
Overview

Sets the type of display glass used. Define this in the Hardware Profile.

  • #define GFX_LCD_TYPE GFX_LCD_TFT - sets type TFT display
  • #define GFX_LCD_TYPE GFX_LCD_CSTN - sets type color STN display
  • #define GFX_LCD_TYPE GFX_LCD_MSTN - sets type mon STN display
  • #define GFX_LCD_TYPE GFX_LCD_OFF - display is turned off
Library API > Graphics Library Configuration > Display Device Driver Layer Configuration > GFX_LCD_TYPE Macro


GFX_LCD_CSTN Macro

Contents | Index | Home
Previous | Up | Next
GFX_LCD_CSTN Macro
C
#define GFX_LCD_CSTN 0x03            // Type Color STN Display
Description

Type Color STN Display

Library API > Graphics Library Configuration > Display Device Driver Layer Configuration > GFX_LCD_TYPE Macro > GFX_LCD_CSTN Macro


GFX_LCD_MSTN Macro

Contents | Index | Home
Previous | Up | Next
GFX_LCD_MSTN Macro
C
#define GFX_LCD_MSTN 0x02            // Type Mono STN Display
Description

Type Mono STN Display

Library API > Graphics Library Configuration > Display Device Driver Layer Configuration > GFX_LCD_TYPE Macro > GFX_LCD_MSTN Macro


GFX_LCD_OFF Macro

Contents | Index | Home
Previous | Up | Next
GFX_LCD_OFF Macro
C
#define GFX_LCD_OFF 0x00            // display is turned off
Description

display is turned off

Library API > Graphics Library Configuration > Display Device Driver Layer Configuration > GFX_LCD_TYPE Macro > GFX_LCD_OFF Macro


GFX_LCD_TFT Macro

Contents | Index | Home
Previous | Up | Next
GFX_LCD_TFT Macro
C
#define GFX_LCD_TFT 0x01            // Type TFT Display
Description

Type TFT Display

Library API > Graphics Library Configuration > Display Device Driver Layer Configuration > GFX_LCD_TYPE Macro > GFX_LCD_TFT Macro


STN_DISPLAY_WIDTH Macro

Contents | Index | Home
Previous | Up | Next
STN_DISPLAY_WIDTH Macro
Macros
C
#define STN_DISPLAY_WIDTH
Overview

Sets the STN glass data width. Define this in the Hardware Profile.

  • #define STN_DISPLAY_WIDTH STN_DISPLAY_WIDTH_4 - use 4-bit wide interface
  • #define STN_DISPLAY_WIDTH STN_DISPLAY_WIDTH_8 - Use 8-bit wide interface
  • #define STN_DISPLAY_WIDTH STN_DISPLAY_WIDTH_16 - Use 16-bit wide interface
Library API > Graphics Library Configuration > Display Device Driver Layer Configuration > STN_DISPLAY_WIDTH Macro


STN_DISPLAY_WIDTH_16 Macro

Contents | Index | Home
Previous | Up | Next
STN_DISPLAY_WIDTH_16 Macro
C
#define STN_DISPLAY_WIDTH_16 0x02    // display interface is 16 bits wide
Description

display interface is 16 bits wide

Library API > Graphics Library Configuration > Display Device Driver Layer Configuration > STN_DISPLAY_WIDTH Macro > STN_DISPLAY_WIDTH_16 Macro


STN_DISPLAY_WIDTH_4 Macro

Contents | Index | Home
Previous | Up | Next
STN_DISPLAY_WIDTH_4 Macro
C
#define STN_DISPLAY_WIDTH_4 0x00    // display interface is 4 bits wide
Description

display interface is 4 bits wide

Library API > Graphics Library Configuration > Display Device Driver Layer Configuration > STN_DISPLAY_WIDTH Macro > STN_DISPLAY_WIDTH_4 Macro


STN_DISPLAY_WIDTH_8 Macro

Contents | Index | Home
Previous | Up | Next
STN_DISPLAY_WIDTH_8 Macro
C
#define STN_DISPLAY_WIDTH_8 0x01    // display interface is 8 bits wide
Description

display interface is 8 bits wide

Library API > Graphics Library Configuration > Display Device Driver Layer Configuration > STN_DISPLAY_WIDTH Macro > STN_DISPLAY_WIDTH_8 Macro


Application Configuration

Contents | Index | Home
Previous | Up | Next
Application Configuration
Topics
Topics
Name | Description
Configuration Setting | This selects the configuration of the library. When Non-blocking configuration is selected, state machine based rendering is used to perform object rendering. When blocking configuration is used, this line MUST be commented. In this case object rendering will not exit until the object is fully rendered. The USE_NONBLOCKING_CONFIG option is located in the GraphicsConfig.h header file.
Font Source Selection | Font data can be placed in multiple locations. Set these options in the GraphicsConfig.h header file. - USE_FONT_FLASH - Font in internal flash memory support. - USE_FONT_EXTERNAL - Font in external memory support. Use this for fonts located in external memory like SPI Flash or external memory mapped to Extended Data Space.
Image Source Selection | Similar to Font data bitmaps can also be placed in two locations. One is in FLASH memory and the other is from external memory. Definining one or both enables the support for bitmaps located in internal flash and external memory. The USE_BITMAP_FLASH and USE_BITMAP_EXTERNAL options are located in the GraphicsConfig.h header file.
Miscellaneous | This contains miscellaneous macros and functions that can be redefined for various system support such as Operating System defined functions.
GraphicsConfig.h Example | This is an example of the GraphicsConfig.h file implementation:
Links
Graphics Library Configuration, Topics
Library API > Graphics Library Configuration > Application Configuration


Configuration Setting

Contents | Index | Home
Previous | Up | Next
Configuration Setting
Macros

This selects the configuration of the library. When Non-blocking configuration is selected, state machine based rendering is used to perform object rendering.

When blocking configuration is used, this line MUST be commented. In this case object rendering will not exit until the object is fully rendered.

The USE_NONBLOCKING_CONFIG option is located in the GraphicsConfig.h header file.

Macros
Name | Description
USE_NONBLOCKING_CONFIG | Blocking and Non-Blocking configuration selection. To enable non-blocking configuration USE_NONBLOCKING_CONFIG must be defined. If this is not defined, blocking configuration is assumed. Define this in GraphicsConfig.h
Links
Application Configuration, Macros
Library API > Graphics Library Configuration > Application Configuration > Configuration Setting


USE_NONBLOCKING_CONFIG Macro

Contents | Index | Home
Previous | Up | Next
USE_NONBLOCKING_CONFIG Macro
C
#define USE_NONBLOCKING_CONFIG
Overview

Blocking and Non-Blocking configuration selection. To enable non-blocking configuration USE_NONBLOCKING_CONFIG must be defined. If this is not defined, blocking configuration is assumed. Define this in GraphicsConfig.h

Library API > Graphics Library Configuration > Application Configuration > Configuration Setting > USE_NONBLOCKING_CONFIG Macro


Font Source Selection

Contents | Index | Home
Previous | Up | Next
Font Source Selection
Macros

Font data can be placed in multiple locations. Set these options in the GraphicsConfig.h header file.

- USE_FONT_FLASH - Font in internal flash memory support.

- USE_FONT_EXTERNAL - Font in external memory support. Use this for fonts located in external memory like SPI Flash or external memory mapped to Extended Data Space.

Macros
Name
Description
USE_FONT_FLASH
Font data can be placed in two locations. One is in FLASH memory and the other is from external memory. Definining one or both enables the support for fonts located in internal flash and external memory. Define this in GraphicsConfig.h

  • USE_FONT_FLASH - Font in internal flash memory support.
  • USE_FONT_EXTERNAL - Font in external memory support (including external memory mapped to EDS).

USE_FONT_EXTERNAL
Font data can be placed in two locations. One is in FLASH memory and the other is from external memory. Definining one or both enables the support for fonts located in internal flash and external memory. Define this in GraphicsConfig.h

  • USE_FONT_FLASH - Font in internal flash memory support.
  • USE_FONT_EXTERNAL - Font in external memory support (including external memory mapped to EDS).

Links
Application Configuration, Macros
Library API > Graphics Library Configuration > Application Configuration > Font Source Selection


USE_FONT_FLASH Macro

Contents | Index | Home
Previous | Up | Next
USE_FONT_FLASH Macro
C
#define USE_FONT_FLASH
Overview

Font data can be placed in two locations. One is in FLASH memory and the other is from external memory. Definining one or both enables the support for fonts located in internal flash and external memory. Define this in GraphicsConfig.h

  • USE_FONT_FLASH - Font in internal flash memory support.
  • USE_FONT_EXTERNAL - Font in external memory support (including external memory mapped to EDS).
Library API > Graphics Library Configuration > Application Configuration > Font Source Selection > USE_FONT_FLASH Macro


USE_FONT_EXTERNAL Macro

Contents | Index | Home
Previous | Up | Next
USE_FONT_EXTERNAL Macro
C
#define USE_FONT_EXTERNAL
Overview

Font data can be placed in two locations. One is in FLASH memory and the other is from external memory. Definining one or both enables the support for fonts located in internal flash and external memory. Define this in GraphicsConfig.h

  • USE_FONT_FLASH - Font in internal flash memory support.
  • USE_FONT_EXTERNAL - Font in external memory support (including external memory mapped to EDS).
Library API > Graphics Library Configuration > Application Configuration > Font Source Selection > USE_FONT_EXTERNAL Macro


Image Source Selection

Contents | Index | Home
Previous | Up | Next
Image Source Selection
Macros

Similar to Font data bitmaps can also be placed in two locations. One is in FLASH memory and the other is from external memory. Definining one or both enables the support for bitmaps located in internal flash and external memory.

The USE_BITMAP_FLASH and USE_BITMAP_EXTERNAL options are located in the GraphicsConfig.h header file.

Macros
Name
Description
USE_BITMAP_FLASH
Similar to Font data bitmaps can also be placed in two locations. One is in FLASH memory and the other is from external memory. Definining one or both enables the support for bitmaps located in internal flash and external memory. Define this in GraphicsConfig.h

  • USE_BITMAP_FLASH - Images located in internal flash memory.
  • USE_BITMAP_EXTERNAL - Images located in external memory (including external memory mapped to EDS)..

USE_BITMAP_EXTERNAL
Similar to Font data bitmaps can also be placed in two locations. One is in FLASH memory and the other is from external memory. Definining one or both enables the support for bitmaps located in internal flash and external memory. Define this in GraphicsConfig.h

  • USE_BITMAP_FLASH - Images located in internal flash memory.
  • USE_BITMAP_EXTERNAL - Images located in external memory (including external memory mapped to EDS)..

Links
Application Configuration, Macros
Library API > Graphics Library Configuration > Application Configuration > Image Source Selection


USE_BITMAP_FLASH Macro

Contents | Index | Home
Previous | Up | Next
USE_BITMAP_FLASH Macro
C
#define USE_BITMAP_FLASH
Overview

Similar to Font data bitmaps can also be placed in two locations. One is in FLASH memory and the other is from external memory. Definining one or both enables the support for bitmaps located in internal flash and external memory. Define this in GraphicsConfig.h

  • USE_BITMAP_FLASH - Images located in internal flash memory.
  • USE_BITMAP_EXTERNAL - Images located in external memory (including external memory mapped to EDS)..
Library API > Graphics Library Configuration > Application Configuration > Image Source Selection > USE_BITMAP_FLASH Macro


USE_BITMAP_EXTERNAL Macro

Contents | Index | Home
Previous | Up | Next
USE_BITMAP_EXTERNAL Macro
C
#define USE_BITMAP_EXTERNAL
Overview

Similar to Font data bitmaps can also be placed in two locations. One is in FLASH memory and the other is from external memory. Definining one or both enables the support for bitmaps located in internal flash and external memory. Define this in GraphicsConfig.h

  • USE_BITMAP_FLASH - Images located in internal flash memory.
  • USE_BITMAP_EXTERNAL - Images located in external memory (including external memory mapped to EDS)..
Library API > Graphics Library Configuration > Application Configuration > Image Source Selection > USE_BITMAP_EXTERNAL Macro


Miscellaneous

Contents | Index | Home
Previous | Up | Next
Miscellaneous
Macros

This contains miscellaneous macros and functions that can be redefined for various system support such as Operating System defined functions.

Macros
Name | Description
USE_PALETTE_EXTERNAL | Palettes can also be specified to reside in external memory similar to fonts and images. Use this when the palette is located in external memory. Define this in GraphicsConfig.h
USE_PALETTE | Using Palettes, different colors can be used with the same bit depth. Define this in GraphicsConfig.h
COLOR_DEPTH | Specifies the color depth used in the application defined in GraphicsConfig.h.
GFX_free | When using Operating Systems (OS), define the OS specific malloc() and free() functions for compatibility with the OS based systems. Define these in GraphicsConfig.h
GFX_malloc | When using Operating Systems (OS), define the OS specific malloc() and free() functions for compatibility with the OS based systems. Define these in GraphicsConfig.h
Links
Application Configuration, Macros
Library API > Graphics Library Configuration > Application Configuration > Miscellaneous


USE_PALETTE_EXTERNAL Macro

Contents | Index | Home
Previous | Up | Next
USE_PALETTE_EXTERNAL Macro
C
#define USE_PALETTE_EXTERNAL
Overview

Palettes can also be specified to reside in external memory similar to fonts and images. Use this when the palette is located in external memory. Define this in GraphicsConfig.h

Library API > Graphics Library Configuration > Application Configuration > Miscellaneous > USE_PALETTE_EXTERNAL Macro


USE_PALETTE Macro

Contents | Index | Home
Previous | Up | Next
USE_PALETTE Macro
C
#define USE_PALETTE
Overview

Using Palettes, different colors can be used with the same bit depth. Define this in GraphicsConfig.h

Library API > Graphics Library Configuration > Application Configuration > Miscellaneous > USE_PALETTE Macro


COLOR_DEPTH Macro

Contents | Index | Home
Previous | Up | Next
COLOR_DEPTH Macro
C
#define COLOR_DEPTH 16
Overview

Specifies the color depth used in the application defined in GraphicsConfig.h.

Library API > Graphics Library Configuration > Application Configuration > Miscellaneous > COLOR_DEPTH Macro


GFX_free Macro

Contents | Index | Home
Previous | Up | Next
GFX_free Macro
C
#define GFX_free(pObj) free(pObj)        // <COPY GFX_malloc>
Overview

When using Operating Systems (OS), define the OS specific malloc() and free() functions for compatibility with the OS based systems. Define these in GraphicsConfig.h

Library API > Graphics Library Configuration > Application Configuration > Miscellaneous > GFX_free Macro


GFX_malloc Macro

Contents | Index | Home
Previous | Up | Next
GFX_malloc Macro
C
#define GFX_malloc(size) malloc(size)
Overview

When using Operating Systems (OS), define the OS specific malloc() and free() functions for compatibility with the OS based systems. Define these in GraphicsConfig.h

Library API > Graphics Library Configuration > Application Configuration > Miscellaneous > GFX_malloc Macro


GraphicsConfig.h Example

Contents | Index | Home
Previous | Up | Next
GraphicsConfig.h Example

This is an example of the GraphicsConfig.h file implementation:

Copy Code
//////////////////// COMPILE OPTIONS AND DEFAULTS ////////////////////

#define     USE_NONBLOCKING_CONFIG     // Comment this line to use blocking configuration
#define     USE_FOCUS                  // Comment this line when not using FOCUS
#define     USE_TOUCHSCREEN            // Enable touch screen support.
#define     USE_KEYBOARD               // Enable key board support.

#define     USE_GOL                    // Enable Graphics Object Layer.
#define     USE_BUTTON                 // Enable Button Object.
#define     USE_CHART                  // Enable Chart Object.
#define     USE_WINDOW                 // Enable Window Object.
#define     USE_CHECKBOX               // Enable Checkbox Object.
#define     USE_RADIOBUTTON            // Enable Radio Button Object.
#define     USE_EDITBOX                // Enable Edit Box Object.
#define     USE_LISTBOX                // Enable List Box Object.
#define     USE_SLIDER                 // Enable Slider or Scroll Bar Object.
#define     USE_PROGRESSBAR            // Enable Progress Bar Object.
#define     USE_STATICTEXT             // Enable Static Text Object.
#define     USE_PICTURE                // Enable Picture Object.
#define     USE_GROUPBOX               // Enable Group Box Object.
#define     USE_ROUNDDIAL              // Enable Dial Object.
#define     USE_METER                  // Enable Meter Object.
#define     USE_TEXTENTRY              // Enable Text Entry Object.
#define     USE_CUSTOM                 // Enable Custom Control Object (an example to create customized Object).

#define     USE_MULTIBYTECHAR          // Enable unicode derived characters
#define     USE_FONT_FLASH             // Support for fonts located in internal flash
#define     USE_BITMAP_FLASH           // Support for bitmaps located in internal flash

#define     GOL_EMBOSS_SIZE            2

#define     COLOR_DEPTH                16  // The color depth used
Links
Application Configuration
Library API > Graphics Library Configuration > Application Configuration > GraphicsConfig.h Example


Hardware Profile

Contents | Index | Home
Previous | Up | Next
Hardware Profile
Topics

These functions and macros are used to determine hardware profile settings on the chosen PIC microcontroller and hardware such as demo boards used.

Topics
Name | Description
PMP Interface | Specifies the interface type to the Parallel Master Port (PMP) or Enhanced Parallel Master Port (EPMP).
Development Platform Used | Specifies the Development Platform used for the Microchip Graphics Library demos.
Graphics PICtail Used | Specifies the Graphics PICtail Display Panel used.
Display Controller Used | Specifies the controller used in the Graphics Library supplied demo.
Display Panel Used | Specifies the Graphics Display Panel used.
Device Driver Options | The options Graphics Hardware Platform, DISPLAY_CONTROLLER and DISPLAY_PANEL are specific to the hardware used. The Graphics Hardware Platform selects the Graphics PICtail™ Plus Board version, PIC24FJ256DA210 Development Board or any other Microchip demo boards for the Graphics Library. Currently there are two Graphics PICtail™ Plus Board versions supported as shown in the Getting Started section. The rest of the settings are used to specify the the display parameters when using an RGB type display controller such as SSD1906 and SSD1926 from Solomon Systech. The table below summarizes the generic parameters found in RGB type display controllers and when each type is used.... more
HardwareProfile.h Example | This is an example of the HardwareProfile.h file implementation:
Links
Graphics Library Configuration, Topics
Library API > Graphics Library Configuration > Hardware Profile


PMP Interface

Contents | Index | Home
Previous | Up | Next
PMP Interface
Macros

Specifies the interface type to the Parallel Master Port (PMP) or Enhanced Parallel Master Port (EPMP).

Macros
Name
Description
USE_8BIT_PMP
Specifies the interface type to the Parallel Master Port (PMP) or Enhanced Parallel Master Port (EPMP).

  • USE_8BIT_PMP - Use 8-bit interface to PMP or EPMP
  • USE_16BIT_PMP - Use 16-bit interface to PMP or EPMP

USE_16BIT_PMP
Specifies the interface type to the Parallel Master Port (PMP) or Enhanced Parallel Master Port (EPMP).

  • USE_8BIT_PMP - Use 8-bit interface to PMP or EPMP
  • USE_16BIT_PMP - Use 16-bit interface to PMP or EPMP

Links
Hardware Profile, Macros
Library API > Graphics Library Configuration > Hardware Profile > PMP Interface


USE_8BIT_PMP Macro

Contents | Index | Home
Previous | Up | Next
USE_8BIT_PMP Macro
C
#define USE_8BIT_PMP
Overview

Specifies the interface type to the Parallel Master Port (PMP) or Enhanced Parallel Master Port (EPMP).

  • USE_8BIT_PMP - Use 8-bit interface to PMP or EPMP
  • USE_16BIT_PMP - Use 16-bit interface to PMP or EPMP
Library API > Graphics Library Configuration > Hardware Profile > PMP Interface > USE_8BIT_PMP Macro


USE_16BIT_PMP Macro

Contents | Index | Home
Previous | Up | Next
USE_16BIT_PMP Macro
C
#define USE_16BIT_PMP
Overview

Specifies the interface type to the Parallel Master Port (PMP) or Enhanced Parallel Master Port (EPMP).

  • USE_8BIT_PMP - Use 8-bit interface to PMP or EPMP
  • USE_16BIT_PMP - Use 16-bit interface to PMP or EPMP
Library API > Graphics Library Configuration > Hardware Profile > PMP Interface > USE_16BIT_PMP Macro


Development Platform Used

Contents | Index | Home
Previous | Up | Next
Development Platform Used
Macros

Specifies the Development Platform used for the Microchip Graphics Library demos.

Macros
Name
Description
EXPLORER_16
Specifies the Development Platform used for the Microchip Graphics Library demos.

  • EXPLORER_16 - Using the Explorer 16 Development Board (DM240001).
  • PIC24FJ256DA210_DEV_BOARD - Using the PIC24FJ256DA210 Development Board (DM240312).
  • MEB_BOARD - Using the Multi-Media Expansion Board (DM320005).
  • PIC_SK - Using PIC32 or dsPIC Starter Kit (examples: PIC32 Starter Kit (DM320001), PIC32 USB Starter Kit II (DM320003-2), PIC32 Ethernet Starter Kit (DM320004)).

PIC24FJ256DA210_DEV_BOARD
Specifies the Development Platform used for the Microchip Graphics Library demos.

  • EXPLORER_16 - Using the Explorer 16 Development Board (DM240001).
  • PIC24FJ256DA210_DEV_BOARD - Using the PIC24FJ256DA210 Development Board (DM240312).
  • MEB_BOARD - Using the Multi-Media Expansion Board (DM320005).
  • PIC_SK - Using PIC32 or dsPIC Starter Kit (examples: PIC32 Starter Kit (DM320001), PIC32 USB Starter Kit II (DM320003-2), PIC32 Ethernet Starter Kit (DM320004)).

MEB_BOARD
Specifies the Development Platform used for the Microchip Graphics Library demos.

  • EXPLORER_16 - Using the Explorer 16 Development Board (DM240001).
  • PIC24FJ256DA210_DEV_BOARD - Using the PIC24FJ256DA210 Development Board (DM240312).
  • MEB_BOARD - Using the Multi-Media Expansion Board (DM320005).
  • PIC_SK - Using PIC32 or dsPIC Starter Kit (examples: PIC32 Starter Kit (DM320001), PIC32 USB Starter Kit II (DM320003-2), PIC32 Ethernet Starter Kit (DM320004)).

PIC_SK
Specifies the Development Platform used for the Microchip Graphics Library demos.

  • EXPLORER_16 - Using the Explorer 16 Development Board (DM240001).
  • PIC24FJ256DA210_DEV_BOARD - Using the PIC24FJ256DA210 Development Board (DM240312).
  • MEB_BOARD - Using the Multi-Media Expansion Board (DM320005).
  • PIC_SK - Using PIC32 or dsPIC Starter Kit (examples: PIC32 Starter Kit (DM320001), PIC32 USB Starter Kit II (DM320003-2), PIC32 Ethernet Starter Kit (DM320004)).

Links
Hardware Profile, Macros
Library API > Graphics Library Configuration > Hardware Profile > Development Platform Used


EXPLORER_16 Macro

Contents | Index | Home
Previous | Up | Next
EXPLORER_16 Macro
C
#define EXPLORER_16
Overview

Specifies the Development Platform used for the Microchip Graphics Library demos.

  • EXPLORER_16 - Using the Explorer 16 Development Board (DM240001).
  • PIC24FJ256DA210_DEV_BOARD - Using the PIC24FJ256DA210 Development Board (DM240312).
  • MEB_BOARD - Using the Multi-Media Expansion Board (DM320005).
  • PIC_SK - Using PIC32 or dsPIC Starter Kit (examples: PIC32 Starter Kit (DM320001), PIC32 USB Starter Kit II (DM320003-2), PIC32 Ethernet Starter Kit (DM320004)).
Library API > Graphics Library Configuration > Hardware Profile > Development Platform Used > EXPLORER_16 Macro


PIC24FJ256DA210_DEV_BOARD Macro

Contents | Index | Home
Previous | Up | Next
PIC24FJ256DA210_DEV_BOARD Macro
C
#define PIC24FJ256DA210_DEV_BOARD
Overview

Specifies the Development Platform used for the Microchip Graphics Library demos.

  • EXPLORER_16 - Using the Explorer 16 Development Board (DM240001).
  • PIC24FJ256DA210_DEV_BOARD - Using the PIC24FJ256DA210 Development Board (DM240312).
  • MEB_BOARD - Using the Multi-Media Expansion Board (DM320005).
  • PIC_SK - Using PIC32 or dsPIC Starter Kit (examples: PIC32 Starter Kit (DM320001), PIC32 USB Starter Kit II (DM320003-2), PIC32 Ethernet Starter Kit (DM320004)).
Library API > Graphics Library Configuration > Hardware Profile > Development Platform Used > PIC24FJ256DA210_DEV_BOARD Macro


MEB_BOARD Macro

Contents | Index | Home
Previous | Up | Next
MEB_BOARD Macro
C
#define MEB_BOARD
Overview

Specifies the Development Platform used for the Microchip Graphics Library demos.

  • EXPLORER_16 - Using the Explorer 16 Development Board (DM240001).
  • PIC24FJ256DA210_DEV_BOARD - Using the PIC24FJ256DA210 Development Board (DM240312).
  • MEB_BOARD - Using the Multi-Media Expansion Board (DM320005).
  • PIC_SK - Using PIC32 or dsPIC Starter Kit (examples: PIC32 Starter Kit (DM320001), PIC32 USB Starter Kit II (DM320003-2), PIC32 Ethernet Starter Kit (DM320004)).
Library API > Graphics Library Configuration > Hardware Profile > Development Platform Used > MEB_BOARD Macro


PIC_SK Macro

Contents | Index | Home
Previous | Up | Next
PIC_SK Macro
C
#define PIC_SK
Overview

Specifies the Development Platform used for the Microchip Graphics Library demos.

  • EXPLORER_16 - Using the Explorer 16 Development Board (DM240001).
  • PIC24FJ256DA210_DEV_BOARD - Using the PIC24FJ256DA210 Development Board (DM240312).
  • MEB_BOARD - Using the Multi-Media Expansion Board (DM320005).
  • PIC_SK - Using PIC32 or dsPIC Starter Kit (examples: PIC32 Starter Kit (DM320001), PIC32 USB Starter Kit II (DM320003-2), PIC32 Ethernet Starter Kit (DM320004)).
Library API > Graphics Library Configuration > Hardware Profile > Development Platform Used > PIC_SK Macro


Graphics PICtail Used

Contents | Index | Home
Previous | Up | Next
Graphics PICtail Used
Macros

Specifies the Graphics PICtail Display Panel used.

Macros
Name
Description
GFX_PICTAIL_LCC
Specifies the Graphics PICtail Display Panel used.

  • GFX_PICTAIL_V3 - Graphics LCD Controller PICtail Plus SSD1926 Board (AC164127-5)
  • GFX_PICTAIL_V3E - Graphics LCD Controller PICtail Plus S1D13517 Board (AC164127-7)
  • GFX_PICTAIL_LCC - Low Cost Controllerless (LCC) Graphics PICtail™ Plus Board (AC164144)

GFX_PICTAIL_V3
Specifies the Graphics PICtail Display Panel used.

  • GFX_PICTAIL_V3 - Graphics LCD Controller PICtail Plus SSD1926 Board (AC164127-5)
  • GFX_PICTAIL_V3E - Graphics LCD Controller PICtail Plus S1D13517 Board (AC164127-7)
  • GFX_PICTAIL_LCC - Low Cost Controllerless (LCC) Graphics PICtail™ Plus Board (AC164144)

GFX_PICTAIL_V3E
Specifies the Graphics PICtail Display Panel used.

  • GFX_PICTAIL_V3 - Graphics LCD Controller PICtail Plus SSD1926 Board (AC164127-5)
  • GFX_PICTAIL_V3E - Graphics LCD Controller PICtail Plus S1D13517 Board (AC164127-7)
  • GFX_PICTAIL_LCC - Low Cost Controllerless (LCC) Graphics PICtail™ Plus Board (AC164144)

Links
Hardware Profile, Macros
Library API > Graphics Library Configuration > Hardware Profile > Graphics PICtail Used


GFX_PICTAIL_LCC Macro

Contents | Index | Home
Previous | Up | Next
GFX_PICTAIL_LCC Macro
C
#define GFX_PICTAIL_LCC
Overview

Specifies the Graphics PICtail Display Panel used.

  • GFX_PICTAIL_V3 - Graphics LCD Controller PICtail Plus SSD1926 Board (AC164127-5)
  • GFX_PICTAIL_V3E - Graphics LCD Controller PICtail Plus S1D13517 Board (AC164127-7)
  • GFX_PICTAIL_LCC - Low Cost Controllerless (LCC) Graphics PICtail™ Plus Board (AC164144)
Library API > Graphics Library Configuration > Hardware Profile > Graphics PICtail Used > GFX_PICTAIL_LCC Macro


GFX_PICTAIL_V3 Macro

Contents | Index | Home
Previous | Up | Next
GFX_PICTAIL_V3 Macro
C
#define GFX_PICTAIL_V3
Overview

Specifies the Graphics PICtail Display Panel used.

  • GFX_PICTAIL_V3 - Graphics LCD Controller PICtail Plus SSD1926 Board (AC164127-5)
  • GFX_PICTAIL_V3E - Graphics LCD Controller PICtail Plus S1D13517 Board (AC164127-7)
  • GFX_PICTAIL_LCC - Low Cost Controllerless (LCC) Graphics PICtail™ Plus Board (AC164144)
Library API > Graphics Library Configuration > Hardware Profile > Graphics PICtail Used > GFX_PICTAIL_V3 Macro


GFX_PICTAIL_V3E Macro

Contents | Index | Home
Previous | Up | Next
GFX_PICTAIL_V3E Macro
C
#define GFX_PICTAIL_V3E
Overview

Specifies the Graphics PICtail Display Panel used.

  • GFX_PICTAIL_V3 - Graphics LCD Controller PICtail Plus SSD1926 Board (AC164127-5)
  • GFX_PICTAIL_V3E - Graphics LCD Controller PICtail Plus S1D13517 Board (AC164127-7)
  • GFX_PICTAIL_LCC - Low Cost Controllerless (LCC) Graphics PICtail™ Plus Board (AC164144)
Library API > Graphics Library Configuration > Hardware Profile > Graphics PICtail Used > GFX_PICTAIL_V3E Macro


Display Controller Used

Contents | Index | Home
Previous | Up | Next
Display Controller Used
Macros

Specifies the controller used in the Graphics Library supplied demo.

Macros
Name
Description
GFX_USE_DISPLAY_CONTROLLER_DMA
Specifies the controller used in the Graphics Library supplied demo.

  • GFX_USE_DISPLAY_CONTROLLER_DMA - Using the PIC32 Low Cost Controllerless (LCC) solution.
  • GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210 - Use the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family)
  • GFX_USE_DISPLAY_CONTROLLER_SSD1926 - Using the Solomon Systech SSD1926 Display Controller.
  • GFX_USE_DISPLAY_CONTROLLER_S1D13517 - Using the Epson S1D13517 Display Controller.

GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210
Specifies the controller used in the Graphics Library supplied demo.

  • GFX_USE_DISPLAY_CONTROLLER_DMA - Using the PIC32 Low Cost Controllerless (LCC) solution.
  • GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210 - Use the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family)
  • GFX_USE_DISPLAY_CONTROLLER_SSD1926 - Using the Solomon Systech SSD1926 Display Controller.
  • GFX_USE_DISPLAY_CONTROLLER_S1D13517 - Using the Epson S1D13517 Display Controller.

GFX_USE_DISPLAY_CONTROLLER_S1D13517
Specifies the controller used in the Graphics Library supplied demo.

  • GFX_USE_DISPLAY_CONTROLLER_DMA - Using the PIC32 Low Cost Controllerless (LCC) solution.
  • GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210 - Use the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family)
  • GFX_USE_DISPLAY_CONTROLLER_SSD1926 - Using the Solomon Systech SSD1926 Display Controller.
  • GFX_USE_DISPLAY_CONTROLLER_S1D13517 - Using the Epson S1D13517 Display Controller.

GFX_USE_DISPLAY_CONTROLLER_SSD1926
Specifies the controller used in the Graphics Library supplied demo.

  • GFX_USE_DISPLAY_CONTROLLER_DMA - Using the PIC32 Low Cost Controllerless (LCC) solution.
  • GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210 - Use the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family)
  • GFX_USE_DISPLAY_CONTROLLER_SSD1926 - Using the Solomon Systech SSD1926 Display Controller.
  • GFX_USE_DISPLAY_CONTROLLER_S1D13517 - Using the Epson S1D13517 Display Controller.

Links
Hardware Profile, Macros
Library API > Graphics Library Configuration > Hardware Profile > Display Controller Used


GFX_USE_DISPLAY_CONTROLLER_DMA Macro

Contents | Index | Home
Previous | Up | Next
GFX_USE_DISPLAY_CONTROLLER_DMA Macro
C
#define GFX_USE_DISPLAY_CONTROLLER_DMA
Overview

Specifies the controller used in the Graphics Library supplied demo.

  • GFX_USE_DISPLAY_CONTROLLER_DMA - Using the PIC32 Low Cost Controllerless (LCC) solution.
  • GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210 - Use the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family)
  • GFX_USE_DISPLAY_CONTROLLER_SSD1926 - Using the Solomon Systech SSD1926 Display Controller.
  • GFX_USE_DISPLAY_CONTROLLER_S1D13517 - Using the Epson S1D13517 Display Controller.
Library API > Graphics Library Configuration > Hardware Profile > Display Controller Used > GFX_USE_DISPLAY_CONTROLLER_DMA Macro


GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210 Macro

Contents | Index | Home
Previous | Up | Next
GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210 Macro
C
#define GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210
Overview

Specifies the controller used in the Graphics Library supplied demo.

  • GFX_USE_DISPLAY_CONTROLLER_DMA - Using the PIC32 Low Cost Controllerless (LCC) solution.
  • GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210 - Use the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family)
  • GFX_USE_DISPLAY_CONTROLLER_SSD1926 - Using the Solomon Systech SSD1926 Display Controller.
  • GFX_USE_DISPLAY_CONTROLLER_S1D13517 - Using the Epson S1D13517 Display Controller.
Library API > Graphics Library Configuration > Hardware Profile > Display Controller Used > GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210 Macro


GFX_USE_DISPLAY_CONTROLLER_S1D13517 Macro

Contents | Index | Home
Previous | Up | Next
GFX_USE_DISPLAY_CONTROLLER_S1D13517 Macro
C
#define GFX_USE_DISPLAY_CONTROLLER_S1D13517
Overview

Specifies the controller used in the Graphics Library supplied demo.

  • GFX_USE_DISPLAY_CONTROLLER_DMA - Using the PIC32 Low Cost Controllerless (LCC) solution.
  • GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210 - Use the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family)
  • GFX_USE_DISPLAY_CONTROLLER_SSD1926 - Using the Solomon Systech SSD1926 Display Controller.
  • GFX_USE_DISPLAY_CONTROLLER_S1D13517 - Using the Epson S1D13517 Display Controller.
Library API > Graphics Library Configuration > Hardware Profile > Display Controller Used > GFX_USE_DISPLAY_CONTROLLER_S1D13517 Macro


GFX_USE_DISPLAY_CONTROLLER_SSD1926 Macro

Contents | Index | Home
Previous | Up | Next
GFX_USE_DISPLAY_CONTROLLER_SSD1926 Macro
C
#define GFX_USE_DISPLAY_CONTROLLER_SSD1926
Overview

Specifies the controller used in the Graphics Library supplied demo.

  • GFX_USE_DISPLAY_CONTROLLER_DMA - Using the PIC32 Low Cost Controllerless (LCC) solution.
  • GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210 - Use the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family)
  • GFX_USE_DISPLAY_CONTROLLER_SSD1926 - Using the Solomon Systech SSD1926 Display Controller.
  • GFX_USE_DISPLAY_CONTROLLER_S1D13517 - Using the Epson S1D13517 Display Controller.
Library API > Graphics Library Configuration > Hardware Profile > Display Controller Used > GFX_USE_DISPLAY_CONTROLLER_SSD1926 Macro


Display Panel Used

Contents | Index | Home
Previous | Up | Next
Display Panel Used
Macros

Specifies the Graphics Display Panel used.

Macros
Name
Description
GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q
Specifies the Graphics Display Panel used.

  • GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E - 3.2 inch QVGA Truly TFT Display Board (AC164127-4)
  • GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q - 4.3 inch WQVGA Powertip TFT Display Board (AC164127-6)
  • GFX_USE_DISPLAY_PANEL_TFT_640480_8_E - 5.7 inch VGA Truly TFT Display Board (AC164127-8)
  • GFX_USE_DISPLAY_PANEL_TFT_800480_33_E - 7 inch WVGA Truly TFT Display Board (AC164127-8)

GFX_USE_DISPLAY_PANEL_TFT_640480_8_E
Specifies the Graphics Display Panel used.

  • GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E - 3.2 inch QVGA Truly TFT Display Board (AC164127-4)
  • GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q - 4.3 inch WQVGA Powertip TFT Display Board (AC164127-6)
  • GFX_USE_DISPLAY_PANEL_TFT_640480_8_E - 5.7 inch VGA Truly TFT Display Board (AC164127-8)
  • GFX_USE_DISPLAY_PANEL_TFT_800480_33_E - 7 inch WVGA Truly TFT Display Board (AC164127-8)

GFX_USE_DISPLAY_PANEL_TFT_800480_33_E
Specifies the Graphics Display Panel used.

  • GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E - 3.2 inch QVGA Truly TFT Display Board (AC164127-4)
  • GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q - 4.3 inch WQVGA Powertip TFT Display Board (AC164127-6)
  • GFX_USE_DISPLAY_PANEL_TFT_640480_8_E - 5.7 inch VGA Truly TFT Display Board (AC164127-8)
  • GFX_USE_DISPLAY_PANEL_TFT_800480_33_E - 7 inch WVGA Truly TFT Display Board (AC164127-8)

GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E
Specifies the Graphics Display Panel used.

  • GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E - 3.2 inch QVGA Truly TFT Display Board (AC164127-4)
  • GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q - 4.3 inch WQVGA Powertip TFT Display Board (AC164127-6)
  • GFX_USE_DISPLAY_PANEL_TFT_640480_8_E - 5.7 inch VGA Truly TFT Display Board (AC164127-8)
  • GFX_USE_DISPLAY_PANEL_TFT_800480_33_E - 7 inch WVGA Truly TFT Display Board (AC164127-8)

Links
Hardware Profile, Macros
Library API > Graphics Library Configuration > Hardware Profile > Display Panel Used


GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q Macro

Contents | Index | Home
Previous | Up | Next
GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q Macro
C
#define GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q
Overview

Specifies the Graphics Display Panel used.

  • GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E - 3.2 inch QVGA Truly TFT Display Board (AC164127-4)
  • GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q - 4.3 inch WQVGA Powertip TFT Display Board (AC164127-6)
  • GFX_USE_DISPLAY_PANEL_TFT_640480_8_E - 5.7 inch VGA Truly TFT Display Board (AC164127-8)
  • GFX_USE_DISPLAY_PANEL_TFT_800480_33_E - 7 inch WVGA Truly TFT Display Board (AC164127-8)
Library API > Graphics Library Configuration > Hardware Profile > Display Panel Used > GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q Macro


GFX_USE_DISPLAY_PANEL_TFT_640480_8_E Macro

Contents | Index | Home
Previous | Up | Next
GFX_USE_DISPLAY_PANEL_TFT_640480_8_E Macro
C
#define GFX_USE_DISPLAY_PANEL_TFT_640480_8_E
Overview

Specifies the Graphics Display Panel used.

  • GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E - 3.2 inch QVGA Truly TFT Display Board (AC164127-4)
  • GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q - 4.3 inch WQVGA Powertip TFT Display Board (AC164127-6)
  • GFX_USE_DISPLAY_PANEL_TFT_640480_8_E - 5.7 inch VGA Truly TFT Display Board (AC164127-8)
  • GFX_USE_DISPLAY_PANEL_TFT_800480_33_E - 7 inch WVGA Truly TFT Display Board (AC164127-8)
Library API > Graphics Library Configuration > Hardware Profile > Display Panel Used > GFX_USE_DISPLAY_PANEL_TFT_640480_8_E Macro


GFX_USE_DISPLAY_PANEL_TFT_800480_33_E Macro

Contents | Index | Home
Previous | Up | Next
GFX_USE_DISPLAY_PANEL_TFT_800480_33_E Macro
C
#define GFX_USE_DISPLAY_PANEL_TFT_800480_33_E
Overview

Specifies the Graphics Display Panel used.

  • GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E - 3.2 inch QVGA Truly TFT Display Board (AC164127-4)
  • GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q - 4.3 inch WQVGA Powertip TFT Display Board (AC164127-6)
  • GFX_USE_DISPLAY_PANEL_TFT_640480_8_E - 5.7 inch VGA Truly TFT Display Board (AC164127-8)
  • GFX_USE_DISPLAY_PANEL_TFT_800480_33_E - 7 inch WVGA Truly TFT Display Board (AC164127-8)
Library API > Graphics Library Configuration > Hardware Profile > Display Panel Used > GFX_USE_DISPLAY_PANEL_TFT_800480_33_E Macro


GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E Macro

Contents | Index | Home
Previous | Up | Next
GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E Macro
C
#define GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E
Overview

Specifies the Graphics Display Panel used.

  • GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E - 3.2 inch QVGA Truly TFT Display Board (AC164127-4)
  • GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q - 4.3 inch WQVGA Powertip TFT Display Board (AC164127-6)
  • GFX_USE_DISPLAY_PANEL_TFT_640480_8_E - 5.7 inch VGA Truly TFT Display Board (AC164127-8)
  • GFX_USE_DISPLAY_PANEL_TFT_800480_33_E - 7 inch WVGA Truly TFT Display Board (AC164127-8)
Library API > Graphics Library Configuration > Hardware Profile > Display Panel Used > GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E Macro


Device Driver Options

Contents | Index | Home
Previous | Up | Next
Device Driver Options
Macros

The options Graphics Hardware Platform, DISPLAY_CONTROLLER and DISPLAY_PANEL are specific to the hardware used. The Graphics Hardware Platform selects the Graphics PICtail™ Plus Board version, PIC24FJ256DA210 Development Board or any other Microchip demo boards for the Graphics Library. Currently there are two Graphics PICtail™ Plus Board versions supported as shown in the Getting Started section.

The rest of the settings are used to specify the the display parameters when using an RGB type display controller such as SSD1906 and SSD1926 from Solomon Systech. The table below summarizes the generic parameters found in RGB type display controllers and when each type is used.

Options | Color STN | Mono STN | TFT
DISP_DATA_WIDTH | YES | YES | YES
DISP_ORIENTATION | YES | YES | YES
DISP_HOR_RESOLUTION | YES | YES | YES
DISP_VER_RESOLUTION | YES | YES | YES
DISP_HOR_BACK_PORCH | NO | NO | YES
DISP_HOR_FRONT_PORCH | NO | NO | YES
DISP_VER_FRONT_PORCH | NO | NO | YES
DISP_VER_BACK_PORCH | NO | NO | YES
DISP_HOR_PULSE_WIDTH | YES | YES | YES
DISP_VER_PULSE_WIDTH | YES | YES | YES
DISP_INV_LSHIFT | YES | YES | YES

All the options listed here are set in the HardwareProfile.h header file implemented in the application layer. An example of this file is shown in HardwareProfile.h Example section.

Macros
Name
Description
DISP_DATA_WIDTH
Defines the display controller's physical interface to the display panel. Valid Values:

  • 1, 4, 8, 16, 18, 24
  • 1, 4, 8 are usually used in MSTN and CSTN displays
  • 16, 18 and 24 are usually used in TFT displays.

DISP_ORIENTATION
Defines the display rotation with respect to its native orientation. For example, if the display has a resolution specifications that says 240x320 (QVGA), the display is natively in portrait mode. If the application uses the display in landscape mode (320x240), then the orientation must be defined as 90 or 180 degree rotation. Graphics Library will calculate the actual pixel location to rotate the contents of the screen. So when users view the display, the image on the screen will come out in the correct orientation. Valid values:

  • 0 : display in its native orientation
  • 90 : rotated 90 degrees clockwise... more
DISP_HOR_RESOLUTION
Defines the native horizontal dimension of the screen. This is the horizontal pixel count given by the display's data sheet. For example a 320x240 display will have DISP_HOR_RESOLUTION of 320. Valid Values:
  • dependent on the display glass resolution used.
DISP_VER_RESOLUTION
Defines the native vertical dimension of the screen. This is the vertical pixel count given by the display's data sheet. For xxample a 320x240 display will have DISP_VER_RESOLUTION of 240. Valid Values:
  • dependent on the display glass resolution used.
DISP_HOR_FRONT_PORCH
Defines the horizontal front porch. DISP_HOR_BACK_PORCH + DISP_HOR_FRONT_PORCH + DISP_HOR_PULSE_WIDTH makes up the horizontal blanking period. Value used will be based on the display panel used.
DISP_HOR_BACK_PORCH
Defines the horizontal back porch. DISP_HOR_BACK_PORCH + DISP_HOR_FRONT_PORCH + DISP_HOR_PULSE_WIDTH makes up the horizontal blanking period. Value used will be based on the display panel used.
DISP_VER_FRONT_PORCH
Defines the vertical front porch. DISP_VER_BACK_PORCH + DISP_VER_FRONT_PORCH + DISP_VER_PULSE_WIDTH makes up the vertical blanking period. Value used will be based on the display panel used.
DISP_VER_BACK_PORCH
Defines the vertical back porch. DISP_VER_BACK_PORCH + DISP_VER_FRONT_PORCH + DISP_VER_PULSE_WIDTH makes up the vertical blanking period. Value used will be based on the display panel used.
DISP_HOR_PULSE_WIDTH
Defines the horizontal sync signal pulse width in pixels. Value used will be based on the display panel used.
DISP_VER_PULSE_WIDTH
Defines the vertical sync signal pulse width in lines. Value used will be based on the display panel used.
DISP_INV_LSHIFT
Indicates that the color data is sampled in the falling edge of the pixel clock.
Links
Hardware Profile, Macros
Library API > Graphics Library Configuration > Hardware Profile > Device Driver Options


DISP_DATA_WIDTH Macro

Contents | Index | Home
Previous | Up | Next
DISP_DATA_WIDTH Macro
C
#define DISP_DATA_WIDTH 18
Overview

Defines the display controller's physical interface to the display panel. Valid Values:

  • 1, 4, 8, 16, 18, 24
  • 1, 4, 8 are usually used in MSTN and CSTN displays
  • 16, 18 and 24 are usually used in TFT displays.

Example
Copy Code
// define in Hardware Profile
#define DISP_DATA_WIDTH 18
Library API > Graphics Library Configuration > Hardware Profile > Device Driver Options > DISP_DATA_WIDTH Macro


DISP_ORIENTATION Macro

Contents | Index | Home
Previous | Up | Next
DISP_ORIENTATION Macro
C
#define DISP_ORIENTATION 0
Overview

Defines the display rotation with respect to its native orientation. For example, if the display has a resolution specifications that says 240x320 (QVGA), the display is natively in portrait mode. If the application uses the display in landscape mode (320x240), then the orientation must be defined as 90 or 180 degree rotation. Graphics Library will calculate the actual pixel location to rotate the contents of the screen. So when users view the display, the image on the screen will come out in the correct orientation. Valid values:

  • 0 : display in its native orientation
  • 90 : rotated 90 degrees clockwise direction
  • 180 : rotated 180 degrees clockwise direction
  • 270 : rotated 270 degrees clockwise direction

Example
Copy Code
// define in Hardware Profile
#define DISP_ORIENTATION 90
Library API > Graphics Library Configuration > Hardware Profile > Device Driver Options > DISP_ORIENTATION Macro


DISP_HOR_RESOLUTION Macro

Contents | Index | Home
Previous | Up | Next
DISP_HOR_RESOLUTION Macro
C
#define DISP_HOR_RESOLUTION 320
Overview

Defines the native horizontal dimension of the screen. This is the horizontal pixel count given by the display's data sheet. For example a 320x240 display will have DISP_HOR_RESOLUTION of 320. Valid Values:

  • dependent on the display glass resolution used.

Example
Copy Code
// define in Hardware Profile
#define DISP_HOR_RESOLUTION 320
Library API > Graphics Library Configuration > Hardware Profile > Device Driver Options > DISP_HOR_RESOLUTION Macro


DISP_VER_RESOLUTION Macro

Contents | Index | Home
Previous | Up | Next
DISP_VER_RESOLUTION Macro
C
#define DISP_VER_RESOLUTION 240
Overview

Defines the native vertical dimension of the screen. This is the vertical pixel count given by the display's data sheet. For xxample a 320x240 display will have DISP_VER_RESOLUTION of 240. Valid Values:

  • dependent on the display glass resolution used.

Example
Copy Code
// define in Hardware Profile
#define DISP_VER_RESOLUTION 240
Library API > Graphics Library Configuration > Hardware Profile > Device Driver Options > DISP_VER_RESOLUTION Macro


DISP_HOR_FRONT_PORCH Macro

Contents | Index | Home
Previous | Up | Next
DISP_HOR_FRONT_PORCH Macro
C
#define DISP_HOR_FRONT_PORCH 10
Overview

Defines the horizontal front porch. DISP_HOR_BACK_PORCH + DISP_HOR_FRONT_PORCH + DISP_HOR_PULSE_WIDTH makes up the horizontal blanking period. Value used will be based on the display panel used.

Library API > Graphics Library Configuration > Hardware Profile > Device Driver Options > DISP_HOR_FRONT_PORCH Macro


DISP_HOR_BACK_PORCH Macro

Contents | Index | Home
Previous | Up | Next
DISP_HOR_BACK_PORCH Macro
C
#define DISP_HOR_BACK_PORCH 20
Overview

Defines the horizontal back porch. DISP_HOR_BACK_PORCH + DISP_HOR_FRONT_PORCH + DISP_HOR_PULSE_WIDTH makes up the horizontal blanking period. Value used will be based on the display panel used.

Library API > Graphics Library Configuration > Hardware Profile > Device Driver Options > DISP_HOR_BACK_PORCH Macro


DISP_VER_FRONT_PORCH Macro

Contents | Index | Home
Previous | Up | Next
DISP_VER_FRONT_PORCH Macro
C
#define DISP_VER_FRONT_PORCH 5
Overview

Defines the vertical front porch. DISP_VER_BACK_PORCH + DISP_VER_FRONT_PORCH + DISP_VER_PULSE_WIDTH makes up the vertical blanking period. Value used will be based on the display panel used.

Library API > Graphics Library Configuration > Hardware Profile > Device Driver Options > DISP_VER_FRONT_PORCH Macro


DISP_VER_BACK_PORCH Macro

Contents | Index | Home
Previous | Up | Next
DISP_VER_BACK_PORCH Macro
C
#define DISP_VER_BACK_PORCH 20
Overview

Defines the vertical back porch. DISP_VER_BACK_PORCH + DISP_VER_FRONT_PORCH + DISP_VER_PULSE_WIDTH makes up the vertical blanking period. Value used will be based on the display panel used.

Library API > Graphics Library Configuration > Hardware Profile > Device Driver Options > DISP_VER_BACK_PORCH Macro


DISP_HOR_PULSE_WIDTH Macro

Contents | Index | Home
Previous | Up | Next
DISP_HOR_PULSE_WIDTH Macro
C
#define DISP_HOR_PULSE_WIDTH 10
Overview

Defines the horizontal sync signal pulse width in pixels. Value used will be based on the display panel used.

Library API > Graphics Library Configuration > Hardware Profile > Device Driver Options > DISP_HOR_PULSE_WIDTH Macro


DISP_VER_PULSE_WIDTH Macro

Contents | Index | Home
Previous | Up | Next
DISP_VER_PULSE_WIDTH Macro
C
#define DISP_VER_PULSE_WIDTH 5
Overview

Defines the vertical sync signal pulse width in lines. Value used will be based on the display panel used.

Library API > Graphics Library Configuration > Hardware Profile > Device Driver Options > DISP_VER_PULSE_WIDTH Macro


DISP_INV_LSHIFT Macro

Contents | Index | Home
Previous | Up | Next
DISP_INV_LSHIFT Macro
C
#define DISP_INV_LSHIFT 18
Overview

Indicates that the color data is sampled in the falling edge of the pixel clock.

Library API > Graphics Library Configuration > Hardware Profile > Device Driver Options > DISP_INV_LSHIFT Macro


HardwareProfile.h Example

Contents | Index | Home
Previous | Up | Next
HardwareProfile.h Example

This is an example of the HardwareProfile.h file implementation:

Copy Code
/*********************************************************************
* GetSystemClock() returns system clock frequency.
* GetPeripheralClock() returns peripheral clock frequency.
* GetInstructionClock() returns instruction clock frequency.
********************************************************************/

/*********************************************************************
* Macro: #define    GetSystemClock()
* Overview: This macro returns the system clock frequency in Hertz.
*            * value is 8 MHz x 4 PLL for PIC24
*            * value is 8 MHz/2 x 18 PLL for PIC32
********************************************************************/
    #if defined(__PIC24F__)
        #define GetSystemClock()    (32000000ul)
    #elif defined(__PIC32MX__)
        #define GetSystemClock()    (72000000ul)
    #elif defined(__dsPIC33F__) || defined(__PIC24H__)
        #define GetSystemClock()    (80000000ul)
    #endif

/*********************************************************************
* Macro: #define    GetPeripheralClock()
* Overview: This macro returns the peripheral clock frequency
*            used in Hertz.
*            * value for PIC24 is <PRE>(GetSystemClock()/2) </PRE>
*            * value for PIC32 is <PRE>(GetSystemClock()/(1<<OSCCONbits.PBDIV)) </PRE>
********************************************************************/
    #if defined(__PIC24F__) || defined(__PIC24H__) || defined(__dsPIC33F__)
        #define GetPeripheralClock()    (GetSystemClock() / 2)
    #elif defined(__PIC32MX__)
        #define GetPeripheralClock()    (GetSystemClock() / (1 << OSCCONbits.PBDIV))
    #endif

/*********************************************************************
* Macro: #define    GetInstructionClock()
* Overview: This macro returns instruction clock frequency
*            used in Hertz.
*            * value for PIC24 is <PRE>(GetSystemClock()/2) </PRE>
*            * value for PIC32 is (GetSystemClock()/PFMWSbits.CHECON) </PRE>
********************************************************************/
    #if defined(__PIC24F__) || defined(__PIC24H__) || defined(__dsPIC33F__)
        #define GetInstructionClock()   (GetSystemClock() / 2)
    #elif defined(__PIC32MX__)
        #define GetInstructionClock()   (GetSystemClock() / PFMWSbits.CHECON)
    #endif

//Auto Generated Code
#define PIC24FJ256DA210_DEV_BOARD
#define USE_16BIT_PMP
#define GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210
#define GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E
#define GFX_GCLK_DIVIDER 61
#define GFX_DISPLAY_BUFFER_START_ADDRESS 0x00020000ul
#define GFX_DISPLAY_BUFFER_LENGTH 0x00025800ul
#define GFX_EPMP_CS1_BASE_ADDRESS 0x00020000ul
#define GFX_EPMP_CS1_MEMORY_SIZE 0x40000ul
//End Auto Generated Code

/*********************************************************************
* External Memory Programmer Settings
*********************************************************************/
#if defined (EXPLORER_16)
    #define USE_COMM_PKT_MEDIA_SERIAL_PORT
    #define BAUDRATE2               115200UL
    #define BRG_DIV2                4
    #define BRGH2                   1
#else
    #define USE_COMM_PKT_MEDIA_USB

    //#define USE_SELF_POWER_SENSE_IO
    #define tris_self_power     TRISAbits.TRISA2    // Input
    #define self_power          1

    //#define USE_USB_BUS_SENSE_IO
    #define tris_usb_bus_sense  TRISBbits.TRISB5    // Input
    #define USB_BUS_SENSE       U1OTGSTATbits.SESVD // Special considerations required if using SESVD for this purpose.  See documentation.

#endif

#define COMM_PKT_RX_MAX_SIZE    (1024)

.....
Links
Hardware Profile
Library API > Graphics Library Configuration > Hardware Profile > HardwareProfile.h Example


Graphics Object Layer API

Contents | Index | Home
Previous | Up | Next
Graphics Object Layer API
Topics
Topics
Name | Description
GOL Objects | The Graphics Object Layer (GOL) contains the Advanced Graphics Objects or commonly known as widgets.
Object States | Objects rendered on the display are based on their current Property States and the Drawing States.
Object Management | This section describes the API functions and macros that are used to create, maintain and render individual and list of objects.
GOL Messages | The library provides an interface to accept messages from the input devices.
Style Scheme | All objects uses a style scheme structure that defines the font and colors used.
GOL Global Variables | Graphics Object Layer global variables.
Links
Library API, Topics
Library API > Graphics Object Layer API


GOL Objects

Contents | Index | Home
Previous | Up | Next
GOL Objects
Enumerations | Modules | Structures | Types

All the GOL objects that will be shown in the display have a corresponding data structure that keeps and maintains its parameters.

Each object type has a set of functions that enables the user to change the state of the object. The Microchip graphics library supports the following set of GOL objects.

Object | Type Definition
Button | OBJ_BUTTON
Chart | OBJ_CHART
Checkbox | OBJ_CHECKBOX
Dial | OBJ_ROUNDDIAL
Digital Meter | OBJ_DIGITALMETER
Edit Box | OBJ_EDITBOX
Grid | OBJ_GRID
Group Box | OBJ_GROUPBOX
List Box | OBJ_LISTBOX
Meter | OBJ_METER
Picture | OBJ_PICTURE
Progress Bar | OBJ_PROGRESSBAR
Radio Button | OBJ_RADIOBUTTON
Slider | OBJ_SLIDER
Static Text | OBJ_STATICTEXT
Text Entry | OBJ_TEXTENTRY
Window | OBJ_WINDOW

Each GOL object type uses a style scheme. The style scheme defines the font and color settings. User can create new style schemes and assign it to objects. Multiple style schemes can be used for different objects.

To efficiently manage the different objects the first 9 fields of the structure for each object are defined the same. Collectively they are referred to as the object header structure (OBJ_HEADER). Defining the OBJ_HEADER enables the common APIs to manage the objects of different types in the same manner.

The GOL operation is centered on two major processes. First is the rendering process and second is the messaging process. These processes make use of linked list objects. The field pNxtObj in OBJ_HEADER makes this possible. To manage the list a global pointer _pGolObjects is utilized. It defines the current active linked list. Newly created objects are automatically added to the end of this list. The active linked list is the list that the messaging and rendering operation parses to evaluate if the messages received affect the objects and if objects need to be redrawn.

The use of the _pGolObjects pointer also provides a way to easily manage objects. In applications where multiple pages are displayed on the screen, objects can be grouped according to pages. The pointer can be manipulated to switch from one page to another depending on the page currently shown on the screen.

Implementation of Multi-Page Objects

User can remove an object from a list by pointer manipulation. Objects that are removed from the list are not accessible by the rendering and messaging processes.

Enumerations
Name | Description
GOL_OBJ_TYPE | This structure defines the Object types used in the library.
Modules
Name | Description
Analog Clock | Analog Clock is an Object that emulates an analog clock with moving hands. It can be used with or without a bitmap image as the background source.
Button | Button is an Object that emulates a press and release effect when operated upon.
Chart | Chart is an Object that draws a bar chart or a pie chart representation of a single data or series of data.
Checkbox | Check Box is an Object that simulates a check box on paper. Usually it is used as an option setting where the checked or filled state means the option is enabled and the unfilled or unchecked state means the option is disabled.
Round Dial | Dial is an Object that can be used to display emulate a turn dial that can both go in clockwise or counterclockwise.
Digital Meter | DigitalMeter is an Object that can be used to display a value of a sampled variable. This Object is ideal when fast refresh of the value is needed. The Object refreshes only the digits that needs to change. A limitation of this Object is that the font used should have equal character widths.
Edit Box | Edit Box is is an Object that emulates a cell or a text area that can be edited dynamically.
Grid | Grid is an Object that draws a grid on the screen with each cell capable of displaying an image or a string.
Group Box | Group Box is an Object that can be used to group Objects together in the screen.
List Box | List Box is an Object that defines a scrollable area where items are listed. User can select a single item or set of items.
Meter | Meter is an Object that can be used to graphically display a sampled input.
Picture Control | Picture is an Object that can be used to transform a bitmap to be an Object in the screen and have control on the bitmap rendering. This object can be used to create animation using a series of bitmaps.
Progress Bar | Progress Bar is an Object that can be used to display the progress of a task such as a file download or transfer.
Radio Button | Radio Button is an Object that can be used to offer set of choices to the user. Only one of the choices is selectable. Changing selection automatically removes the selection on the previous option.
Slider/Scroll Bar | Slider or Scrollbar is an Object that can be used to display a value or scrolling location in a predefined area.
Static Text | Static Text is an Object that can be used to display a single or multi-line string of text in a predefined location.
Text Entry | Text Entry is an Object that can be used to emulate a key pad entry with a display area for the entered characters. The Object has a feature where you can define a key to reply with a translated message that signifies a command key was pressed. A command key example can be your enter or carriage return key or an escape key. Multiple keys can be assigned command keys. Application can utilize the command key to define the behavior of the program based on a command key press.
Window | Window is an Object that can be used to encapsulate objects into a group. Unlike the Group Box Object, the Window Object has additional features such as displaying an icon or a small bitmap on its Title Bar. It also has additional controls for both Title Bar and Client Area.
Structures
Name | Description
OBJ_HEADER | This structure defines the first nine fields of the Objects structure. This allows generic operations on library Objects.
Types
Name | Description
DRAW_FUNC | object draw function pointer typedef
FREE_FUNC | object free function pointer typedef
MSG_DEFAULT_FUNC | object default message function pointer typedef
MSG_FUNC | object message function pointer typedef
Links
Enumerations, Graphics Object Layer API, Modules, Structures, Types
Library API > Graphics Object Layer API > GOL Objects


GOL_OBJ_TYPE Enumeration

Contents | Index | Home
Previous | Up | Next
GOL_OBJ_TYPE Enumeration
C
typedef enum {
  OBJ_BUTTON,
  OBJ_WINDOW,
  OBJ_CHECKBOX,
  OBJ_RADIOBUTTON,
  OBJ_EDITBOX,
  OBJ_LISTBOX,
  OBJ_SLIDER,
  OBJ_PROGRESSBAR,
  OBJ_STATICTEXT,
  OBJ_PICTURE,
  OBJ_GROUPBOX,
  OBJ_CUSTOM,
  OBJ_ROUNDDIAL,
  OBJ_METER,
  OBJ_GRID,
  OBJ_CHART,
  OBJ_TEXTENTRY,
  OBJ_DIGITALMETER,
  OBJ_ANALOGCLOCK,
  OBJ_UNKNOWN
} GOL_OBJ_TYPE;
Overview

This structure defines the Object types used in the library.

Members
Members | Description
OBJ_BUTTON | Type defined for Button Object.
OBJ_WINDOW | Type defined for Window Object.
OBJ_CHECKBOX | Type defined for Check Box Object.
OBJ_RADIOBUTTON | Type defined for Radio Button Object.
OBJ_EDITBOX | Type defined for Edit Box Object.
OBJ_LISTBOX | Type defined for List Box Object.
OBJ_SLIDER | Type defined for Slider and/or Scroll Bar Object.
OBJ_PROGRESSBAR | Type defined for Progress Object.
OBJ_STATICTEXT | Type defined for Static Text Object.
OBJ_PICTURE | Type defined for Picture or Bitmap Object.
OBJ_GROUPBOX | Type defined for Group Box Object.
OBJ_CUSTOM | Type defined for Custom Object.
OBJ_ROUNDDIAL | Type defined for Dial Object.
OBJ_METER | Type defined for Meter Object.
OBJ_GRID | Type defined for Grid Object.
OBJ_CHART | Type defined for Chart Object.
OBJ_TEXTENTRY | Type defined for Text-Entry Object.
OBJ_DIGITALMETER | Type defined for DIGITALMETER Object.
OBJ_ANALOGCLOCK | Type defined for ANALOGCLOCK Object.
OBJ_UNKNOWN | Type is undefined and not supported by the library.
Library API > Graphics Object Layer API > GOL Objects > GOL_OBJ_TYPE Enumeration


OBJ_HEADER Structure

Contents | Index | Home
Previous | Up | Next
OBJ_HEADER Structure
C
typedef struct {
  WORD ID;
  void * pNxtObj;
  GOL_OBJ_TYPE type;
  WORD state;
  SHORT left;
  SHORT top;
  SHORT right;
  SHORT bottom;
  GOL_SCHEME * pGolScheme;
  DRAW_FUNC DrawObj;
  FREE_FUNC FreeObj;
  MSG_FUNC MsgObj;
  MSG_DEFAULT_FUNC MsgDefaultObj;
} OBJ_HEADER;
Overview

This structure defines the first nine fields of the Objects structure. This allows generic operations on library Objects.

Members
Members | Description
WORD ID; | Unique id assigned for referencing.
void * pNxtObj; | A pointer to the next object.
GOL_OBJ_TYPE type; | Identifies the type of GOL object.
WORD state; | State of object.
SHORT left; | Left position of the Object.
SHORT top; | Top position of the Object.
SHORT right; | Right position of the Object.
SHORT bottom; | Bottom position of the Object.
GOL_SCHEME * pGolScheme; | Pointer to the scheme used.
DRAW_FUNC DrawObj; | function pointer to the object draw function
FREE_FUNC FreeObj; | function pointer to the object free function
MSG_FUNC MsgObj; | function pointer to the object message function
MSG_DEFAULT_FUNC MsgDefaultObj; | function pointer to the object default message function
Library API > Graphics Object Layer API > GOL Objects > OBJ_HEADER Structure


DRAW_FUNC Type

Contents | Index | Home
Previous | Up | Next
DRAW_FUNC Type
C
typedef WORD (* DRAW_FUNC)(void *);
Description

object draw function pointer typedef

Library API > Graphics Object Layer API > GOL Objects > DRAW_FUNC Type


FREE_FUNC Type

Contents | Index | Home
Previous | Up | Next
FREE_FUNC Type
C
typedef void (* FREE_FUNC)(void *);
Description

object free function pointer typedef

Library API > Graphics Object Layer API > GOL Objects > FREE_FUNC Type


MSG_DEFAULT_FUNC Type

Contents | Index | Home
Previous | Up | Next
MSG_DEFAULT_FUNC Type
C
typedef void (* MSG_DEFAULT_FUNC)(WORD, void *, GOL_MSG *);
Description

object default message function pointer typedef

Library API > Graphics Object Layer API > GOL Objects > MSG_DEFAULT_FUNC Type


MSG_FUNC Type

Contents | Index | Home
Previous | Up | Next
MSG_FUNC Type
C
typedef WORD (* MSG_FUNC)(void *, GOL_MSG *);
Description

object message function pointer typedef

Library API > Graphics Object Layer API > GOL Objects > MSG_FUNC Type


Analog Clock

Contents | Index | Home
Previous | Up | Next
Analog Clock
Functions | Structures | Topics

The Analog Clock object is rendered using the assigned style scheme. The following figure illustrates the color assignments for the clock.

Functions
Name | Description
AcCreate | This function creates an Analog Clock object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
AcDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set.
AcSetHour | Sets the hour value of the analog clock.
AcSetMinute | Sets the minute value of the analog clock.
AcSetSecond | Sets the second value of the analog clock.
Structures
Name
Description
ANALOGCLOCK
Defines the parameters required for a clock Object. The following relationships of the parameters determines the general shape of the clock:
  1. centerx and centery determine the middle of the clock.
  2. radius defines the radius of the clock.
  4. *pBitmap points to the background image for the analog clock.
Topics
Name | Description
Analog Clock States | List of Analog Clock bit states.
Links
Functions, GOL Objects, Legend, Structures, Topics
Library API > Graphics Object Layer API > GOL Objects > Analog Clock


Analog Clock States

Contents | Index | Home
Previous | Up | Next
Analog Clock States
Macros | Analog Clock

List of Analog Clock bit states.

Macros
Name | Description
AC_DRAW | Bit to indicate button must be redrawn.
AC_DISABLED | Bit for disabled state.
AC_HIDE | Bit to indicate button must be removed from screen.
AC_PRESSED | Bit for press state.
AC_TICK | Bit to tick second hand
UPDATE_HOUR | Bit to indicate hour hand must be redrawn
UPDATE_MINUTE | Bit to indicate minute hand must be redrawn
UPDATE_SECOND | Bit to indicate minute hand must be redrawn
Module

Analog Clock

Links
Macros, Analog Clock
Library API > Graphics Object Layer API > GOL Objects > Analog Clock > Analog Clock States


AC_DRAW Macro

Contents | Index | Home
Previous | Up | Next
AC_DRAW Macro
C
#define AC_DRAW 0x4000   // Bit to indicate button must be redrawn.
Description

Bit to indicate button must be redrawn.

Library API > Graphics Object Layer API > GOL Objects > Analog Clock > Analog Clock States > AC_DRAW Macro


AC_DISABLED Macro

Contents | Index | Home
Previous | Up | Next
AC_DISABLED Macro
C
#define AC_DISABLED 0x0002   // Bit for disabled state.
Description

Bit for disabled state.

Library API > Graphics Object Layer API > GOL Objects > Analog Clock > Analog Clock States > AC_DISABLED Macro


AC_HIDE Macro

Contents | Index | Home
Previous | Up | Next
AC_HIDE Macro
C
#define AC_HIDE 0x8000   // Bit to indicate button must be removed from screen.
Description

Bit to indicate button must be removed from screen.

Library API > Graphics Object Layer API > GOL Objects > Analog Clock > Analog Clock States > AC_HIDE Macro


AC_PRESSED Macro

Contents | Index | Home
Previous | Up | Next
AC_PRESSED Macro
C
#define AC_PRESSED 0x0004   // Bit for press state.
Description

Bit for press state.

Library API > Graphics Object Layer API > GOL Objects > Analog Clock > Analog Clock States > AC_PRESSED Macro


AC_TICK Macro

Contents | Index | Home
Previous | Up | Next
AC_TICK Macro
C
#define AC_TICK 0x1000   // Bit to tick second hand
Description

Bit to tick second hand

Library API > Graphics Object Layer API > GOL Objects > Analog Clock > Analog Clock States > AC_TICK Macro


UPDATE_HOUR Macro

Contents | Index | Home
Previous | Up | Next
UPDATE_HOUR Macro
C
#define UPDATE_HOUR 0x2000   // Bit to indicate hour hand must be redrawn
Description

Bit to indicate hour hand must be redrawn

Library API > Graphics Object Layer API > GOL Objects > Analog Clock > Analog Clock States > UPDATE_HOUR Macro


UPDATE_MINUTE Macro

Contents | Index | Home
Previous | Up | Next
UPDATE_MINUTE Macro
C
#define UPDATE_MINUTE 0x0100   // Bit to indicate minute hand must be redrawn
Description

Bit to indicate minute hand must be redrawn

Library API > Graphics Object Layer API > GOL Objects > Analog Clock > Analog Clock States > UPDATE_MINUTE Macro


UPDATE_SECOND Macro

Contents | Index | Home
Previous | Up | Next
UPDATE_SECOND Macro
C
#define UPDATE_SECOND 0x0200   // Bit to indicate minute hand must be redrawn
Description

Bit to indicate minute hand must be redrawn

Library API > Graphics Object Layer API > GOL Objects > Analog Clock > Analog Clock States > UPDATE_SECOND Macro


AcCreate Function

Contents | Index | Home
Previous | Up | Next
AcCreate Function
Analog Clock
C
ANALOGCLOCK * AcCreate(
    WORD ID,
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    SHORT hour,
    SHORT minute,
    SHORT radius,
    BOOL sechand,
    WORD state,
    void * pBitmap,
    GOL_SCHEME * pScheme
);
Overview

This function creates an Analog Clock object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.

Input Parameters
Input Parameters | Description
WORD ID | Unique user defined ID for the object instance.
SHORT left | Left most position of the object.
SHORT top | Top most position of the object.
SHORT right | Right most position of the object.
SHORT bottom | Bottom most position of the object.
SHORT hour | Initial hour value.
SHORT minute | Initial minute value.
SHORT radius | Sets the radius of the clock.
BOOL sechand | Flag to indicate if the second hand will be drawn or not.
WORD state | Sets the initial state of the object.
void * pBitmap | Pointer to the bitmap used on the face of the analog clock dimension of the image must match the dimension of the widget.
GOL_SCHEME * pScheme | Pointer to the style scheme used.
Returns

Returns the pointer to the object created.

Preconditions

none

Side Effects

none

Example
Copy Code
GOL_SCHEME *pScheme;
WORD state;

    pScheme = GOLCreateScheme();
    state = AC_DRAW;

    AnalogClock = AcCreate(ANALOGCLOCK_ID, 20, 64, 50, 118, 1, 20, 30, FALSE, state, NULL, pScheme);
Library API > Graphics Object Layer API > GOL Objects > Analog Clock > AcCreate Function


AcDraw Function

Contents | Index | Home
Previous | Up | Next
AcDraw Function
Analog Clock
C
WORD AcDraw(
    void * pAc
);
Overview

This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set.

Input Parameters
Input Parameters | Description
void * pAc | Pointer to the object to be rendered.
Returns

Returns the status of the drawing

  • 1 - If the rendering was completed and
  • 0 - If the rendering is not yet finished.
Next call to the function will resume the rendering on the pending drawing state.

Preconditions

Object must be created before this function is called.

Side Effects

none

Example
Copy Code
void MyGOLDraw(){
    static OBJ_HEADER *pCurrentObj = NULL;
    int done;

    // There are no objects
    if(GOLGetList() == NULL)
        return;

    // If it's last object jump to head
    if(pCurrentObj == NULL)
        pCurrentObj = GOLGetList();

    done = 0;

    // this only process Button and Window
    while(pCurrentObj != NULL){
        // check if object state indicates redrawing
        if(pCurrentObj->state&0xFC00) {
            switch(pCurrentObj->type){
                case OBJ_ANALOGCLOCK:
                    done = AcDraw((ANALOGCLOCK*)pCurrentObj);
                    break;
                case OBJ_WINDOW:
                    done = WndDraw((WINDOW*)pCurrentObj);
                    break;
                default:
                    done = 1;
                    break;
            }
            if(done){
                // reset only the state if drawing was finished
                pCurrentObj->state = 0;
            }else{
                // done processing the list
                return;
            }
        }
        // go to next object
        pCurrentObj = pCurrentObj->pNxtObj;
    }
}
Library API > Graphics Object Layer API > GOL Objects > Analog Clock > AcDraw Function


AcSetHour Function

Contents | Index | Home
Previous | Up | Next
AcSetHour Function
Analog Clock
C
void AcSetHour(
    ANALOGCLOCK * pAc,
    SHORT hour
);
Overview

Sets the hour value of the analog clock.

Input Parameters
Input Parameters | Description
ANALOGCLOCK * pAc | The pointer to the object whose hands will be modified.
SHORT hour | New hour time.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Analog Clock > AcSetHour Function


AcSetMinute Function

Contents | Index | Home
Previous | Up | Next
AcSetMinute Function
Analog Clock
C
void AcSetMinute(
    ANALOGCLOCK * pAc,
    SHORT minute
);
Overview

Sets the minute value of the analog clock.

Input Parameters
Input Parameters | Description
ANALOGCLOCK * pAc | The pointer to the object whose hands will be modified.
SHORT minute | New minute time.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Analog Clock > AcSetMinute Function


AcSetSecond Function

Contents | Index | Home
Previous | Up | Next
AcSetSecond Function
Analog Clock
C
void AcSetSecond(
    ANALOGCLOCK * pAc,
    SHORT second
);
Overview

Sets the second value of the analog clock.

Input Parameters
Input Parameters | Description
ANALOGCLOCK * pAc | The pointer to the object whose hands will be modified.
SHORT second | New second time.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Analog Clock > AcSetSecond Function


ANALOGCLOCK Structure

Contents | Index | Home
Previous | Up | Next
ANALOGCLOCK Structure
Analog Clock
C
typedef struct {
  OBJ_HEADER hdr;
  SHORT radius;
  SHORT centerx;
  SHORT centery;
  SHORT valueS;
  SHORT prev_valueS;
  SHORT valueM;
  SHORT prev_valueM;
  SHORT valueH;
  SHORT prev_valueH;
  void * pBitmap;
} ANALOGCLOCK;
Overview

Defines the parameters required for a clock Object. The following relationships of the parameters determines the general shape of the clock:

  1. centerx and centery determine the middle of the clock.
  2. radius defines the radius of the clock.
  4. *pBitmap points to the background image for the analog clock.

Members
Members | Description
OBJ_HEADER hdr; | Generic header for all Objects (see OBJ_HEADER).
SHORT radius; | Radius of the clock.
SHORT centerx; | center location in X-axis.
SHORT centery; | center location in Y-axis.
SHORT valueS; | time in Second
SHORT prev_valueS; | previous time in Second
SHORT valueM; | time in Minute
SHORT prev_valueM; | previous time in Minute
SHORT valueH; | time in Hour
SHORT prev_valueH; | previous time in Hour
void * pBitmap; | Pointer to bitmap used.
Library API > Graphics Object Layer API > GOL Objects > Analog Clock > ANALOGCLOCK Structure


Button

Contents | Index | Home
Previous | Up | Next
Button
Functions | Macros | Structures | Topics

Button supports Keyboard and Touchscreen inputs, replying to their events with the following messages:

1. BTN_MSG_PRESSED

2. BTN_MSG_RELEASED

The button object is rendered using the assigned style scheme. The following figure illustrates the color assignments for the button.

A variant of the button widget, is to implement it as a two tone button. The button object is rendered using the modified color assignments in the style scheme.

Functions
Name | Description
BtnCreate | This function creates a BUTTON object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
BtnDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. The text on the face of the button is drawn on top of the bitmap. Text is always rendered centered on the face of the button. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid... more
BtnSetText | This function sets the string used for the object.
BtnMsgDefault | This function performs the actual state change based on the translated message given. The following state changes are supported:
BtnTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Macros
Name | Description
BtnGetText | This macro returns the address of the current text string used for the object.
BtnGetBitmap | This macro returns the location of the currently used bitmap for the object.
BtnSetBitmap | This macro sets the bitmap used in the object. The size of the bitmap must match the face of the button.
Structures
Name
Description
BUTTON
Defines the parameters required for a button Object. The following relationships of the parameters determines the general shape of the button:
  1. Width is determined by right - left.
  2. Height is determined by top - bottom.
  3. Radius - specifies if the button will have a rounded edge. If zero then the button will have sharp (cornered) edge.
  4. If 2*radius = height = width, the button is a circular button.
Topics
Name | Description
Button States | List of Button bit states.
Links
Functions, GOL Objects, Legend, Macros, Structures, Topics
Library API > Graphics Object Layer API > GOL Objects > Button


Button States

Contents | Index | Home
Previous | Up | Next
Button States
Macros | Button

List of Button bit states.

Macros
Name | Description
BTN_DISABLED | Bit for disabled state.
BTN_DRAW | Bit to indicate button must be redrawn.
BTN_DRAW_FOCUS | Bit to indicate focus must be redrawn.
BTN_FOCUSED | Bit for focus state.
BTN_HIDE | Bit to indicate button must be removed from screen.
BTN_PRESSED | Bit for press state.
BTN_TEXTBOTTOM | Bit to indicate text is top aligned.
BTN_TEXTLEFT | Bit to indicate text is left aligned.
BTN_TEXTRIGHT | Bit to indicate text is right aligned.
BTN_TEXTTOP | Bit to indicate text is bottom aligned.
BTN_TOGGLE | Bit to indicate button will have a toggle behavior.
BTN_TWOTONE | Bit to indicate the button is a two tone type.
BTN_NOPANEL | Bit to indicate the button will be drawn without a panel (for faster drawing when the button image used is larger than the button panel).
Module

Button

Links
Macros, Button
Library API > Graphics Object Layer API > GOL Objects > Button > Button States


BTN_DISABLED Macro

Contents | Index | Home
Previous | Up | Next
BTN_DISABLED Macro
C
#define BTN_DISABLED 0x0002  // Bit for disabled state.
Description

Bit for disabled state.

Library API > Graphics Object Layer API > GOL Objects > Button > Button States > BTN_DISABLED Macro


BTN_DRAW Macro

Contents | Index | Home
Previous | Up | Next
BTN_DRAW Macro
C
#define BTN_DRAW 0x4000  // Bit to indicate button must be redrawn.
Description

Bit to indicate button must be redrawn.

Library API > Graphics Object Layer API > GOL Objects > Button > Button States > BTN_DRAW Macro


BTN_DRAW_FOCUS Macro

Contents | Index | Home
Previous | Up | Next
BTN_DRAW_FOCUS Macro
C
#define BTN_DRAW_FOCUS 0x2000  // Bit to indicate focus must be redrawn.
Description

Bit to indicate focus must be redrawn.

Library API > Graphics Object Layer API > GOL Objects > Button > Button States > BTN_DRAW_FOCUS Macro


BTN_FOCUSED Macro

Contents | Index | Home
Previous | Up | Next
BTN_FOCUSED Macro
C
#define BTN_FOCUSED 0x0001  // Bit for focus state.
Description

Bit for focus state.

Library API > Graphics Object Layer API > GOL Objects > Button > Button States > BTN_FOCUSED Macro


BTN_HIDE Macro

Contents | Index | Home
Previous | Up | Next
BTN_HIDE Macro
C
#define BTN_HIDE 0x8000  // Bit to indicate button must be removed from screen.
Description

Bit to indicate button must be removed from screen.

Library API > Graphics Object Layer API > GOL Objects > Button > Button States > BTN_HIDE Macro


BTN_PRESSED Macro

Contents | Index | Home
Previous | Up | Next
BTN_PRESSED Macro
C
#define BTN_PRESSED 0x0004  // Bit for press state.
Description

Bit for press state.

Library API > Graphics Object Layer API > GOL Objects > Button > Button States > BTN_PRESSED Macro


BTN_TEXTBOTTOM Macro

Contents | Index | Home
Previous | Up | Next
BTN_TEXTBOTTOM Macro
C
#define BTN_TEXTBOTTOM 0x0040  // Bit to indicate text is top aligned.
Description

Bit to indicate text is top aligned.

Library API > Graphics Object Layer API > GOL Objects > Button > Button States > BTN_TEXTBOTTOM Macro


BTN_TEXTLEFT Macro

Contents | Index | Home
Previous | Up | Next
BTN_TEXTLEFT Macro
C
#define BTN_TEXTLEFT 0x0020  // Bit to indicate text is left aligned.
Description

Bit to indicate text is left aligned.

Library API > Graphics Object Layer API > GOL Objects > Button > Button States > BTN_TEXTLEFT Macro


BTN_TEXTRIGHT Macro

Contents | Index | Home
Previous | Up | Next
BTN_TEXTRIGHT Macro
C
#define BTN_TEXTRIGHT 0x0010  // Bit to indicate text is right aligned.
Description

Bit to indicate text is right aligned.

Library API > Graphics Object Layer API > GOL Objects > Button > Button States > BTN_TEXTRIGHT Macro


BTN_TEXTTOP Macro

Contents | Index | Home
Previous | Up | Next
BTN_TEXTTOP Macro
C
#define BTN_TEXTTOP 0x0080  // Bit to indicate text is bottom aligned.
Description

Bit to indicate text is bottom aligned.

Library API > Graphics Object Layer API > GOL Objects > Button > Button States > BTN_TEXTTOP Macro


BTN_TOGGLE Macro

Contents | Index | Home
Previous | Up | Next
BTN_TOGGLE Macro
C
#define BTN_TOGGLE 0x0008  // Bit to indicate button will have a toggle behavior.
Description

Bit to indicate button will have a toggle behavior.

Library API > Graphics Object Layer API > GOL Objects > Button > Button States > BTN_TOGGLE Macro


BTN_TWOTONE Macro

Contents | Index | Home
Previous | Up | Next
BTN_TWOTONE Macro
C
#define BTN_TWOTONE 0x0100  // Bit to indicate the button is a two tone type.
Description

Bit to indicate the button is a two tone type.

Library API > Graphics Object Layer API > GOL Objects > Button > Button States > BTN_TWOTONE Macro


BTN_NOPANEL Macro

Contents | Index | Home
Previous | Up | Next
BTN_NOPANEL Macro
C
#define BTN_NOPANEL 0x0200  // Bit to indicate the button will be drawn without a panel (for faster drawing when the button image used is larger than the button panel).
Description

Bit to indicate the button will be drawn without a panel (for faster drawing when the button image used is larger than the button panel).

Library API > Graphics Object Layer API > GOL Objects > Button > Button States > BTN_NOPANEL Macro


BtnCreate Function

Contents | Index | Home
Previous | Up | Next
BtnCreate Function
Button
C
BUTTON * BtnCreate(
    WORD ID,
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    SHORT radius,
    WORD state,
    void * pBitmap,
    XCHAR * pText,
    GOL_SCHEME * pScheme
);
Overview

This function creates a BUTTON object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.

Input Parameters
Input Parameters | Description
WORD ID | Unique user defined ID for the object instance.
SHORT left | Left most position of the object.
SHORT top | Top most position of the object.
SHORT right | Right most position of the object.
SHORT bottom | Bottom most position of the object.
SHORT radius | Radius of the rounded edge.
WORD state | Sets the initial state of the object.
void * pBitmap | Pointer to the bitmap used on the face of the button dimension of the bitmap must match the dimension of the button.
XCHAR * pText | Pointer to the text of the button.
GOL_SCHEME * pScheme | Pointer to the style scheme used.
Returns

Returns the pointer to the object created.

Preconditions

none

Side Effects

none

Example
Copy Code
GOL_SCHEME *pScheme;
BUTTON *buttons[3];
WORD state;

    pScheme = GOLCreateScheme();
    state = BTN_DRAW;

    buttons[0] = BtnCreate(1,20,64,50,118,0, state, NULL, "ON", pScheme);
    // check if button 0 is created
    if (buttons[0] == NULL)
       return 0;

    buttons[1] = BtnCreate(2,52,64,82,118,0, state, NULL, "OFF", pScheme);
    // check if button 1 is created
    if (buttons[1] == NULL)
       return 0;

    buttons[2] = BtnCreate(3,84,64,114,118,0, state, NULL, "HI", pScheme);
    // check if button 2 is created
    if (buttons[2] == NULL)
       return 0;

    return 1;
Library API > Graphics Object Layer API > GOL Objects > Button > BtnCreate Function


BtnDraw Function

Contents | Index | Home
Previous | Up | Next
BtnDraw Function
Button
C
WORD BtnDraw(
    void * pObj
);
Overview

This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set.

The text on the face of the button is drawn on top of the bitmap. Text is always rendered centered on the face of the button.

When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.

Input Parameters
Input Parameters | Description
pB | Pointer to the object to be rendered.
Returns

Returns the status of the drawing

  • 1 - If the rendering was completed and
  • 0 - If the rendering is not yet finished.
Next call to the function will resume the rendering on the pending drawing state.

Preconditions

Object must be created before this function is called.

Side Effects

none

Example
Copy Code
void MyGOLDraw(){
    static OBJ_HEADER *pCurrentObj = NULL;
    int done;

    // There are no objects
    if(GOLGetList() == NULL)
        return;

    // If it's last object jump to head
    if(pCurrentObj == NULL)
        pCurrentObj = GOLGetList();

    done = 0;

    // this only process Button and Window
    while(pCurrentObj != NULL){
        // check if object state indicates redrawing
        done = pCurrentObj->draw(pCurrentObj);

            if(done){
                // reset only the state if drawing was finished
                pCurrentObj->state = 0;
            }else{
                // done processing the list
                return;
            }
        }
        // go to next object
        pCurrentObj = pCurrentObj->pNxtObj;
    }
}
Library API > Graphics Object Layer API > GOL Objects > Button > BtnDraw Function


BtnGetText Macro

Contents | Index | Home
Previous | Up | Next
BtnGetText Macro
Button
C
#define BtnGetText(pB) ((BUTTON *)pB)->pText
Overview

This macro returns the address of the current text string used for the object.

Input Parameters
Input Parameters | Description
pB | Pointer to the object.
Returns

Returns pointer to the text string being used.

Preconditions

none

Side Effects

none

Example
Copy Code
XCHAR *pChar;
BUTTON Button[2];

pChar = BtnGetText(Button[0]);
Library API > Graphics Object Layer API > GOL Objects > Button > BtnGetText Macro


BtnSetText Function

Contents | Index | Home
Previous | Up | Next
BtnSetText Function
Button
C
void BtnSetText(
    BUTTON * pB,
    XCHAR * pText
);
Overview

This function sets the string used for the object.

Input Parameters
Input Parameters | Description
BUTTON * pB | The pointer to the object whose text will be modified.
XCHAR * pText | Pointer to the text that will be used.
Returns

none

Preconditions

none

Side Effects

none

Example
Copy Code
XCHAR Label0[] = “ON”;
XCHAR Label1[] = “OFF”;
BUTTON Button[2];

    BtnSetText(Button[0], Label0);
    BtnSetText(Button[1], Label1);
Library API > Graphics Object Layer API > GOL Objects > Button > BtnSetText Function


BtnGetBitmap Macro

Contents | Index | Home
Previous | Up | Next
BtnGetBitmap Macro
Button
C
#define BtnGetBitmap(pB) ((BUTTON *)pB)->pBitmap
Overview

This macro returns the location of the currently used bitmap for the object.

Input Parameters
Input Parameters | Description
pB | Pointer to the object.
Returns

Returns the pointer to the current bitmap used.

Preconditions

none

Side Effects

none

Example
Copy Code
BUTTON *pButton;
BITMAP_FLASH *pUsedBitmap;

    pUsedbitmap = BtnGetBitmap(pButton);
Library API > Graphics Object Layer API > GOL Objects > Button > BtnGetBitmap Macro


BtnSetBitmap Macro

Contents | Index | Home
Previous | Up | Next
BtnSetBitmap Macro
Button
C
#define BtnSetBitmap(pB, pBtmap) ((BUTTON *)pB)->pBitmap = pBtmap
Overview

This macro sets the bitmap used in the object. The size of the bitmap must match the face of the button.

Input Parameters
Input Parameters | Description
pB | Pointer to the object.
pBitmap | Pointer to the bitmap to be used.
Returns

none

Preconditions

none

Side Effects

none

Example
Copy Code
extern BITMAP_FLASH myIcon;
BUTTON *pButton;

    BtnSetBitmap(pButton , &myIcon);
Library API > Graphics Object Layer API > GOL Objects > Button > BtnSetBitmap Macro


BtnMsgDefault Function

Contents | Index | Home
Previous | Up | Next
BtnMsgDefault Function
Button
C
void BtnMsgDefault(
    WORD translatedMsg,
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function performs the actual state change based on the translated message given. The following state changes are supported:

Translated Message | Input Source | Set/Clear State Bit | Description
BTN_MSG_PRESSED | Touch Screen, Keyboard | Set BTN_PRESSED | Button will be redrawn in the pressed state.
BTN_MSG_RELEASED | Touch Screen, Keyboard | Clear BTN_PRESSED | Button will be redrawn in the unpressed state.
BTN_MSG_CANCELPRESS | Touch Screen, | Clear BTN_PRESSED | Button will be redrawn in the unpressed state.
Input Parameters
Input Parameters | Description
WORD translatedMsg | The translated message.
void * pObj | The pointer to the object whose state will be modified.
GOL_MSG * pMsg | The pointer to the GOL message.
Returns

none

Preconditions

none

Side Effects

none

Example

See BtnTranslateMsg() example.

Library API > Graphics Object Layer API > GOL Objects > Button > BtnMsgDefault Function


BtnTranslateMsg Function

Contents | Index | Home
Previous | Up | Next
BtnTranslateMsg Function
Button
C
WORD BtnTranslateMsg(
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.

Translated Message | Input Source | Set/Clear State Bit | Description
BTN_MSG_PRESSED | Touch Screen | EVENT_PRESS, EVENT_MOVE | If events occurs and the x,y position falls in the face of the button while the button is not pressed.
 | Keyboard | EVENT_KEYSCAN | If event occurs and parameter1 passed matches the object’s ID and parameter 2 passed matches SCAN_CR_PRESSED or SCAN_SPACE_PRESSED while the button is not pressed.
BTN_MSG_STILLPRESSED | Touch Screen | EVENT_STILLPRESS | If event occurs and the x,y position does not change from the previous press position in the face of the button.
BTN_MSG_RELEASED | Touch Screen | EVENT_RELEASE | If the event occurs and the x,y position falls in the face of the button while the button is pressed.
 | Keyboard | EVENT_KEYSCAN | If event occurs and parameter1 passed matches the object’s ID and parameter 2 passed matches SCAN_CR_RELEASED or SCAN_SPACE_RELEASED while the button is pressed.
BTN_MSG_CANCELPRESS | Touch Screen | EVENT_MOVE | If the event occurs outside the face of the button and the button is currently pressed.
OBJ_MSG_INVALID | Any | Any | If the message did not affect the object.
Input Parameters
Input Parameters | Description
void * pObj | The pointer to the object where the message will be evaluated to check if the message will affect the object.
GOL_MSG * pMsg | Pointer to the message struct containing the message from the user interface.
Returns

Returns the translated message depending on the received GOL message:

  • BTN_MSG_PRESSED – Button is pressed
  • BTN_MSG_RELEASED – Button is released
  • BTN_MSG_CANCELPRESS – Button will be released, user cancels press action on the button
  • OBJ_MSG_INVALID – Button is not affected

Preconditions

none

Side Effects

none

Example
Copy Code
void MyGOLMsg(GOL_MSG *pMsg){

    OBJ_HEADER *pCurrentObj;
    WORD objMsg;

    if(pMsg->uiEvent == EVENT_INVALID)
        return;
    pCurrentObj = GOLGetList();

    while(pCurrentObj != NULL){
        // If the object must be redrawn
        // It cannot accept message
        if(!IsObjUpdated(pCurrentObj)){
            translatedMsg = pCurrentObj->MsgObj(pCurrentObj, pMsg);

             if(translatedMsg != OBJ_MSG_INVALID)
             {
                 if(GOLMsgCallback(translatedMsg, pCurrentObj, pMsg))
                     if(pCurrentObj->MsgDefaultObj)
                         pCurrentObj->MsgDefaultObj(translatedMsg, pCurrentObj, pMsg);
             }

        }
    }
    pCurrentObj = pCurrentObj->pNxtObj;
}
Library API > Graphics Object Layer API > GOL Objects > Button > BtnTranslateMsg Function


BUTTON Structure

Contents | Index | Home
Previous | Up | Next
BUTTON Structure
Button
C
typedef struct {
  OBJ_HEADER hdr;
  SHORT radius;
  SHORT textWidth;
  SHORT textHeight;
  XCHAR * pText;
  void * pBitmap;
} BUTTON;
Overview

Defines the parameters required for a button Object. The following relationships of the parameters determines the general shape of the button:

  1. Width is determined by right - left.
  2. Height is determined by top - bottom.
  3. Radius - specifies if the button will have a rounded edge. If zero then the button will have sharp (cornered) edge.
  4. If 2*radius = height = width, the button is a circular button.

Members
Members | Description
OBJ_HEADER hdr; | Generic header for all Objects (see OBJ_HEADER).
SHORT radius; | Radius for rounded buttons.
SHORT textWidth; | Computed text width, done at creation.
SHORT textHeight; | Computed text height, done at creation.
XCHAR * pText; | Pointer to the text used.
void * pBitmap; | Pointer to bitmap used.
Library API > Graphics Object Layer API > GOL Objects > Button > BUTTON Structure


Chart

Contents | Index | Home
Previous | Up | Next
Chart
Functions | Macros | Structures | Topics

It supports only Keyboard inputs, replying to any touch screen events with the message: CH_MSG_SELECTED.

The Chart Object is rendered using the assigned style scheme. The following figure illustrates the color assignments.

Chart Terminologies

  1. Value Axis - This is the vertical range of a chart for normal bar charts and horizontal range of the chart for horizontally drawn bar charts. In most cases this axis will represent values ($ amounts), temperatures, or other numeric data.
  2. Sample Axis - This is the horizontal range of a chart for normal bar charts and vertical range of the chart for horizontally drawn bar charts. In most cases this axis will represent categories, such as months, sample segments, or other non-numeric data.
  3. Title - The text used to define the Title of the chart.
  4. Data Points (or the sample points) These are the individual points where a value is graphed, as a point on a line, a bar, or a pie slice.
  5. Data Series - A complete series of data, distinguished by the same color and type of sample point.
  6. Legend - Labels that indicate how each data series is displayed on the chart. Each color represents a different data series. For pie charts with only one data series shown, each color represents one sector or one sample point.
  7. Data Sample Range - The scale for the data sample axis. Example: months from January to December. Internally, this range is represented by:
    • Numeric Sequence 1, 2, 3, ... and so on
    • Alphabet Sequence A, B, C, .. and so on.
  8. Value Range - The scale for the value axis. Example: range of numbers from the lowest to the highest to be charted.

Functions
Name | Description
ChCreate | This function creates a CHART object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
ChDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. The colors of the bars of the bar chart or sectors of the pie chart can be the default color table or user defined color table set by ChSetColorTable() function. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is... more
ChAddDataSeries | This function creates a DATASERIES object and populates the structure with the given parameters.
ChRemoveDataSeries | This function removes DATASERIES object from the list of DATASERIES objects and frees the memory used of that removed object. The position of the object to be removed is specified by the number parameter. If the list has only one member, it removes the member regardless of the number given.
ChSetValueRange | This function sets the minimum and maximum range of values that the bar chart will show. The criteria is that min <= max.
ChSetPercentRange | This function sets the minimum and maximum range of percentage that the bar chart will show. The criteria is that min <= max. This affects bar charts only and CH_PERCENTAGE bit state is set.
ChSetSampleRange | This function sets the sample start and sample end when drawing the chart. Together with the data series' SHOW_DATA flags the different way of displaying the chart data is achieved.
ChFreeDataSeries | This function removes DATASERIES object from the list of DATASERIES objects and frees the memory used of that removed object.
ChTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Macros
Name | Description
ChShowSeries | This macro sets the specified data series number show flag to be set to SHOW_DATA.
ChHideSeries | This macro sets the specified data series number show flag to be set to HIDE_DATA.
ChGetShowSeriesCount | This macro shows the number of data series that has its show flag set to SHOW_DATA
ChGetShowSeriesStatus | This macro returns the show ID status of the DATASERIES.
ChSetValueLabel | This macro sets the address of the current text string used for the value axis label of the bar chart.
ChGetValueLabel | This macro returns the address of the current text string used for the value axis label of the bar chart.
ChGetValueMax | This macro returns the current maximum value that will be drawn for bar charts.
ChGetValueMin | This macro returns the current minimum value that will be drawn for bar charts.
ChGetValueRange | This macro gets the current range for bar charts. The value returned is calculated from the current (valMax - valMin) set. To get the minimum use ChGetValueMin() and to get the maximum use ChGetValueMax().
ChSetSampleLabel | This macro sets the address of the current text string used for the sample axis label of the bar chart.
ChGetSampleLabel | This macro returns the address of the current text string used for the sample axis label of the bar chart.
ChGetSampleStart | This macro returns the sampling start value.
ChGetSampleEnd | This macro returns the sampling end value.
ChGetPercentRange | This macro gets the percentage range for bar charts. The value returned is calculated from percentage max - min. To get the minimum use ChGetPercentMin() and to get the maximum use ChGetPercentMax().
ChGetSampleRange | This macro gets the sample range for pie or bar charts. The value returned is calculated from smplEnd - smplStart.
ChGetPercentMax | This macro returns the current maximum value of the percentage range that will be drawn for bar charts when CH_PERCENTAGE bit state is set.
ChGetPercentMin | This macro returns the current minimum value of the percentage range that will be drawn for bar charts when CH_PERCENTAGE bit state is set.
ChSetColorTable | This macro sets the color table used to draw the data in pie and bar charts.
ChGetColorTable | This macro returns the current color table used for the pie and bar charts.
ChSetTitle | This macro sets the address of the current text string used for the title of the chart.
ChGetTitle | This macro returns the address of the current text string used for the title of the chart.
ChSetTitleFont | This macro sets the location of the font used for the title of the chart.
ChGetTitleFont | This macro returns the location of the font used for the title of the chart.
ChGetAxisLabelFont | This macro returns the location of the font used for the X and Y axis labels of the chart.
ChSetAxisLabelFont | This macro sets the location of the font used for the X and Y axis labels of the chart.
ChGetGridLabelFont | This macro returns the location of the font used for the X and Y axis grid labels of the chart.
ChSetGridLabelFont | This macro sets the location of the font used for the X and Y axis grid labels of the chart.
Structures
Name | Description
CHART | Defines the parameters required for a chart Object.
DATASERIES | Defines a variable for the CHART object. It specifies the number of samples, pointer to the array of samples for the data series and pointer to the next data series. A member of this structure (show) is used as a flag to determine if the series is to be drawn or not. Together with the smplStart and smplEnd it will determine what kind of chart will be drawn.
CHARTPARAM | Defines the parameters for the CHART object.
Topics
Name | Description
Chart States | List of Chart bit states.
Data Series Status Settings | Data Series show status flag settings.
Chart Examples | Examples of generated bar charts based on settings.
Color Table | Default color table used to draw data points in a chart.
Links
Functions, GOL Objects, Legend, Macros, Structures, Topics
Library API > Graphics Object Layer API > GOL Objects > Chart


Chart States

Contents | Index | Home
Previous | Up | Next
Chart States
Macros | Chart

List of Chart bit states.

Macros
Name | Description
CH_DISABLED | Bit for disabled state.
CH_DRAW | Bit to indicate chart must be redrawn.
CH_DRAW_DATA | Bit to indicate data portion of the chart must be redrawn.
CH_3D_ENABLE | Bit to indicate that bar charts are to be drawn with 3-D effect
CH_BAR | Bit to indicate the chart is type bar. If both PIE and BAR types are set BAR type has higher priority.
CH_BAR_HOR | These bits (with CH_BAR bit set), sets the bar chart to be drawn horizontally.
CH_DONUT | These bits (with CH_PIE bit set), sets the pie chart to be drawn in a donut shape.
CH_LEGEND | Bit to indicate that legend is to be shown. Usable only when seriesCount > 1.
CH_NUMERIC | This bit is used only for bar charts. If this bit is set, it indicates that the bar chart labels for variables are numeric. If this bit is not set, it indicates that the bar chart labels for variables are alphabets.
CH_PERCENT | Bit to indicate that the pie chart will be drawn with percentage values shown for the sample data. For bar chart, if CH_VALUE is set, it toggles the value shown to percentage.
CH_PIE | Bit to indicate the chart is type pie. If both PIE and BAR types are set BAR type has higher priority.
CH_VALUE | Bit to indicate that the values of the bar chart data or pie chart data are to be shown
CH_HIDE | Bit to indicate chart must be removed from screen.
Module

Chart

Links
Macros, Chart
Library API > Graphics Object Layer API > GOL Objects > Chart > Chart States


CH_DISABLED Macro

Contents | Index | Home
Previous | Up | Next
CH_DISABLED Macro
C
#define CH_DISABLED 0x0002      // Bit for disabled state.
Description

Bit for disabled state.

Library API > Graphics Object Layer API > GOL Objects > Chart > Chart States > CH_DISABLED Macro


CH_DRAW Macro

Contents | Index | Home
Previous | Up | Next
CH_DRAW Macro
C
#define CH_DRAW 0x4000      // Bit to indicate chart must be redrawn.
Description

Bit to indicate chart must be redrawn.

Library API > Graphics Object Layer API > GOL Objects > Chart > Chart States > CH_DRAW Macro


CH_DRAW_DATA Macro

Contents | Index | Home
Previous | Up | Next
CH_DRAW_DATA Macro
C
#define CH_DRAW_DATA 0x2000      // Bit to indicate data portion of the chart must be redrawn.
Description

Bit to indicate data portion of the chart must be redrawn.

Library API > Graphics Object Layer API > GOL Objects > Chart > Chart States > CH_DRAW_DATA Macro


CH_3D_ENABLE Macro

Contents | Index | Home
Previous | Up | Next
CH_3D_ENABLE Macro
C
#define CH_3D_ENABLE 0x0008      // Bit to indicate that bar charts are to be drawn with 3-D effect
Description

Bit to indicate that bar charts are to be drawn with 3-D effect

Library API > Graphics Object Layer API > GOL Objects > Chart > Chart States > CH_3D_ENABLE Macro


CH_BAR Macro

Contents | Index | Home
Previous | Up | Next
CH_BAR Macro
C
#define CH_BAR 0x0200      // Bit to indicate the chart is type bar. If both PIE and BAR types are set BAR type has higher priority.
Description

Bit to indicate the chart is type bar. If both PIE and BAR types are set BAR type has higher priority.

Library API > Graphics Object Layer API > GOL Objects > Chart > Chart States > CH_BAR Macro


CH_BAR_HOR Macro

Contents | Index | Home
Previous | Up | Next
CH_BAR_HOR Macro
C
#define CH_BAR_HOR 0x0240      // These bits (with CH_BAR bit set), sets the bar chart to be drawn horizontally.
Description

These bits (with CH_BAR bit set), sets the bar chart to be drawn horizontally.

Library API > Graphics Object Layer API > GOL Objects > Chart > Chart States > CH_BAR_HOR Macro


CH_DONUT Macro

Contents | Index | Home
Previous | Up | Next
CH_DONUT Macro
C
#define CH_DONUT 0x0140      // These bits (with CH_PIE bit set), sets the pie chart to be drawn in a donut shape.
Description

These bits (with CH_PIE bit set), sets the pie chart to be drawn in a donut shape.

Library API > Graphics Object Layer API > GOL Objects > Chart > Chart States > CH_DONUT Macro


CH_LEGEND Macro

Contents | Index | Home
Previous | Up | Next
CH_LEGEND Macro
C
#define CH_LEGEND 0x0001      // Bit to indicate that legend is to be shown. Usable only when seriesCount > 1.
Description

Bit to indicate that legend is to be shown. Usable only when seriesCount > 1.

Library API > Graphics Object Layer API > GOL Objects > Chart > Chart States > CH_LEGEND Macro


CH_NUMERIC Macro

Contents | Index | Home
Previous | Up | Next
CH_NUMERIC Macro
C
#define CH_NUMERIC 0x0080      // This bit is used only for bar charts. If this bit is set, it indicates that the
Description

This bit is used only for bar charts. If this bit is set, it indicates that the bar chart labels for variables are numeric. If this bit is not set, it indicates that the bar chart labels for variables are alphabets.

Library API > Graphics Object Layer API > GOL Objects > Chart > Chart States > CH_NUMERIC Macro


CH_PERCENT Macro

Contents | Index | Home
Previous | Up | Next
CH_PERCENT Macro
C
#define CH_PERCENT 0x0010      // Bit to indicate that the pie chart will be drawn with percentage values shown for the sample data.
Description

Bit to indicate that the pie chart will be drawn with percentage values shown for the sample data. For bar chart, if CH_VALUE is set, it toggles the value shown to percentage.

Library API > Graphics Object Layer API > GOL Objects > Chart > Chart States > CH_PERCENT Macro


CH_PIE Macro

Contents | Index | Home
Previous | Up | Next
CH_PIE Macro
C
#define CH_PIE 0x0100      // Bit to indicate the chart is type pie. If both PIE and BAR types are set BAR type has higher priority.
Description

Bit to indicate the chart is type pie. If both PIE and BAR types are set BAR type has higher priority.

Library API > Graphics Object Layer API > GOL Objects > Chart > Chart States > CH_PIE Macro


CH_VALUE Macro

Contents | Index | Home
Previous | Up | Next
CH_VALUE Macro
C
#define CH_VALUE 0x0004      // Bit to indicate that the values of the bar chart data or pie chart data are to be shown
Description

Bit to indicate that the values of the bar chart data or pie chart data are to be shown

Library API > Graphics Object Layer API > GOL Objects > Chart > Chart States > CH_VALUE Macro


CH_HIDE Macro

Contents | Index | Home
Previous | Up | Next
CH_HIDE Macro
C
#define CH_HIDE 0x8000      // Bit to indicate chart must be removed from screen.
Description

Bit to indicate chart must be removed from screen.

Library API > Graphics Object Layer API > GOL Objects > Chart > Chart States > CH_HIDE Macro


Data Series Status Settings

Contents | Index | Home
Previous | Up | Next
Data Series Status Settings
Macros | Chart

Data Series show status flag settings.

Macros
Name | Description
HIDE_DATA | Macro used to reset the data series show flag or indicate that the data series will be not be shown when the chart is drawn.
SHOW_DATA | Macro used to set the data series show flag or indicate that the data series will be shown when the chart is drawn.
Module

Chart

Links
Macros, Chart
Library API > Graphics Object Layer API > GOL Objects > Chart > Data Series Status Settings


HIDE_DATA Macro

Contents | Index | Home
Previous | Up | Next
HIDE_DATA Macro
C
#define HIDE_DATA 0               // Macro used to reset the data series show flag or indicate that the data series will be not be shown when the chart is drawn.
Description

Macro used to reset the data series show flag or indicate that the data series will be not be shown when the chart is drawn.

Library API > Graphics Object Layer API > GOL Objects > Chart > Data Series Status Settings > HIDE_DATA Macro


SHOW_DATA Macro

Contents | Index | Home
Previous | Up | Next
SHOW_DATA Macro
C
#define SHOW_DATA 1               // Macro used to set the data series show flag or indicate that the data series will be shown when the chart is drawn.
Description

Macro used to set the data series show flag or indicate that the data series will be shown when the chart is drawn.

Library API > Graphics Object Layer API > GOL Objects > Chart > Data Series Status Settings > SHOW_DATA Macro


Chart Examples

Contents | Index | Home
Previous | Up | Next
Chart Examples
Chart

The following are some examples of settings and output chart that will be generated.

Module

Chart

Links
Chart
Library API > Graphics Object Layer API > GOL Objects > Chart > Chart Examples


ChCreate Function

Contents | Index | Home
Previous | Up | Next
ChCreate Function
Chart
C
CHART * ChCreate(
    WORD ID,
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    WORD state,
    DATASERIES * pData,
    CHARTPARAM * pParam,
    GOL_SCHEME * pScheme
);
Overview

This function creates a CHART object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.

Input Parameters
Input Parameters | Description
WORD ID | Unique user defined ID for the object instance.
SHORT left | Left most position of the object.
SHORT top | Top most position of the object.
SHORT right | Right most position of the object.
SHORT bottom | Bottom most position of the object.
WORD state | Sets the initial state of the object.
DATASERIES * pData | Pointer to the data for the contents of the chart. NULL can be assigned initially when creating the object.
CHARTPARAM * pParam | Pointer to the chart parameters. NULL can be assigned initially when creating the object and the chart parameters can be populated using the API provided.
GOL_SCHEME * pScheme | Pointer to the style scheme used. When set to NULL, the default style scheme will be used.
Returns

Returns the pointer to the object created.

Preconditions

none

Side Effects

none

Example
Copy Code
extern const FONT_FLASH GOLSmallFont;
extern const FONT_FLASH GOLMediumFont;

// Note that strings are declared as such to cover cases
// where XCHAR type is declared as short (2 bytes).
XCHAR ChTitle[]     = {'E','x','a','m','p','l','e',0};
XCHAR SampleName[]  = {'C','a','t','e','g','o','r','y',0};
XCHAR ValueName[]   = {'#','H','i','t','s',0};
XCHAR SeriesName[2] = {
                       {'V','1',0},
                       {'V','2',0},
                      };
V1Data[2] = { 50, 100};
V2Data[2] = { 5,  10};

GOL_SCHEME  *pScheme;
CHART       *pChart;
CHARTPARAM   Contents;
WORD         state;

    pScheme = GOLCreateScheme();
    state = CH_BAR|CH_DRAW|CH_BAR_HOR;  // Bar Chart to be drawn with horizontal orientation

    pChart = ChCreate(0x01,                         // ID
                      0, 0,                         // dimensions
                      GetMaxX(),
                      GetMaxY(),
                      state,                        // state of the chart
                      NULL,                         // data not initialized yet
                      NULL,                         // no parameters yet
                      pScheme);                     // style scheme used

    if (pMyChart == NULL)                           // check if chart was allocated memory
        return 0;

    ChSetTitleFont(pChart, (void*)&GOLMediumFont);
    ChSetTitle(pChart, ChTitle);                    // set the title

    // set the grid labels and axis labels font
    ChSetGridLabelFont(pChart, (void*)&GOLSmallFont);
    ChSetAxisLabelFont(pChart, (void*)&GOLSmallFont);

    // set the labels for the X and Y axis
    ChSetSampleLabel(pChart, (XCHAR*)SampleName);
    ChSetValueLabel(pChart, (XCHAR*)ValueName);

    ChAddDataSeries(pChart, 2, V1Data, (XCHAR*)SeriesName[0]);
    ChAddDataSeries(pChart, 2, V2Data, (XCHAR*)SeriesName[1]);

    // set the range of the sample values
    ChSetValueRange(pChart, 0, 100);

    // show all two samples to be displayed (start = 1, end = 2)
    ChSetSampleRange(pChart, 1, 2);

    GOLDraw();                                      // draw the chart
Library API > Graphics Object Layer API > GOL Objects > Chart > ChCreate Function


ChDraw Function

Contents | Index | Home
Previous | Up | Next
ChDraw Function
Chart
C
WORD ChDraw(
    void * pObj
);
Overview

This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set.

The colors of the bars of the bar chart or sectors of the pie chart can be the default color table or user defined color table set by ChSetColorTable() function.

When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.

Input Parameters
Input Parameters | Description
pCh | Pointer to the object to be rendered.
Returns

Returns the status of the drawing

  • 1 - If the rendering was completed and
  • 0 - If the rendering is not yet finished.
Next call to the function will resume the rendering on the pending drawing state.

Preconditions

Object must be created before this function is called.

Side Effects

none.

Library API > Graphics Object Layer API > GOL Objects > Chart > ChDraw Function


ChAddDataSeries Function

Contents | Index | Home
Previous | Up | Next
ChAddDataSeries Function
Chart
C
DATASERIES * ChAddDataSeries(
    CHART * pCh,
    WORD nSamples,
    WORD * pData,
    XCHAR * pName
);
Overview

This function creates a DATASERIES object and populates the structure with the given parameters.

Input Parameters
Input Parameters | Description
CHART * pCh | Pointer to the chart object.
WORD nSamples | The number of samples or data points.
WORD * pData | Pointer to the array of samples or data points.
XCHAR * pName | Pointer to the string used to label the data series.
Returns

Returns the pointer to the data variable (DATASERIES) object created. If NULL is returned, the addition of the new object failed due to not enough memory for the object.

Preconditions

none

Side Effects

Appends to the list of DATASERIES that the chart is operating on. By default, the show flag of the newly added data series is set to SHOW_DATA or enabled.

Example

See ChCreate() example.

Library API > Graphics Object Layer API > GOL Objects > Chart > ChAddDataSeries Function


ChRemoveDataSeries Function

Contents | Index | Home
Previous | Up | Next
ChRemoveDataSeries Function
Chart
C
void ChRemoveDataSeries(
    CHART * pCh,
    WORD number
);
Overview

This function removes DATASERIES object from the list of DATASERIES objects and frees the memory used of that removed object. The position of the object to be removed is specified by the number parameter. If the list has only one member, it removes the member regardless of the number given.

Input Parameters
Input Parameters | Description
CHART * pCh | Pointer to the chart object.
WORD number | The position of the object to be removed in the list where the first object in the list is assigned a value of 1. If this parameter is set to zero, the whole list of DATA_SERIES is removed.
Returns

none.

Preconditions

none

Side Effects

none.

Example
Copy Code
void ClearChartData(CHART *pCh) {
    if(pCh->pChData != NULL)
        // remove the all data series
        ChRemoveDataSeries(pCh, 0);
}
Library API > Graphics Object Layer API > GOL Objects > Chart > ChRemoveDataSeries Function


ChShowSeries Macro

Contents | Index | Home
Previous | Up | Next
ChShowSeries Macro
Chart
C
#define ChShowSeries(pCh, seriesNum) (ChSetDataSeries(pCh, seriesNum, SHOW_DATA))
Overview

This macro sets the specified data series number show flag to be set to SHOW_DATA.

Input Parameters
Input Parameters | Description
pCh | Pointer to the chart object.
seriesNum | The data series number that will be modified. If this number is zero, all the entries' flag in the list will be set to SHOW_DATA.
Returns

Returns the same passed number if successful otherwise -1 if unsuccesful.

Preconditions

none

Side Effects

none

Example
Copy Code
// from the example in  ChCreate() we change the items to be shown when
// GOLDraw() is called.

// reset all data series to be HIDE_DATA
ChHideSeries(pMyChart, 0);
// set data series 1 (V1Data) to be shown
ChShowSeries(pMyChart, 1);
// draw the chart
GOLDraw();
.....

*

Library API > Graphics Object Layer API > GOL Objects > Chart > ChShowSeries Macro


ChHideSeries Macro

Contents | Index | Home
Previous | Up | Next
ChHideSeries Macro
Chart
C
#define ChHideSeries(pCh, seriesNum) (ChSetDataSeries(pCh, seriesNum, HIDE_DATA))
Overview

This macro sets the specified data series number show flag to be set to HIDE_DATA.

Input Parameters
Input Parameters | Description
pCh | Pointer to the chart object.
seriesNum | The data series number that will be modified. If this number is zero, all the entries' flag in the list will be set to HIDE_DATA.
Returns

Returns the same passed number if successful otherwise -1 if unsuccesful.

Preconditions

none

Side Effects

none

Example

See ChShowSeries() example.

Library API > Graphics Object Layer API > GOL Objects > Chart > ChHideSeries Macro


ChGetShowSeriesCount Macro

Contents | Index | Home
Previous | Up | Next
ChGetShowSeriesCount Macro
Chart
C
#define ChGetShowSeriesCount(pCh) (pCh->prm.seriesCount)
Overview

This macro shows the number of data series that has its show flag set to SHOW_DATA

Input Parameters
Input Parameters | Description
pCh | Pointer to the object.
Returns

Returns the number of data series with its show flag set to SHOW_DATA.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Chart > ChGetShowSeriesCount Macro


ChGetShowSeriesStatus Macro

Contents | Index | Home
Previous | Up | Next
ChGetShowSeriesStatus Macro
Chart
C
#define ChGetShowSeriesStatus(pDSeries) (pDSeries->show)
Overview

This macro returns the show ID status of the DATASERIES.

Input Parameters
Input Parameters | Description
pDSeries | Pointer to the data series(DATASERIES) that is being checked.
Returns

Returns the status of the show flag. 1 - (SHOW_DATA) means that the show status flag is set. 0 - (HIDE_DATA) means that the show status flag is not set.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Chart > ChGetShowSeriesStatus Macro


ChSetValueLabel Macro

Contents | Index | Home
Previous | Up | Next
ChSetValueLabel Macro
Chart
C
#define ChSetValueLabel(pCh, pNewValueLabel) (((CHART *)pCh)->prm.pValLabel = pNewValueLabel)
Overview

This macro sets the address of the current text string used for the value axis label of the bar chart.

Input Parameters
Input Parameters | Description
pCh | Pointer to the object.
pNewYLabel | pointer to the string to be used as an value axis label of the bar chart.
Returns

none.

Preconditions

none

Side Effects

none

Example

See ChCreate() example.

Library API > Graphics Object Layer API > GOL Objects > Chart > ChSetValueLabel Macro


ChGetValueLabel Macro

Contents | Index | Home
Previous | Up | Next
ChGetValueLabel Macro
Chart
C
#define ChGetValueLabel(pCh) (((CHART *)pCh)->prm.pValLabel)
Overview

This macro returns the address of the current text string used for the value axis label of the bar chart.

Input Parameters
Input Parameters | Description
pCh | Pointer to the object.
Returns

Returns the pointer to the current value axis label text of the bar chart.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Chart > ChGetValueLabel Macro


ChGetValueMax Macro

Contents | Index | Home
Previous | Up | Next
ChGetValueMax Macro
Chart
C
#define ChGetValueMax(pCh) (pCh->prm.valMax)
Overview

This macro returns the current maximum value that will be drawn for bar charts.

Input Parameters
Input Parameters | Description
pCh | Pointer to the object.
Returns

Returns the maximum value set when bar charts are drawn.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Chart > ChGetValueMax Macro


ChGetValueMin Macro

Contents | Index | Home
Previous | Up | Next
ChGetValueMin Macro
Chart
C
#define ChGetValueMin(pCh) (pCh->prm.valMin)
Overview

This macro returns the current minimum value that will be drawn for bar charts.

Input Parameters
Input Parameters | Description
pCh | Pointer to the object.
Returns

Returns the minimum value set when bar charts are drawn.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Chart > ChGetValueMin Macro


ChSetValueRange Function

Contents | Index | Home
Previous | Up | Next
ChSetValueRange Function
Chart
C
void ChSetValueRange(
    CHART * pCh,
    WORD min,
    WORD max
);
Overview

This function sets the minimum and maximum range of values that the bar chart will show. The criteria is that min <= max.

Input Parameters
Input Parameters | Description
CHART * pCh | Pointer to the chart object.
WORD min | Minimum value that will be displayed in the bar chart.
WORD max | Maximum value that will be displayed in the bar chart.
Returns

none.

Preconditions

none

Side Effects

none.

Library API > Graphics Object Layer API > GOL Objects > Chart > ChSetValueRange Function


ChGetValueRange Macro

Contents | Index | Home
Previous | Up | Next
ChGetValueRange Macro
Chart
C
#define ChGetValueRange(pCh) (pCh->prm.valMax - pCh->prm.valMin)
Overview

This macro gets the current range for bar charts. The value returned is calculated from the current (valMax - valMin) set. To get the minimum use ChGetValueMin() and to get the maximum use ChGetValueMax().

Input Parameters
Input Parameters | Description
pCh | Pointer to the chart object.
Returns

Value range computed from valMax-valMin.

Preconditions

none

Side Effects

none.

Library API > Graphics Object Layer API > GOL Objects > Chart > ChGetValueRange Macro


ChSetSampleLabel Macro

Contents | Index | Home
Previous | Up | Next
ChSetSampleLabel Macro
Chart
C
#define ChSetSampleLabel(pCh, pNewXLabel) (((CHART *)pCh)->prm.pSmplLabel = pNewXLabel)
Overview

This macro sets the address of the current text string used for the sample axis label of the bar chart.

Input Parameters
Input Parameters | Description
pCh | Pointer to the object.
pNewXLabel | pointer to the string to be used as an sample axis label of the bar chart.
Returns

none.

Preconditions

none

Side Effects

none

Example

See ChCreate() example.

Library API > Graphics Object Layer API > GOL Objects > Chart > ChSetSampleLabel Macro


ChGetSampleLabel Macro

Contents | Index | Home
Previous | Up | Next
ChGetSampleLabel Macro
Chart
C
#define ChGetSampleLabel(pCh) (((CHART *)pCh)->prm.pSmplLabel)
Overview

This macro returns the address of the current text string used for the sample axis label of the bar chart.

Input Parameters
Input Parameters | Description
pCh | Pointer to the object.
Returns

Returns the pointer to the current sample axis label text of the bar chart.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Chart > ChGetSampleLabel Macro


ChGetSampleStart Macro

Contents | Index | Home
Previous | Up | Next
ChGetSampleStart Macro
Chart
C
#define ChGetSampleStart(pCh) (((CHART *)pCh)->prm.smplStart)
Overview

This macro returns the sampling start value.

Input Parameters
Input Parameters | Description
pCh | Pointer to the object.
Returns

Returns the sample start point.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Chart > ChGetSampleStart Macro


ChGetSampleEnd Macro

Contents | Index | Home
Previous | Up | Next
ChGetSampleEnd Macro
Chart
C
#define ChGetSampleEnd(pCh) ((CHART *)pCh)->prm.smplEnd
Overview

This macro returns the sampling end value.

Input Parameters
Input Parameters | Description
pCh | Pointer to the object.
Returns

Returns the sample end point.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Chart > ChGetSampleEnd Macro


ChSetPercentRange Function

Contents | Index | Home
Previous | Up | Next
ChSetPercentRange Function
Chart
C
void ChSetPercentRange(
    CHART * pCh,
    WORD min,
    WORD max
);
Overview

This function sets the minimum and maximum range of percentage that the bar chart will show. The criteria is that min <= max. This affects bar charts only and CH_PERCENTAGE bit state is set.

Input Parameters
Input Parameters | Description
CHART * pCh | Pointer to the chart object.
WORD min | Minimum percentage value that will be displayed in the bar chart.
WORD max | Maximum percentage value that will be displayed in the bar chart.
Returns

none.

Preconditions

none

Side Effects

none.

Library API > Graphics Object Layer API > GOL Objects > Chart > ChSetPercentRange Function


ChGetPercentRange Macro

Contents | Index | Home
Previous | Up | Next
ChGetPercentRange Macro
Chart
C
#define ChGetPercentRange(pCh) (pCh->prm.perMax - pCh->prm.perMin)
Overview

This macro gets the percentage range for bar charts. The value returned is calculated from percentage max - min. To get the minimum use ChGetPercentMin() and to get the maximum use ChGetPercentMax().

Input Parameters
Input Parameters | Description
pCh | Pointer to the chart object.
Returns

Percentage range computed from max-min.

Preconditions

none

Side Effects

none.

Library API > Graphics Object Layer API > GOL Objects > Chart > ChGetPercentRange Macro


ChSetSampleRange Function

Contents | Index | Home
Previous | Up | Next
ChSetSampleRange Function
Chart
C
void ChSetSampleRange(
    CHART * pCh,
    WORD start,
    WORD end
);
Overview

This function sets the sample start and sample end when drawing the chart. Together with the data series' SHOW_DATA flags the different way of displaying the chart data is achieved.

Start & End Value | The # of Data Series Flag Set | Chart Description
Start <= End | 1 | Show the data indicated by Start and End points of the DATASERIES with the flag set
Start = End | 1 | Show the data indicated by Start or End points of the DATASERIES with the flag set
Start, End = don't care | > 1 | Show the data indicated by Start point of the DATASERIES with the flag set. Each samples of all checked data series are grouped together according to sample number.
Input Parameters
Input Parameters | Description
CHART * pCh | Pointer to the chart object.
WORD start | Start point of the data samples to be displayed.
WORD end | End point of the data samples to be displayed.
Returns

none.

Preconditions

none

Side Effects

none.

Example

See ChCreate() example.

Library API > Graphics Object Layer API > GOL Objects > Chart > ChSetSampleRange Function


ChGetSampleRange Macro

Contents | Index | Home
Previous | Up | Next
ChGetSampleRange Macro
Chart
C
#define ChGetSampleRange(pCh) (ChGetSampleEnd(pCh) - ChGetSampleStart(pCh))
Overview

This macro gets the sample range for pie or bar charts. The value returned is calculated from smplEnd - smplStart.

Input Parameters
Input Parameters | Description
pCh | Pointer to the chart object.
Returns

Sample range computed from smplEnd - smplStart.

Preconditions

none

Side Effects

none.

Library API > Graphics Object Layer API > GOL Objects > Chart > ChGetSampleRange Macro


ChGetPercentMax Macro

Contents | Index | Home
Previous | Up | Next
ChGetPercentMax Macro
Chart
C
#define ChGetPercentMax(pCh) (pCh->prm.perMax)
Overview

This macro returns the current maximum value of the percentage range that will be drawn for bar charts when CH_PERCENTAGE bit state is set.

Input Parameters
Input Parameters | Description
pCh | Pointer to the object.
Returns

Returns the maximum percentage value set when bar charts are drawn.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Chart > ChGetPercentMax Macro


ChGetPercentMin Macro

Contents | Index | Home
Previous | Up | Next
ChGetPercentMin Macro
Chart
C
#define ChGetPercentMin(pCh) (pCh->prm.perMin)
Overview

This macro returns the current minimum value of the percentage range that will be drawn for bar charts when CH_PERCENTAGE bit state is set.

Input Parameters
Input Parameters | Description
pCh | Pointer to the object.
Returns

Returns the minimum percentage value when bar charts are drawn.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Chart > ChGetPercentMin Macro


ChSetColorTable Macro

Contents | Index | Home
Previous | Up | Next
ChSetColorTable Macro
Chart
C
#define ChSetColorTable(pCh, pNewTable) ((((CHART *)pCh)->prm.pColor) = pNewTable)
Overview

This macro sets the color table used to draw the data in pie and bar charts.

Input Parameters
Input Parameters | Description
pCh | Pointer to the object.
pNewTable | Pointer to the color table that will be used.
Returns

none.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Chart > ChSetColorTable Macro


ChGetColorTable Macro

Contents | Index | Home
Previous | Up | Next
ChGetColorTable Macro
Chart
C
#define ChGetColorTable(pCh) (((CHART *)pCh)->prm.pColor)
Overview

This macro returns the current color table used for the pie and bar charts.

Input Parameters
Input Parameters | Description
pCh | Pointer to the object.
Returns

Returns the address of the color table used.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Chart > ChGetColorTable Macro


ChSetTitle Macro

Contents | Index | Home
Previous | Up | Next
ChSetTitle Macro
Chart
C
#define ChSetTitle(pCh, pNewTitle) (((CHART *)pCh)->prm.pTitle = pNewTitle)
Overview

This macro sets the address of the current text string used for the title of the chart.

Input Parameters
Input Parameters | Description
pCh | Pointer to the object.
pNewTitle | pointer to the string to be used as a title of the chart.
Returns

none.

Preconditions

none

Side Effects

none

Example

See ChCreate() example.

Library API > Graphics Object Layer API > GOL Objects > Chart > ChSetTitle Macro


ChGetTitle Macro

Contents | Index | Home
Previous | Up | Next
ChGetTitle Macro
Chart
C
#define ChGetTitle(pCh) (((CHART *)pCh)->prm.pTitle)
Overview

This macro returns the address of the current text string used for the title of the chart.

Input Parameters
Input Parameters | Description
pCh | Pointer to the object.
Returns

Returns the pointer to the current title text used.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Chart > ChGetTitle Macro


ChSetTitleFont Macro

Contents | Index | Home
Previous | Up | Next
ChSetTitleFont Macro
Chart
C
#define ChSetTitleFont(pCh, pNewFont) (((CHART *)pCh)->prm.pTitleFont = pNewFont)
Overview

This macro sets the location of the font used for the title of the chart.

Input Parameters
Input Parameters | Description
pCh | Pointer to the object.
pNewFont | Pointer to the font used.
Returns

none.

Preconditions

none

Side Effects

none

Example

See ChCreate() example.

Library API > Graphics Object Layer API > GOL Objects > Chart > ChSetTitleFont Macro


ChGetTitleFont Macro

Contents | Index | Home
Previous | Up | Next
ChGetTitleFont Macro
Chart
C
#define ChGetTitleFont(pCh) (((CHART *)pCh)->prm.pTitleFont)
Overview

This macro returns the location of the font used for the title of the chart.

Input Parameters
Input Parameters | Description
pCh | Pointer to the object.
Returns

Returns the address of the current font used for the title text.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Chart > ChGetTitleFont Macro


ChGetAxisLabelFont Macro

Contents | Index | Home
Previous | Up | Next
ChGetAxisLabelFont Macro
Chart
C
#define ChGetAxisLabelFont(pCh) (((CHART *)pCh)->prm.pAxisLabelsFont)
Overview

This macro returns the location of the font used for the X and Y axis labels of the chart.

Input Parameters
Input Parameters | Description
pCh | Pointer to the object.
Returns

Returns the address of the current font used for the title text.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Chart > ChGetAxisLabelFont Macro


ChSetAxisLabelFont Macro

Contents | Index | Home
Previous | Up | Next
ChSetAxisLabelFont Macro
Chart
C
#define ChSetAxisLabelFont(pCh, pNewFont) (((CHART *)pCh)->prm.pAxisLabelsFont = pNewFont)
Overview

This macro sets the location of the font used for the X and Y axis labels of the chart.

Input Parameters
Input Parameters | Description
pCh | Pointer to the object.
pNewFont | Pointer to the font used.
Returns

none.

Preconditions

none

Side Effects

none

Example

See ChCreate() example.

Library API > Graphics Object Layer API > GOL Objects > Chart > ChSetAxisLabelFont Macro


ChGetGridLabelFont Macro

Contents | Index | Home
Previous | Up | Next
ChGetGridLabelFont Macro
Chart
C
#define ChGetGridLabelFont(pCh) (((CHART *)pCh)->prm.pGridLabelsFont)
Overview

This macro returns the location of the font used for the X and Y axis grid labels of the chart.

Input Parameters
Input Parameters | Description
pCh | Pointer to the object.
Returns

Returns the address of the current font used for the title text.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Chart > ChGetGridLabelFont Macro


ChSetGridLabelFont Macro

Contents | Index | Home
Previous | Up | Next
ChSetGridLabelFont Macro
Chart
C
#define ChSetGridLabelFont(pCh, pNewFont) (((CHART *)pCh)->prm.pGridLabelsFont = pNewFont)
Overview

This macro sets the location of the font used for the X and Y axis grid labels of the chart.

Input Parameters
Input Parameters | Description
pCh | Pointer to the object.
pNewFont | Pointer to the font used.
Returns

none.

Preconditions

none

Side Effects

none

Example

See ChCreate() example.

Library API > Graphics Object Layer API > GOL Objects > Chart > ChSetGridLabelFont Macro


ChFreeDataSeries Function

Contents | Index | Home
Previous | Up | Next
ChFreeDataSeries Function
Chart
C
void ChFreeDataSeries(
    void * pObj
);
Overview

This function removes DATASERIES object from the list of DATASERIES objects and frees the memory used of that removed object.

Input Parameters
Input Parameters | Description
pCh | Pointer to the chart object.
Returns

none.

Preconditions

none

Side Effects

none.

Example
Copy Code
void ClearChartData(CHART *pCh) {
    if(pCh->pChData != NULL)
        // remove the all data series
        ChFreeDataSeries(pCh;
}
Library API > Graphics Object Layer API > GOL Objects > Chart > ChFreeDataSeries Function


ChTranslateMsg Function

Contents | Index | Home
Previous | Up | Next
ChTranslateMsg Function
Chart
C
WORD ChTranslateMsg(
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.

Translated Message | Input Source | Events | Description
CH_MSG_SELECTED | Touch Screen | EVENT_PRESS, EVENT_RELEASE, EVENT_MOVE | If events occurs and the x,y position falls in the area of the chart.
OBJ_MSG_INVALID | Any | Any | If the message did not affect the object.
Input Parameters
Input Parameters | Description
GOL_MSG * pMsg | Pointer to the message struct containing the message from the user interface.
pCh | The pointer to the object where the message will be evaluated to check if the message will affect the object.
Returns

Returns the translated message depending on the received GOL message:

  • CH_MSG_SELECTED – Chart area is selected
  • OBJ_MSG_INVALID – Chart is not affected

none.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Chart > ChTranslateMsg Function


CHART Structure

Contents | Index | Home
Previous | Up | Next
CHART Structure
Chart
C
typedef struct {
  OBJ_HEADER hdr;
  CHARTPARAM prm;
  DATASERIES * pChData;
} CHART;
Overview

Defines the parameters required for a chart Object.

Members
Members | Description
OBJ_HEADER hdr; | Generic header for all Objects (see OBJ_HEADER).
CHARTPARAM prm; | Structure for the parameters of the chart.
DATASERIES * pChData; | Pointer to the first chart data series in the link list of data series.
Library API > Graphics Object Layer API > GOL Objects > Chart > CHART Structure


DATASERIES Structure

Contents | Index | Home
Previous | Up | Next
DATASERIES Structure
Chart
C
typedef struct {
  XCHAR * pSData;
  WORD samples;
  BYTE show;
  WORD * pData;
  void * pNextData;
} DATASERIES;
Overview

Defines a variable for the CHART object. It specifies the number of samples, pointer to the array of samples for the data series and pointer to the next data series. A member of this structure (show) is used as a flag to determine if the series is to be drawn or not. Together with the smplStart and smplEnd it will determine what kind of chart will be drawn.

Members
Members | Description
XCHAR * pSData; | Pointer to the data series name.
WORD samples; | Indicates the number of data samples (or data points) contained in the array specified by pData.
BYTE show; | The flag to indicate if the data series will be shown or not. If this flag is set to SHOW_DATA, the data series will be shown. If HIDE_DATA, the data series will not be shown.
WORD * pData; | Pointer to the array of data samples.
void * pNextData; | Pointer to the next data series. NULL if no other data series follows.
Library API > Graphics Object Layer API > GOL Objects > Chart > DATASERIES Structure


CHARTPARAM Structure

Contents | Index | Home
Previous | Up | Next
CHARTPARAM Structure
Chart
C
typedef struct {
  XCHAR * pTitle;
  XCHAR * pSmplLabel;
  XCHAR * pValLabel;
  SHORT seriesCount;
  WORD smplStart;
  WORD smplEnd;
  WORD valMax;
  WORD valMin;
  WORD perMax;
  WORD perMin;
  GFX_COLOR * pColor;
  void * pTitleFont;
  void * pAxisLabelsFont;
  void * pGridLabelsFont;
} CHARTPARAM;
Overview

Defines the parameters for the CHART object.

Members
Members | Description
XCHAR * pTitle; | Pointer to the Title of the chart.
XCHAR * pSmplLabel; | Pointer to the bar chart sample axis label. Depending
XCHAR * pValLabel; | Pointer to the bar chart value axis label. Depending
SHORT seriesCount; | Number of data series that will be displayed when chart is drawn.
WORD smplStart; | Start point of data sample range to be displayed (minimum/default value = 1)
WORD smplEnd; | End point of data sample range to be displayed.
WORD valMax; | Maximum value of a sample that can be displayed.
WORD valMin; | Minimum value of a sample that can be displayed.
WORD perMax; | Maximum value of the percentage range that can be displayed.
WORD perMin; | Minimum value of the percentage range that can be displayed.
GFX_COLOR * pColor; | Pointer to the color table used to draw the chart data.
void * pTitleFont; | Pointer to the font used for the title label of the chart.
void * pAxisLabelsFont; | Pointer to the font used for X and Y axis labels.
void * pGridLabelsFont; | Pointer to the font used for X and Y axis grid labels.
Library API > Graphics Object Layer API > GOL Objects > Chart > CHARTPARAM Structure


Color Table

Contents | Index | Home
Previous | Up | Next
Color Table
Macros | Chart

Default color table used to draw data points in a chart.

Macros
Name | Description
CH_CLR0 | Bright Blue
CH_CLR1 | Bright Red
CH_CLR2 | Bright Green
CH_CLR3 | Bright Yellow
CH_CLR4 | Orange
CH_CLR5 | Blue
CH_CLR6 | Red
CH_CLR7 | Green
CH_CLR8 | Yellow
CH_CLR9 | Dark Orange
CH_CLR10 | Light Blur
CH_CLR11 | Light Red
CH_CLR12 | Light Green
CH_CLR13 | Light Yellow
CH_CLR14 | Light Orange
CH_CLR15 | Gold
Module

Chart

Links
Macros, Chart
Library API > Graphics Object Layer API > GOL Objects > Chart > Color Table


CH_CLR0 Macro

Contents | Index | Home
Previous | Up | Next
CH_CLR0 Macro
C
#define CH_CLR0 WHITE
Description

Bright Blue

Library API > Graphics Object Layer API > GOL Objects > Chart > Color Table > CH_CLR0 Macro


CH_CLR1 Macro

Contents | Index | Home
Previous | Up | Next
CH_CLR1 Macro
C
#define CH_CLR1 BLACK
Description

Bright Red

Library API > Graphics Object Layer API > GOL Objects > Chart > Color Table > CH_CLR1 Macro


CH_CLR2 Macro

Contents | Index | Home
Previous | Up | Next
CH_CLR2 Macro
C
#define CH_CLR2 WHITE
Description

Bright Green

Library API > Graphics Object Layer API > GOL Objects > Chart > Color Table > CH_CLR2 Macro


CH_CLR3 Macro

Contents | Index | Home
Previous | Up | Next
CH_CLR3 Macro
C
#define CH_CLR3 BLACK
Description

Bright Yellow

Library API > Graphics Object Layer API > GOL Objects > Chart > Color Table > CH_CLR3 Macro


CH_CLR4 Macro

Contents | Index | Home
Previous | Up | Next
CH_CLR4 Macro
C
#define CH_CLR4 WHITE
Description

Orange

Library API > Graphics Object Layer API > GOL Objects > Chart > Color Table > CH_CLR4 Macro


CH_CLR5 Macro

Contents | Index | Home
Previous | Up | Next
CH_CLR5 Macro
C
#define CH_CLR5 BLACK
Description

Blue

Library API > Graphics Object Layer API > GOL Objects > Chart > Color Table > CH_CLR5 Macro


CH_CLR6 Macro

Contents | Index | Home
Previous | Up | Next
CH_CLR6 Macro
C
#define CH_CLR6 WHITE
Description

Red

Library API > Graphics Object Layer API > GOL Objects > Chart > Color Table > CH_CLR6 Macro


CH_CLR7 Macro

Contents | Index | Home
Previous | Up | Next
CH_CLR7 Macro
C
#define CH_CLR7 BLACK
Description

Green

Library API > Graphics Object Layer API > GOL Objects > Chart > Color Table > CH_CLR7 Macro


CH_CLR8 Macro

Contents | Index | Home
Previous | Up | Next
CH_CLR8 Macro
C
#define CH_CLR8 WHITE
Description

Yellow

Library API > Graphics Object Layer API > GOL Objects > Chart > Color Table > CH_CLR8 Macro


CH_CLR9 Macro

Contents | Index | Home
Previous | Up | Next
CH_CLR9 Macro
C
#define CH_CLR9 BLACK
Description

Dark Orange

Library API > Graphics Object Layer API > GOL Objects > Chart > Color Table > CH_CLR9 Macro


CH_CLR10 Macro

Contents | Index | Home
Previous | Up | Next
CH_CLR10 Macro
C
#define CH_CLR10 WHITE
Description

Light Blur

Library API > Graphics Object Layer API > GOL Objects > Chart > Color Table > CH_CLR10 Macro


CH_CLR11 Macro

Contents | Index | Home
Previous | Up | Next
CH_CLR11 Macro
C
#define CH_CLR11 BLACK
Description

Light Red

Library API > Graphics Object Layer API > GOL Objects > Chart > Color Table > CH_CLR11 Macro


CH_CLR12 Macro

Contents | Index | Home
Previous | Up | Next
CH_CLR12 Macro
C
#define CH_CLR12 WHITE
Description

Light Green

Library API > Graphics Object Layer API > GOL Objects > Chart > Color Table > CH_CLR12 Macro


CH_CLR13 Macro

Contents | Index | Home
Previous | Up | Next
CH_CLR13 Macro
C
#define CH_CLR13 BLACK
Description

Light Yellow

Library API > Graphics Object Layer API > GOL Objects > Chart > Color Table > CH_CLR13 Macro


CH_CLR14 Macro

Contents | Index | Home
Previous | Up | Next
CH_CLR14 Macro
C
#define CH_CLR14 WHITE
Description

Light Orange

Library API > Graphics Object Layer API > GOL Objects > Chart > Color Table > CH_CLR14 Macro


CH_CLR15 Macro

Contents | Index | Home
Previous | Up | Next
CH_CLR15 Macro
C
#define CH_CLR15 BLACK
Description

Gold

Library API > Graphics Object Layer API > GOL Objects > Chart > Color Table > CH_CLR15 Macro


Checkbox

Contents | Index | Home
Previous | Up | Next
Checkbox
Functions | Macros | Structures | Topics

Check Box supports Keyboard and Touchscreen inputs, replying to their events with the following messages:

1. CB_MSG_UNCHECKED - When the check box is unchecked.

2. CB_MSG_CHECKED - When check box is unchecked.

The Check Box Object is rendered using the assigned style scheme. The following figure illustrates the color assignments.

Functions
Name | Description
CbCreate | This function creates a CHECKBOX object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
CbDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
CbSetText | This function sets the text that will be used.
CbMsgDefault | This function performs the actual state change based on the translated message given. The following state changes are supported:
CbTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Macros
Name | Description
CbGetText | This macro returns the location of the text used for the check box.
Structures
Name | Description
CHECKBOX | The structure contains check box data
Topics
Name | Description
Check Box States | List of Checkbox bit states.
Links
Functions, GOL Objects, Legend, Macros, Structures, Topics
Library API > Graphics Object Layer API > GOL Objects > Checkbox


Check Box States

Contents | Index | Home
Previous | Up | Next
Check Box States
Macros | Checkbox

List of Checkbox bit states.

Macros
Name | Description
CB_CHECKED | Checked state
CB_DISABLED | Disabled state
CB_DRAW | Whole check box must be redrawn
CB_DRAW_CHECK | Check box mark should be redrawn
CB_DRAW_FOCUS | Focus must be redrawn
CB_FOCUSED | Focus state
CB_HIDE | Check box must be removed from screen
Module

Checkbox

Links
Macros, Checkbox
Library API > Graphics Object Layer API > GOL Objects > Checkbox > Check Box States


CB_CHECKED Macro

Contents | Index | Home
Previous | Up | Next
CB_CHECKED Macro
C
#define CB_CHECKED 0x0004  // Checked state
Description

Checked state

Library API > Graphics Object Layer API > GOL Objects > Checkbox > Check Box States > CB_CHECKED Macro


CB_DISABLED Macro

Contents | Index | Home
Previous | Up | Next
CB_DISABLED Macro
C
#define CB_DISABLED 0x0002  // Disabled state
Description

Disabled state

Library API > Graphics Object Layer API > GOL Objects > Checkbox > Check Box States > CB_DISABLED Macro


CB_DRAW Macro

Contents | Index | Home
Previous | Up | Next
CB_DRAW Macro
C
#define CB_DRAW 0x4000  // Whole check box must be redrawn
Description

Whole check box must be redrawn

Library API > Graphics Object Layer API > GOL Objects > Checkbox > Check Box States > CB_DRAW Macro


CB_DRAW_CHECK Macro

Contents | Index | Home
Previous | Up | Next
CB_DRAW_CHECK Macro
C
#define CB_DRAW_CHECK 0x1000  // Check box mark should be redrawn
Description

Check box mark should be redrawn

Library API > Graphics Object Layer API > GOL Objects > Checkbox > Check Box States > CB_DRAW_CHECK Macro


CB_DRAW_FOCUS Macro

Contents | Index | Home
Previous | Up | Next
CB_DRAW_FOCUS Macro
C
#define CB_DRAW_FOCUS 0x2000  // Focus must be redrawn
Description

Focus must be redrawn

Library API > Graphics Object Layer API > GOL Objects > Checkbox > Check Box States > CB_DRAW_FOCUS Macro


CB_FOCUSED Macro

Contents | Index | Home
Previous | Up | Next
CB_FOCUSED Macro
C
#define CB_FOCUSED 0x0001  // Focus state
Description

Focus state

Library API > Graphics Object Layer API > GOL Objects > Checkbox > Check Box States > CB_FOCUSED Macro


CB_HIDE Macro

Contents | Index | Home
Previous | Up | Next
CB_HIDE Macro
C
#define CB_HIDE 0x8000  // Check box must be removed from screen
Description

Check box must be removed from screen

Library API > Graphics Object Layer API > GOL Objects > Checkbox > Check Box States > CB_HIDE Macro


CbCreate Function

Contents | Index | Home
Previous | Up | Next
CbCreate Function
Checkbox
C
CHECKBOX * CbCreate(
    WORD ID,
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    WORD state,
    XCHAR * pText,
    GOL_SCHEME * pScheme
);
Overview

This function creates a CHECKBOX object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.

Input Parameters
Input Parameters | Description
WORD ID | Unique user defined ID for the object instance.
SHORT left | Left most position of the Object.
SHORT top | Top most position of the Object.
SHORT right | Right most position of the Object
SHORT bottom | Bottom most position of the object
WORD state | Sets the initial state of the object
XCHAR * pText | Pointer to the text of the check box.
GOL_SCHEME * pScheme | Pointer to the style scheme
Returns

Returns the pointer to the object created

Preconditions

none

Side Effects

none

Example
Copy Code
GOL_SCHEME *pScheme;
CHECKBOX *pCb[2];

    pScheme = GOLCreateScheme();
    pCb = CbCreate(ID_CHECKBOX1,          // ID
                   20,135,150,175,        // dimension
                   CB_DRAW,               // Draw the object
                   "Scale",               // text
                   pScheme);              // use this scheme

    pCb = CbCreate(ID_CHECKBOX2,          // ID
                   170,135,300,175,       // dimension
                   CB_DRAW,               // Draw the object
                   "Animate",             // text
                   pScheme);              // use this scheme

    while(!CbDraw(pCb[0]));               // draw the objects
    while(!CbDraw(pCb[1]));
Library API > Graphics Object Layer API > GOL Objects > Checkbox > CbCreate Function


CbDraw Function

Contents | Index | Home
Previous | Up | Next
CbDraw Function
Checkbox
C
WORD CbDraw(
    void * pObj
);
Overview

This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set.

When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.

Input Parameters
Input Parameters | Description
pCb | Pointer to the object to be rendered.
Returns

Returns the status of the drawing

  • 1 - If the rendering was completed and
  • 0 - If the rendering is not yet finished.

Next call to the function will resume the rendering on the pending drawing state.

Preconditions

Object must be created before this function is called.

Side Effects

none

Example

See CbCreate() Example.

Library API > Graphics Object Layer API > GOL Objects > Checkbox > CbDraw Function


CbGetText Macro

Contents | Index | Home
Previous | Up | Next
CbGetText Macro
Checkbox
C
#define CbGetText(pCb) pCb->pText
Overview

This macro returns the location of the text used for the check box.

Input Parameters
Input Parameters | Description
pCb | Pointer to the object
Returns

Returns the location of the text used.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Checkbox > CbGetText Macro


CbSetText Function

Contents | Index | Home
Previous | Up | Next
CbSetText Function
Checkbox
C
void CbSetText(
    CHECKBOX * pCb,
    XCHAR * pText
);
Overview

This function sets the text that will be used.

Input Parameters
Input Parameters | Description
CHECKBOX * pCb | The pointer to the check box whose text will be modified.
XCHAR * pText | The pointer to the text that will be used.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Checkbox > CbSetText Function


CbMsgDefault Function

Contents | Index | Home
Previous | Up | Next
CbMsgDefault Function
Checkbox
C
void CbMsgDefault(
    WORD translatedMsg,
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function performs the actual state change based on the translated message given. The following state changes are supported:

Translated Message | Input Source | Set/Clear State Bit | Description
CB_MSG_CHECKED | Touch Screen, Keyboard | Set CB_CHECKED | Check Box will be redrawn in checked state.
CB_MSG_UNCHECKED | Touch Screen, Keyboard | Clear CB_CHECKED | Check Box will be redrawn in un-checked state.
Input Parameters
Input Parameters | Description
WORD translatedMsg | The translated message
GOL_MSG * pMsg | The pointer to the GOL message
pCb | The pointer to the object whose state will be modified
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Checkbox > CbMsgDefault Function


CbTranslateMsg Function

Contents | Index | Home
Previous | Up | Next
CbTranslateMsg Function
Checkbox
C
WORD CbTranslateMsg(
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.

Translated Message | Input Source | Events | Description
CB_MSG_CHECKED | Touch Screen | EVENT_PRESS | If events occurs and the x,y position falls in the area of the check box while the check box is unchecked.
 | Keyboard | EVENT_KEYSCAN | If event occurs and parameter1 passed matches the object’s ID and parameter 2 passed matches SCAN_CR_PRESSED or SCAN_SPACE_PRESSED while the check box is unchecked.
CB_MSG_UNCHECKED | Touch Screen | EVENT_PRESS | If events occurs and the x,y position falls in the area of the check box while the check box is checked.
 | Keyboard | EVENT_KEYSCAN | If event occurs and parameter1 passed matches the object’s ID and parameter 2 passed matches SCAN_CR_PRESSED or SCAN_SPACE_PRESSED while the check box is checked.
OBJ_MSG_INVALID | Any | Any | If the message did not affect the object.
Input Parameters
Input Parameters | Description
GOL_MSG * pMsg | pointer to the message struct containing the message the user
pCb | the pointer to the object where the message will be evaluated to check if the message will affect the object
Returns

Returns the translated message depending on the received GOL message:

  • CB_MSG_CHECKED – Check Box is checked.
  • CB_MSG_UNCHECKED – Check Box is unchecked.
  • OBJ_MSG_INVALID – Check Box is not affected.

Preconditions

none

Side Effects

none

Example

Usage is similar to BtnTranslateMsg() example.

Library API > Graphics Object Layer API > GOL Objects > Checkbox > CbTranslateMsg Function


CHECKBOX Structure

Contents | Index | Home
Previous | Up | Next
CHECKBOX Structure
Checkbox
C
typedef struct {
  OBJ_HEADER hdr;
  SHORT textHeight;
  XCHAR * pText;
} CHECKBOX;
Overview

The structure contains check box data

Members
Members | Description
OBJ_HEADER hdr; | Generic header for all Objects (see OBJ_HEADER).
SHORT textHeight; | Pre-computed text height
XCHAR * pText; | Pointer to text
Library API > Graphics Object Layer API > GOL Objects > Checkbox > CHECKBOX Structure


Round Dial

Contents | Index | Home
Previous | Up | Next
Round Dial
Functions | Macros | Structures | Topics

Dial supports only Touchscreen inputs, replying to their events with the following messages:

1. RD_MSG_CLOCKWISE - When movement of the touch is in the face of the dial and in the clockwise direction.

2. RD_MSG_CTR_CLOCKWISE - When movement of the touch is in the face of the dial and in the counter clockwise direction.

The Dial object is rendered using the assigned style scheme. The following figure illustrates the color assignments.

Functions
Name | Description
RdiaCreate | This function creates a ROUNDDIAL object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
RdiaDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the center (x,y) postion and the radius parameters. The colors used are dependent on the state of the object. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
RdiaMsgDefault | This function performs the actual state change based on the translated message given. The following state changes are supported:
RdiaTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen inputs.
Macros
Name | Description
RdiaIncVal | Used to directly increment the value. The delta change used is the resolution setting (res).
RdiaDecVal | Used to directly decrement the value. The delta change used is the resolution setting (res).
RdiaGetVal | Returns the current dial value. Value is always in the 0-max range inclusive.
RdiaSetVal | Sets the value to the given new value. Value set must be in 0-max range inclusive.
Structures
Name | Description
ROUNDDIAL | Defines the parameters required for a dial Object. The curr_xPos, curr_yPos, new_xPos and new_yPos parameters are internally generated to aid in the redrawing of the dial. User must avoid modifying these values.
Topics
Name | Description
Dial States | List of Dial bit states.
Links
Functions, GOL Objects, Legend, Macros, Structures, Topics
Library API > Graphics Object Layer API > GOL Objects > Round Dial


Dial States

Contents | Index | Home
Previous | Up | Next
Dial States
Macros | Round Dial

List of Dial bit states.

Macros
Name | Description
RDIA_DISABLED | Bit for disabled state.
RDIA_DRAW | Bit to indicate object must be redrawn.
RDIA_HIDE | Bit to indicate object must be removed from screen.
RDIA_ROT_CCW | Bit for rotate counter clockwise state.
RDIA_ROT_CW | Bit for rotate clockwise state.
Module

Round Dial

Links
Macros, Round Dial
Library API > Graphics Object Layer API > GOL Objects > Round Dial > Dial States


RDIA_DISABLED Macro

Contents | Index | Home
Previous | Up | Next
RDIA_DISABLED Macro
C
#define RDIA_DISABLED 0x0002  // Bit for disabled state.
Description

Bit for disabled state.

Library API > Graphics Object Layer API > GOL Objects > Round Dial > Dial States > RDIA_DISABLED Macro


RDIA_DRAW Macro

Contents | Index | Home
Previous | Up | Next
RDIA_DRAW Macro
C
#define RDIA_DRAW 0x4000  // Bit to indicate object must be redrawn.
Description

Bit to indicate object must be redrawn.

Library API > Graphics Object Layer API > GOL Objects > Round Dial > Dial States > RDIA_DRAW Macro


RDIA_HIDE Macro

Contents | Index | Home
Previous | Up | Next
RDIA_HIDE Macro
C
#define RDIA_HIDE 0x8000  // Bit to indicate object must be removed from screen.
Description

Bit to indicate object must be removed from screen.

Library API > Graphics Object Layer API > GOL Objects > Round Dial > Dial States > RDIA_HIDE Macro


RDIA_ROT_CCW Macro

Contents | Index | Home
Previous | Up | Next
RDIA_ROT_CCW Macro
C
#define RDIA_ROT_CCW 0x0008  // Bit for rotate counter clockwise state.
Description

Bit for rotate counter clockwise state.

Library API > Graphics Object Layer API > GOL Objects > Round Dial > Dial States > RDIA_ROT_CCW Macro


RDIA_ROT_CW Macro

Contents | Index | Home
Previous | Up | Next
RDIA_ROT_CW Macro
C
#define RDIA_ROT_CW 0x0004  // Bit for rotate clockwise state.
Description

Bit for rotate clockwise state.

Library API > Graphics Object Layer API > GOL Objects > Round Dial > Dial States > RDIA_ROT_CW Macro


RdiaCreate Function

Contents | Index | Home
Previous | Up | Next
RdiaCreate Function
Round Dial
C
ROUNDDIAL * RdiaCreate(
    WORD ID,
    SHORT x,
    SHORT y,
    SHORT radius,
    WORD state,
    SHORT res,
    SHORT value,
    SHORT max,
    GOL_SCHEME * pScheme
);
Overview

This function creates a ROUNDDIAL object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.

Input Parameters
Input Parameters | Description
WORD ID | Unique user defined ID for the object instance.
SHORT x | Location of the center of the dial in the x coordinate.
SHORT y | Location of the center of the dial in the y coordinate.
SHORT radius | Defines the radius of the dial.
WORD state | Sets the initial state of the object.
SHORT res | Sets the resolution of the dial when rotating clockwise or counter clockwise.
SHORT value | Sets the initial value of the dial.
SHORT max | Sets the maximum value of the dial.
GOL_SCHEME * pScheme | Pointer to the style scheme used.
Returns

Returns the pointer to the object created.

Preconditions

none

Side Effects

none

Example
Copy Code
GOL_SCHEME *pScheme;
ROUNDDIAL *pDial;
WORD state;

    pScheme = GOLCreateScheme();
    state = RDIA_DRAW;

    // creates a dial at (50,50) x,y location, with an initial value
    // of 50, a resolution of 2 and maximum value of 100.
    pDial = RdiaCreate(1,50,50,25,118,0, state, 2, 50, 100, pScheme);
    // check if dial was created
    if (pDial == NULL)
       return 0;

    return 1;
Library API > Graphics Object Layer API > GOL Objects > Round Dial > RdiaCreate Function


RdiaDraw Function

Contents | Index | Home
Previous | Up | Next
RdiaDraw Function
Round Dial
C
WORD RdiaDraw(
    void * pObj
);
Overview

This function renders the object on the screen using the current parameter settings. Location of the object is determined by the center (x,y) postion and the radius parameters. The colors used are dependent on the state of the object.

When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.

Input Parameters
Input Parameters | Description
pDia | Pointer to the object
Returns

Returns the status of the drawing

  • 1 - If the rendering was completed and
  • 0 - If the rendering is not yet finished.

Preconditions

Object must be created before this function is called.

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Round Dial > RdiaDraw Function


RdiaIncVal Macro

Contents | Index | Home
Previous | Up | Next
RdiaIncVal Macro
Round Dial
C
#define RdiaIncVal(pDia) RdiaSetVal(pDia, (pDia->val + pDia->res))
Overview

Used to directly increment the value. The delta change used is the resolution setting (res).

Input Parameters
Input Parameters | Description
pDia | Pointer to the object.
Returns

none

Preconditions

none

Side Effects

none

Example
Copy Code
WORD updatedVal, prevVal;
ROUNDDIAL *pDia;

    // assuming pDia is initialized to an existing dial Object
    // assume GetInput() is a function that retrieves source data
    prevVal = RdiaGetVal(pDia);
    updatedVal = GetInput();
    if (updatedVal > prevVal)
        RdiaIncVal(pDia);
    if (updatedVal < prevVal)
        RdiaDecVal(pDia);
Library API > Graphics Object Layer API > GOL Objects > Round Dial > RdiaIncVal Macro


RdiaDecVal Macro

Contents | Index | Home
Previous | Up | Next
RdiaDecVal Macro
Round Dial
C
#define RdiaDecVal(pDia) RdiaSetVal(pDia, (pDia->pos - pDia->res))
Overview

Used to directly decrement the value. The delta change used is the resolution setting (res).

Input Parameters
Input Parameters | Description
pDia | Pointer to the object.
Returns

none

Preconditions

none

Side Effects

none

Example

Refer to RdiaIncVal() example.

Library API > Graphics Object Layer API > GOL Objects > Round Dial > RdiaDecVal Macro


RdiaGetVal Macro

Contents | Index | Home
Previous | Up | Next
RdiaGetVal Macro
Round Dial
C
#define RdiaGetVal(pDia) (pDia)->value
Overview

Returns the current dial value. Value is always in the 0-max range inclusive.

Input Parameters
Input Parameters | Description
pDia | Pointer to the object.
Returns

Returns the current value of the dial.

Preconditions

none

Side Effects

none

Example
Copy Code
WORD currVal;
ROUNDDIAL *pDia;

    // assuming pDia is initialized to an existing dial Object
    currVal = RdiaGetVal(pDia);
Library API > Graphics Object Layer API > GOL Objects > Round Dial > RdiaGetVal Macro


RdiaSetVal Macro

Contents | Index | Home
Previous | Up | Next
RdiaSetVal Macro
Round Dial
C
#define RdiaSetVal(pDia, newVal) (pDia)->value = newVal
Overview

Sets the value to the given new value. Value set must be in 0-max range inclusive.

Input Parameters
Input Parameters | Description
pDia | Pointer to the object.
newVal | New dial value.
Returns

none

Preconditions

none

Side Effects

none

Example
Copy Code
WORD updatedVal;
ROUNDDIAL *pDia;

    // assuming pDia is initialized to an existing dial Object
    // assume GetInput() is a function that retrieves source data
    updatedVal = GetInput();
    RdiaSetVal(pDia, updatedVal);
Library API > Graphics Object Layer API > GOL Objects > Round Dial > RdiaSetVal Macro


RdiaMsgDefault Function

Contents | Index | Home
Previous | Up | Next
RdiaMsgDefault Function
Round Dial
C
void RdiaMsgDefault(
    WORD translatedMsg,
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function performs the actual state change based on the translated message given. The following state changes are supported:

Translated Message | Input Source | Set/Clear State Bit | Description
RD_MSG_CLOCKWISE | Touch Screen | Set RDIA_ROT_CW, Set RDIA_DRAW | Dial will be redrawn with clockwise update.
RD_MSG_CTR_CLOCKWISE | Touch Screen | Set RDIA_ROT_CCW, Set RDIA_DRAW | Dial will be redrawn with counter clockwise update.
Input Parameters
Input Parameters | Description
WORD translatedMsg | The translated message
GOL_MSG * pMsg | The pointer to the GOL message
pDia | The pointer to the object whose state will be modified
Returns

none

Preconditions

none

Side Effects

none

Example

See RdiaTranslateMsg() example.

Library API > Graphics Object Layer API > GOL Objects > Round Dial > RdiaMsgDefault Function


RdiaTranslateMsg Function

Contents | Index | Home
Previous | Up | Next
RdiaTranslateMsg Function
Round Dial
C
WORD RdiaTranslateMsg(
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen inputs.

Translated Message | Input Source | Events | Description
RD_MSG_CLOCKWISE | Touch Screen | EVENT_MOVE | If events occurs and the x,y position falls in the face of the Dial and moving in the clockwise rotation.
RD_MSG_CTR_CLOCKWISE | Touch Screen | EVENT_MOVE | If events occurs and the x,y position falls in the face of the Dial and moving in the counter clockwise rotation.
OBJ_MSG_INVALID | Any | Any | If the message did not affect the object.
Input Parameters
Input Parameters | Description
GOL_MSG * pMsg | Pointer to the message struct containing the message from the user interface.
pDia | The pointer to the object where the message will be evaluated to check if the message will affect the object.
Returns

Returns the translated message depending on the received GOL message:

  • RD_MSG_CLOCKWISE – Dial is moved in a clockwise direction.
  • RD_MSG_CTR_CLOCKWISE – Dial is moved in a counter clockwise direction.
  • OBJ_MSG_INVALID – Dial is not affected

Preconditions

none

Side Effects

none

Example
Copy Code
void MyGOLMsg(GOL_MSG *pMsg){

    OBJ_HEADER *pCurrentObj;
    WORD objMsg;

    if(pMsg->event == EVENT_INVALID)
        return;
    pCurrentObj = GOLGetList();

    while(pCurrentObj != NULL){
        // Process only ROUNDDIAL
        if(!IsObjUpdated(pCurrentObj)){
            switch(pCurrentObj->type){
                case OBJ_ROUNDIAL:
                    objMsg = RdiaTranslateMsg((ROUNDDIAL*)pCurrentObj, pMsg);
                    if(objMsg == OBJ_MSG_INVALID)
                        break;
                    if(GOLMsgCallback(objMsg,pCurrentObj,pMsg))
                        RdiaMsgDefault(objMsg,(ROUNDDIAL*)pCurrentObj);
                    break;
                default: break;
            }
        }
    }
    pCurrentObj = pCurrentObj->pNxtObj;
}
Library API > Graphics Object Layer API > GOL Objects > Round Dial > RdiaTranslateMsg Function


ROUNDDIAL Structure

Contents | Index | Home
Previous | Up | Next
ROUNDDIAL Structure
Round Dial
C
typedef struct {
  OBJ_HEADER hdr;
  SHORT xCenter;
  SHORT yCenter;
  SHORT radius;
  SHORT value;
  WORD max;
  WORD res;
  SHORT curr_xPos;
  SHORT curr_yPos;
  SHORT new_xPos;
  SHORT new_yPos;
  SHORT vAngle;
} ROUNDDIAL;
Overview

Defines the parameters required for a dial Object. The curr_xPos, curr_yPos, new_xPos and new_yPos parameters are internally generated to aid in the redrawing of the dial. User must avoid modifying these values.

Members
Members | Description
OBJ_HEADER hdr; | Generic header for all Objects (see OBJ_HEADER).
SHORT xCenter; | x coordinate center position.
SHORT yCenter; | y coordinate center position.
SHORT radius; | Radius of the dial.
SHORT value; | Initial value of the dial.
WORD max; | Maximum value of variable value (maximum = 65535).
WORD res; | Resolution of movement.
SHORT curr_xPos; | Current x position.
SHORT curr_yPos; | Current y position.
SHORT new_xPos; | New x position.
SHORT new_yPos; | New y position.
Library API > Graphics Object Layer API > GOL Objects > Round Dial > ROUNDDIAL Structure


Digital Meter

Contents | Index | Home
Previous | Up | Next
Digital Meter
Functions | Macros | Structures | Topics

DigitalMeter supports only Touchscreen inputs, replying to touch screen events with the message:

DM_MSG_SELECTED.

The DigitalMeter object is rendered using the assigned style scheme. The following figure illustrates the color assignments for the digital meter.

Functions
Name | Description
DmCreate | This function creates a DIGITALMETER object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
DmDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
DmSetValue | This function sets the value that will be used for the object.
DmTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Macros
Name | Description
DmGetValue | This macro returns the current value used for the object.
DmDecVal | This macro is used to directly decrement the value.
DmIncVal | This macro is used to directly increment the value.
Structures
Name | Description
DIGITALMETER | Defines the parameters required for a Digital Meter Object.
Topics
Name | Description
Digital Meter States | List of Digital Meter bit states.
Links
Functions, GOL Objects, Legend, Macros, Structures, Topics
Library API > Graphics Object Layer API > GOL Objects > Digital Meter


Digital Meter States

Contents | Index | Home
Previous | Up | Next
Digital Meter States
Macros | Digital Meter

List of Digital Meter bit states.

Macros
Name | Description
DM_DISABLED | Bit for disabled state.
DM_DRAW | Bit to indicate object must be redrawn.
DM_HIDE | Bit to remove object from screen.
DM_CENTER_ALIGN | Bit to indicate value is center aligned.
DM_RIGHT_ALIGN | Bit to indicate value is left aligned.
DM_FRAME | Bit to indicate frame is displayed.
DM_UPDATE | Bit to indicate that only text must be redrawn.
Module

Digital Meter

Links
Macros, Digital Meter
Library API > Graphics Object Layer API > GOL Objects > Digital Meter > Digital Meter States


DM_DISABLED Macro

Contents | Index | Home
Previous | Up | Next
DM_DISABLED Macro
C
#define DM_DISABLED 0x0002  // Bit for disabled state.
Description

Bit for disabled state.

Library API > Graphics Object Layer API > GOL Objects > Digital Meter > Digital Meter States > DM_DISABLED Macro


DM_DRAW Macro

Contents | Index | Home
Previous | Up | Next
DM_DRAW Macro
C
#define DM_DRAW 0x4000  // Bit to indicate object must be redrawn.
Description

Bit to indicate object must be redrawn.

Library API > Graphics Object Layer API > GOL Objects > Digital Meter > Digital Meter States > DM_DRAW Macro


DM_HIDE Macro

Contents | Index | Home
Previous | Up | Next
DM_HIDE Macro
C
#define DM_HIDE 0x8000  // Bit to remove object from screen.
Description

Bit to remove object from screen.

Library API > Graphics Object Layer API > GOL Objects > Digital Meter > Digital Meter States > DM_HIDE Macro


DM_CENTER_ALIGN Macro

Contents | Index | Home
Previous | Up | Next
DM_CENTER_ALIGN Macro
C
#define DM_CENTER_ALIGN 0x0008  // Bit to indicate value is center aligned.
Description

Bit to indicate value is center aligned.

Library API > Graphics Object Layer API > GOL Objects > Digital Meter > Digital Meter States > DM_CENTER_ALIGN Macro


DM_RIGHT_ALIGN Macro

Contents | Index | Home
Previous | Up | Next
DM_RIGHT_ALIGN Macro
C
#define DM_RIGHT_ALIGN 0x0004  // Bit to indicate value is left aligned.
Description

Bit to indicate value is left aligned.

Library API > Graphics Object Layer API > GOL Objects > Digital Meter > Digital Meter States > DM_RIGHT_ALIGN Macro


DM_FRAME Macro

Contents | Index | Home
Previous | Up | Next
DM_FRAME Macro
C
#define DM_FRAME 0x0010  // Bit to indicate frame is displayed.
Description

Bit to indicate frame is displayed.

Library API > Graphics Object Layer API > GOL Objects > Digital Meter > Digital Meter States > DM_FRAME Macro


DM_UPDATE Macro

Contents | Index | Home
Previous | Up | Next
DM_UPDATE Macro
C
#define DM_UPDATE 0x2000  // Bit to indicate that only text must be redrawn.
Description

Bit to indicate that only text must be redrawn.

Library API > Graphics Object Layer API > GOL Objects > Digital Meter > Digital Meter States > DM_UPDATE Macro


DmCreate Function

Contents | Index | Home
Previous | Up | Next
DmCreate Function
Digital Meter
C
DIGITALMETER * DmCreate(
    WORD ID,
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    WORD state,
    DWORD Value,
    BYTE NoOfDigits,
    BYTE DotPos,
    GOL_SCHEME * pScheme
);
Overview

This function creates a DIGITALMETER object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.

Input Parameters
Input Parameters | Description
WORD ID | Unique user defined ID for the object instance.
SHORT left | Left most position of the object.
SHORT top | Top most position of the object.
SHORT right | Right most position of the object.
SHORT bottom | Bottom most position of the object.
WORD state | Sets the initial state of the object.
DWORD Value | Sets the initial value to be displayed
BYTE NoOfDigits | Sets the number of digits to be displayed
BYTE DotPos | Sets the position of decimal point in the display
GOL_SCHEME * pScheme | Pointer to the style scheme. Set to NULL if default style scheme is used.
Returns

Returns the pointer to the object created.

Preconditions

none

Side Effects

none

Example
GOL_SCHEME *pScheme;
DIGITALMETER *pDm;

    pScheme = GOLCreateScheme();
    state = DM_DRAW | DM_FRAME | DM_CENTER_ALIGN;
    DmCreate(ID_DIGITALMETER1,          // ID
             30,80,235,160,           // dimension
             state,                   // has frame and center aligned
             789,4,1,                 // to display 078.9
             pScheme);                // use given scheme

    while(!DmDraw(pDm));              // draw the object
Library API > Graphics Object Layer API > GOL Objects > Digital Meter > DmCreate Function


DmDraw Function

Contents | Index | Home
Previous | Up | Next
DmDraw Function
Digital Meter
C
WORD DmDraw(
    void * pObj
);
Overview

This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set.

When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.

Input Parameters
Input Parameters | Description
pDm | Pointer to the object to be rendered.
Returns

Returns the status of the drawing

  • 1 - If the rendering was completed and
  • 0 - If the rendering is not yet finished.
Next call to the function will resume the rendering on the pending drawing state.

Preconditions

Object must be created before this function is called.

Side Effects

none

Example

See DmCreate() Example.

Library API > Graphics Object Layer API > GOL Objects > Digital Meter > DmDraw Function


DmGetValue Macro

Contents | Index | Home
Previous | Up | Next
DmGetValue Macro
Digital Meter
C
#define DmGetValue(pDm) pDm->Cvalue
Overview

This macro returns the current value used for the object.

Input Parameters
Input Parameters | Description
pDm | Pointer to the object.
Returns

Returns the value used.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Digital Meter > DmGetValue Macro


DmSetValue Function

Contents | Index | Home
Previous | Up | Next
DmSetValue Function
Digital Meter
C
void DmSetValue(
    DIGITALMETER * pDm,
    DWORD Value
);
Overview

This function sets the value that will be used for the object.

Input Parameters
Input Parameters | Description
DIGITALMETER * pDm | The pointer to the object whose value will be modified.
DWORD Value | New value to be set for the Digital Meter.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Digital Meter > DmSetValue Function


DmDecVal Macro

Contents | Index | Home
Previous | Up | Next
DmDecVal Macro
Digital Meter
C
#define DmDecVal(pDm, deltaValue) DmSetValue(pDm, (pDm->Cvalue - deltaValue))
Overview

This macro is used to directly decrement the value.

Input Parameters
Input Parameters | Description
pDm | Pointer to the object.
deltaValue | Number to be subtracted to the current Digital Meter value.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Digital Meter > DmDecVal Macro


DmIncVal Macro

Contents | Index | Home
Previous | Up | Next
DmIncVal Macro
Digital Meter
C
#define DmIncVal(pDm, deltaValue) DmSetValue(pDm, (pDm->Cvalue + deltaValue))
Overview

This macro is used to directly increment the value.

Input Parameters
Input Parameters | Description
pDm | Pointer to the object.
deltaValue | Number to be added to the current Digital Meter value.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Digital Meter > DmIncVal Macro


DmTranslateMsg Function

Contents | Index | Home
Previous | Up | Next
DmTranslateMsg Function
Digital Meter
C
WORD DmTranslateMsg(
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.

Translated Message | Input Source | Events | Description
DM_MSG_SELECTED | Touch Screen | EVENT_PRESS, EVENT_RELEASE | If events occurs and the x,y position falls in the area of the Digital Meter.
OBJ_MSG_INVALID | Any | Any | If the message did not affect the object.
Input Parameters
Input Parameters | Description
GOL_MSG * pMsg | Pointer to the message struct containing the message from the user interface.
pDm | The pointer to the object where the message will be evaluated to check if the message will affect the object.
Returns

Returns the translated message depending on the received GOL message:

  • DM_MSG_SELECTED – Digital Meter is selected
  • OBJ_MSG_INVALID – Digital Meter is not affected

Preconditions

none

Side Effects

none

Example

Usage is similar to BtnTranslateMsg() example.

Library API > Graphics Object Layer API > GOL Objects > Digital Meter > DmTranslateMsg Function


DIGITALMETER Structure

Contents | Index | Home
Previous | Up | Next
DIGITALMETER Structure
Digital Meter
C
typedef struct {
  OBJ_HEADER hdr;
  SHORT textHeight;
  DWORD Cvalue;
  DWORD Pvalue;
  BYTE NoOfDigits;
  BYTE DotPos;
} DIGITALMETER;
Overview

Defines the parameters required for a Digital Meter Object.

Description

Structure: DIGITALMETER

Members
Members | Description
OBJ_HEADER hdr; | Generic header for all Objects (see OBJ_HEADER).
SHORT textHeight; | Pre-computed text height
DWORD Cvalue; | Current value
DWORD Pvalue; | Previous value
BYTE NoOfDigits; | Number of digits to be displayed
BYTE DotPos; | Position of decimal point
Library API > Graphics Object Layer API > GOL Objects > Digital Meter > DIGITALMETER Structure


Edit Box

Contents | Index | Home
Previous | Up | Next
Edit Box
Functions | Macros | Structures | Topics

Edit Box supports only Keyboard inputs, replying to their events with the following messages:

1. EB_MSG_CHAR - when a character is to be inserted at the end of the current text.

2. EB_MSG_DEL - when a character is to be removed from the current text.

The Edit Box Object is rendered using the assigned style scheme. The following figure illustrates the color assignments.

Functions
Name | Description
EbCreate | This function creates a EDITBOX object with the parameters given and initializes the default settings. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
EbDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
EbSetText | This function sets the text to be used for the object.
EbAddChar | This function inserts a character at the end of the text used by the object.
EbDeleteChar | This function removes a character at the end of the text used by the object.
EbMsgDefault | This function performs the actual state change based on the translated message given. The following state changes are supported:
EbTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Macros
Name | Description
EbGetText | This macro returns the address of the current text string used for the object.
Structures
Name | Description
EDITBOX | Defines the parameters required for a Edit Box Object.
Topics
Name | Description
Edit Box States | List of Edit Box bit states.
Links
Functions, GOL Objects, Legend, Macros, Structures, Topics
Library API > Graphics Object Layer API > GOL Objects > Edit Box


Edit Box States

Contents | Index | Home
Previous | Up | Next
Edit Box States
Macros | Edit Box

List of Edit Box bit states.

Macros
Name | Description
EB_CENTER_ALIGN | Bit to indicate text is center aligned.
EB_DISABLED | Bit for disabled state.
EB_DRAW | Bit to indicate whole edit box must be redrawn.
EB_HIDE | Bit to remove object from screen.
EB_FOCUSED | Bit for focused state. Cursor caret will be drawn when EB_DRAW_CARET is also set.
EB_RIGHT_ALIGN | Bit to indicate text is left aligned.
EB_DRAW_CARET | Bit to indicate the cursor caret will be drawn if EB_FOCUSED state bit is set and erase when EB_FOCUSED state bit is not set.
EB_CARET | Bit to indicate the cursor caret will always be shown.
Module

Edit Box

Links
Macros, Edit Box
Library API > Graphics Object Layer API > GOL Objects > Edit Box > Edit Box States


EB_CENTER_ALIGN Macro

Contents | Index | Home
Previous | Up | Next
EB_CENTER_ALIGN Macro
C
#define EB_CENTER_ALIGN 0x0008  // Bit to indicate text is center aligned.
Description

Bit to indicate text is center aligned.

Library API > Graphics Object Layer API > GOL Objects > Edit Box > Edit Box States > EB_CENTER_ALIGN Macro


EB_DISABLED Macro

Contents | Index | Home
Previous | Up | Next
EB_DISABLED Macro
C
#define EB_DISABLED 0x0002  // Bit for disabled state.
Description

Bit for disabled state.

Library API > Graphics Object Layer API > GOL Objects > Edit Box > Edit Box States > EB_DISABLED Macro


EB_DRAW Macro

Contents | Index | Home
Previous | Up | Next
EB_DRAW Macro
C
#define EB_DRAW 0x4000  // Bit to indicate whole edit box must be redrawn.
Description

Bit to indicate whole edit box must be redrawn.

Library API > Graphics Object Layer API > GOL Objects > Edit Box > Edit Box States > EB_DRAW Macro


EB_HIDE Macro

Contents | Index | Home
Previous | Up | Next
EB_HIDE Macro
C
#define EB_HIDE 0x8000  // Bit to remove object from screen.
Description

Bit to remove object from screen.

Library API > Graphics Object Layer API > GOL Objects > Edit Box > Edit Box States > EB_HIDE Macro


EB_FOCUSED Macro

Contents | Index | Home
Previous | Up | Next
EB_FOCUSED Macro
C
#define EB_FOCUSED 0x0001  // Bit for focused state. Cursor caret will be drawn when EB_DRAW_CARET is also set.
Description

Bit for focused state. Cursor caret will be drawn when EB_DRAW_CARET is also set.

Library API > Graphics Object Layer API > GOL Objects > Edit Box > Edit Box States > EB_FOCUSED Macro


EB_RIGHT_ALIGN Macro

Contents | Index | Home
Previous | Up | Next
EB_RIGHT_ALIGN Macro
C
#define EB_RIGHT_ALIGN 0x0004  // Bit to indicate text is left aligned.
Description

Bit to indicate text is left aligned.

Library API > Graphics Object Layer API > GOL Objects > Edit Box > Edit Box States > EB_RIGHT_ALIGN Macro


EB_DRAW_CARET Macro

Contents | Index | Home
Previous | Up | Next
EB_DRAW_CARET Macro
C
#define EB_DRAW_CARET 0x2000  // Bit to indicate the cursor caret will be drawn if EB_FOCUSED state bit is set and erase when EB_FOCUSED state bit is not set.
Description

Bit to indicate the cursor caret will be drawn if EB_FOCUSED state bit is set and erase when EB_FOCUSED state bit is not set.

Library API > Graphics Object Layer API > GOL Objects > Edit Box > Edit Box States > EB_DRAW_CARET Macro


EB_CARET Macro

Contents | Index | Home
Previous | Up | Next
EB_CARET Macro
C
#define EB_CARET 0x0010  // Bit to indicate the cursor caret will always be shown.
Description

Bit to indicate the cursor caret will always be shown.

Library API > Graphics Object Layer API > GOL Objects > Edit Box > Edit Box States > EB_CARET Macro


EbCreate Function

Contents | Index | Home
Previous | Up | Next
EbCreate Function
Edit Box
C
EDITBOX * EbCreate(
    WORD ID,
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    WORD state,
    XCHAR * pText,
    WORD charMax,
    GOL_SCHEME * pScheme
);
Overview

This function creates a EDITBOX object with the parameters given and initializes the default settings. It automatically attaches the new object into a global linked list of objects and returns the address of the object.

Input Parameters
Input Parameters | Description
WORD ID | Unique user defined ID for the object instance.
SHORT left | Left most position of the Object.
SHORT top | Top most position of the Object.
SHORT right | Right most position of the Object.
SHORT bottom | Bottom most position of the object.
WORD state | Sets the initial state of the object.
XCHAR * pText | Pointer to the text to be used.
WORD charMax | Defines the maximum number of characters in the edit box.
GOL_SCHEME * pScheme | Pointer to the style scheme.
Returns

Returns the pointer to the object created.

Preconditions

none

Side Effects

none

Example
Copy Code
#define ID_MYEDITBOX    101
EDITBOX *pEb;

pEb = EbCreate(ID_MYEDITBOX,    // ID
             10,                // left
             10,                // top
             100,               // right
             30,                // bottom
             EB_DRAW,           // redraw after creation
             NULL,              // no text yet
             4,                 // display only four characters
             pScheme);          // pointer to the style scheme

if( pEb == NULL )
{
    // MEMORY ERROR. Object was not created.
}
Library API > Graphics Object Layer API > GOL Objects > Edit Box > EbCreate Function


EbDraw Function

Contents | Index | Home
Previous | Up | Next
EbDraw Function
Edit Box
C
WORD EbDraw(
    void * pObj
);
Overview

This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set.

When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.

Input Parameters
Input Parameters | Description
pEb | Pointer to the object to be rendered.
Returns

Returns the status of the drawing

  • 1 - If the rendering was completed and
  • 0 - If the rendering is not yet finished.

Next call to the function will resume the rendering on the pending drawing state.

Preconditions

Object must be created before this function is called.

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Edit Box > EbDraw Function


EbGetText Macro

Contents | Index | Home
Previous | Up | Next
EbGetText Macro
Edit Box
C
#define EbGetText(pEb) (pEb->pBuffer)
Overview

This macro returns the address of the current text string used for the object.

Input Parameters
Input Parameters | Description
pEb | Pointer to the object
Returns

Returns pointer to the text string being used.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Edit Box > EbGetText Macro


EbSetText Function

Contents | Index | Home
Previous | Up | Next
EbSetText Function
Edit Box
C
void EbSetText(
    EDITBOX * pEb,
    XCHAR * pText
);
Overview

This function sets the text to be used for the object.

Input Parameters
Input Parameters | Description
EDITBOX * pEb | The pointer to the object whose text will be modified.
XCHAR * pText | Pointer to the text that will be used.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Edit Box > EbSetText Function


EbAddChar Function

Contents | Index | Home
Previous | Up | Next
EbAddChar Function
Edit Box
C
void EbAddChar(
    EDITBOX * pEb,
    XCHAR ch
);
Overview

This function inserts a character at the end of the text used by the object.

Input Parameters
Input Parameters | Description
EDITBOX * pEb | The pointer to the object whose text will be modified.
XCHAR ch | Character to be inserted.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Edit Box > EbAddChar Function


EbDeleteChar Function

Contents | Index | Home
Previous | Up | Next
EbDeleteChar Function
Edit Box
C
void EbDeleteChar(
    EDITBOX * pEb
);
Overview

This function removes a character at the end of the text used by the object.

Input Parameters
Input Parameters | Description
EDITBOX * pEb | The pointer to the object to be modified.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Edit Box > EbDeleteChar Function


EbMsgDefault Function

Contents | Index | Home
Previous | Up | Next
EbMsgDefault Function
Edit Box
C
void EbMsgDefault(
    WORD translatedMsg,
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function performs the actual state change based on the translated message given. The following state changes are supported:

Translated Message | Input Source | Set/Clear State Bit | Description
EB_MSG_CHAR | Keyboard | Set EB_DRAW | New character is added and Edit Box will be redrawn.
EB_MSG_DEL | Keyboard | Set EB_DRAW | Last character is removed and Edit Box will be redrawn.
Input Parameters
Input Parameters | Description
WORD translatedMsg | The translated message.
GOL_MSG * pMsg | The pointer to the GOL message.
pEb | The pointer to the object whose state will be modified.
Returns

none

Preconditions

none

Side Effects

none

Example

Usage is similar to BtnMsgDefault() example.

Library API > Graphics Object Layer API > GOL Objects > Edit Box > EbMsgDefault Function


EbTranslateMsg Function

Contents | Index | Home
Previous | Up | Next
EbTranslateMsg Function
Edit Box
C
WORD EbTranslateMsg(
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.

Translated Message | Input Source | Events | Description
EB_MSG_CHAR | Keyboard | EVENT_CHARCODE | New character should be added.
EB_MSG_DEL | Keyboard | EVENT_KEYPRESS | Last character should be removed.
OBJ_MSG_INVALID | Any | Any | If the message did not affect the object.
Input Parameters
Input Parameters | Description
GOL_MSG * pMsg | Pointer to the message struct containing the message from the user interface.
pEb | The pointer to the object where the message will be evaluated to check if the message will affect the object.
Returns

Returns the translated message depending on the received GOL message:

  • EB_MSG_CHAR – New character should be added.
  • EB_MSG_DEL – Last character should be removed.
  • OBJ_MSG_INVALID – Object is not affected.

Preconditions

none

Side Effects

none

Example

Usage is similar to BtnTranslateMsg() example.

Library API > Graphics Object Layer API > GOL Objects > Edit Box > EbTranslateMsg Function


EDITBOX Structure

Contents | Index | Home
Previous | Up | Next
EDITBOX Structure
Edit Box
C
typedef struct {
  OBJ_HEADER hdr;
  SHORT textHeight;
  XCHAR * pBuffer;
  WORD charMax;
  WORD length;
} EDITBOX;
Overview

Defines the parameters required for a Edit Box Object.

Members
Members | Description
OBJ_HEADER hdr; | Generic header for all Objects (see OBJ_HEADER).
SHORT textHeight; | Pre-computed text height.
XCHAR * pBuffer; | Pointer to text buffer.
WORD charMax; | Maximum number of characters in the edit box.
WORD length; | Current text length.
Library API > Graphics Object Layer API > GOL Objects > Edit Box > EDITBOX Structure


Grid

Contents | Index | Home
Previous | Up | Next
Grid
Functions | Macros | Structures | Topics

Grid supports Keyboard and Touchscreen inputs, replying to their events with the following messages:

1. GRID_MSG_TOUCHED

2. GRID_MSG_ITEM_SELECTED

3. GRID_MSG_LEFT

4. GRID_MSG_RIGHT

5. GRID_MSG_UP

6. GRID_MSG_DOWN

See GridTranslateMsg() and GridMsgDefault() for details.

The Grid lines are drawn using the EmbossLitColor, the string drawn using the TextColor0 and the background is drawn using the CommonBkColor.

Functions
Name | Description
GridCreate | This function creates a GRID object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
GridDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
GridClearCellState | This function clears the state of the cell (or Grid Item) specified by the column and row.
GridFreeItems | This function removes all grid items for the given Grid and frees the memory used.
GridGetCell | This function removes all grid items for the given Grid and frees the memory used.
GridSetCell | This function sets the Grid Item state and data.
GridSetCellState | This function sets the state of the Grid Item or cell.
GridSetFocus | This function sets the focus of the specified Grid Item or cell.
GridMsgDefault | This function performs the actual state change based on the translated message given. The following state changes are supported:
GridTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Macros
Name | Description
GridGetFocusX | This macro returns the x position of the focused cell.
GridGetFocusY | This macro returns the y position of the focused cell.
GRID_OUT_OF_BOUNDS | Status of an out of bounds cell GridSetCell() operation.
GRID_SUCCESS | Status of a successful GridSetCell() operation.
Structures
Name | Description
GRID | Defines the parameters required for a grid Object. Clipping is not supported in grid object.
GRIDITEM | Defines the grid item.
Topics
Name | Description
Grid States | List of Grid bit states.
Grid Item States | List of Grid Items bit states.
Links
Functions, GOL Objects, Legend, Macros, Structures, Topics
Library API > Graphics Object Layer API > GOL Objects > Grid


Grid States

Contents | Index | Home
Previous | Up | Next
Grid States
Macros | Grid

List of Grid bit states.

Macros
Name | Description
GRID_FOCUSED | Bit for focused state
GRID_DISABLED | Bit for disabled state
GRID_SHOW_LINES | Display grid lines
GRID_SHOW_FOCUS | Highlight the focused cell.
GRID_SHOW_BORDER_ONLY | Draw only the outside border of the grid.
GRID_SHOW_SEPARATORS_ONLY | Draw only the lines between cells (like Tic-tac-toe)
GRID_DRAW_ITEMS | Bit to indicate that at least one item must be redrawn, but not the entire grid.
GRID_DRAW_ALL | Bit to indicate whole edit box must be redrawn
GRID_HIDE | Bit to remove object from screen
Module

Grid

Links
Macros, Grid
Library API > Graphics Object Layer API > GOL Objects > Grid > Grid States


GRID_FOCUSED Macro

Contents | Index | Home
Previous | Up | Next
GRID_FOCUSED Macro
C
#define GRID_FOCUSED 0x0001  // Bit for focused state
Description

Bit for focused state

Library API > Graphics Object Layer API > GOL Objects > Grid > Grid States > GRID_FOCUSED Macro


GRID_DISABLED Macro

Contents | Index | Home
Previous | Up | Next
GRID_DISABLED Macro
C
#define GRID_DISABLED 0x0002  // Bit for disabled state
Description

Bit for disabled state

Library API > Graphics Object Layer API > GOL Objects > Grid > Grid States > GRID_DISABLED Macro


GRID_SHOW_LINES Macro

Contents | Index | Home
Previous | Up | Next
GRID_SHOW_LINES Macro
C
#define GRID_SHOW_LINES 0x0004  // Display grid lines
Description

Display grid lines

Library API > Graphics Object Layer API > GOL Objects > Grid > Grid States > GRID_SHOW_LINES Macro


GRID_SHOW_FOCUS Macro

Contents | Index | Home
Previous | Up | Next
GRID_SHOW_FOCUS Macro
C
#define GRID_SHOW_FOCUS 0x0008  // Highlight the focused cell.
Description

Highlight the focused cell.

Library API > Graphics Object Layer API > GOL Objects > Grid > Grid States > GRID_SHOW_FOCUS Macro


GRID_SHOW_BORDER_ONLY Macro

Contents | Index | Home
Previous | Up | Next
GRID_SHOW_BORDER_ONLY Macro
C
#define GRID_SHOW_BORDER_ONLY 0x0010  // Draw only the outside border of the grid.
Description

Draw only the outside border of the grid.

Library API > Graphics Object Layer API > GOL Objects > Grid > Grid States > GRID_SHOW_BORDER_ONLY Macro


GRID_SHOW_SEPARATORS_ONLY Macro

Contents | Index | Home
Previous | Up | Next
GRID_SHOW_SEPARATORS_ONLY Macro
C
#define GRID_SHOW_SEPARATORS_ONLY 0x0020  // Draw only the lines between cells (like Tic-tac-toe)
Description

Draw only the lines between cells (like Tic-tac-toe)

Library API > Graphics Object Layer API > GOL Objects > Grid > Grid States > GRID_SHOW_SEPARATORS_ONLY Macro


GRID_DRAW_ITEMS Macro

Contents | Index | Home
Previous | Up | Next
GRID_DRAW_ITEMS Macro
C
#define GRID_DRAW_ITEMS 0x1000  // Bit to indicate that at least one item must be redrawn, but not the entire grid.
Description

Bit to indicate that at least one item must be redrawn, but not the entire grid.

Library API > Graphics Object Layer API > GOL Objects > Grid > Grid States > GRID_DRAW_ITEMS Macro


GRID_DRAW_ALL Macro

Contents | Index | Home
Previous | Up | Next
GRID_DRAW_ALL Macro
C
#define GRID_DRAW_ALL 0x4000  // Bit to indicate whole edit box must be redrawn
Description

Bit to indicate whole edit box must be redrawn

Library API > Graphics Object Layer API > GOL Objects > Grid > Grid States > GRID_DRAW_ALL Macro


GRID_HIDE Macro

Contents | Index | Home
Previous | Up | Next
GRID_HIDE Macro
C
#define GRID_HIDE 0x8000  // Bit to remove object from screen
Description

Bit to remove object from screen

Library API > Graphics Object Layer API > GOL Objects > Grid > Grid States > GRID_HIDE Macro


Grid Item States

Contents | Index | Home
Previous | Up | Next
Grid Item States
Macros | Grid

List of Grid Items bit states.

Macros
Name | Description
GRIDITEM_SELECTED | The cell is selected.
GRIDITEM_IS_TEXT | The grid item is a text string.
GRIDITEM_IS_BITMAP | The grid item is a bitmap.
GRIDITEM_TEXTBOTTOM | Bit to indicate text is top aligned.
GRIDITEM_TEXTLEFT | Text in the cell is left aligned.
GRIDITEM_TEXTRIGHT | Text in the cell is right aligned.
GRIDITEM_TEXTTOP | Bit to indicate text is bottom aligned.
GRIDITEM_DRAW | Draw this cell
Module

Grid

Links
Macros, Grid
Library API > Graphics Object Layer API > GOL Objects > Grid > Grid Item States


GRIDITEM_SELECTED Macro

Contents | Index | Home
Previous | Up | Next
GRIDITEM_SELECTED Macro
C
#define GRIDITEM_SELECTED 0x0001  // The cell is selected.
Description

The cell is selected.

Library API > Graphics Object Layer API > GOL Objects > Grid > Grid Item States > GRIDITEM_SELECTED Macro


GRIDITEM_IS_TEXT Macro

Contents | Index | Home
Previous | Up | Next
GRIDITEM_IS_TEXT Macro
C
#define GRIDITEM_IS_TEXT 0x0000  // The grid item is a text string.
Description

The grid item is a text string.

Library API > Graphics Object Layer API > GOL Objects > Grid > Grid Item States > GRIDITEM_IS_TEXT Macro


GRIDITEM_IS_BITMAP Macro

Contents | Index | Home
Previous | Up | Next
GRIDITEM_IS_BITMAP Macro
C
#define GRIDITEM_IS_BITMAP 0x0008  // The grid item is a bitmap.
Description

The grid item is a bitmap.

Library API > Graphics Object Layer API > GOL Objects > Grid > Grid Item States > GRIDITEM_IS_BITMAP Macro


GRIDITEM_TEXTBOTTOM Macro

Contents | Index | Home
Previous | Up | Next
GRIDITEM_TEXTBOTTOM Macro
C
#define GRIDITEM_TEXTBOTTOM 0x0040  // Bit to indicate text is top aligned.
Description

Bit to indicate text is top aligned.

Library API > Graphics Object Layer API > GOL Objects > Grid > Grid Item States > GRIDITEM_TEXTBOTTOM Macro


GRIDITEM_TEXTLEFT Macro

Contents | Index | Home
Previous | Up | Next
GRIDITEM_TEXTLEFT Macro
C
#define GRIDITEM_TEXTLEFT 0x0020  // Text in the cell is left aligned.
Description

Text in the cell is left aligned.

Library API > Graphics Object Layer API > GOL Objects > Grid > Grid Item States > GRIDITEM_TEXTLEFT Macro


GRIDITEM_TEXTRIGHT Macro

Contents | Index | Home
Previous | Up | Next
GRIDITEM_TEXTRIGHT Macro
C
#define GRIDITEM_TEXTRIGHT 0x0010  // Text in the cell is right aligned.
Description

Text in the cell is right aligned.

Library API > Graphics Object Layer API > GOL Objects > Grid > Grid Item States > GRIDITEM_TEXTRIGHT Macro


GRIDITEM_TEXTTOP Macro

Contents | Index | Home
Previous | Up | Next
GRIDITEM_TEXTTOP Macro
C
#define GRIDITEM_TEXTTOP 0x0080  // Bit to indicate text is bottom aligned.
Description

Bit to indicate text is bottom aligned.

Library API > Graphics Object Layer API > GOL Objects > Grid > Grid Item States > GRIDITEM_TEXTTOP Macro


GRIDITEM_DRAW Macro

Contents | Index | Home
Previous | Up | Next
GRIDITEM_DRAW Macro
C
#define GRIDITEM_DRAW 0x0100  // Draw this cell
Description

Draw this cell

Library API > Graphics Object Layer API > GOL Objects > Grid > Grid Item States > GRIDITEM_DRAW Macro


GridCreate Function

Contents | Index | Home
Previous | Up | Next
GridCreate Function
Grid
C
GRID * GridCreate(
    WORD ID,
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    WORD state,
    SHORT numColumns,
    SHORT numRows,
    SHORT cellWidth,
    SHORT cellHeight,
    GOL_SCHEME * pScheme
);
Overview

This function creates a GRID object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.

Input Parameters
Input Parameters | Description
WORD ID | Unique user defined ID for the object instance.
SHORT left | Left most position of the Object.
SHORT top | Top most position of the Object.
SHORT right | Right most position of the Object.
SHORT bottom | Bottom most position of the object.
WORD state | Sets the initial state of the object.
SHORT numColumns | Sets the number of columns for the grid.
SHORT numRows | Sets the number of rows for the grid.
SHORT cellWidth | Sets the width of each cell of the grid.
SHORT cellHeight | Sets the height of each cell of the grid.
GOL_SCHEME * pScheme | Pointer to the style scheme used for the object. Set to NULL if default style scheme is used.
Returns

Returns the pointer to the object created.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Grid > GridCreate Function


GridDraw Function

Contents | Index | Home
Previous | Up | Next
GridDraw Function
Grid
C
WORD GridDraw(
    void * pObj
);
Overview

This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set.

When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.

Input Parameters
Input Parameters | Description
pGb | Pointer to the object to be rendered.
Returns

Returns the status of the drawing

  • 1 - If the rendering was completed and
  • 0 - If the rendering is not yet finished.
Next call to the function will resume the rendering on the pending drawing state.

Preconditions

Object must be created before this function is called.

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Grid > GridDraw Function


GridClearCellState Function

Contents | Index | Home
Previous | Up | Next
GridClearCellState Function
Grid
C
void GridClearCellState(
    GRID * pGrid,
    SHORT column,
    SHORT row,
    WORD state
);
Overview

This function clears the state of the cell (or Grid Item) specified by the column and row.

Input Parameters
Input Parameters | Description
GRID * pGrid | Pointer to the object.
SHORT column | column index of the cell
SHORT row | row index of the cell
atate | specifies the state to be cleared. See Grid Item State.
Returns

none.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Grid > GridClearCellState Function


GridGetFocusX Macro

Contents | Index | Home
Previous | Up | Next
GridGetFocusX Macro
Grid
C
#define GridGetFocusX(pGrid) pGrid->focusX
Overview

This macro returns the x position of the focused cell.

Input Parameters
Input Parameters | Description
pGrid | Pointer to the object.
Returns

Returns the x position of the focused cell.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Grid > GridGetFocusX Macro


GridGetFocusY Macro

Contents | Index | Home
Previous | Up | Next
GridGetFocusY Macro
Grid
C
#define GridGetFocusY(pGrid) pGrid->focusY
Overview

This macro returns the y position of the focused cell.

Input Parameters
Input Parameters | Description
pGrid | Pointer to the object.
Returns

Returns the y position of the focused cell.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Grid > GridGetFocusY Macro


GRID_OUT_OF_BOUNDS Macro

Contents | Index | Home
Previous | Up | Next
GRID_OUT_OF_BOUNDS Macro
Grid
C
#define GRID_OUT_OF_BOUNDS 0x0001  // Status of an out of bounds cell GridSetCell() operation.
Description

Status of an out of bounds cell GridSetCell() operation.

Library API > Graphics Object Layer API > GOL Objects > Grid > GRID_OUT_OF_BOUNDS Macro


GRID_SUCCESS Macro

Contents | Index | Home
Previous | Up | Next
GRID_SUCCESS Macro
Grid
C
#define GRID_SUCCESS 0x0000    // Status of a successful GridSetCell() operation.
Description

Status of a successful GridSetCell() operation.

Library API > Graphics Object Layer API > GOL Objects > Grid > GRID_SUCCESS Macro


GridFreeItems Function

Contents | Index | Home
Previous | Up | Next
GridFreeItems Function
Grid
C
void GridFreeItems(
    void * pObj
);
Overview

This function removes all grid items for the given Grid and frees the memory used.

Input Parameters
Input Parameters | Description
pGrid | The pointer to the Grid object.
Returns

none.

Preconditions

Object must be created before this function is called.

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Grid > GridFreeItems Function


GridGetCell Function

Contents | Index | Home
Previous | Up | Next
GridGetCell Function
Grid
C
void * GridGetCell(
    GRID * pGrid,
    SHORT column,
    SHORT row,
    WORD * cellType
);
Overview

This function removes all grid items for the given Grid and frees the memory used.

Input Parameters
Input Parameters | Description
GRID * pGrid | The pointer to the Grid object.
SHORT column | the column index of the cell
SHORT row | the row index of the cell
WORD * cellType | pointer that will receive the type of grid item or cell (GRIDITEM_IS_TEXT or GRIDITEM_IS_BITMAP).
Returns

Returns a pointer to the grid item or cell data.

Preconditions

Object must be created before this function is called.

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Grid > GridGetCell Function


GridSetCell Function

Contents | Index | Home
Previous | Up | Next
GridSetCell Function
Grid
C
WORD GridSetCell(
    GRID * pGrid,
    SHORT column,
    SHORT row,
    WORD state,
    void * data
);
Overview

This function sets the Grid Item state and data.

Input Parameters
Input Parameters | Description
GRID * pGrid | The pointer to the Grid object.
SHORT column | the column index of the cell
SHORT row | the row index of the cell
WORD state | sets the state of the Grid Item specified.
void * data | pointer to the data used for the Grid Item.
Returns

Returns the status of the operation

  • GRID_SUCCESS - if the set succeeded
  • GRID_OUT_OF_BOUNDS - if the row and column given results in an out of bounds location.

Preconditions

Object must be created before this function is called.

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Grid > GridSetCell Function


GridSetCellState Function

Contents | Index | Home
Previous | Up | Next
GridSetCellState Function
Grid
C
void GridSetCellState(
    GRID * pGrid,
    SHORT column,
    SHORT row,
    WORD state
);
Overview

This function sets the state of the Grid Item or cell.

Input Parameters
Input Parameters | Description
GRID * pGrid | The pointer to the Grid object.
SHORT column | the column index of the cell
SHORT row | the row index of the cell
WORD state | sets the state of the Grid Item specified.
Returns

none.

Preconditions

Object must be created before this function is called.

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Grid > GridSetCellState Function


GridSetFocus Function

Contents | Index | Home
Previous | Up | Next
GridSetFocus Function
Grid
C
void GridSetFocus(
    GRID * pGrid,
    SHORT column,
    SHORT row
);
Overview

This function sets the focus of the specified Grid Item or cell.

Input Parameters
Input Parameters | Description
GRID * pGrid | The pointer to the Grid object.
SHORT column | the column index of the cell
SHORT row | the row index of the cell
Returns

none.

Preconditions

Object must be created before this function is called.

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Grid > GridSetFocus Function


GridMsgDefault Function

Contents | Index | Home
Previous | Up | Next
GridMsgDefault Function
Grid
C
void GridMsgDefault(
    WORD translatedMsg,
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function performs the actual state change based on the translated message given. The following state changes are supported:

Translated Message | Input Source | Set/Clear State Bit | Description
GRID_MSG_TOUCHED | Touch Screen | none | Grid will have no state change because of this event.
GRID_MSG_ITEM_SELECTED | Keyboard | Set GRIDITEM_SELECTED, | Grid Item selected will be redrawn.
 |  | GRID_DRAW_ITEMS |
GRID_MSG_UP | Keyboard | Set GRIDITEM_DRAW, | Grid Item above the currently focused item will be redrawn.
 |  | GRID_DRAW_ITEMS |
GRID_MSG_DOWN | Keyboard | Set GRIDITEM_DRAW, | Grid Item below the currently focused item will be redrawn.
 |  | GRID_DRAW_ITEMS |
GRID_MSG_LEFT | Keyboard | Set GRIDITEM_DRAW, | Grid Item to the left of the currently focused item will be redrawn.
 |  | GRID_DRAW_ITEMS |
GRID_MSG_RIGHT | Keyboard | Set GRIDITEM_DRAW, | Grid Item to the right of the currently focused item will be redrawn.
 |  | GRID_DRAW_ITEMS |
Input Parameters
Input Parameters | Description
WORD translatedMsg | The translated message.
GOL_MSG * pMsg | The pointer to the GOL message.
pGrid | The pointer to the object whose state will be modified.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Grid > GridMsgDefault Function


GridTranslateMsg Function

Contents | Index | Home
Previous | Up | Next
GridTranslateMsg Function
Grid
C
WORD GridTranslateMsg(
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.

Translated Message | Input Source | Set/Clear State Bit | Description
GRID_MSG_TOUCHED | Touch Screen | none | If any touch events occurs and the x,y position falls in the face of the grid.
GRID_MSG_ITEM_SELECTED | Keyboard | EVENT_KEYSCAN | If event occurs and parameter1 passed matches the object’s ID and parameter 2 passed matches SCAN_SPACE_PRESSED or SCAN_CR_PRESSED.
GRID_MSG_UP | Keyboard | EVENT_KEYSCAN | If event occurs and parameter1 passed matches the object’s ID and parameter 2 passed matches SCAN_UP_PRESSED.
GRID_MSG_DOWN | Keyboard | EVENT_KEYSCAN | If event occurs and parameter1 passed matches the object’s ID and parameter 2 passed matches SCAN_DOWN_PRESSED.
GRID_MSG_LEFT | Keyboard | EVENT_KEYSCAN | If event occurs and parameter1 passed matches the object’s ID and parameter 2 passed matches SCAN_LEFT_PRESSED.
GRID_MSG_RIGHT | Keyboard | EVENT_KEYSCAN | If event occurs and parameter1 passed matches the object’s ID and parameter 2 passed matches SCAN_RIGHT_PRESSED.
OBJ_MSG_INVALID | Any | Any | If the message did not affect the object.
Input Parameters
Input Parameters | Description
GOL_MSG * pMsg | Pointer to the message struct containing the message from the user interface.
pGrid | The pointer to the object where the message will be evaluated to check if the message will affect the object.
Returns

Returns the translated message depending on the received GOL message:

  • GRID_MSG_TOUCHED - when the grid object is touched.
  • GRID_MSG_ITEM_SELECTED – when key scan SCAN_SPACE_PRESSED or SCAN_CR_PRESSED are detected.
  • GRID_MSG_UP – when key scan SCAN_UP_PRESSED is detected.
  • GRID_MSG_DOWN – when key scan SCAN_DOWN_PRESSED is detected.
  • GRID_MSG_LEFT – when key scan SCAN_LEFT_PRESSED is detected.
  • GRID_MSG_RIGHT – when key scan SCAN_RIGHT_PRESSED is detected.
  • OBJ_MSG_INVALID – Button is not affected

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Grid > GridTranslateMsg Function


GRID Structure

Contents | Index | Home
Previous | Up | Next
GRID Structure
Grid
C
typedef struct {
  OBJ_HEADER hdr;
  SHORT numColumns;
  SHORT numRows;
  SHORT cellHeight;
  SHORT cellWidth;
  SHORT focusX;
  SHORT focusY;
  GRIDITEM * gridObjects;
} GRID;
Overview

Defines the parameters required for a grid Object. Clipping is not supported in grid object.

Members
Members | Description
OBJ_HEADER hdr; | Generic header for all Objects (see OBJ_HEADER).
SHORT numColumns; | Number of columns drawn for the Grid.
SHORT numRows; | Number of rows drawn for the Grid.
SHORT cellHeight; | The height of each cell in pixels.
SHORT cellWidth; | The width of each cell in pixels.
SHORT focusX; | The x position of the cell to be focused.
SHORT focusY; | The y position of the cell to be focused.
GRIDITEM * gridObjects; | The pointer to grid items
Library API > Graphics Object Layer API > GOL Objects > Grid > GRID Structure


GRIDITEM Structure

Contents | Index | Home
Previous | Up | Next
GRIDITEM Structure
Grid
C
typedef struct {
  void * data;
  WORD status;
} GRIDITEM;
Overview

Defines the grid item.

Members
Members | Description
void * data; | Indicates if the Grid Item is type GRIDITEM_IS_TEXT or GRIDITEM_IS_BITMAP
WORD status; | indicates the status of the Grid Item
Library API > Graphics Object Layer API > GOL Objects > Grid > GRIDITEM Structure


Group Box

Contents | Index | Home
Previous | Up | Next
Group Box
Functions | Macros | Structures | Topics

Group Box supports only Touchscreen inputs, replying to their events with the message:

GB_MSG_SELECTED - when the touch is within the dimension of the object.

The Group box object is rendered using the assigned style scheme. The following figure illustrates the color assignments.

Functions
Name | Description
GbCreate | This function creates a GROUPBOX object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
GbDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
GbSetText | This function sets the text used by passing the pointer to the static string.
GbTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen inputs.
Macros
Name | Description
GbGetText | This macro returns the location of the text used.
Structures
Name | Description
GROUPBOX | Defines the parameters required for a group box Object. The textwidth and textHeight is not checked with the actual dimension of the object. Clipping is not supported in group box object. It is possible for the text to exceed the dimension of the Object.
Topics
Name | Description
Group Box States | List of Group Box bit states.
Links
Functions, GOL Objects, Legend, Macros, Structures, Topics
Library API > Graphics Object Layer API > GOL Objects > Group Box


Group Box States

Contents | Index | Home
Previous | Up | Next
Group Box States
Macros | Group Box

List of Group Box bit states.

Macros
Name | Description
GB_CENTER_ALIGN | Bit to indicate text is center aligned
GB_DISABLED | Bit for disabled state
GB_DRAW | Bit to indicate group box must be redrawn
GB_HIDE | Bit to remove object from screen
GB_RIGHT_ALIGN | Bit to indicate text is right aligned
Module

Group Box

Links
Macros, Group Box
Library API > Graphics Object Layer API > GOL Objects > Group Box > Group Box States


GB_CENTER_ALIGN Macro

Contents | Index | Home
Previous | Up | Next
GB_CENTER_ALIGN Macro
C
#define GB_CENTER_ALIGN 0x0008  // Bit to indicate text is center aligned
Description

Bit to indicate text is center aligned

Library API > Graphics Object Layer API > GOL Objects > Group Box > Group Box States > GB_CENTER_ALIGN Macro


GB_DISABLED Macro

Contents | Index | Home
Previous | Up | Next
GB_DISABLED Macro
C
#define GB_DISABLED 0x0002  // Bit for disabled state
Description

Bit for disabled state

Library API > Graphics Object Layer API > GOL Objects > Group Box > Group Box States > GB_DISABLED Macro


GB_DRAW Macro

Contents | Index | Home
Previous | Up | Next
GB_DRAW Macro
C
#define GB_DRAW 0x4000          // Bit to indicate group box must be redrawn
Description

Bit to indicate group box must be redrawn

Library API > Graphics Object Layer API > GOL Objects > Group Box > Group Box States > GB_DRAW Macro


GB_HIDE Macro

Contents | Index | Home
Previous | Up | Next
GB_HIDE Macro
C
#define GB_HIDE 0x8000          // Bit to remove object from screen
Description

Bit to remove object from screen

Library API > Graphics Object Layer API > GOL Objects > Group Box > Group Box States > GB_HIDE Macro


GB_RIGHT_ALIGN Macro

Contents | Index | Home
Previous | Up | Next
GB_RIGHT_ALIGN Macro
C
#define GB_RIGHT_ALIGN 0x0004  // Bit to indicate text is right aligned
Description

Bit to indicate text is right aligned

Library API > Graphics Object Layer API > GOL Objects > Group Box > Group Box States > GB_RIGHT_ALIGN Macro


GbCreate Function

Contents | Index | Home
Previous | Up | Next
GbCreate Function
Group Box
C
GROUPBOX * GbCreate(
    WORD ID,
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    WORD state,
    XCHAR * pText,
    GOL_SCHEME * pScheme
);
Overview

This function creates a GROUPBOX object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.

Input Parameters
Input Parameters | Description
WORD ID | Unique user defined ID for the object instance.
SHORT left | Left most position of the Object.
SHORT top | Top most position of the Object.
SHORT right | Right most position of the Object.
SHORT bottom | Bottom most position of the object.
WORD state | Sets the initial state of the object.
XCHAR * pText | The pointer to the text used for the group box. Length of string must be checked not to exceed the object’s width. Clipping is not supported for the text of this object.
GOL_SCHEME * pScheme | Pointer to the style scheme used for the object. Set to NULL if default style scheme is used.
Returns

Returns the pointer to the object created.

Preconditions

none

Side Effects

none

Example
Copy Code
GOL_SCHEME *pScheme;
GROUPBOX *groupbox[2];
WORD state;

pScheme = GOLCreateScheme();
state = GB_DRAW | GB_RIGHT_ALIGN;
groupbox[0] = GbCreate( 10, 14,48,152,122,
                        state, "Power", scheme);
if (groupbox[0] == NULL)
    return 0;
state = GB_DRAW;
groupbox[1] = GbCreate( 11, 160,48,298,122,
                        state, "Pressure", scheme);
if (groupbox[1] == NULL)
    return 0;

while(!GbDraw(groupbox[0]));
while(!GbDraw(groupbox[1]));
return 1;
Library API > Graphics Object Layer API > GOL Objects > Group Box > GbCreate Function


GbDraw Function

Contents | Index | Home
Previous | Up | Next
GbDraw Function
Group Box
C
WORD GbDraw(
    void * pObj
);
Overview

This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set.

When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.

Input Parameters
Input Parameters | Description
pGb | Pointer to the object to be rendered.
Returns

Returns the status of the drawing

  • 1 - If the rendering was completed and
  • 0 - If the rendering is not yet finished.
Next call to the function will resume the rendering on the pending drawing state.

Preconditions

Object must be created before this function is called.

Side Effects

none

Example

See GbCreate() example.

Library API > Graphics Object Layer API > GOL Objects > Group Box > GbDraw Function


GbGetText Macro

Contents | Index | Home
Previous | Up | Next
GbGetText Macro
Group Box
C
#define GbGetText(pB) pGb->pText
Overview

This macro returns the location of the text used.

Input Parameters
Input Parameters | Description
pGb | Pointer to the object.
Returns

Returns the address of the text string used.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Group Box > GbGetText Macro


GbSetText Function

Contents | Index | Home
Previous | Up | Next
GbSetText Function
Group Box
C
void GbSetText(
    GROUPBOX * pGb,
    XCHAR * pText
);
Overview

This function sets the text used by passing the pointer to the static string.

Input Parameters
Input Parameters | Description
GROUPBOX * pGb | the pointer to the object whose state will be modified.
XCHAR * pText | pointer to the text that will be used.
Returns

none

Preconditions

The style scheme used for the object MUST be initialized with a valid font. If font is not valid, textWidth and textHeight parameter of GROUPBOX will be undefined.

Side Effects

Modifies the object width and height depending on the selected string width and font height.

Library API > Graphics Object Layer API > GOL Objects > Group Box > GbSetText Function


GbTranslateMsg Function

Contents | Index | Home
Previous | Up | Next
GbTranslateMsg Function
Group Box
C
WORD GbTranslateMsg(
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen inputs.

Translated Message | Input Source | Events | Description
GB_MSG_SELECTED | Touch Screen | EVENT_PRESS, EVENT_RELEASE | If events occurs and the x,y position falls in the area of the group box.
OBJ_MSG_INVALID | Any | Any | If the message did not affect the object.
Input Parameters
Input Parameters | Description
GOL_MSG * pMsg | Pointer to the message struct containing the message from the user interface.
pGb | The pointer to the object where the message will be evaluated to check if the message will affect the object.
Returns

Returns the translated message depending on the received GOL message:

  • GB_MSG_SELECTED – Group Box is selected
  • OBJ_MSG_INVALID – Group Box is not affected

Preconditions

none

Side Effects

none

Example

Usage is similar to BtnTranslateMsg() example.

Library API > Graphics Object Layer API > GOL Objects > Group Box > GbTranslateMsg Function


GROUPBOX Structure

Contents | Index | Home
Previous | Up | Next
GROUPBOX Structure
Group Box
C
typedef struct {
  OBJ_HEADER hdr;
  SHORT textWidth;
  SHORT textHeight;
  XCHAR * pText;
} GROUPBOX;
Overview

Defines the parameters required for a group box Object. The textwidth and textHeight is not checked with the actual dimension of the object. Clipping is not supported in group box object. It is possible for the text to exceed the dimension of the Object.

Members
Members | Description
OBJ_HEADER hdr; | Generic header for all Objects (see OBJ_HEADER).
SHORT textWidth; | Pre-computed text width.
SHORT textHeight; | Pre-computed text height.
XCHAR * pText; | Text string used.
Library API > Graphics Object Layer API > GOL Objects > Group Box > GROUPBOX Structure


List Box

Contents | Index | Home
Previous | Up | Next
List Box
Functions | Macros | Structures | Topics

List Box supports both Touchscreen and Keyboard inputs, replying to their events with the following messages:

LB_MSG_TOUCHSCREEN – Item is selected using touch screen

LB_MSG_MOVE – Focus is moved to the next item depending on the key pressed (UP or DOWN key).

LB_MSG_SEL – Selection is set to the currently focused item.

The List Box Object is rendered using the assigned style scheme. The following figure illustrates the color assignments. Icons can be added to each item when adding items to the list using LbAddItem().

Functions
Name | Description
LbCreate | This function creates a LISTBOX object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
LbDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. The text or items drawn in the visible window of the list box is dependent on the alignment set. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
LbAddItem | This function allocates memory for the LISTITEM and adds it to the list box. The newly created LISTITEM will store the location of pText, pBitmap and other parameters describing the added item.
LbDelItem | This function removes an item from the list box and frees the memory used.
LbChangeSel | This function changes the selection status of an item in the list box. If the item is currently selected, it resets the selection. If the item is currently not selected it is set to be selected.
LbGetSel | This function searches for selected items from the list box. A starting position can optionally be given. If starting position is set to NULL, search will begin from the first item list. It returns the pointer to the first selected item found or NULL if there are no items selected.
LbGetFocusedItem | This function returns the index of the focused item in the list box.
LbSetFocusedItem | This function sets the focus for the item with the given index.
LbDelItemsList | This function removes all items from the list box and frees the memory used.
LbMsgDefault | This function performs the actual state change based on the translated message given. The following state changes are supported:
LbTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Macros
Name | Description
LbGetItemList | This function returns the pointer to the current item list used in the list box.
LbSetSel | This macro sets the selection status of an item to selected.
LbGetCount | This macro returns the number of items in the list box.
LbGetVisibleCount | This macro returns the number of items visible in the list box window.
LbSetBitmap | This macro sets the bitmap used in the item.
LbGetBitmap | This macro returns the location of the currently used bitmap for the item.
Structures
Name | Description
LISTBOX | Defines the parameters required for a list box Object.
LISTITEM | Defines the parameters required for a list item used in list box.
Topics
Name | Description
List Box States | List of List Box bit states.
List Item Status | List of Items status.
Links
Functions, GOL Objects, Legend, Macros, Structures, Topics
Library API > Graphics Object Layer API > GOL Objects > List Box


List Box States

Contents | Index | Home
Previous | Up | Next
List Box States
Macros | List Box

List of List Box bit states.

Macros
Name | Description
LB_RIGHT_ALIGN | Bit to indicate text is left aligned
LB_SINGLE_SEL | Bit to indicate the only item can be selected
LB_CENTER_ALIGN | Bit to indicate text is center aligned
LB_DISABLED | Bit for disabled state
LB_DRAW | Bit to indicate whole edit box must be redrawn
LB_DRAW_FOCUS | Bit to indicate whole edit box must be redrawn
LB_DRAW_ITEMS | Bit to indicate whole edit box must be redrawn
LB_FOCUSED | Bit for focused state
LB_HIDE | Bit to remove object from screen
Module

List Box

Links
Macros, List Box
Library API > Graphics Object Layer API > GOL Objects > List Box > List Box States


LB_RIGHT_ALIGN Macro

Contents | Index | Home
Previous | Up | Next
LB_RIGHT_ALIGN Macro
C
#define LB_RIGHT_ALIGN 0x0004  // Bit to indicate text is left aligned
Description

Bit to indicate text is left aligned

Library API > Graphics Object Layer API > GOL Objects > List Box > List Box States > LB_RIGHT_ALIGN Macro


LB_SINGLE_SEL Macro

Contents | Index | Home
Previous | Up | Next
LB_SINGLE_SEL Macro
C
#define LB_SINGLE_SEL 0x0010  // Bit to indicate the only item can be selected
Description

Bit to indicate the only item can be selected

Library API > Graphics Object Layer API > GOL Objects > List Box > List Box States > LB_SINGLE_SEL Macro


LB_CENTER_ALIGN Macro

Contents | Index | Home
Previous | Up | Next
LB_CENTER_ALIGN Macro
C
#define LB_CENTER_ALIGN 0x0008  // Bit to indicate text is center aligned
Description

Bit to indicate text is center aligned

Library API > Graphics Object Layer API > GOL Objects > List Box > List Box States > LB_CENTER_ALIGN Macro


LB_DISABLED Macro

Contents | Index | Home
Previous | Up | Next
LB_DISABLED Macro
C
#define LB_DISABLED 0x0002  // Bit for disabled state
Description

Bit for disabled state

Library API > Graphics Object Layer API > GOL Objects > List Box > List Box States > LB_DISABLED Macro


LB_DRAW Macro

Contents | Index | Home
Previous | Up | Next
LB_DRAW Macro
C
#define LB_DRAW 0x4000  // Bit to indicate whole edit box must be redrawn
Description

Bit to indicate whole edit box must be redrawn

Library API > Graphics Object Layer API > GOL Objects > List Box > List Box States > LB_DRAW Macro


LB_DRAW_FOCUS Macro

Contents | Index | Home
Previous | Up | Next
LB_DRAW_FOCUS Macro
C
#define LB_DRAW_FOCUS 0x2000  // Bit to indicate whole edit box must be redrawn
Description

Bit to indicate whole edit box must be redrawn

Library API > Graphics Object Layer API > GOL Objects > List Box > List Box States > LB_DRAW_FOCUS Macro


LB_DRAW_ITEMS Macro

Contents | Index | Home
Previous | Up | Next
LB_DRAW_ITEMS Macro
C
#define LB_DRAW_ITEMS 0x1000  // Bit to indicate whole edit box must be redrawn
Description

Bit to indicate whole edit box must be redrawn

Library API > Graphics Object Layer API > GOL Objects > List Box > List Box States > LB_DRAW_ITEMS Macro


LB_FOCUSED Macro

Contents | Index | Home
Previous | Up | Next
LB_FOCUSED Macro
C
#define LB_FOCUSED 0x0001  // Bit for focused state
Description

Bit for focused state

Library API > Graphics Object Layer API > GOL Objects > List Box > List Box States > LB_FOCUSED Macro


LB_HIDE Macro

Contents | Index | Home
Previous | Up | Next
LB_HIDE Macro
C
#define LB_HIDE 0x8000  // Bit to remove object from screen
Description

Bit to remove object from screen

Library API > Graphics Object Layer API > GOL Objects > List Box > List Box States > LB_HIDE Macro


List Item Status

Contents | Index | Home
Previous | Up | Next
List Item Status
Macros | List Box

List of Items status.

Macros
Name | Description
LB_STS_SELECTED | Item is selected.
LB_STS_REDRAW | Item is to be redrawn.
Module

List Box

Links
Macros, List Box
Library API > Graphics Object Layer API > GOL Objects > List Box > List Item Status


LB_STS_SELECTED Macro

Contents | Index | Home
Previous | Up | Next
LB_STS_SELECTED Macro
C
#define LB_STS_SELECTED 0x0001  // Item is selected.
Description

Item is selected.

Library API > Graphics Object Layer API > GOL Objects > List Box > List Item Status > LB_STS_SELECTED Macro


LB_STS_REDRAW Macro

Contents | Index | Home
Previous | Up | Next
LB_STS_REDRAW Macro
C
#define LB_STS_REDRAW 0x0002  // Item is to be redrawn.
Description

Item is to be redrawn.

Library API > Graphics Object Layer API > GOL Objects > List Box > List Item Status > LB_STS_REDRAW Macro


LbCreate Function

Contents | Index | Home
Previous | Up | Next
LbCreate Function
List Box
C
LISTBOX * LbCreate(
    WORD ID,
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    WORD state,
    XCHAR * pText,
    GOL_SCHEME * pScheme
);
Overview

This function creates a LISTBOX object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.

Input Parameters
Input Parameters | Description
WORD ID | Unique user defined ID for the object instance.
SHORT left | Left most position of the Object.
SHORT top | Top most position of the Object.
SHORT right | Right most position of the Object.
SHORT bottom | Bottom most position of the Object.
WORD state | Sets the initial state of the object.
XCHAR * pText | Pointer to the initialization text for the items.
GOL_SCHEME * pScheme | Pointer to the style scheme.
Returns

Returns the pointer to the object created.

Preconditions

none

Side Effects

none

Example
Copy Code
#define LISTBOX_ID   10

const XCHAR ItemList[] = "Line1n" "Line2n";

GOL_SCHEME *pScheme;
LISTBOX *pLb;
XCHAR *pTemp;
WORD state, counter;

    pScheme = GOLCreateScheme();
    state = LB_DRAW;

    // create an empty listbox with default style scheme
    pLb = LbCreate( LISTBOX_ID,         // ID number
                    10,10,150,200,      // dimension
                    state,              // initial state
                    NULL,               // set items to be empty
                    NULL);              // use default style scheme
    // check if Listbox was created
    if (pLb == NULL)
       return 0;

    // create the list of items to be placed in the listbox
    // Add items (each line will become one item,
    // lines must be separated by 'n' character)
    pTemp = ItemList;
    counter = 0;
    while(*pTemp){
        // since each item is appended NULL is assigned to
        // LISTITEM pointer.
        if(NULL == LbAddItem(pLb, NULL, pTemp, NULL, 0, counter))
            break;
        while((unsigned XCHAR)*pTemp++ > (unsigned XCHAR)31);
        if(*(pTemp-1) == 0)
            break;
        counter++;
    }
Library API > Graphics Object Layer API > GOL Objects > List Box > LbCreate Function


LbDraw Function

Contents | Index | Home
Previous | Up | Next
LbDraw Function
List Box
C
WORD LbDraw(
    void * pObj
);
Overview

This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set.

The text or items drawn in the visible window of the list box is dependent on the alignment set.

When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.

Input Parameters
Input Parameters | Description
pLb | Pointer to the object to be rendered.
Returns

Returns the status of the drawing

  • 1 - If the rendering was completed and
  • 0 - If the rendering is not yet finished.
Next call to the function will resume the rendering on the pending drawing state.

Preconditions

Object must be created before this function is called.

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > List Box > LbDraw Function


LbGetItemList Macro

Contents | Index | Home
Previous | Up | Next
LbGetItemList Macro
List Box
C
#define LbGetItemList(pLb) ((LISTITEM *)((LISTBOX *)pLb)->pItemList)
Overview

This function returns the pointer to the current item list used in the list box.

Input Parameters
Input Parameters | Description
pLb | The pointer to the list box object.
Returns

Returns the pointer to the LISTITEM used in the list box.

Preconditions

none

Side Effects

none

Example

See LbAddItem() example.

Library API > Graphics Object Layer API > GOL Objects > List Box > LbGetItemList Macro


LbAddItem Function

Contents | Index | Home
Previous | Up | Next
LbAddItem Function
List Box
C
LISTITEM * LbAddItem(
    LISTBOX * pLb,
    LISTITEM * pPrevItem,
    XCHAR * pText,
    void * pBitmap,
    WORD status,
    WORD data
);
Overview

This function allocates memory for the LISTITEM and adds it to the list box. The newly created LISTITEM will store the location of pText, pBitmap and other parameters describing the added item.

Input Parameters
Input Parameters | Description
LISTBOX * pLb | The pointer to the list box object.
LISTITEM * pPrevItem | Pointer to the item after which a new item must be inserted, if this pointer is NULL, the item will be appended at the end of the items list.
XCHAR * pText | Pointer to the text that will be inserted. Text must persist in memory for as long as it is referenced by an item in the list box.
void * pBitmap | Pointer to the bitmap for the item. Bitmap must persist in memory for as long as it is referenced by the an item in the list box.
WORD status | This parameter specifies if the item being added will be selected or redrawn (LB_STS_SELECTED or LB_STS_REDRAW). Refer to LISTITEM structure for details.
WORD data | User assigned data associated with the item.
Returns

Return a pointer to the item created, NULL if the operation was not successful.

Preconditions

none

Side Effects

none

Example
Copy Code
const XCHAR ItemList[] = "Line1n" "Line2n" "Line3n";

extern BITMAP_FLASH myIcon;
LISTBOX *pLb;
LISTITEM *pItem, *pItemList;
XCHAR *pTemp;

// Assume that pLb is pointing to an existing list box in memory
// that is empty (no list).

// Create the list of the list box

// Initialize this to NULL to indicate that items will be added
// at the end of the list if the list exist on the list box or
// start a new list if the list box is empty.
pItem = NULL;
pTemp = ItemList;
pItem = LbAddItem(pLb, pItem, pTemp, NULL, LB_STS_SELECTED, 1)
if(pItem == NULL)
    return 0;
LbSetBitmap(pItem, &myIcon);

// Adjust pTemp to point to the next line
while((unsigned XCHAR)*pTemp++ > (unsigned XCHAR)31);

// add the next item
pItem = LbAddItem(pLb, pItem, pTemp, NULL, 0, 2)
if(pItem == NULL)
    return 0;
LbSetBitmap(pItem, &myIcon);

// Adjust pTemp to point to the next line
while((unsigned XCHAR)*pTemp++ > (unsigned XCHAR)31);

// this time insert the next item after the first item on the list
pItem = LbGetItemList(pLb);
pItem = LbAddItem(pLb, pItem, pTemp, NULL, 0, 3)
if(pItem == NULL)
    return 0;
LbSetBitmap(pItem, &myIcon);
Library API > Graphics Object Layer API > GOL Objects > List Box > LbAddItem Function


LbDelItem Function

Contents | Index | Home
Previous | Up | Next
LbDelItem Function
List Box
C
void LbDelItem(
    LISTBOX * pLb,
    LISTITEM * pItem
);
Overview

This function removes an item from the list box and frees the memory used.

Input Parameters
Input Parameters | Description
LISTBOX * pLb | The pointer to the list box object.
LISTITEM * pItem | The pointer to the item that will be removed.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > List Box > LbDelItem Function


LbChangeSel Function

Contents | Index | Home
Previous | Up | Next
LbChangeSel Function
List Box
C
void LbChangeSel(
    LISTBOX * pLb,
    LISTITEM * pItem
);
Overview

This function changes the selection status of an item in the list box. If the item is currently selected, it resets the selection. If the item is currently not selected it is set to be selected.

Input Parameters
Input Parameters | Description
LISTBOX * pLb | The pointer to the list box object.
LISTITEM * pItem | The pointer to the item the selection status will be changed.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > List Box > LbChangeSel Function


LbSetSel Macro

Contents | Index | Home
Previous | Up | Next
LbSetSel Macro
List Box
C
#define LbSetSel(pLb, pItem) \
    if(!(pItem->status & LB_STS_SELECTED)) \
        LbChangeSel((LISTBOX *)pLb, pItem);
Overview

This macro sets the selection status of an item to selected.

Input Parameters
Input Parameters | Description
pLb | The pointer to the list box object.
pItem | The pointer to the item the selection status will be set.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > List Box > LbSetSel Macro


LbGetSel Function

Contents | Index | Home
Previous | Up | Next
LbGetSel Function
List Box
C
LISTITEM * LbGetSel(
    LISTBOX * pLb,
    LISTITEM * pFromItem
);
Overview

This function searches for selected items from the list box. A starting position can optionally be given. If starting position is set to NULL, search will begin from the first item list. It returns the pointer to the first selected item found or NULL if there are no items selected.

Input Parameters
Input Parameters | Description
LISTBOX * pLb | The pointer to the list box object.
LISTITEM * pFromItem | The pointer to the item the search must start from, if the pointer is NULL the search begins from the start of the items list.
Returns

pointer to the selected item, NULL if there are no items selected

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > List Box > LbGetSel Function


LbGetFocusedItem Function

Contents | Index | Home
Previous | Up | Next
LbGetFocusedItem Function
List Box
C
SHORT LbGetFocusedItem(
    LISTBOX * pLb
);
Overview

This function returns the index of the focused item in the list box.

Input Parameters
Input Parameters | Description
LISTBOX * pLb | The pointer to the list box object.
Returns

Returns the index of the focused item in the list box.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > List Box > LbGetFocusedItem Function


LbSetFocusedItem Function

Contents | Index | Home
Previous | Up | Next
LbSetFocusedItem Function
List Box
C
void LbSetFocusedItem(
    LISTBOX * pLb,
    SHORT index
);
Overview

This function sets the focus for the item with the given index.

Input Parameters
Input Parameters | Description
LISTBOX * pLb | The pointer to the list box object.
SHORT index | The index number of the item to be focused. First item on the list is always indexed 0.
Returns

none.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > List Box > LbSetFocusedItem Function


LbGetCount Macro

Contents | Index | Home
Previous | Up | Next
LbGetCount Macro
List Box
C
#define LbGetCount(pLb) ((LISTBOX *)pLb)->itemsNumber
Overview

This macro returns the number of items in the list box.

Input Parameters
Input Parameters | Description
pLb | The pointer to the list box object.
Returns

The number of items the list box contains.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > List Box > LbGetCount Macro


LbGetVisibleCount Macro

Contents | Index | Home
Previous | Up | Next
LbGetVisibleCount Macro
List Box
C
#define LbGetVisibleCount(pLb) \
        (                                                                                                    \
            (((LISTBOX *)pLb)->hdr.bottom - ((LISTBOX *)pLb)->hdr.top - 2 * (GOL_EMBOSS_SIZE + LB_INDENT)) / \
                ((LISTBOX *)pLb)->textHeight                                                                 \
        )
Overview

This macro returns the number of items visible in the list box window.

Input Parameters
Input Parameters | Description
pLb | The pointer to the list box object.
Returns

The number of items visible in the list box window.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > List Box > LbGetVisibleCount Macro


LbSetBitmap Macro

Contents | Index | Home
Previous | Up | Next
LbSetBitmap Macro
List Box
C
#define LbSetBitmap(pItem, pBtmap) ((LISTITEM *)pItem)->pBitmap = pBtmap
Overview

This macro sets the bitmap used in the item.

Input Parameters
Input Parameters | Description
pItem | Pointer to the item.
pBtmap | Pointer to the bitmap to be used.
Returns

none

Preconditions

none

Side Effects

none

Example

See LbAddItem() example.

Library API > Graphics Object Layer API > GOL Objects > List Box > LbSetBitmap Macro


LbGetBitmap Macro

Contents | Index | Home
Previous | Up | Next
LbGetBitmap Macro
List Box
C
#define LbGetBitmap(pItem) ((LISTITEM *)pItem)->pBitmap
Overview

This macro returns the location of the currently used bitmap for the item.

Input Parameters
Input Parameters | Description
pItem | Pointer to the list item.
Returns

Returns the pointer to the current bitmap used.

Preconditions

none

Side Effects

none

Example
Copy Code
// Assume pLb is initialized to an existing list box
LISTITEM *pItem;
void *pBitmap;

pItem = LbGetItemList(pLb);
pBitmap = LbGetBitmap(pItem);
Library API > Graphics Object Layer API > GOL Objects > List Box > LbGetBitmap Macro


LbDelItemsList Function

Contents | Index | Home
Previous | Up | Next
LbDelItemsList Function
List Box
C
void LbDelItemsList(
    void * pObj
);
Overview

This function removes all items from the list box and frees the memory used.

Input Parameters
Input Parameters | Description
pLb | The pointer to the list box object.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > List Box > LbDelItemsList Function


LbMsgDefault Function

Contents | Index | Home
Previous | Up | Next
LbMsgDefault Function
List Box
C
void LbMsgDefault(
    WORD translatedMsg,
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function performs the actual state change based on the translated message given. The following state changes are supported:

Translated Message | Input Source | Set/Clear State Bit | Description
LB_MSG_TOUCHSCREEN | Touch Screen | Set LB_FOCUSED, | If focus is enabled, the focus state bit LB_FOCUSED will be set. LB_DRAW_FOCUS draw state bit will force
 |  | Set LB_DRAW_FOCUS | the List Box to be redrawn with focus.
 |  | Set LB_DRAW_ITEMS | List Box will be redrawn with selected item(s).
LB_MSG_MOVE | KeyBoard | Set LB_DRAW_ITEMS | List Box will be redrawn with focus on one item.
LB_MSG_SEL | KeyBoard | Set LB_DRAW_ITEMS | List Box will be redrawn with selection on the current item focused.
Input Parameters
Input Parameters | Description
WORD translatedMsg | The translated message
GOL_MSG * pMsg | The pointer to the GOL message.
pB | The pointer to the object whose state will be modified.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > List Box > LbMsgDefault Function


LbTranslateMsg Function

Contents | Index | Home
Previous | Up | Next
LbTranslateMsg Function
List Box
C
WORD LbTranslateMsg(
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.

Translated Message | Input Source | Events | Description
LB_MSG_TOUCHSCREEN | Touch Screen | Any | Item is selected using touch screen.
LB_MSG_MOVE | Keyboard | EVENT_KEYSCAN | Focus is moved to the next item depending on the key pressed (UP or DOWN key).
LB_MSG_SEL | Keyboard | EVENT_KEYSCAN | LB_MSG_SEL – Selection is set to the currently focused item.
OBJ_MSG_INVALID | Any | Any | If the message did not affect the object.
Input Parameters
Input Parameters | Description
GOL_MSG * pMsg | Pointer to the message struct containing the message from the user interface.
pLB | The pointer to the object where the message will be evaluated to check if the message will affect the object.
Returns

Returns the translated message depending on the received GOL message:

  • LB_MSG_TOUCHSCREEN – Item is selected using touch screen.
  • LB_MSG_MOVE – Focus is moved to the next item depending on the key pressed (UP or DOWN key).
  • LB_MSG_SEL – Selection is set to the currently focused item.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > List Box > LbTranslateMsg Function


LISTBOX Structure

Contents | Index | Home
Previous | Up | Next
LISTBOX Structure
List Box
C
typedef struct {
  OBJ_HEADER hdr;
  LISTITEM * pItemList;
  LISTITEM * pFocusItem;
  WORD itemsNumber;
  SHORT scrollY;
  SHORT textHeight;
} LISTBOX;
Overview

Defines the parameters required for a list box Object.

Members
Members | Description
OBJ_HEADER hdr; | Generic header for all Objects (see OBJ_HEADER).
LISTITEM * pItemList; | Pointer to the list of items.
LISTITEM * pFocusItem; | Pointer to the focused item.
WORD itemsNumber; | Number of items in the list box.
SHORT scrollY; | Scroll displacement for the list.
SHORT textHeight; | Pre-computed text height.
Library API > Graphics Object Layer API > GOL Objects > List Box > LISTBOX Structure


LISTITEM Structure

Contents | Index | Home
Previous | Up | Next
LISTITEM Structure
List Box
C
typedef struct {
  void * pPrevItem;
  void * pNextItem;
  WORD status;
  XCHAR * pText;
  void * pBitmap;
  WORD data;
} LISTITEM;
Overview

Defines the parameters required for a list item used in list box.

Members
Members | Description
void * pPrevItem; | Pointer to the next item
void * pNextItem; | Pointer to the next item
WORD status; | Specifies the status of the item.
XCHAR * pText; | Pointer to the text for the item
void * pBitmap; | Pointer to the bitmap
WORD data; | Some data associated with the item
Library API > Graphics Object Layer API > GOL Objects > List Box > LISTITEM Structure


Meter

Contents | Index | Home
Previous | Up | Next
Meter
Functions | Macros | Structures | Topics

There are three meter types that you can draw:

  1. MTR_WHOLE_TYPE
  2. MTR_HALF_TYPE
  3. MTR_QUARTER_TYPE
It supports only System inputs, replying to the event EVENT_SET with the message: MTR_MSG_SET (see MtrTranslateMsg() for details). This action ID means that the message contains the new value of the meter on the parameter 2 of the message.

The Meter Object is rendered using the assigned style scheme, value range colors (see MtrSetScaleColors() for details) and compile time settings. The following figure illustrates the assignments for a MTR_HALF_TYPE meter.

Functions
Name | Description
MtrCreate | This function creates a METER object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
MtrDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. Depending on the defined settings, value of the meter will displayed or hidden. Displaying the value will require a little bit more rendering time depending on the size of the meter and font used. When rendering objects of the same type, each object must be rendered completely before the rendering of the... more
MtrSetVal | This function sets the value of the meter to the passed newVal. newVal is checked to be in the minValue-maxValue range inclusive. If newVal is not in the range, minValue maxValue is assigned depending on the given newVal if less than minValue or above maxValue.
MtrMsgDefault | This function performs the actual state change based on the translated message given. Meter value is set based on parameter 2 of the message given. The following state changes are supported:
MtrTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Macros
Name
Description
MtrGetVal
This macro returns the current value of the meter. Value is always in the minValue-maxValue range inclusive.
MtrDecVal
This macro is used to directly decrement the value.
MtrIncVal
This macro is used to directly increment the value.
MtrSetScaleColors
Scale colors can be used to highlight values of the meter. User can set these colors to define the arc colors and scale colors. This also sets the color of the meter value when displayed. Limitation is that color settings are set to the following angles: Color Boundaries Type Whole Type Half Type Quarter Arc 6 225 to 180 not used not used Arc 5 179 to 135 179 to 135 not used Arc 4 134 to 90 134 to 90 not used Arc 3 89 to 45 89 to 45 89 to 45 Arc 2 44 to 0 44... more
MtrSetTitleFont
This function sets the font of title.
MtrSetValueFont
This function sets the font of value.
METER_TYPE
This is a compile time setting to select the type if meter shape. There are three types:
  • MTR_WHOLE_TYPE - Meter drawn with 6 octants used.
  • MTR_HALF_TYPE - Meter drawn with semi circle shape.
  • MTR_QUARTER_TYPE - Meter drawn with quarter circle shape.
Set only one value at a time. This is done to save code space. User can define the colors of the arcs for each type. MTR_WHOLE_TYPE will use all the arc colors (arcColor1 - arcColor6) MTR_HALF_TYPE will use arc colors (arcColor5, arcColor4, arcColor3, arcColor2) MTR_QUARTER_TYPE will use arc colors (arcColor3, arcColor2) Set the meter type in Meter.h file and... more
MTR_ACCURACY
Sets the meter accuracy to one decimal places when displaying the values. Application must multiply the minValue, maxValue and values passed to the widget by RESOLUTION.
Structures
Name | Description
METER | Defines the parameters required for a meter Object. Depending on the type selected the meter is drawn with the defined shape parameters and values set on the given fields.
Topics
Name | Description
Meter States | List of Meter bit states.
Links
Functions, GOL Objects, Legend, Macros, Structures, Topics
Library API > Graphics Object Layer API > GOL Objects > Meter


Meter States

Contents | Index | Home
Previous | Up | Next
Meter States
Macros | Meter

List of Meter bit states.

Macros
Name | Description
MTR_DISABLED | Bit for disabled state.
MTR_DRAW | Bit to indicate object must be redrawn.
MTR_HIDE | Bit to indicate object must be removed from screen.
MTR_RING | Bit for ring type, scales are drawn over the ring default is only scales drawn.
MTR_DRAW_UPDATE | Bit to indicate an update only.
Module

Meter

Links
Macros, Meter
Library API > Graphics Object Layer API > GOL Objects > Meter > Meter States


MTR_DISABLED Macro

Contents | Index | Home
Previous | Up | Next
MTR_DISABLED Macro
C
#define MTR_DISABLED 0x0002      // Bit for disabled state.
Description

Bit for disabled state.

Library API > Graphics Object Layer API > GOL Objects > Meter > Meter States > MTR_DISABLED Macro


MTR_DRAW Macro

Contents | Index | Home
Previous | Up | Next
MTR_DRAW Macro
C
#define MTR_DRAW 0x4000      // Bit to indicate object must be redrawn.
Description

Bit to indicate object must be redrawn.

Library API > Graphics Object Layer API > GOL Objects > Meter > Meter States > MTR_DRAW Macro


MTR_HIDE Macro

Contents | Index | Home
Previous | Up | Next
MTR_HIDE Macro
C
#define MTR_HIDE 0x8000      // Bit to indicate object must be removed from screen.
Description

Bit to indicate object must be removed from screen.

Library API > Graphics Object Layer API > GOL Objects > Meter > Meter States > MTR_HIDE Macro


MTR_RING Macro

Contents | Index | Home
Previous | Up | Next
MTR_RING Macro
C
#define MTR_RING 0x0004      // Bit for ring type, scales are drawn over the ring
Description

Bit for ring type, scales are drawn over the ring default is only scales drawn.

Library API > Graphics Object Layer API > GOL Objects > Meter > Meter States > MTR_RING Macro


MTR_DRAW_UPDATE Macro

Contents | Index | Home
Previous | Up | Next
MTR_DRAW_UPDATE Macro
C
#define MTR_DRAW_UPDATE 0x1000      // Bit to indicate an update only.
Description

Bit to indicate an update only.

Library API > Graphics Object Layer API > GOL Objects > Meter > Meter States > MTR_DRAW_UPDATE Macro


MtrCreate Function

Contents | Index | Home
Previous | Up | Next
MtrCreate Function
Meter
C
METER * MtrCreate(
    WORD ID,
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    WORD state,
    SHORT value,
    SHORT minValue,
    SHORT maxValue,
    void * pTitleFont,
    void * pValueFont,
    XCHAR * pText,
    GOL_SCHEME * pScheme
);
Overview

This function creates a METER object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.

Input Parameters
Input Parameters | Description
WORD ID | Unique user defined ID for the object instance.
SHORT left | Left most position of the object.
SHORT top | Top most position of the object.
SHORT right | Right most position of the object.
SHORT bottom | Bottom most position of the object.
WORD state | Sets the initial state of the object.
SHORT value | Initial value set to the meter.
SHORT minValue | The minimum value the meter will display.
SHORT maxValue | The maximum value the meter will display.
void * pTitleFont | Pointer to the font used for the Title.
XCHAR * pText | Pointer to the text label of the meter.
GOL_SCHEME * pScheme | Pointer to the font used for the Value. Pointer to the style scheme used.
Returns

Returns the pointer to the object created.

Preconditions

none

Side Effects

none

Example
Copy Code
#define ID_METER 101

extern const FONT_FLASH GOLMediumFont;      // medium font
extern const FONT_FLASH GOLSmallFont;       // small font

GOL_SCHEME *pMeterScheme;
METER *pMtr;

    pMeterScheme = GOLCreateScheme();

    pMtr = MtrCreate(
            ID_METER,               // assign ID
            30, 50, 150, 180,       // set dimension
            MTR_DRAW|MTR_RING,      // draw object after creation
            0,                      // set initial value
            0, 100,                 // set minimum and maximum value
            (void*)&GOLMediumFont,  // set title font
            (void*)&GOLSmallFont,   // set value font
            "Speed",                // Text Label
            pMeterScheme);          // style scheme

    // check if meter was created
    if (pMtr == NULL)
       return 0;

    // Change range colors: Normal values to WHITE
    //                      Critical values to BLUE
    //                      Danger values to RED
    // assume that WHITE, GREEN, YELLOW and RED have been defined.
    MtrSetScaleColors(pMtr, WHITE, WHITE, WHITE, GREEN, YELLOW, RED);

    // use GOLDraw() to draw the meter and all other objects you created
    while(!GOLDraw());
    // OR to draw the meter manually use this:
    //while(!MtrDraw(pMtr);
Library API > Graphics Object Layer API > GOL Objects > Meter > MtrCreate Function


MtrDraw Function

Contents | Index | Home
Previous | Up | Next
MtrDraw Function
Meter
C
WORD MtrDraw(
    void * pObj
);
Overview

This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set.

Depending on the defined settings, value of the meter will displayed or hidden. Displaying the value will require a little bit more rendering time depending on the size of the meter and font used.

When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.

Input Parameters
Input Parameters | Description
pMtr | Pointer to the object to be rendered.
Returns

Returns the status of the drawing

  • 1 - If the rendering was completed and
  • 0 - If the rendering is not yet finished.
Next call to the function will resume the rendering on the pending drawing state.

Preconditions

Object must be created before this function is called.

Side Effects

none

Example

See MtrCreate() example.

Library API > Graphics Object Layer API > GOL Objects > Meter > MtrDraw Function


MtrSetVal Function

Contents | Index | Home
Previous | Up | Next
MtrSetVal Function
Meter
C
void MtrSetVal(
    METER * pMtr,
    SHORT newVal
);
Overview

This function sets the value of the meter to the passed newVal. newVal is checked to be in the minValue-maxValue range inclusive. If newVal is not in the range, minValue maxValue is assigned depending on the given newVal if less than minValue or above maxValue.

Input Parameters
Input Parameters | Description
METER * pMtr | The pointer to the object.
SHORT newVal | New value to be set for the Meter.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Meter > MtrSetVal Function


MtrGetVal Macro

Contents | Index | Home
Previous | Up | Next
MtrGetVal Macro
Meter
C
#define MtrGetVal(pMtr) ((pMtr)->value)
Overview

This macro returns the current value of the meter. Value is always in the minValue-maxValue range inclusive.

Input Parameters
Input Parameters | Description
pMtr | Pointer to the object.
Returns

Returns current value of the meter.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Meter > MtrGetVal Macro


MtrDecVal Macro

Contents | Index | Home
Previous | Up | Next
MtrDecVal Macro
Meter
C
#define MtrDecVal(pMtr, deltaValue) MtrSetVal(pMtr, ((pMtr)->value - deltaValue))
Overview

This macro is used to directly decrement the value.

Input Parameters
Input Parameters | Description
pMtr | Pointer to the object.
deltaValue | Number to be subtracted to the current Meter value.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Meter > MtrDecVal Macro


MtrIncVal Macro

Contents | Index | Home
Previous | Up | Next
MtrIncVal Macro
Meter
C
#define MtrIncVal(pMtr, deltaValue) MtrSetVal(pMtr, ((pMtr)->value + deltaValue))
Overview

This macro is used to directly increment the value.

Input Parameters
Input Parameters | Description
pMtr | Pointer to the object.
deltaValue | Number to be added to the current Meter value.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Meter > MtrIncVal Macro


MtrSetScaleColors Macro

Contents | Index | Home
Previous | Up | Next
MtrSetScaleColors Macro
Meter
C
#define MtrSetScaleColors(pMtr, arc1, arc2, arc3, arc4, arc5, arc6) \
    {                                                                   \
        pMtr->arcColor6 = arc6;                                         \
        pMtr->arcColor5 = arc5;                                         \
        pMtr->arcColor4 = arc4;                                         \
        pMtr->arcColor3 = arc3;                                         \
        pMtr->arcColor2 = arc2;                                         \
        pMtr->arcColor1 = arc1;                                         \
    }
Overview

Scale colors can be used to highlight values of the meter. User can set these colors to define the arc colors and scale colors. This also sets the color of the meter value when displayed. Limitation is that color settings are set to the following angles: Color Boundaries Type Whole Type Half Type Quarter Arc 6 225 to 180 not used not used Arc 5 179 to 135 179 to 135 not used Arc 4 134 to 90 134 to 90 not used Arc 3 89 to 45 89 to 45 89 to 45 Arc 2 44 to 0 44 to 0 44 to 0 Arc 1 -45 to -1 not used not used As the meter is drawn colors are changed depending on the angle of the scale and label being drawn.

Input Parameters
Input Parameters | Description
pMtr | Pointer to the object.
arc1 | color for arc 1.
arc2 | color for arc 2.
arc3 | color for arc 3.
arc4 | color for arc 4.
arc5 | color for arc 5.
arc6 | color for arc 6.
Returns

none

Preconditions

The object must be created (using MtrCreate()) before a call to this macro is performed.

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Meter > MtrSetScaleColors Macro


MtrSetTitleFont Macro

Contents | Index | Home
Previous | Up | Next
MtrSetTitleFont Macro
Meter
C
#define MtrSetTitleFont(pMtr, pNewFont) (((METER *)pMtr)->pTitleFont = pNewFont)
Overview

This function sets the font of title.

Input Parameters
Input Parameters | Description
pMtr | Pointer to the object.
pNewFont | Pointer to the new font used for the title.
Returns

N/A

Preconditions

Font must be created before this function is called.

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Meter > MtrSetTitleFont Macro


MtrSetValueFont Macro

Contents | Index | Home
Previous | Up | Next
MtrSetValueFont Macro
Meter
C
#define MtrSetValueFont(pMtr, pNewFont) (((METER *)pMtr)->pValueFont = pNewFont)
Overview

This function sets the font of value.

Input Parameters
Input Parameters | Description
pMtr | Pointer to the object.
pNewFont | Pointer to the new font used for the value.
Returns

N/A

Preconditions

Font must be created before this function is called.

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Meter > MtrSetValueFont Macro


METER_TYPE Macro

Contents | Index | Home
Previous | Up | Next
METER_TYPE Macro
Meter
C
#define METER_TYPE MTR_WHOLE_TYPE
Overview

This is a compile time setting to select the type if meter shape. There are three types:

  • MTR_WHOLE_TYPE - Meter drawn with 6 octants used.
  • MTR_HALF_TYPE - Meter drawn with semi circle shape.
  • MTR_QUARTER_TYPE - Meter drawn with quarter circle shape.
Set only one value at a time. This is done to save code space. User can define the colors of the arcs for each type. MTR_WHOLE_TYPE will use all the arc colors (arcColor1 - arcColor6) MTR_HALF_TYPE will use arc colors (arcColor5, arcColor4, arcColor3, arcColor2) MTR_QUARTER_TYPE will use arc colors (arcColor3, arcColor2) Set the meter type in Meter.h file and arc colors using MtrSetScaleColors(pMtr, arc1, arc2, arc3, arc4, arc5, arc6) macro.

Library API > Graphics Object Layer API > GOL Objects > Meter > METER_TYPE Macro


MTR_ACCURACY Macro

Contents | Index | Home
Previous | Up | Next
MTR_ACCURACY Macro
Meter
C
#define MTR_ACCURACY 0x0008      // Sets the meter accuracy to one decimal places
Description

Sets the meter accuracy to one decimal places when displaying the values. Application must multiply the minValue, maxValue and values passed to the widget by RESOLUTION.

Library API > Graphics Object Layer API > GOL Objects > Meter > MTR_ACCURACY Macro


MtrMsgDefault Function

Contents | Index | Home
Previous | Up | Next
MtrMsgDefault Function
Meter
C
void MtrMsgDefault(
    WORD translatedMsg,
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function performs the actual state change based on the translated message given. Meter value is set based on parameter 2 of the message given. The following state changes are supported:

Translated Message | Input Source | Set/Clear State Bit | Description
MTR_MSG_SET | System | Set MTR_DRAW_UPDATE | Meter will be redrawn to update the needle position and value displayed.
Input Parameters
Input Parameters | Description
WORD translatedMsg | The translated message.
GOL_MSG * pMsg | The pointer to the GOL message.
pMtr | The pointer to the object whose state will be modified.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Meter > MtrMsgDefault Function


MtrTranslateMsg Function

Contents | Index | Home
Previous | Up | Next
MtrTranslateMsg Function
Meter
C
WORD MtrTranslateMsg(
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.

Translated Message | Input Source | Events | Description
MTR_MSG_SET | System | EVENT_SET | If event set occurs and the meter ID is sent in parameter 1.
OBJ_MSG_INVALID | Any | Any | If the message did not affect the object.
Input Parameters
Input Parameters | Description
GOL_MSG * pMsg | Pointer to the message struct containing the message from the user interface.
pMtr | The pointer to the object where the message will be evaluated to check if the message will affect the object.
Returns

Returns the translated message depending on the received GOL message:

  • MTR_MSG_SET - Meter ID is given in parameter 1 for a TYPE_SYSTEM message.
  • OBJ_MSG_INVALID - Meter is not affected.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Meter > MtrTranslateMsg Function


METER Structure

Contents | Index | Home
Previous | Up | Next
METER Structure
Meter
C
typedef struct {
  OBJ_HEADER hdr;
  XCHAR * pText;
  SHORT value;
  SHORT minValue;
  SHORT maxValue;
  SHORT xCenter;
  SHORT yCenter;
  SHORT radius;
  SHORT xPos;
  SHORT yPos;
  WORD arcColor6;
  WORD arcColor5;
  WORD arcColor4;
  WORD arcColor3;
  WORD arcColor2;
  WORD arcColor1;
  void * pTitleFont;
  void * pValueFont;
} METER;
Overview

Defines the parameters required for a meter Object. Depending on the type selected the meter is drawn with the defined shape parameters and values set on the given fields.

Members
Members | Description
OBJ_HEADER hdr; | Generic header for all Objects (see OBJ_HEADER).
XCHAR * pText; | The text label of the meter.
SHORT value; | Current value of the meter.
SHORT minValue; | minimum value the meter can display
SHORT maxValue; | maximum value the meter can display (range is maxValue - minValue)
SHORT xCenter; | The x coordinate center position. This is computed automatically.
SHORT yCenter; | The y coordinate center position. This is computed automatically.
SHORT radius; | Radius of the meter, also defines the needle length.
SHORT xPos; | The current x position of the needle. This is computed automatically.
SHORT yPos; | The current y position of the needle. This is computed automatically.
WORD arcColor6; | Arc 6 color parameter.
WORD arcColor5; | Arc 5 color parameter
WORD arcColor4; | Arc 4 color parameter
WORD arcColor3; | Arc 3 color parameter
WORD arcColor2; | Arc 2 color parameter
WORD arcColor1; | Arc 1 color parameter
void * pTitleFont; | Pointer to the font used in the title of the meter
void * pValueFont; | Pointer to the font used in the current reading (if displayed) of the meter
Library API > Graphics Object Layer API > GOL Objects > Meter > METER Structure


Picture Control

Contents | Index | Home
Previous | Up | Next
Picture Control
Functions | Macros | Structures | Topics

It supports only Keyboard inputs, replying to any touch screen events with the message: PICT_MSG_SELECTED.

The Picture Object is rendered using the assigned style scheme. The following figure illustrates the color assignments.

Functions
Name | Description
PictCreate | This function creates a PICTURE object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
PictDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
PictTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event accepted by the PICTURE Object.
Macros
Name | Description
PictSetBitmap | This macro sets the bitmap used in the object.
PictGetBitmap | This macro returns the pointer to the bitmap used in the object.
PictGetScale | This macro returns the current scale factor used to render the bitmap.
PictSetScale | This macro sets the scale factor used to render the bitmap used in the object.
Structures
Name | Description
PICTURE | The structure contains data for picture control
Topics
Name | Description
Picture States | List of Picture Control bit states.
Links
Functions, GOL Objects, Legend, Macros, Structures, Topics
Library API > Graphics Object Layer API > GOL Objects > Picture Control


Picture States

Contents | Index | Home
Previous | Up | Next
Picture States
Macros | Picture Control

List of Picture Control bit states.

Macros
Name | Description
PICT_DISABLED | Bit to indicate Picture is in a disabled state.
PICT_DRAW | Bit to indicate Picture will be redrawn.
PICT_FRAME | Bit to indicate Picture has a frame.
PICT_HIDE | Bit to indicate Picture must be hidden.
Module

Picture Control

Links
Macros, Picture Control
Library API > Graphics Object Layer API > GOL Objects > Picture Control > Picture States


PICT_DISABLED Macro

Contents | Index | Home
Previous | Up | Next
PICT_DISABLED Macro
C
#define PICT_DISABLED 0x0002  // Bit to indicate Picture is in a disabled state.
Description

Bit to indicate Picture is in a disabled state.

Library API > Graphics Object Layer API > GOL Objects > Picture Control > Picture States > PICT_DISABLED Macro


PICT_DRAW Macro

Contents | Index | Home
Previous | Up | Next
PICT_DRAW Macro
C
#define PICT_DRAW 0x4000  // Bit to indicate Picture will be redrawn.
Description

Bit to indicate Picture will be redrawn.

Library API > Graphics Object Layer API > GOL Objects > Picture Control > Picture States > PICT_DRAW Macro


PICT_FRAME Macro

Contents | Index | Home
Previous | Up | Next
PICT_FRAME Macro
C
#define PICT_FRAME 0x0004  // Bit to indicate Picture has a frame.
Description

Bit to indicate Picture has a frame.

Library API > Graphics Object Layer API > GOL Objects > Picture Control > Picture States > PICT_FRAME Macro


PICT_HIDE Macro

Contents | Index | Home
Previous | Up | Next
PICT_HIDE Macro
C
#define PICT_HIDE 0x8000  // Bit to indicate Picture must be hidden.
Description

Bit to indicate Picture must be hidden.

Library API > Graphics Object Layer API > GOL Objects > Picture Control > Picture States > PICT_HIDE Macro


PictCreate Function

Contents | Index | Home
Previous | Up | Next
PictCreate Function
Picture Control
C
PICTURE * PictCreate(
    WORD ID,
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    WORD state,
    char scale,
    void * pBitmap,
    GOL_SCHEME * pScheme
);
Overview

This function creates a PICTURE object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.

Input Parameters
Input Parameters | Description
WORD ID | Unique user defined ID for the object instance.
SHORT left | Left most position of the Object.
SHORT top | Top most position of the Object.
SHORT right | Right most position of the Object.
SHORT bottom | Bottom most position of the object.
WORD state | Sets the initial state of the object.
char scale | Sets the scale factor used to render the bitmap.
void * pBitmap | Pointer to the bitmap that will be used.
GOL_SCHEME * pScheme | Pointer to the style scheme
radius | Radius of the rounded edge.
Returns

Returns the pointer to the object created

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Picture Control > PictCreate Function


PictDraw Function

Contents | Index | Home
Previous | Up | Next
PictDraw Function
Picture Control
C
WORD PictDraw(
    void * pObj
);
Overview

This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object.

When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.

Input Parameters
Input Parameters | Description
pPict | Pointer to the object to be rendered.
Returns

Returns the status of the drawing

  • 1 - If the rendering was completed and
  • 0 - If the rendering is not yet finished.
Next call to the function will resume the rendering on the pending drawing state.

Preconditions

Object must be created before this function is called.

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Picture Control > PictDraw Function


PictSetBitmap Macro

Contents | Index | Home
Previous | Up | Next
PictSetBitmap Macro
Picture Control
C
#define PictSetBitmap(pPict, pBtmap) ((PICTURE*)pPict)->pBitmap = pBtmap
Overview

This macro sets the bitmap used in the object.

Input Parameters
Input Parameters | Description
pPict | Pointer to the object
pBtMap | Pointer to the bitmap to be used
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Picture Control > PictSetBitmap Macro


PictGetBitmap Macro

Contents | Index | Home
Previous | Up | Next
PictGetBitmap Macro
Picture Control
C
#define PictGetBitmap(pPict) ((PICTURE*)pPict)->pBitmap
Overview

This macro returns the pointer to the bitmap used in the object.

Input Parameters
Input Parameters | Description
pPict | Pointer to the object
Returns

Returns the pointer to the bitmap used.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Picture Control > PictGetBitmap Macro


PictGetScale Macro

Contents | Index | Home
Previous | Up | Next
PictGetScale Macro
Picture Control
C
#define PictGetScale(pPict) pPict->scale
Overview

This macro returns the current scale factor used to render the bitmap.

Input Parameters
Input Parameters | Description
pPict | Pointer to the object
Returns

Returns the current scale factor used to display the bitmap.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Picture Control > PictGetScale Macro


PictSetScale Macro

Contents | Index | Home
Previous | Up | Next
PictSetScale Macro
Picture Control
C
#define PictSetScale(pPict, scl) pPict->scale = scl
Overview

This macro sets the scale factor used to render the bitmap used in the object.

Input Parameters
Input Parameters | Description
pPict | Pointer to the object
scl | The scale factor that will be used to display the bitmap.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Picture Control > PictSetScale Macro


PictTranslateMsg Function

Contents | Index | Home
Previous | Up | Next
PictTranslateMsg Function
Picture Control
C
WORD PictTranslateMsg(
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event accepted by the PICTURE Object.

Translated Message | Input Source | Events | Description
PICT_MSG_SELECTED | Touch Screen | EVENT_PRESS, EVENT_RELEASE, EVENT_MOVE | If events occurs and the x,y position falls in the area of the picture.
OBJ_MSG_INVALID | Any | Any | If the message did not affect the object.
Input Parameters
Input Parameters | Description
GOL_MSG * pMsg | Pointer to the message struct containing the message from the user interface.
pPict | The pointer to the object where the message will be evaluated to check if the message will affect the object.
Returns

Returns the translated message depending on the received GOL message:

  • PICT_MSG_SELECTED – Picture is touched.
  • OBJ_MSG_INVALID – Picture is not affected

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Picture Control > PictTranslateMsg Function


PICTURE Structure

Contents | Index | Home
Previous | Up | Next
PICTURE Structure
Picture Control
C
typedef struct {
  OBJ_HEADER hdr;
  char scale;
  void * pBitmap;
} PICTURE;
Overview

The structure contains data for picture control

Members
Members | Description
OBJ_HEADER hdr; | Generic header for all Objects (see OBJ_HEADER).
char scale; | Scale factor for the bitmap
void * pBitmap; | Pointer to the bitmap
Library API > Graphics Object Layer API > GOL Objects > Picture Control > PICTURE Structure


Progress Bar

Contents | Index | Home
Previous | Up | Next
Progress Bar
Functions | Macros | Structures | Topics

Progress Bar supports only Touchscreen inputs, replying to their events with the message: PB_MSG_SELECTED.

The Progress Bar Object is rendered using the assigned style scheme. The following figure illustrates the color assignments.

Functions
Name | Description
PbCreate | This function creates a PROGRESSBAR object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
PbDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
PbSetRange | This function sets the range of the progress bar. Calling this function also resets the position equal to the new range value.
PbSetPos | This function sets the position of the progress bar. Position should be in the given range inclusive.
PbTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen inputs.
Macros
Name | Description
PbGetRange | This macro returns the current range of the progress bar.
PbGetPos | This macro returns the current progress bar position.
Structures
Name | Description
PROGRESSBAR | The structure contains data for the progress bar
Topics
Name | Description
Progress Bar States | List of Progress Bar bit states.
Links
Functions, GOL Objects, Legend, Macros, Structures, Topics
Library API > Graphics Object Layer API > GOL Objects > Progress Bar


Progress Bar States

Contents | Index | Home
Previous | Up | Next
Progress Bar States
Macros | Progress Bar

List of Progress Bar bit states.

Macros
Name | Description
PB_DISABLED | Bit to indicate Progress Bar is in a disabled state.
PB_DRAW | Bit to indicate Progress Bar must be redrawn.
PB_DRAW_BAR | Bit to indicate Progress Bar must be redrawn.
PB_HIDE | Bit to indicate Progress Bar must be hidden.
PB_VERTICAL | Bit for orientation (0 - horizontal, 1 - vertical)
Module

Progress Bar

Links
Macros, Progress Bar
Library API > Graphics Object Layer API > GOL Objects > Progress Bar > Progress Bar States


PB_DISABLED Macro

Contents | Index | Home
Previous | Up | Next
PB_DISABLED Macro
C
#define PB_DISABLED 0x0002  // Bit to indicate Progress Bar is in a disabled state.
Description

Bit to indicate Progress Bar is in a disabled state.

Library API > Graphics Object Layer API > GOL Objects > Progress Bar > Progress Bar States > PB_DISABLED Macro


PB_DRAW Macro

Contents | Index | Home
Previous | Up | Next
PB_DRAW Macro
C
#define PB_DRAW 0x4000  // Bit to indicate Progress Bar must be redrawn.
Description

Bit to indicate Progress Bar must be redrawn.

Library API > Graphics Object Layer API > GOL Objects > Progress Bar > Progress Bar States > PB_DRAW Macro


PB_DRAW_BAR Macro

Contents | Index | Home
Previous | Up | Next
PB_DRAW_BAR Macro
C
#define PB_DRAW_BAR 0x2000  // Bit to indicate Progress Bar must be redrawn.
Description

Bit to indicate Progress Bar must be redrawn.

Library API > Graphics Object Layer API > GOL Objects > Progress Bar > Progress Bar States > PB_DRAW_BAR Macro


PB_HIDE Macro

Contents | Index | Home
Previous | Up | Next
PB_HIDE Macro
C
#define PB_HIDE 0x8000  // Bit to indicate Progress Bar must be hidden.
Description

Bit to indicate Progress Bar must be hidden.

Library API > Graphics Object Layer API > GOL Objects > Progress Bar > Progress Bar States > PB_HIDE Macro


PB_VERTICAL Macro

Contents | Index | Home
Previous | Up | Next
PB_VERTICAL Macro
C
#define PB_VERTICAL 0x0004  // Bit for orientation  (0 - horizontal, 1 - vertical)
Description

Bit for orientation (0 - horizontal, 1 - vertical)

Library API > Graphics Object Layer API > GOL Objects > Progress Bar > Progress Bar States > PB_VERTICAL Macro


PbCreate Function

Contents | Index | Home
Previous | Up | Next
PbCreate Function
Progress Bar
C
PROGRESSBAR * PbCreate(
    WORD ID,
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    WORD state,
    WORD pos,
    WORD range,
    GOL_SCHEME * pScheme
);
Overview

This function creates a PROGRESSBAR object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.

Input Parameters
Input Parameters | Description
WORD ID | Unique user defined ID for the object instance.
SHORT left | Left most position of the Object.
SHORT top | Top most position of the Object.
SHORT right | Right most position of the Object.
SHORT bottom | Bottom most position of the Object.
WORD state | Sets the initial state of the Object.
WORD pos | Defines the initial position of the progress.
WORD range | This specifies the maximum value of the progress bar when the progress bar is at 100% position.
GOL_SCHEME * pScheme | Pointer to the style scheme used for the object. Set to NULL if default style scheme is used.
Returns

Returns the pointer to the object created

Preconditions

none

Side Effects

none

Example
Copy Code
PROGRESSBAR *pPBar;
void CreateProgressBar(){
    pPBar = PbCreate(ID_PROGRESSBAR1,    // ID
                     50,90,270,140,      // dimension
                     PB_DRAW,            // Draw the object
                     25,                 // position
                     50,                 // set the range
                     NULL);              // use default GOL scheme
    while(!PbDraw(pPBar));
}
Library API > Graphics Object Layer API > GOL Objects > Progress Bar > PbCreate Function


PbDraw Function

Contents | Index | Home
Previous | Up | Next
PbDraw Function
Progress Bar
C
WORD PbDraw(
    void * pObj
);
Overview

This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set.

When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.

Input Parameters
Input Parameters | Description
pPb | Pointer to the object to be rendered.
Returns

Returns the status of the drawing

  • 1 - If the rendering was completed and
  • 0 - If the rendering is not yet finished.
Next call to the function will resume the rendering on the pending drawing state.

Preconditions

Object must be created before this function is called.

Side Effects

none

Example

See PbCreate() example.

Library API > Graphics Object Layer API > GOL Objects > Progress Bar > PbDraw Function


PbSetRange Function

Contents | Index | Home
Previous | Up | Next
PbSetRange Function
Progress Bar
C
void PbSetRange(
    PROGRESSBAR * pPb,
    WORD range
);
Overview

This function sets the range of the progress bar. Calling this function also resets the position equal to the new range value.

Input Parameters
Input Parameters | Description
PROGRESSBAR * pPb | Pointer to the object
Returns

none.

Preconditions

none

Side Effects

Sets the position equal to the new range.

Library API > Graphics Object Layer API > GOL Objects > Progress Bar > PbSetRange Function


PbGetRange Macro

Contents | Index | Home
Previous | Up | Next
PbGetRange Macro
Progress Bar
C
#define PbGetRange(pPb) (pPb->range)
Overview

This macro returns the current range of the progress bar.

Input Parameters
Input Parameters | Description
pPb | Pointer to the object
Returns

Returns the range value.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Progress Bar > PbGetRange Macro


PbSetPos Function

Contents | Index | Home
Previous | Up | Next
PbSetPos Function
Progress Bar
C
void PbSetPos(
    PROGRESSBAR * pPb,
    WORD position
);
Overview

This function sets the position of the progress bar. Position should be in the given range inclusive.

Input Parameters
Input Parameters | Description
PROGRESSBAR * pPb | Pointer to the object
WORD position | New position.
Returns

none

Preconditions

none

Side Effects

none

Example
Copy Code
PROGRESSBAR *pPb;
BYTE  direction = 1;

    // this code increments and decrements the progress bar by 1
    // assume progress bar was created and initialized before
    while (1) {
        if(direction) {
            if(pPb ->pos == pPb ->range)
                direction = 0;
            else
                PbSetPos(pPb,PbGetPos(pPb)+1);
        } else {
            if(pPb ->pos == 0)
                direction = 1;
            else
                PbSetPos(pPb,PbGetPos(pPb)-1);
        }
    }
Library API > Graphics Object Layer API > GOL Objects > Progress Bar > PbSetPos Function


PbGetPos Macro

Contents | Index | Home
Previous | Up | Next
PbGetPos Macro
Progress Bar
C
#define PbGetPos(pPb) pPb->pos
Overview

This macro returns the current progress bar position.

Input Parameters
Input Parameters | Description
pPb | Pointer to the object
Returns

Returns the progress bar position.

Preconditions

none

Side Effects

none

Example

See PbSetPos() exmaple.

Library API > Graphics Object Layer API > GOL Objects > Progress Bar > PbGetPos Macro


PbTranslateMsg Function

Contents | Index | Home
Previous | Up | Next
PbTranslateMsg Function
Progress Bar
C
WORD PbTranslateMsg(
    PROGRESSBAR * pPb,
    GOL_MSG * pMsg
);
Overview

This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen inputs.

Translated Message | Input Source | Events | Description
PB_MSG_SELECTED | Touch Screen | EVENT_PRESS, EVENT_RELEASE, EVENT_MOVE | If events occurs and the x,y position falls in the area of the progress bar.
OBJ_MSG_INVALID | Any | Any | If the message did not affect the object.
Input Parameters
Input Parameters | Description
PROGRESSBAR * pPb | The pointer to the object where the message will be evaluated to check if the message will affect the object.
GOL_MSG * pMsg | Pointer to the message struct containing the message from the user interface.
Returns

Returns the translated message depending on the received GOL message:

  • PB_MSG_SELECTED – Progress Bar is selected.
  • OBJ_MSG_INVALID – Progress Bar is not affected

Preconditions

none

Side Effects

none

Example

Usage is similar to BtnTranslateMsg() example.

Library API > Graphics Object Layer API > GOL Objects > Progress Bar > PbTranslateMsg Function


PROGRESSBAR Structure

Contents | Index | Home
Previous | Up | Next
PROGRESSBAR Structure
Progress Bar
C
typedef struct {
  OBJ_HEADER hdr;
  WORD pos;
  WORD prevPos;
  WORD range;
} PROGRESSBAR;
Overview

The structure contains data for the progress bar

Members
Members | Description
OBJ_HEADER hdr; | Generic header for all Objects (see OBJ_HEADER).
WORD pos; | Current progress position.
WORD prevPos; | Previous progress position.
WORD range; | Sets the range of the object.
Library API > Graphics Object Layer API > GOL Objects > Progress Bar > PROGRESSBAR Structure


Radio Button

Contents | Index | Home
Previous | Up | Next
Radio Button
Functions | Macros | Structures | Topics

Radio Button supports both Keyboard and Touchscreen inputs, replying to their events with the message: RB_MSG_CHECKED.

The Radio Button Object is rendered using the assigned style scheme. The following figure illustrates the color assignments.

Functions
Name | Description
RbCreate | This function creates a RADIOBUTTON object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
RbDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
RbGetCheck | This function returns the ID of the currently checked Radio Button in the group.
RbSetCheck | This function sets the Radio Button with the given ID to its checked state.
RbSetText | This function sets the string used for the object.
RbMsgDefault | This function performs the actual state change based on the translated message given. The following state changes are supported:
RbTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Macros
Name | Description
RbGetText | This macro returns the address of the current text string used for the object.
Structures
Name | Description
RADIOBUTTON | the structure contains data for the Radio Button
Topics
Name | Description
Radio Button States | List of Radio Button bit states.
Links
Functions, GOL Objects, Legend, Macros, Structures, Topics
Library API > Graphics Object Layer API > GOL Objects > Radio Button


Radio Button States

Contents | Index | Home
Previous | Up | Next
Radio Button States
Macros | Radio Button

List of Radio Button bit states.

Macros
Name | Description
RB_CHECKED | Bit to indicate Radio Button is checked.
RB_DISABLED | Bit for disabled state.
RB_DRAW | Bit to indicate whole Radio Button must be redrawn.
RB_DRAW_CHECK | Bit to indicate check mark should be redrawn.
RB_DRAW_FOCUS | Bit to indicate focus must be redrawn.
RB_FOCUSED | Bit for focused state.
RB_GROUP | Bit to indicate the first Radio Button in the group.
RB_HIDE | Bit to indicate that button must be removed from screen.
Module

Radio Button

Links
Macros, Radio Button
Library API > Graphics Object Layer API > GOL Objects > Radio Button > Radio Button States


RB_CHECKED Macro

Contents | Index | Home
Previous | Up | Next
RB_CHECKED Macro
C
#define RB_CHECKED 0x0004  // Bit to indicate Radio Button is checked.
Description

Bit to indicate Radio Button is checked.

Library API > Graphics Object Layer API > GOL Objects > Radio Button > Radio Button States > RB_CHECKED Macro


RB_DISABLED Macro

Contents | Index | Home
Previous | Up | Next
RB_DISABLED Macro
C
#define RB_DISABLED 0x0002  // Bit for disabled state.
Description

Bit for disabled state.

Library API > Graphics Object Layer API > GOL Objects > Radio Button > Radio Button States > RB_DISABLED Macro


RB_DRAW Macro

Contents | Index | Home
Previous | Up | Next
RB_DRAW Macro
C
#define RB_DRAW 0x4000  // Bit to indicate whole Radio Button must be redrawn.
Description

Bit to indicate whole Radio Button must be redrawn.

Library API > Graphics Object Layer API > GOL Objects > Radio Button > Radio Button States > RB_DRAW Macro


RB_DRAW_CHECK Macro

Contents | Index | Home
Previous | Up | Next
RB_DRAW_CHECK Macro
C
#define RB_DRAW_CHECK 0x1000  // Bit to indicate check mark should be redrawn.
Description

Bit to indicate check mark should be redrawn.

Library API > Graphics Object Layer API > GOL Objects > Radio Button > Radio Button States > RB_DRAW_CHECK Macro


RB_DRAW_FOCUS Macro

Contents | Index | Home
Previous | Up | Next
RB_DRAW_FOCUS Macro
C
#define RB_DRAW_FOCUS 0x2000  // Bit to indicate focus must be redrawn.
Description

Bit to indicate focus must be redrawn.

Library API > Graphics Object Layer API > GOL Objects > Radio Button > Radio Button States > RB_DRAW_FOCUS Macro


RB_FOCUSED Macro

Contents | Index | Home
Previous | Up | Next
RB_FOCUSED Macro
C
#define RB_FOCUSED 0x0001  // Bit for focused state.
Description

Bit for focused state.

Library API > Graphics Object Layer API > GOL Objects > Radio Button > Radio Button States > RB_FOCUSED Macro


RB_GROUP Macro

Contents | Index | Home
Previous | Up | Next
RB_GROUP Macro
C
#define RB_GROUP 0x0008  // Bit to indicate the first Radio Button in the group.
Description

Bit to indicate the first Radio Button in the group.

Library API > Graphics Object Layer API > GOL Objects > Radio Button > Radio Button States > RB_GROUP Macro


RB_HIDE Macro

Contents | Index | Home
Previous | Up | Next
RB_HIDE Macro
C
#define RB_HIDE 0x8000  // Bit to indicate that button must be removed from screen.
Description

Bit to indicate that button must be removed from screen.

Library API > Graphics Object Layer API > GOL Objects > Radio Button > Radio Button States > RB_HIDE Macro


RbCreate Function

Contents | Index | Home
Previous | Up | Next
RbCreate Function
Radio Button
C
RADIOBUTTON * RbCreate(
    WORD ID,
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    WORD state,
    XCHAR * pText,
    GOL_SCHEME * pScheme
);
Overview

This function creates a RADIOBUTTON object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.

Input Parameters
Input Parameters | Description
WORD ID | Unique user defined ID for the object instance.
SHORT left | Left most position of the Object.
SHORT top | Top most position of the Object.
SHORT right | Right most position of the Object
SHORT bottom | Bottom most position of the object
WORD state | Sets the initial state of the object pText – The pointer to the text used for the Radio Button.
GOL_SCHEME * pScheme | Pointer to the style scheme used.
Returns

Returns the pointer to the object created

Preconditions

none

Side Effects

none

Example
Copy Code
GOL_SCHEME *pScheme;
RADIOBUTTON *pRb[3];

    pScheme = GOLCreateScheme();
    pRb[0] = RbCreate(ID_RADIOBUTTON1,              // ID
                      255,40,310,80,                // dimension
                      RB_DRAW|RB_GROUP|RB_CHECKED,  // will be dislayed and
                                                    // focused after creation
                                                    // first button in the group
                      "RB1",                        // text
                      pScheme);                     // scheme used

    pRb[1] = RbCreate(ID_RADIOBUTTON2,              // ID
                      255,85,310,125,               // dimension
                      RB_DRAW,                      // will be dislayed and
                                                    // checked after creation
                      "RB2",                        // text
                      pScheme);                     // scheme used

    pRb[2] = RbCreate(ID_RADIOBUTTON3,              // ID
                      255,130,310,170,              // dimension
                      RB_DRAW,                      // will be dislayed and
                                                    // disabled after creation
                      "RB3",                        // text
                      pScheme);                     // scheme used

    while(!RbDraw(pRb[0]));                         // draw the objects
    while(!RbDraw(pRb[1]));
    while(!RbDraw(pRb[2]));
Library API > Graphics Object Layer API > GOL Objects > Radio Button > RbCreate Function


RbDraw Function

Contents | Index | Home
Previous | Up | Next
RbDraw Function
Radio Button
C
WORD RbDraw(
    void * pObj
);
Overview

This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set.

When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.

Input Parameters
Input Parameters | Description
pB | Pointer to the object to be rendered.
Returns

Returns the status of the drawing

  • 1 - If the rendering was completed and
  • 0 - If the rendering is not yet finished.
Next call to the function will resume the rendering on the pending drawing state.

Preconditions

Object must be created before this function is called.

Side Effects

none

Example

See RbCreate() example.

Library API > Graphics Object Layer API > GOL Objects > Radio Button > RbDraw Function


RbGetCheck Function

Contents | Index | Home
Previous | Up | Next
RbGetCheck Function
Radio Button
C
WORD RbGetCheck(
    RADIOBUTTON * pRb
);
Overview

This function returns the ID of the currently checked Radio Button in the group.

Input Parameters
Input Parameters | Description
RADIOBUTTON * pRb | Pointer to the Radio Button in the group.
Returns

Returns the ID of the selected button in the group. It returns -1 if there is no object checked.

Preconditions

none

Side Effects

none

Example
Copy Code
GOL_SCHEME *pScheme;
RADIOBUTTON *pRb[3];
SHORT ID;

    pScheme = GOLCreateScheme();
    pRb[0] = RbCreate(ID_RADIOBUTTON1,              // ID
                      255,40,310,80,                // dimension
                      RB_DRAW|RB_GROUP|RB_CHECKED,  // will be dislayed and
                                                    // focused after creation
                                                    // first button in the group
                      "RB1",                        // text
                      pScheme);                     // scheme used

    pRb[1] = RbCreate(ID_RADIOBUTTON2,              // ID
                      255,85,310,125,               // dimension
                      RB_DRAW,                      // will be dislayed and
                                                    // checked after creation
                      "RB2",                        // text
                      pScheme);                     // scheme used

    pRb[2] = RbCreate(ID_RADIOBUTTON3,              // ID
                      255,130,310,170,              // dimension
                      RB_DRAW,                      // will be dislayed and
                                                    // disabled after creation
                      "RB3",                        // text
                      pScheme);                     // scheme used

    // draw the Radio Buttons here

    ID = RbGetCheck(pRb[2]);                        // can also use pRb[1] or
                                                    // pRb[0] to search the
                                                    // checked radio button of the
                                                    // group. ID here should
                                                    // be ID_RADIOBUTTON1
    if (ID == ID_RADIOBUTTON1) {
        // do something here then clear the check
        ClrState(pRb[0], RB_CHECKED);
        // Change the checked object. Pointer used is any of the three.
        // the ID used will find the correct object to be checked
        RbSetCheck(pRb[3], ID_RADIOBUTTON2);
    }
Library API > Graphics Object Layer API > GOL Objects > Radio Button > RbGetCheck Function


RbSetCheck Function

Contents | Index | Home
Previous | Up | Next
RbSetCheck Function
Radio Button
C
void RbSetCheck(
    RADIOBUTTON * pRb,
    WORD ID
);
Overview

This function sets the Radio Button with the given ID to its checked state.

Input Parameters
Input Parameters | Description
RADIOBUTTON * pRb | Pointer to the Radio Button in the group.
WORD ID | ID of the object to be checked.
Returns

none

Preconditions

none

Side Effects

none

Example

See RbGetCheck() example.

Library API > Graphics Object Layer API > GOL Objects > Radio Button > RbSetCheck Function


RbGetText Macro

Contents | Index | Home
Previous | Up | Next
RbGetText Macro
Radio Button
C
#define RbGetText(pRb) pRb->pText
Overview

This macro returns the address of the current text string used for the object.

Input Parameters
Input Parameters | Description
pRb | Pointer to the object
Returns

Returns pointer to the text string being used.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Radio Button > RbGetText Macro


RbSetText Function

Contents | Index | Home
Previous | Up | Next
RbSetText Function
Radio Button
C
void RbSetText(
    RADIOBUTTON * pRb,
    XCHAR * pText
);
Overview

This function sets the string used for the object.

Input Parameters
Input Parameters | Description
RADIOBUTTON * pRb | The pointer to the object whose text will be modified
XCHAR * pText | Pointer to the text that will be used
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Radio Button > RbSetText Function


RbMsgDefault Function

Contents | Index | Home
Previous | Up | Next
RbMsgDefault Function
Radio Button
C
void RbMsgDefault(
    WORD translatedMsg,
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function performs the actual state change based on the translated message given. The following state changes are supported:

Translated Message | Input Source | Set/Clear State Bit | Description
RB_MSG_CHECKED | Touch Screen, | Set RB_DRAW, | Depending on the current value of RB_CHECKED Check Box will be redrawn.
 | Keyboard | Set/Clear RB_CHECKED |
Input Parameters
Input Parameters | Description
WORD translatedMsg | The translated message
GOL_MSG * pMsg | The pointer to the GOL message
pRb | The pointer to the object whose state will be modified
Returns

none

Preconditions

none

Side Effects

none

Example

See BtnTranslateMsg() example.

Library API > Graphics Object Layer API > GOL Objects > Radio Button > RbMsgDefault Function


RbTranslateMsg Function

Contents | Index | Home
Previous | Up | Next
RbTranslateMsg Function
Radio Button
C
WORD RbTranslateMsg(
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.

Translated Message | Input Source | Events | Description
RB_MSG_CHECKED | Touch Screen | EVENT_PRESS | If event occurs and the x,y position falls in the area of the Radio Button while the Radio Button is not checked.
 | Keyboard | EVENT_KEYSCAN | If event occurs and parameter1 passed matches the object’s ID and parameter 2 passed matches SCAN_CR_PRESSED or SCAN_SPACE_PRESSED while the Radio Button is not checked.
OBJ_MSG_INVALID | Any | Any | If the message did not affect the object.
Input Parameters
Input Parameters | Description
GOL_MSG * pMsg | Pointer to the message struct containing the message from the user interface.
pRb | The pointer to the object where the message will be evaluated to check if the message will affect the object.
Returns

Returns the translated message depending on the received GOL message:

  • RB_MSG_CHECKED – Radio Button is checked
  • OBJ_MSG_INVALID – Radio Button is not affected

Preconditions

none

Side Effects

none

Example

Usage is similar to BtnTranslateMsg() example.

Library API > Graphics Object Layer API > GOL Objects > Radio Button > RbTranslateMsg Function


RADIOBUTTON Structure

Contents | Index | Home
Previous | Up | Next
RADIOBUTTON Structure
Radio Button
C
typedef struct {
  OBJ_HEADER hdr;
  OBJ_HEADER * pHead;
  OBJ_HEADER * pNext;
  SHORT textHeight;
  XCHAR * pText;
} RADIOBUTTON;
Overview

the structure contains data for the Radio Button

Members
Members | Description
OBJ_HEADER hdr; | Generic header for all Objects (see OBJ_HEADER).
OBJ_HEADER * pHead; | Pointer to the first Radio Button in the group
OBJ_HEADER * pNext; | Pointer to the next Radio Button in the group
SHORT textHeight; | Pre-computed text height
XCHAR * pText; | Pointer to the text
Library API > Graphics Object Layer API > GOL Objects > Radio Button > RADIOBUTTON Structure


Slider/Scroll Bar

Contents | Index | Home
Previous | Up | Next
Slider/Scroll Bar
Functions | Macros | Structures | Topics

Slider or Scrollbar supports both Keyboard and Touchscreen inputs, replying to their events with the following messages:

1. SLD_MSG_INC - when the thumb is to be incremented in position

2. SLD_MSG_DEC - when the thumb is to be decremented in position

The Slider object is rendered using the assigned style scheme. The following figure illustrates the color assignments.

Functions
Name | Description
SldCreate | This function creates a SLIDER object with the parameters given. Depending on the SLD_SCROLLBAR state bit slider or scrollbar mode is set. If SLD_SCROLLBAR is set, mode is scrollbar; if not set mode is slider. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
SldDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
SldSetPage | This sets the page size of the object. Page size defines the delta change of the thumb position when incremented via SldIncPos() or decremented via SldDecPos(). Page size minimum value is 1. Maximum value is range/2.
SldSetPos | This function sets the position of the slider thumb. Value should be in the set range inclusive. Object must be redrawn to reflect the change.
SldSetRange | This sets the range of the thumb. If this field is changed Object must be completely redrawn to reflect the change.
SldMsgDefault | This function performs the actual state change based on the translated message given. The following state changes are supported:
SldTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Macros
Name | Description
SldGetPage | Returns the current page size of the object. Page size defines the delta change of the thumb position when incremented via SldIncPos() or decremented via SldDecPos(). Page size minimum value is 1. Maximum value is range/2.
SldGetPos | Returns returns the current position of the slider thumb.
SldGetRange | Returns the current range of the thumb.
SldIncPos | This macro increment the slider position by the delta change (page) value set. Object must be redrawn after this function is called to reflect the changes to the object.
SldDecPos | This macro decrement the slider position by the delta change (page) value set. Object must be redrawn after this function is called to reflect the changes to the object.
Structures
Name | Description
SLIDER | Defines the parameters required for a slider/scrollbar Object. Depending on the SLD_SCROLLBAR state bit slider or scrollbar mode is set. If SLD_SCROLLBAR is set, mode is scrollbar; if not set mode is slider. For scrollbar mode, focus rectangle is not drawn.
Topics
Name | Description
Slider States | List of Slider bit states.
Links
Functions, GOL Objects, Legend, Macros, Structures, Topics
Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar


Slider States

Contents | Index | Home
Previous | Up | Next
Slider States
Macros | Slider/Scroll Bar

List of Slider bit states.

Macros
Name | Description
SLD_DISABLED | Bit for disabled state
SLD_DRAW | Bit to indicate whole slider must be redrawn
SLD_DRAW_FOCUS | Bit to indicate that only the focus will be redrawn
SLD_DRAW_THUMB | Bit to indicate that only thumb area must be redrawn
SLD_FOCUSED | Bit for focus state
SLD_HIDE | Bit to remove object from screen
SLD_SCROLLBAR | Bit for type usage (0 - Slider, 1 - ScrollBar)
SLD_VERTICAL | Bit for orientation (0 - horizontal, 1 - vertical)
Module

Slider/Scroll Bar

Links
Macros, Slider/Scroll Bar
Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > Slider States


SLD_DISABLED Macro

Contents | Index | Home
Previous | Up | Next
SLD_DISABLED Macro
C
#define SLD_DISABLED 0x0002  // Bit for disabled state
Description

Bit for disabled state

Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > Slider States > SLD_DISABLED Macro


SLD_DRAW Macro

Contents | Index | Home
Previous | Up | Next
SLD_DRAW Macro
C
#define SLD_DRAW 0x4000  // Bit to indicate whole slider must be redrawn
Description

Bit to indicate whole slider must be redrawn

Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > Slider States > SLD_DRAW Macro


SLD_DRAW_FOCUS Macro

Contents | Index | Home
Previous | Up | Next
SLD_DRAW_FOCUS Macro
C
#define SLD_DRAW_FOCUS 0x2000  // Bit to indicate that only the focus will be redrawn
Description

Bit to indicate that only the focus will be redrawn

Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > Slider States > SLD_DRAW_FOCUS Macro


SLD_DRAW_THUMB Macro

Contents | Index | Home
Previous | Up | Next
SLD_DRAW_THUMB Macro
C
#define SLD_DRAW_THUMB 0x1000  // Bit to indicate that only thumb area must be redrawn
Description

Bit to indicate that only thumb area must be redrawn

Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > Slider States > SLD_DRAW_THUMB Macro


SLD_FOCUSED Macro

Contents | Index | Home
Previous | Up | Next
SLD_FOCUSED Macro
C
#define SLD_FOCUSED 0x0001  // Bit for focus state
Description

Bit for focus state

Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > Slider States > SLD_FOCUSED Macro


SLD_HIDE Macro

Contents | Index | Home
Previous | Up | Next
SLD_HIDE Macro
C
#define SLD_HIDE 0x8000  // Bit to remove object from screen
Description

Bit to remove object from screen

Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > Slider States > SLD_HIDE Macro


SLD_SCROLLBAR Macro

Contents | Index | Home
Previous | Up | Next
SLD_SCROLLBAR Macro
C
#define SLD_SCROLLBAR 0x0010  // Bit for type usage (0 - Slider, 1 - ScrollBar)
Description

Bit for type usage (0 - Slider, 1 - ScrollBar)

Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > Slider States > SLD_SCROLLBAR Macro


SLD_VERTICAL Macro

Contents | Index | Home
Previous | Up | Next
SLD_VERTICAL Macro
C
#define SLD_VERTICAL 0x0004  // Bit for orientation  (0 - horizontal, 1 - vertical)
Description

Bit for orientation (0 - horizontal, 1 - vertical)

Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > Slider States > SLD_VERTICAL Macro


SldCreate Function

Contents | Index | Home
Previous | Up | Next
SldCreate Function
Slider/Scroll Bar
C
SLIDER * SldCreate(
    WORD ID,
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    WORD state,
    WORD range,
    WORD page,
    WORD pos,
    GOL_SCHEME * pScheme
);
Overview

This function creates a SLIDER object with the parameters given. Depending on the SLD_SCROLLBAR state bit slider or scrollbar mode is set. If SLD_SCROLLBAR is set, mode is scrollbar; if not set mode is slider. It automatically attaches the new object into a global linked list of objects and returns the address of the object.

Input Parameters
Input Parameters | Description
WORD ID | Unique user defined ID for the object instance.
SHORT left | Left most position of the Object.
SHORT top | Top most position of the Object.
SHORT right | Right most position of the Object.
SHORT bottom | Bottom most position of the Object.
WORD state | This defines the initial state of the Object.
WORD range | This specifies the maximum value of the slider when the thumb is on the rightmost position for a horizontal orientation and bottom most position for the vertical orientation. Minimum value is always at zero.
WORD page | This is the incremental change of the slider when user action requests to move the slider thumb. This value is added or subtracted to the current position of the thumb.
WORD pos | This defines the initial position of the thumb.
GOL_SCHEME * pScheme | The pointer to the style scheme used for the Object. Set to NULL if default style scheme is used.
Returns

Returns the pointer to the object created.

Preconditions

none

Side Effects

none

Example
Copy Code
GOL_SCHEME *pScheme;
SLIDER *slider[3];
WORD state;

    pScheme = GOLCreateScheme();

    // create a slider with
    //       range = [0 – 50000]
    //       delta = 500
    //       initial position = 25000
    state = SLD_DRAW;
    slider[0] = SldCreate(  5,
                            150, 145, 285, 181,
                            state,
                            50000, 500, 25000,
                            pScheme);
    if (slider[0] == NULL)
        return 0;

    // create a scrollbar with
    //       range = [0 – 100]
    //       delta = 20
    //       initial position = 0

    state = SLD_DRAW|SLD_SCROLLBAR;
    slider[1] = SldCreate(  6,
                            150, 190, 285, 220,
                            state,
                            100, 20, 0,
                            pScheme);
    if (slider[1] == NULL)
        return 0;

    // create a vertical slider with
    //       range = [0 – 30]
    //       delta = 2
    //       initial position = 20

    state = SLD_DRAW|SLD_VERTICAL;
    slider[2] = SldCreate(  7,
                            120, 145, 140, 220,
                            state,
                            30, 2, 20,
                            pScheme);
    if (slider[2] == NULL)
        return 0;

    // draw the sliders
    while(!sldDraw(slider[0]);      // draw the horizontal slider
    while(!sldDraw(slider[1]);      // draw the horizontal scroll bar
    while(!sldDraw(slider[2]);      // draw the vertical slider
    return 1;
Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > SldCreate Function


SldDraw Function

Contents | Index | Home
Previous | Up | Next
SldDraw Function
Slider/Scroll Bar
C
WORD SldDraw(
    void * pObj
);
Overview

This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object.

When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.

Input Parameters
Input Parameters | Description
pSld | Pointer to the object to be rendered.
Returns

Returns the status of the drawing

  • 1 - If the rendering was completed and
  • 0 - If the rendering is not yet finished.
Next call to the function will resume the rendering on the pending drawing state.

Preconditions

Object must be created before this function is called.

Side Effects

none

Example

See SldCreate() example.

Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > SldDraw Function


SldSetPage Function

Contents | Index | Home
Previous | Up | Next
SldSetPage Function
Slider/Scroll Bar
C
void SldSetPage(
    SLIDER * pSld,
    WORD newPage
);
Overview

This sets the page size of the object. Page size defines the delta change of the thumb position when incremented via SldIncPos() or decremented via SldDecPos(). Page size minimum value is 1. Maximum value is range/2.

Input Parameters
Input Parameters | Description
SLIDER * pSld | Pointer to the object.
WORD newPage | Value of the new page used.
Returns

None.

Preconditions

none

Side Effects

Position of the thumb may change when redrawn.

Example

See SldIncPos() example.

Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > SldSetPage Function


SldGetPage Macro

Contents | Index | Home
Previous | Up | Next
SldGetPage Macro
Slider/Scroll Bar
C
#define SldGetPage(pSld) (((SLIDER*)pSld)->page)
Overview

Returns the current page size of the object. Page size defines the delta change of the thumb position when incremented via SldIncPos() or decremented via SldDecPos(). Page size minimum value is 1. Maximum value is range/2.

Input Parameters
Input Parameters | Description
pSld | Pointer to the object.
Returns

Returns the current value of the slider page.

Preconditions

none

Side Effects

none

Example
Copy Code
WORD page;
SLIDER *pSld;

    page = SldGetPage(pSld);
Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > SldGetPage Macro


SldSetPos Function

Contents | Index | Home
Previous | Up | Next
SldSetPos Function
Slider/Scroll Bar
C
void SldSetPos(
    SLIDER * pSld,
    SHORT newPos
);
Overview

This function sets the position of the slider thumb. Value should be in the set range inclusive. Object must be redrawn to reflect the change.

Input Parameters
Input Parameters | Description
SLIDER * pSld | Pointer to the object.
SHORT newPos | The new position of the slider's thumb.
Returns

none

Preconditions

none

Side Effects

none

Example
Copy Code
SLIDER *pSlider;
DWORD ctr = 0;

    // create slider here and initialize parameters
    SetState(pSlider, SLD_DRAW);
    SldDraw(pSlider);

    while("some condition") {
        SldSetPos(pSlider, ctr);
        SetState(pSlider, SLD_DRAW_THUMB);
        SldDraw(pSlider);
        // update ctr here
        ctr = "some source of value";
    }
Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > SldSetPos Function


SldGetPos Macro

Contents | Index | Home
Previous | Up | Next
SldGetPos Macro
Slider/Scroll Bar
C
#define SldGetPos(pSld) (((SLIDER*)pSld)->pos)
Overview

Returns returns the current position of the slider thumb.

Input Parameters
Input Parameters | Description
pSld | Pointer to the object.
Returns

Returns the current position of the slider's thumb.

Preconditions

none

Side Effects

none

Example
Copy Code
#define MAXVALUE 100;

SLIDER *pSlider;
DWORD ctr = 0;

    // create slider here and initialize parameters
    SetState(pSlider, SLD_DRAW);
    SldDraw(pSlider);

    while("some condition") {
        SldSetPos(pSlider, ctr);
        SetState(pSlider, SLD_DRAW_THUMB);
        SldDraw(pSlider);
        // update ctr here
        ctr = "some source of value";
    }

    if (SldGetPos(pSlider) > (MAXVALUE – 1))
       return 0;
    else
        "do something else"
Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > SldGetPos Macro


SldSetRange Function

Contents | Index | Home
Previous | Up | Next
SldSetRange Function
Slider/Scroll Bar
C
void SldSetRange(
    SLIDER * pSld,
    SHORT newRange
);
Overview

This sets the range of the thumb. If this field is changed Object must be completely redrawn to reflect the change.

Input Parameters
Input Parameters | Description
SLIDER * pSld | Pointer to the object.
SHORT newRange | Value of the new range used.
Returns

None.

Preconditions

none

Side Effects

Position of the thumb may change when redrawn.

Example
Copy Code
SLIDER *pSld;

    SldSetRange(pSld, 100);
    // to completely redraw the object when GOLDraw() is executed.
    SetState(pSld, SLD_DRAW);
Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > SldSetRange Function


SldGetRange Macro

Contents | Index | Home
Previous | Up | Next
SldGetRange Macro
Slider/Scroll Bar
C
#define SldGetRange(pSld) (((SLIDER*)pSld)->range)
Overview

Returns the current range of the thumb.

Input Parameters
Input Parameters | Description
pSld | Pointer to the object.
Returns

Returns the current range of the slider thumb.

Preconditions

none

Side Effects

none

Example
Copy Code
WORD range;
SLIDER *pSld;

    range = SldGetRange(pSld);
Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > SldGetRange Macro


SldIncPos Macro

Contents | Index | Home
Previous | Up | Next
SldIncPos Macro
Slider/Scroll Bar
C
#define SldIncPos(pSld) \
    SldSetPos                                                                                      \
    (                                                                                              \
        pSld,                                                                                      \
        (((DWORD) pSld->pos + (DWORD) ((SLIDER*)pSld)->page) <= (DWORD) ((SLIDER*)pSld)->range) ?  \
                        (((SLIDER*)pSld)->pos + ((SLIDER*)pSld)->page) : ((SLIDER*)pSld)->range    \
    )
Overview

This macro increment the slider position by the delta change (page) value set. Object must be redrawn after this function is called to reflect the changes to the object.

Input Parameters
Input Parameters | Description
pSld | Pointer to the object.
Returns

none

Preconditions

none

Side Effects

none

Example
Copy Code
void ControlSpeed(SLIDER* pSld, int setSpeed, int curSpeed)
{
    SldSetPage(pSld, 1);                    // set page size to 1
    if (setSpeed < curSpeed) {
        while(SldGetPos(pSld) < SetSpeed)
            SldIncPos(pSld);                // increment by 1
    }
    else if (setSpeed > curSpeed) {
        while(SldGetPos(pSld) > SetSpeed)
            SldDecPos(pSld);                // decrement by 1
    }
}
Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > SldIncPos Macro


SldDecPos Macro

Contents | Index | Home
Previous | Up | Next
SldDecPos Macro
Slider/Scroll Bar
C
#define SldDecPos(pSld) \
    SldSetPos                                                                                      \
    (                                                                                              \
        pSld,                                                                                      \
        (((LONG) ((SLIDER*)pSld)->pos - (LONG) ((SLIDER*)pSld)->page) >= 0) ?                      \
                        (((SLIDER*)pSld)->pos - ((SLIDER*)pSld)->page) : 0                         \
    )
Overview

This macro decrement the slider position by the delta change (page) value set. Object must be redrawn after this function is called to reflect the changes to the object.

Input Parameters
Input Parameters | Description
pSld | Pointer to the object.
Returns

none

Preconditions

none

Side Effects

none

Example

See SldIncPos() example.

Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > SldDecPos Macro


SldMsgDefault Function

Contents | Index | Home
Previous | Up | Next
SldMsgDefault Function
Slider/Scroll Bar
C
void SldMsgDefault(
    WORD translatedMsg,
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function performs the actual state change based on the translated message given. The following state changes are supported:

Translated Message | Input Source | Set/Clear State Bit | Description
SLD_MSG_INC | Touch Screen, Keyboard | Set SLD_DRAW_THUMB | Slider will be redrawn with thumb in the incremented position.
SLD_MSG_DEC | Touch Screen, Keyboard | Set SLD_DRAW_THUMB | Slider will be redrawn with thumb in the decremented position.
Input Parameters
Input Parameters | Description
WORD translatedMsg | The translated message.
GOL_MSG * pMsg | The pointer to the GOL message.
pSld | The pointer to the object whose state will be modified.
Returns

none

Preconditions

none

Side Effects

none

Example

Usage is similar to BtnTranslateMsg() example.

Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > SldMsgDefault Function


SldTranslateMsg Function

Contents | Index | Home
Previous | Up | Next
SldTranslateMsg Function
Slider/Scroll Bar
C
WORD SldTranslateMsg(
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.

Translated Message | Input Source | Events | Description
SLD_MSG_INC | Touch Screen | EVENT_PRESS, EVENT_MOVE | If events occurs and the x,y position falls in the area of the slider and the slider position is to the LEFT of the x,y position for a horizontal slider or BELOW the x,y position for a vertical slider.
 | Keyboard | EVENT_KEYSCAN | If event occurs and parameter1 passed matches the object’s ID and parameter 2 passed matches SCAN_UP_PRESSED or SCAN_LEFT_PRESSED.
SLD_MSG_DEC | Touch Screen | EVENT_PRESS, EVENT_MOVE | If events occurs and the x,y position falls in the area of the slider and the slider position is to the RIGHT of the x,y position for a horizontal slider or ABOVE the x,y position for a vertical slider.
 | Keyboard | EVENT_KEYSCAN | If event occurs and parameter1 passed matches the object’s ID and parameter 2 passed matches SCAN_DOWN_PRESSED or SCAN_RIGHT_PRESSED.
OBJ_MSG_PASSIVE | Touch Screen | EVENT_RELEASE | If events occurs and the x,y position falls in the area of the slider.
OBJ_MSG_INVALID | Any | Any | If the message did not affect the object.
Input Parameters
Input Parameters | Description
GOL_MSG * pMsg | Pointer to the message struct containing the message from the user interface.
pSld | The pointer to the object where the message will be evaluated to check if the message will affect the object.
Returns

Returns the translated message depending on the received GOL message:

  • SLD_MSG_INC – Increment slider position
  • SLD_MSG_DEC – Decrement slider position
  • OBJ_MSG_PASSIVE – Slider is not affected
  • OBJ_MSG_INVALID – Slider is not affected

Preconditions

none

Side Effects

none

Example

Usage is similar to BtnTranslateMsg() example.

Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > SldTranslateMsg Function


SLIDER Structure

Contents | Index | Home
Previous | Up | Next
SLIDER Structure
Slider/Scroll Bar
C
typedef struct {
  OBJ_HEADER hdr;
  WORD currPos;
  WORD prevPos;
  WORD range;
  WORD pos;
  WORD page;
  WORD thWidth;
  WORD thHeight;
} SLIDER;
Overview

Defines the parameters required for a slider/scrollbar Object. Depending on the SLD_SCROLLBAR state bit slider or scrollbar mode is set. If SLD_SCROLLBAR is set, mode is scrollbar; if not set mode is slider. For scrollbar mode, focus rectangle is not drawn.

Members
Members | Description
OBJ_HEADER hdr; | Generic header for all Objects (see OBJ_HEADER).
WORD currPos; | Position of the slider relative to minimum.
WORD prevPos; | Previous position of the slider relative to minimum.
WORD range; | User defined range of the slider. Minimum value at 0 and maximum at 0x7FFF.
WORD pos; | Position of the slider in range domain.
WORD page; | User specified resolution to incrementally change the position
WORD thWidth; | Thumb width. This is computed internally.
WORD thHeight; | Thumb width. This is computed internally. User must not change this value.
Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > SLIDER Structure


Static Text

Contents | Index | Home
Previous | Up | Next
Static Text
Functions | Macros | Structures | Topics

Static Text supports only Touchscreen inputs, replying to their events with the message:

ST_MSG_SELECTED - when the touch is within the dimension of the object.

The Static Text Object is rendered using the assigned style scheme. The following figure illustrates the color assignments.

Functions
Name | Description
StCreate | This function creates a STATICTEXT object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
StDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
StSetText | This function sets the string that will be used for the object.
StTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Macros
Name | Description
StGetText | This macro returns the address of the current text string used for the object.
Structures
Name | Description
STATICTEXT | Defines the parameters required for a Static Text Object.
Topics
Name | Description
Static Text States | List of Static Text bit states.
Links
Functions, GOL Objects, Legend, Macros, Structures, Topics
Library API > Graphics Object Layer API > GOL Objects > Static Text


Static Text States

Contents | Index | Home
Previous | Up | Next
Static Text States
Macros | Static Text

List of Static Text bit states.

Macros
Name | Description
ST_CENTER_ALIGN | Bit to indicate text is center aligned.
ST_DISABLED | Bit for disabled state.
ST_DRAW | Bit to indicate static text must be redrawn.
ST_FRAME | Bit to indicate frame is displayed.
ST_HIDE | Bit to remove object from screen.
ST_RIGHT_ALIGN | Bit to indicate text is left aligned.
ST_UPDATE | Bit to indicate that text area only is redrawn.
Module

Static Text

Links
Macros, Static Text
Library API > Graphics Object Layer API > GOL Objects > Static Text > Static Text States


ST_CENTER_ALIGN Macro

Contents | Index | Home
Previous | Up | Next
ST_CENTER_ALIGN Macro
C
#define ST_CENTER_ALIGN 0x0008  // Bit to indicate text is center aligned.
Description

Bit to indicate text is center aligned.

Library API > Graphics Object Layer API > GOL Objects > Static Text > Static Text States > ST_CENTER_ALIGN Macro


ST_DISABLED Macro

Contents | Index | Home
Previous | Up | Next
ST_DISABLED Macro
C
#define ST_DISABLED 0x0002  // Bit for disabled state.
Description

Bit for disabled state.

Library API > Graphics Object Layer API > GOL Objects > Static Text > Static Text States > ST_DISABLED Macro


ST_DRAW Macro

Contents | Index | Home
Previous | Up | Next
ST_DRAW Macro
C
#define ST_DRAW 0x4000  // Bit to indicate static text must be redrawn.
Description

Bit to indicate static text must be redrawn.

Library API > Graphics Object Layer API > GOL Objects > Static Text > Static Text States > ST_DRAW Macro


ST_FRAME Macro

Contents | Index | Home
Previous | Up | Next
ST_FRAME Macro
C
#define ST_FRAME 0x0010  // Bit to indicate frame is displayed.
Description

Bit to indicate frame is displayed.

Library API > Graphics Object Layer API > GOL Objects > Static Text > Static Text States > ST_FRAME Macro


ST_HIDE Macro

Contents | Index | Home
Previous | Up | Next
ST_HIDE Macro
C
#define ST_HIDE 0x8000  // Bit to remove object from screen.
Description

Bit to remove object from screen.

Library API > Graphics Object Layer API > GOL Objects > Static Text > Static Text States > ST_HIDE Macro


ST_RIGHT_ALIGN Macro

Contents | Index | Home
Previous | Up | Next
ST_RIGHT_ALIGN Macro
C
#define ST_RIGHT_ALIGN 0x0004  // Bit to indicate text is left aligned.
Description

Bit to indicate text is left aligned.

Library API > Graphics Object Layer API > GOL Objects > Static Text > Static Text States > ST_RIGHT_ALIGN Macro


ST_UPDATE Macro

Contents | Index | Home
Previous | Up | Next
ST_UPDATE Macro
C
#define ST_UPDATE 0x2000  // Bit to indicate that text area only is redrawn.
Description

Bit to indicate that text area only is redrawn.

Library API > Graphics Object Layer API > GOL Objects > Static Text > Static Text States > ST_UPDATE Macro


StCreate Function

Contents | Index | Home
Previous | Up | Next
StCreate Function
Static Text
C
STATICTEXT * StCreate(
    WORD ID,
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    WORD state,
    XCHAR * pText,
    GOL_SCHEME * pScheme
);
Overview

This function creates a STATICTEXT object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.

Input Parameters
Input Parameters | Description
WORD ID | Unique user defined ID for the object instance.
SHORT left | Left most position of the object.
SHORT top | Top most position of the object.
SHORT right | Right most position of the object.
SHORT bottom | Bottom most position of the object.
WORD state | Sets the initial state of the object.
XCHAR * pText | Pointer to the text used in the static text.
GOL_SCHEME * pScheme | Pointer to the style scheme. Set to NULL if default style scheme is used.
Returns

Returns the pointer to the object created.

Preconditions

none

Side Effects

none

Example
Copy Code
GOL_SCHEME *pScheme;
STATICTEXT *pSt;

    pScheme = GOLCreateScheme();
    state = ST_DRAW | ST_FRAME | ST_CENTER_ALIGN;
    StCreate(ID_STATICTEXT1,          // ID
             30,80,235,160,           // dimension
             state,                   // has frame and center aligned
             "Static Textn Example", // text
             pScheme);                // use given scheme

    while(!StDraw(pSt));              // draw the object
Library API > Graphics Object Layer API > GOL Objects > Static Text > StCreate Function


StDraw Function

Contents | Index | Home
Previous | Up | Next
StDraw Function
Static Text
C
WORD StDraw(
    void * pObj
);
Overview

This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set.

When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.

Input Parameters
Input Parameters | Description
pSt | Pointer to the object to be rendered.
Returns

Returns the status of the drawing

  • 1 - If the rendering was completed and
  • 0 - If the rendering is not yet finished.
Next call to the function will resume the rendering on the pending drawing state.

Preconditions

Object must be created before this function is called.

Side Effects

none

Example

See StCreate() Example.

Library API > Graphics Object Layer API > GOL Objects > Static Text > StDraw Function


StGetText Macro

Contents | Index | Home
Previous | Up | Next
StGetText Macro
Static Text
C
#define StGetText(pSt) pSt->pText
Overview

This macro returns the address of the current text string used for the object.

Input Parameters
Input Parameters | Description
pSt | Pointer to the object.
Returns

Returns the pointer to the text string used.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Static Text > StGetText Macro


StSetText Function

Contents | Index | Home
Previous | Up | Next
StSetText Function
Static Text
C
void StSetText(
    STATICTEXT * pSt,
    XCHAR * pText
);
Overview

This function sets the string that will be used for the object.

Input Parameters
Input Parameters | Description
STATICTEXT * pSt | The pointer to the object whose text string will be modified.
XCHAR * pText | The pointer to the string that will be used.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > GOL Objects > Static Text > StSetText Function


StTranslateMsg Function

Contents | Index | Home
Previous | Up | Next
StTranslateMsg Function
Static Text
C
WORD StTranslateMsg(
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.

Translated Message | Input Source | Events | Description
ST_MSG_SELECTED | Touch Screen | EVENT_PRESS, EVENT_RELEASE | If events occurs and the x,y position falls in the area of the static text.
OBJ_MSG_INVALID | Any | Any | If the message did not affect the object.
Input Parameters
Input Parameters | Description
GOL_MSG * pMsg | Pointer to the message struct containing the message from the user interface.
pSt | The pointer to the object where the message will be evaluated to check if the message will affect the object.
Returns

Returns the translated message depending on the received GOL message:

  • ST_MSG_SELECTED – Static Text is selected
  • OBJ_MSG_INVALID – Static Text is not affected

Preconditions

none

Side Effects

none

Example

Usage is similar to BtnTranslateMsg() example.

Library API > Graphics Object Layer API > GOL Objects > Static Text > StTranslateMsg Function


STATICTEXT Structure

Contents | Index | Home
Previous | Up | Next
STATICTEXT Structure
Static Text
C
typedef struct {
  OBJ_HEADER hdr;
  SHORT textHeight;
  XCHAR * pText;
} STATICTEXT;
Overview

Defines the parameters required for a Static Text Object.

Members
Members | Description
OBJ_HEADER hdr; | Generic header for all Objects (see OBJ_HEADER).
SHORT textHeight; | Pre-computed text height.
XCHAR * pText; | The pointer to text used.
Library API > Graphics Object Layer API > GOL Objects > Static Text > STATICTEXT Structure


Text Entry

Contents | Index | Home
Previous | Up | Next
Text Entry
Functions | Macros | Structures | Topics

Text Entry supports only Touchscreen inputs, replying to their events with the following messages:

1. TE_MSG_RELEASE – A key has been released.

2. TE_MSG_PRESS – A key is pressed.

3. TE_MSG_ADD_CHAR – A key was released with character assigned.

4. TE_MSG_DELETE – A key was released with delete command assigned.

5. TE_MSG_SPACE - A key was released with space command assigned.

6. TE_MSG_ENTER - A key was released with enter command assigned.

The Text Entry Object is rendered using the assigned style scheme. The following figure illustrates the color assignments.

Functions
Name | Description
TeCreate | This function creates a TEXTENTRY object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
TeDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. This widget will draw the keys using the function GOLPanelDraw(). The number of keys will depend on the horizontal and vertical parameters given (horizontalKeys*verticakKeys).
TeSetBuffer | This function sets the buffer used to display text. If the buffer is initialized with a string, the string must be a null terminated string. If the string length is greater than MaxSize, string will be truncated to MaxSize. pText must point to a valid memory location with size equal to MaxSize+1. The +1 is used for the string terminator.
TeClearBuffer | This function will clear the data in the display. You must set the drawing state bit TE_UPDATE_TEXT to update the TEXTENTRY on the screen.
TeGetKeyCommand | This function will return the currently used command by a key with the given index.
TeSetKeyCommand | This function will assign a command (TE_DELETE_COM, TE_SPACE_COM or TE_ENTER_COM) to a key with the given index.
TeCreateKeyMembers | This function will create the list of KEYMEMBERS that holds the information on each key. The number of keys is determined by the equation (verticalKeys*horizontalKeys). The object creates the information holder for each key automatically and assigns each entry in the *pText[] array with the first entry automatically assigned to the key with an index of 1. The number of entries to *pText[] must be equal or greater than (verticalKeys*horizontalKeys). The last key is assigned with an index of (verticalKeys*horizontalKeys)-1. No checking is performed on the length of *pText[] entries to match (verticalKeys*horizontalKeys).
TeAddChar | This function will insert a character to the end of the buffer. The character inserted is dependent on the currently pressed key. Drawing states TE_UPDATE_TEXT or TE_DRAW must be set to see the effect of this insertion.
TeIsKeyPressed | This function will test if a key given by its index in the TextEntry object has been pressed.
TeSpaceChar | This function will insert a space character to the end of the buffer. Drawing states TE_UPDATE_TEXT or TE_DRAW must be set to see the effect of this insertion.
TeDelKeyMembers | This function will delete the KEYMEMBER list assigned to the object from memory. Pointer to the KEYMEMBER list is then initialized to NULL.
TeSetKeyText | This function will set the test assigned to a key with the given index.
TeMsgDefault | This function performs the actual state change based on the translated message given. The following state changes are supported:
TeTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. If the message is valid, the keys in the Text Entry object will be scanned to detect which key was pressed. If True, the corresponding text will be displayed, the ‘text’ will also be stored in the TeOutput parameter of the object.
Macros
Name | Description
TeGetBuffer | This macro will return the currently used buffer in the TextEntry object.
Structures
Name | Description
TEXTENTRY | Defines the parameters required for a TextEntry Object.
KEYMEMBER | Defines the parameters and the strings assigned for each key.
Topics
Name | Description
TextEntry States | List of Text Entry bit states.
Key Command Types | List of available Key command types.
Links
Functions, GOL Objects, Legend, Macros, Structures, Topics
Library API > Graphics Object Layer API > GOL Objects > Text Entry


TextEntry States

Contents | Index | Home
Previous | Up | Next
TextEntry States
Macros | Text Entry

List of Text Entry bit states.

Macros
Name | Description
TE_KEY_PRESSED | Bit for press state of one of the keys.
TE_DISABLED | Bit for disabled state.
TE_ECHO_HIDE | Bit to hide the entered characters and instead echo "*" characters to the display.
TE_DRAW | Bit to indicate object must be redrawn.
TE_HIDE | Bit to indicate object must be removed from screen.
TE_UPDATE_KEY | Bit to indicate redraw of a key is needed.
TE_UPDATE_TEXT | Bit to indicate redraw of the text displayed is needed.
Module

Text Entry

Links
Macros, Text Entry
Library API > Graphics Object Layer API > GOL Objects > Text Entry > TextEntry States


TE_KEY_PRESSED Macro

Contents | Index | Home
Previous | Up | Next
TE_KEY_PRESSED Macro
C
#define TE_KEY_PRESSED 0x0004  // Bit for press state of one of the keys.
Description

Bit for press state of one of the keys.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TextEntry States > TE_KEY_PRESSED Macro


TE_DISABLED Macro

Contents | Index | Home
Previous | Up | Next
TE_DISABLED Macro
C
#define TE_DISABLED 0x0002  // Bit for disabled state.
Description

Bit for disabled state.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TextEntry States > TE_DISABLED Macro


TE_ECHO_HIDE Macro

Contents | Index | Home
Previous | Up | Next
TE_ECHO_HIDE Macro
C
#define TE_ECHO_HIDE 0x0008  // Bit to hide the entered characters and instead echo "*" characters to the display.
Description

Bit to hide the entered characters and instead echo "*" characters to the display.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TextEntry States > TE_ECHO_HIDE Macro


TE_DRAW Macro

Contents | Index | Home
Previous | Up | Next
TE_DRAW Macro
C
#define TE_DRAW 0x4000  // Bit to indicate object must be redrawn.
Description

Bit to indicate object must be redrawn.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TextEntry States > TE_DRAW Macro


TE_HIDE Macro

Contents | Index | Home
Previous | Up | Next
TE_HIDE Macro
C
#define TE_HIDE 0x8000  // Bit to indicate object must be removed from screen.
Description

Bit to indicate object must be removed from screen.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TextEntry States > TE_HIDE Macro


TE_UPDATE_KEY Macro

Contents | Index | Home
Previous | Up | Next
TE_UPDATE_KEY Macro
C
#define TE_UPDATE_KEY 0x2000  // Bit to indicate redraw of a key is needed.
Description

Bit to indicate redraw of a key is needed.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TextEntry States > TE_UPDATE_KEY Macro


TE_UPDATE_TEXT Macro

Contents | Index | Home
Previous | Up | Next
TE_UPDATE_TEXT Macro
C
#define TE_UPDATE_TEXT 0x1000  // Bit to indicate redraw of the text displayed is needed.
Description

Bit to indicate redraw of the text displayed is needed.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TextEntry States > TE_UPDATE_TEXT Macro


Key Command Types

Contents | Index | Home
Previous | Up | Next
Key Command Types
Macros | Text Entry

List of available Key command types.

Macros
Name | Description
TE_DELETE_COM | This macro is used to assign a "delete" command on a key.
TE_ENTER_COM | This macro is used to assign an "enter" (carriage return) command on a key.
TE_SPACE_COM | This macro is used to assign an insert "space" command on a key.
Module

Text Entry

Links
Macros, Text Entry
Library API > Graphics Object Layer API > GOL Objects > Text Entry > Key Command Types


TE_DELETE_COM Macro

Contents | Index | Home
Previous | Up | Next
TE_DELETE_COM Macro
C
#define TE_DELETE_COM 0x01    // This macro is used to assign a "delete" command on a key.
Description

This macro is used to assign a "delete" command on a key.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > Key Command Types > TE_DELETE_COM Macro


TE_ENTER_COM Macro

Contents | Index | Home
Previous | Up | Next
TE_ENTER_COM Macro
C
#define TE_ENTER_COM 0x03    // This macro is used to assign an "enter" (carriage return) command on a key.
Description

This macro is used to assign an "enter" (carriage return) command on a key.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > Key Command Types > TE_ENTER_COM Macro


TE_SPACE_COM Macro

Contents | Index | Home
Previous | Up | Next
TE_SPACE_COM Macro
C
#define TE_SPACE_COM 0x02    // This macro is used to assign an insert "space" command on a key.
Description

This macro is used to assign an insert "space" command on a key.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > Key Command Types > TE_SPACE_COM Macro


TeCreate Function

Contents | Index | Home
Previous | Up | Next
TeCreate Function
Text Entry
C
TEXTENTRY * TeCreate(
    WORD ID,
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    WORD state,
    SHORT horizontalKeys,
    SHORT verticalKeys,
    XCHAR * pText[],
    void * pBuffer,
    WORD bufferLength,
    void * pDisplayFont,
    GOL_SCHEME * pScheme
);
Overview

This function creates a TEXTENTRY object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.

Input Parameters
Input Parameters | Description
WORD ID | Unique user defined ID for the object instance
SHORT left | Left most position of the object.
SHORT top | Top most position of the object.
SHORT right | Right most position of the object.
SHORT bottom | Bottom most position of the object.
WORD state | state of the widget.
SHORT horizontalKeys | Number of horizontal keys
SHORT verticalKeys | Number of vertical keys
XCHAR * pText[] | array of pointer to the custom "text" assigned by the user.
void * pBuffer | pointer to the buffer that holds the text to be displayed.
WORD bufferLength | length of the buffer assigned by the user.
void * pDisplayFont | pointer to the font image to be used on the editbox
GOL_SCHEME * pScheme | Pointer to the style scheme used. Output Returns the pointer to the object created.
Preconditions

If the object will use customized keys, the structure CUSTOMEKEYS must be populated before calling this function.

Side Effects

none.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TeCreate Function


TeDraw Function

Contents | Index | Home
Previous | Up | Next
TeDraw Function
Text Entry
C
WORD TeDraw(
    void * pObj
);
Overview

This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object.

This widget will draw the keys using the function GOLPanelDraw(). The number of keys will depend on the horizontal and vertical parameters given (horizontalKeys*verticakKeys).

Input Parameters
Input Parameters | Description
pTe | Pointer to the object to be rendered.
Returns

Returns the status of the drawing

  • 1 - If the rendering was completed and
  • 0 - If the rendering is not yet finished.
Next call to the function will resume the rendering on the pending drawing state.

Preconditions

Object must be created before this function is called.

Side Effects

none.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TeDraw Function


TeGetBuffer Macro

Contents | Index | Home
Previous | Up | Next
TeGetBuffer Macro
Text Entry
C
#define TeGetBuffer(pTe) (((TEXTENTRY *)pTe)->pTeOutput)
Overview

This macro will return the currently used buffer in the TextEntry object.

Input Parameters
Input Parameters | Description
pTe | pointer to the object
Returns

It will return a pointer to the buffer used.

Preconditions

none

Side Effects

none.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TeGetBuffer Macro


TeSetBuffer Function

Contents | Index | Home
Previous | Up | Next
TeSetBuffer Function
Text Entry
C
void TeSetBuffer(
    TEXTENTRY * pTe,
    XCHAR * pText,
    WORD MaxSize
);
Overview

This function sets the buffer used to display text. If the buffer is initialized with a string, the string must be a null terminated string. If the string length is greater than MaxSize, string will be truncated to MaxSize. pText must point to a valid memory location with size equal to MaxSize+1. The +1 is used for the string terminator.

Input Parameters
Input Parameters | Description
TEXTENTRY * pTe | pointer to the object
XCHAR * pText | pointer to the new text buffer to be displayed
maxSize | maximum length of the new buffer to be used.
Returns

none.

Preconditions

none

Side Effects

none.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TeSetBuffer Function


TeClearBuffer Function

Contents | Index | Home
Previous | Up | Next
TeClearBuffer Function
Text Entry
C
void TeClearBuffer(
    TEXTENTRY * pTe
);
Overview

This function will clear the data in the display. You must set the drawing state bit TE_UPDATE_TEXT to update the TEXTENTRY on the screen.

Input Parameters
Input Parameters | Description
TEXTENTRY * pTe | pointer to the object
Returns

none

Preconditions

none

Side Effects

none.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TeClearBuffer Function


TeGetKeyCommand Function

Contents | Index | Home
Previous | Up | Next
TeGetKeyCommand Function
Text Entry
C
WORD TeGetKeyCommand(
    TEXTENTRY * pTe,
    WORD index
);
Overview

This function will return the currently used command by a key with the given index.

Input Parameters
Input Parameters | Description
TEXTENTRY * pTe | pointer to the object
WORD index | index to the key in the link list
Returns

It will return the command ID currently set for the key. If the given index is not in the list the function returns zero. 0x00 - no command is assigned or the index given does not exist. 0x01 - TE_DELETE_COM 0x02 - TE_SPACE_COM 0x03 - TE_ENTER_COM

Preconditions

none

Side Effects

none.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TeGetKeyCommand Function


TeSetKeyCommand Function

Contents | Index | Home
Previous | Up | Next
TeSetKeyCommand Function
Text Entry
C
BOOL TeSetKeyCommand(
    TEXTENTRY * pTe,
    WORD index,
    WORD command
);
Overview

This function will assign a command (TE_DELETE_COM, TE_SPACE_COM or TE_ENTER_COM) to a key with the given index.

Input Parameters
Input Parameters | Description
TEXTENTRY * pTe | pointer to the object
WORD index | index to the key in the link list
WORD command | command assigned for the key
Returns

Returns TRUE if successful and FALSE if not.

Preconditions

none

Side Effects

none.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TeSetKeyCommand Function


TeCreateKeyMembers Function

Contents | Index | Home
Previous | Up | Next
TeCreateKeyMembers Function
Text Entry
C
KEYMEMBER * TeCreateKeyMembers(
    TEXTENTRY * pTe,
    XCHAR * pText[]
);
Overview

This function will create the list of KEYMEMBERS that holds the information on each key. The number of keys is determined by the equation (verticalKeys*horizontalKeys). The object creates the information holder for each key automatically and assigns each entry in the *pText[] array with the first entry automatically assigned to the key with an index of 1. The number of entries to *pText[] must be equal or greater than (verticalKeys*horizontalKeys). The last key is assigned with an index of (verticalKeys*horizontalKeys)-1. No checking is performed on the length of *pText[] entries to match (verticalKeys*horizontalKeys).

Input Parameters
Input Parameters | Description
TEXTENTRY * pTe | pointer to the object
XCHAR * pText[] | pointer to the text defined by the user
Returns

Returns the pointer to the newly created KEYMEMBER list. A NULL is returned if the list is not created succesfully.

Preconditions

none

Side Effects

none.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TeCreateKeyMembers Function


TeAddChar Function

Contents | Index | Home
Previous | Up | Next
TeAddChar Function
Text Entry
C
void TeAddChar(
    TEXTENTRY * pTe
);
Overview

This function will insert a character to the end of the buffer. The character inserted is dependent on the currently pressed key. Drawing states TE_UPDATE_TEXT or TE_DRAW must be set to see the effect of this insertion.

Input Parameters
Input Parameters | Description
TEXTENTRY * pTe | pointer to the object
Preconditions

none

Side Effects

none.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TeAddChar Function


TeIsKeyPressed Function

Contents | Index | Home
Previous | Up | Next
TeIsKeyPressed Function
Text Entry
C
BOOL TeIsKeyPressed(
    TEXTENTRY * pTe,
    WORD index
);
Overview

This function will test if a key given by its index in the TextEntry object has been pressed.

Input Parameters
Input Parameters | Description
TEXTENTRY * pTe | pointer to the object
WORD index | index to the key in the link list
Returns

Returns a TRUE if the key is pressed. FALSE if key is not pressed or the given index does not exist in the list.

Preconditions

none

Side Effects

none.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TeIsKeyPressed Function


TeSpaceChar Function

Contents | Index | Home
Previous | Up | Next
TeSpaceChar Function
Text Entry
C
void TeSpaceChar(
    TEXTENTRY * pTe
);
Overview

This function will insert a space character to the end of the buffer. Drawing states TE_UPDATE_TEXT or TE_DRAW must be set to see the effect of this insertion.

Input Parameters
Input Parameters | Description
TEXTENTRY * pTe | pointer to the object
Returns

none.

Preconditions

none

Side Effects

none.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TeSpaceChar Function


TeDelKeyMembers Function

Contents | Index | Home
Previous | Up | Next
TeDelKeyMembers Function
Text Entry
C
void TeDelKeyMembers(
    void * pObj
);
Overview

This function will delete the KEYMEMBER list assigned to the object from memory. Pointer to the KEYMEMBER list is then initialized to NULL.

Input Parameters
Input Parameters | Description
pTe | pointer to the object
Returns

none.

Preconditions

none

Side Effects

none.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TeDelKeyMembers Function


TeSetKeyText Function

Contents | Index | Home
Previous | Up | Next
TeSetKeyText Function
Text Entry
C
BOOL TeSetKeyText(
    TEXTENTRY * pTe,
    WORD index,
    XCHAR * pText
);
Overview

This function will set the test assigned to a key with the given index.

Input Parameters
Input Parameters | Description
TEXTENTRY * pTe | pointer to the object
WORD index | index to the key in the link list
XCHAR * pText | pointer to the new string to be used
Returns

Returns TRUE if successful and FALSE if not.

Preconditions

none

Side Effects

none.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TeSetKeyText Function


TeMsgDefault Function

Contents | Index | Home
Previous | Up | Next
TeMsgDefault Function
Text Entry
C
void TeMsgDefault(
    WORD translatedMsg,
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function performs the actual state change based on the translated message given. The following state changes are supported:

Translated Message | Input Source | Set/Clear State Bit | Description
TE_MSG_ADD_CHAR | Touch Screen, | Set TE_UPDATE_TEXT, TE_UPDATE_KEY, | Add a character in the buffer and update the text displayed.
 |  | Clear TE_KEY_PRESSED |
TE_MSG_SPACE | Touch Screen, | Set TE_UPDATE_TEXT, TE_UPDATE_KEY, | Insert a space character in the buffer and update the text displayed.
 |  | Clear TE_KEY_PRESSED |
TE_MSG_DELETE | Touch Screen, | Set TE_UPDATE_TEXT, TE_UPDATE_KEY, | Delete the most recent character in the buffer and update the text displayed.
 |  | Clear TE_KEY_PRESSED |
TE_MSG_ENTER | Touch Screen, | Set TE_UPDATE_TEXT, TE_UPDATE_KEY, | User can define the use of this event in the message callback. Object will just update the key.
 |  | Clear TE_KEY_PRESSED |
TE_MSG_RELEASED | Touch Screen, | Clear TE_KEY_PRESSED | A Key in the object will be redrawn in the unpressed state.
 |  | Set Te_UPDATE_KEY |
TE_MSG_PRESSED | Touch Screen, | Set TE_KEY_PRESSED TE_UPDATE_KEY | A Key in the object will be redrawn in the pressed state.
Input Parameters
Input Parameters | Description
WORD translatedMsg | The translated message.
GOL_MSG * pMsg | The pointer to the GOL message.
pTe | The pointer to the object whose state will be modified.
Returns

none

Preconditions

none

Side Effects

none

Example

See BtnTranslateMsg() example.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TeMsgDefault Function


TeTranslateMsg Function

Contents | Index | Home
Previous | Up | Next
TeTranslateMsg Function
Text Entry
C
WORD TeTranslateMsg(
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function evaluates the message from a user if the message will affect the object or not. If the message is valid, the keys in the Text Entry object will be scanned to detect which key was pressed. If True, the corresponding text will be displayed, the ‘text’ will also be stored in the TeOutput parameter of the object.

Translated Message | Input Source | Events | Description
TE_MSG_PRESS | Touch Screen | EVENT_PRESS, EVENT_MOVE | If the event occurs and the x,y position falls in the face of one of the keys of the object while the key is unpressed.
TE_MSG_RELEASED | Touch Screen | EVENT_MOVE | If the event occurs and the x,y position falls outside the face of one of the keys of the object while the key is pressed.
TE_MSG_RELEASED | Touch Screen | EVENT_RELEASE | If the event occurs and the x,y position falls does not falls inside any of the faces of the keys of the object.
TE_MSG_ADD_CHAR | Touch Screen | EVENT_RELEASE, EVENT_MOVE | If the event occurs and the x,y position falls in the face of one of the keys of the object while the key is unpressed and the key is associated with no commands.
TE_MSG_DELETE | Touch Screen | EVENT_RELEASE, EVENT_MOVE | If the event occurs and the x,y position falls in the face of one of the keys of the object while the key is unpressed and the key is associated with delete command.
TE_MSG_SPACE | Touch Screen | EVENT_RELEASE, EVENT_MOVE | If the event occurs and the x,y position falls in the face of one of the keys of the object while the key is unpressed and the key is associated with space command.
TE_MSG_ENTER | Touch Screen | EVENT_RELEASE, EVENT_MOVE | If the event occurs and the x,y position falls in the face of one of the keys of the object while the key is unpressed and the key is associated with enter command.
OBJ_MSG_INVALID | Any | Any | If the message did not affect the object.
Input Parameters
Input Parameters | Description
GOL_MSG * pMsg | Pointer to the message struct containing the message from the user interface.
pTe | The pointer to the object where the message will be evaluated to check if the message will affect the object.
Returns

Returns the translated message depending on the received GOL message:

  • TE_MSG_PRESS – A key is pressed
  • TE_MSG_RELEASED - A key was released (generic for keys with no commands or characters assigned)
  • TE_MSG_ADD_CHAR – A key was released with character assigned
  • TE_MSG_DELETE – A key was released with delete command assigned
  • TE_MSG_SPACE - A key was released with space command assigned
  • TE_MSG_ENTER - A key was released with enter command assigned
  • OBJ_MSG_INVALID – Text Entry is not affected

Preconditions

none

Side Effects

none.

Library API > Graphics Object Layer API > GOL Objects > Text Entry > TeTranslateMsg Function


TEXTENTRY Structure

Contents | Index | Home
Previous | Up | Next
TEXTENTRY Structure
Text Entry
C
typedef struct {
  OBJ_HEADER hdr;
  SHORT horizontalKeys;
  SHORT verticalKeys;
  XCHAR * pTeOutput;
  WORD CurrentLength;
  WORD outputLenMax;
  KEYMEMBER * pActiveKey;
  KEYMEMBER * pHeadOfList;
  void * pDisplayFont;
} TEXTENTRY;
Overview

Defines the parameters required for a TextEntry Object.

Members
Members | Description
OBJ_HEADER hdr; | Generic header for all objects (see OBJ_HEADER).
SHORT horizontalKeys; | Number of horizontal keys
SHORT verticalKeys; | Number of vertical keys
XCHAR * pTeOutput; | Pointer to the buffer assigned by the user which holds the text shown in the editbox.
WORD CurrentLength; | Current length of the string in the buffer. The maximum value of this is equal to outputLenMax.
WORD outputLenMax; | Maximum expected length of output buffer pTeOutput
KEYMEMBER * pActiveKey; | Pointer to the active key KEYMEMBER. This is only used by the Widget. User must not change
KEYMEMBER * pHeadOfList; | Pointer to head of the list
void * pDisplayFont; | Pointer to the font used in displaying the text.
Library API > Graphics Object Layer API > GOL Objects > Text Entry > TEXTENTRY Structure


KEYMEMBER Structure

Contents | Index | Home
Previous | Up | Next
KEYMEMBER Structure
Text Entry
C
typedef struct {
  SHORT left;
  SHORT top;
  SHORT right;
  SHORT bottom;
  SHORT index;
  WORD state;
  BOOL update;
  WORD command;
  XCHAR * pKeyName;
  SHORT textWidth;
  SHORT textHeight;
  void * pNextKey;
} KEYMEMBER;
Overview

Defines the parameters and the strings assigned for each key.

Members
Members | Description
SHORT left; | Left position of the key
SHORT top; | Top position of the key
SHORT right; | Right position of the key
SHORT bottom; | Bottom position of the key
SHORT index; | Index of the key in the list
WORD state; | State of the key. Either Pressed (TE_KEY_PRESSED) or Released (0)
BOOL update; | flag to indicate key is to be redrawn with the current state
WORD command; | Command of the key. Either TE_DELETE_COM, TE_SPACE_COM or TE_ENTER_COM.
XCHAR * pKeyName; | Pointer to the custom text assigned to the key. This is displayed over the face of the key.
SHORT textWidth; | Computed text width, done at creation. Used to predict size and position of text on the key face.
SHORT textHeight; | Computed text height, done at creation. Used to predict size and position of text on the key face.
void * pNextKey; | Pointer to the next key parameters.
Library API > Graphics Object Layer API > GOL Objects > Text Entry > KEYMEMBER Structure


Window

Contents | Index | Home
Previous | Up | Next
Window
Functions | Macros | Structures | Topics

Window supports only Touchscreen inputs, replying to their events with the following messages:

1. WND_MSG_TITLE – Title area is selected.

2. WND_MSG_CLIENT – Client area is selected.

The Window Object is rendered using the assigned style scheme. The following figure illustrates the color assignments.

Functions
Name | Description
WndCreate | This function creates a WINDOW object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
WndDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
WndSetText | This function sets the string used for the title bar.
WndTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen inputs.
Macros
Name | Description
WndGetText | This macro returns the address of the current text string used for the title bar.
Structures
Name | Description
WINDOW | The structure contains data for the window
Topics
Name | Description
Window States | List of Window bit states.
Links
Functions, GOL Objects, Legend, Macros, Structures, Topics
Library API > Graphics Object Layer API > GOL Objects > Window


Window States

Contents | Index | Home
Previous | Up | Next
Window States
Macros | Window

List of Window bit states.

Macros
Name | Description
WND_DISABLED | Bit for disabled state
WND_DRAW | Bits to indicate whole window must be redrawn
WND_DRAW_CLIENT | Bit to indicate client area must be redrawn
WND_DRAW_TITLE | Bit to indicate title area must be redrawn
WND_FOCUSED | Bit for focus state
WND_HIDE | Bit to indicate window must be removed from screen
WND_TITLECENTER | Bit to center the text on the Title Area
Module

Window

Links
Macros, Window
Library API > Graphics Object Layer API > GOL Objects > Window > Window States


WND_DISABLED Macro

Contents | Index | Home
Previous | Up | Next
WND_DISABLED Macro
C
#define WND_DISABLED 0x0002  // Bit for disabled state
Description

Bit for disabled state

Library API > Graphics Object Layer API > GOL Objects > Window > Window States > WND_DISABLED Macro


WND_DRAW Macro

Contents | Index | Home
Previous | Up | Next
WND_DRAW Macro
C
#define WND_DRAW 0x6000  // Bits to indicate whole window must be redrawn
Description

Bits to indicate whole window must be redrawn

Library API > Graphics Object Layer API > GOL Objects > Window > Window States > WND_DRAW Macro


WND_DRAW_CLIENT Macro

Contents | Index | Home
Previous | Up | Next
WND_DRAW_CLIENT Macro
C
#define WND_DRAW_CLIENT 0x4000  // Bit to indicate client area must be redrawn
Description

Bit to indicate client area must be redrawn

Library API > Graphics Object Layer API > GOL Objects > Window > Window States > WND_DRAW_CLIENT Macro


WND_DRAW_TITLE Macro

Contents | Index | Home
Previous | Up | Next
WND_DRAW_TITLE Macro
C
#define WND_DRAW_TITLE 0x2000  // Bit to indicate title area must be redrawn
Description

Bit to indicate title area must be redrawn

Library API > Graphics Object Layer API > GOL Objects > Window > Window States > WND_DRAW_TITLE Macro


WND_FOCUSED Macro

Contents | Index | Home
Previous | Up | Next
WND_FOCUSED Macro
C
#define WND_FOCUSED 0x0001  // Bit for focus state
Description

Bit for focus state

Library API > Graphics Object Layer API > GOL Objects > Window > Window States > WND_FOCUSED Macro


WND_HIDE Macro

Contents | Index | Home
Previous | Up | Next
WND_HIDE Macro
C
#define WND_HIDE 0x8000  // Bit to indicate window must be removed from screen
Description

Bit to indicate window must be removed from screen

Library API > Graphics Object Layer API > GOL Objects > Window > Window States > WND_HIDE Macro


WND_TITLECENTER Macro

Contents | Index | Home
Previous | Up | Next
WND_TITLECENTER Macro
C
#define WND_TITLECENTER 0x0004  // Bit to center the text on the Title Area
Description

Bit to center the text on the Title Area

Library API > Graphics Object Layer API > GOL Objects > Window > Window States > WND_TITLECENTER Macro


WndCreate Function

Contents | Index | Home
Previous | Up | Next
WndCreate Function
Window
C
WINDOW * WndCreate(
    WORD ID,
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    WORD state,
    void * pBitmap,
    XCHAR * pText,
    GOL_SCHEME * pScheme
);
Overview

This function creates a WINDOW object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.

Input Parameters
Input Parameters | Description
WORD ID | Unique user defined ID for the object instance.
SHORT left | Left most position of the Object.
SHORT top | Top most position of the Object.
SHORT right | Right most position of the Object.
SHORT bottom | Bottom most position of the object.
WORD state | Sets the initial state of the object.
void * pBitmap | Pointer to the bitmap used in the title bar.
XCHAR * pText | Pointer to the text used as a title of the window.
GOL_SCHEME * pScheme | Pointer to the style scheme used.
Returns

Returns the pointer to the object created

Preconditions

none

Side Effects

none

Example
Copy Code
WINDOW *pWindow;
    pWindow  = WndCreate(ID_WINDOW1,                // ID
                         0,0,GetMaxX(),GetMaxY(),   // whole screen dimension
                         WND_DRAW,                  // set state to draw all
                         (char*)myIcon,             // icon
                         "Place Title Here.",       // text
                         NULL);                     // use default GOL scheme

    if (pWindow == NULL)
        return 0;
    WndDraw(pWindow);
    return 1;
Library API > Graphics Object Layer API > GOL Objects > Window > WndCreate Function


WndDraw Function

Contents | Index | Home
Previous | Up | Next
WndDraw Function
Window
C
WORD WndDraw(
    void * pObj
);
Overview

This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set.

When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.

Input Parameters
Input Parameters | Description
pW | Pointer to the object to be rendered.
Returns

Returns the status of the drawing

  • 1 - If the rendering was completed and
  • 0 - If the rendering is not yet finished.
Next call to the function will resume the rendering on the pending drawing state.

Preconditions

Object must be created before this function is called.

Side Effects

none

Example

See WndCreate() example.

Library API > Graphics Object Layer API > GOL Objects > Window > WndDraw Function


WndGetText Macro

Contents | Index | Home
Previous | Up | Next
WndGetText Macro
Window
C
#define WndGetText(pW) pW->pText
Overview

This macro returns the address of the current text string used for the title bar.

Input Parameters
Input Parameters | Description
pW | Pointer to the object
Returns

Returns pointer to the text string being used.

Preconditions

none

Side Effects

none

Example
Copy Code
WINDOW *pWindow;
XCHAR textUsed = “USE THIS!”;

    if (WndGetText(pWindow) == NULL)
        WndSetText(&textUsed);
Library API > Graphics Object Layer API > GOL Objects > Window > WndGetText Macro


WndSetText Function

Contents | Index | Home
Previous | Up | Next
WndSetText Function
Window
C
void WndSetText(
    WINDOW * pW,
    XCHAR * pText
);
Overview

This function sets the string used for the title bar.

Input Parameters
Input Parameters | Description
WINDOW * pW | The pointer to the object whose text will be modified
XCHAR * pText | Pointer to the text that will be used
Returns

none

Preconditions

none

Side Effects

none

Example

See WndGetText() example.

Library API > Graphics Object Layer API > GOL Objects > Window > WndSetText Function


WndTranslateMsg Function

Contents | Index | Home
Previous | Up | Next
WndTranslateMsg Function
Window
C
WORD WndTranslateMsg(
    void * pObj,
    GOL_MSG * pMsg
);
Overview

This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen inputs.

Translated Message | Input Source | Events | Description
WND_MSG_TITLE | Touch Screen | EVENT_PRESS, EVENT_RELEASE, EVENT_MOVE | If events occurs and the x,y position falls in the TITLE area of the window
WND_MSG_CLIENT | Touch Screen | EVENT_PRESS, EVENT_RELEASE, EVENT_MOVE | If events occurs and the x,y position falls in the CLIENT area of the window
OBJ_MSG_INVALID | Any | Any | If the message did not affect the object.
Input Parameters
Input Parameters | Description
GOL_MSG * pMsg | Pointer to the message struct containing the message from the user interface.
pW | The pointer to the object where the message will be evaluated to check if the message will affect the object.
Returns

Returns the translated message depending on the received GOL message:

  • WND_MSG_TITLE – Title area is selected
  • WND_MSG_CLIENT – Client area is selected
  • OBJ_MSG_INVALID – Window is not affected

Preconditions

none

Side Effects

none

Example

Usage is similar to BtnTranslateMsg() example.

Library API > Graphics Object Layer API > GOL Objects > Window > WndTranslateMsg Function


WINDOW Structure

Contents | Index | Home
Previous | Up | Next
WINDOW Structure
Window
C
typedef struct {
  OBJ_HEADER hdr;
  SHORT textHeight;
  XCHAR * pText;
  void * pBitmap;
} WINDOW;
Overview

The structure contains data for the window

Members
Members | Description
OBJ_HEADER hdr; | Generic header for all Objects (see OBJ_HEADER).
SHORT textHeight; | Pre-computed text height
XCHAR * pText; | Pointer to the title text
void * pBitmap; | Pointer to the bitmap for the title bar
Library API > Graphics Object Layer API > GOL Objects > Window > WINDOW Structure


Object States

Contents | Index | Home
Previous | Up | Next
Object States
Macros | Topics

The GOL objects follow two types of states, the Property States and the Drawing States. Property States defines action and appearance of objects. Drawing States on the other hand indicate if the object needs to be hidden, partially redrawn, or fully redrawn in the display. To store the states, the field state defined in OBJ_HEADER structure is used. Six most significant bits are allocated for Drawing States and the rest is allocated for the Property States. Some common Property States and Drawing States are shown in the following table.

State | Type | Bit Location | Description
OBJ_FOCUSED | P | 0x0001 | Object is in the focused state. This is usually used to show selection of the object. Not all objects have this feature.
OBJ_DISABLED | P | 0x0002 | Object is disabled and will ignore all messages.
OBJ_DRAW_FOCUS | D | 0x2000 | Focus for the object should be redrawn.
OBJ_DRAW | D | 0x4000 | Object should be redrawn completely.
OBJ_HIDE | D | 0x8000 | Object will be hidden by filling the area occupied by the object with the common background color. This has the highest priority over all Drawing States. When an object is set to be hidden, all other drawing states are overridden.

Where:

  • OBJ – represent the prefix assigned to a GOL object.
  • P – Property states, D – Drawing states
Individual Object drawing function (e.g. BtnDraw(), SldDraw(), etc...) does not reset the draw states instead use GOLDraw() to automatically reset and manage the draw states. If the call to individual drawing function cannot be avoided, draw states must be reset manually after the drawing functions returns a 1.

Macros
Name | Description
GetState | This macro retrieves the current value of the state bits of an object. It is possible to get several state bits.
ClrState | This macro clear the state bits of an object. Object must be redrawn to display the changes. It is possible to clear several state bits with this macro.
SetState | This macro sets the state bits of an object. Object must be redrawn to display the changes. It is possible to set several state bits with this macro.
Topics
Name | Description
Common Object States | List of common Object bit states.
Links
Graphics Object Layer API, Macros, Topics
Library API > Graphics Object Layer API > Object States


Common Object States

Contents | Index | Home
Previous | Up | Next
Common Object States
Macros

List of common Object bit states.

Macros
Name | Description
FOCUSED | Focus state bit.
DISABLED | Disabled state bit.
HIDE | Object hide state bit. Object will be hidden from the screen by drawing over it the common background color.
DRAW | Object redraw state bit. The whole Object must be redrawn.
DRAW_FOCUS | Focus redraw state bit. The focus rectangle must be redrawn.
DRAW_UPDATE | Partial Object redraw state bit. A part or parts of of the Object must be redrawn to show updated state.
Links
Object States, Macros
Library API > Graphics Object Layer API > Object States > Common Object States


FOCUSED Macro

Contents | Index | Home
Previous | Up | Next
FOCUSED Macro
C
#define FOCUSED 0x0001
Description

Focus state bit.

Library API > Graphics Object Layer API > Object States > Common Object States > FOCUSED Macro


DISABLED Macro

Contents | Index | Home
Previous | Up | Next
DISABLED Macro
C
#define DISABLED 0x0002
Description

Disabled state bit.

Library API > Graphics Object Layer API > Object States > Common Object States > DISABLED Macro


HIDE Macro

Contents | Index | Home
Previous | Up | Next
HIDE Macro
C
#define HIDE 0x8000
Description

Object hide state bit. Object will be hidden from the screen by drawing over it the common background color.

Library API > Graphics Object Layer API > Object States > Common Object States > HIDE Macro


DRAW Macro

Contents | Index | Home
Previous | Up | Next
DRAW Macro
C
#define DRAW 0x7C00
Description

Object redraw state bit. The whole Object must be redrawn.

Library API > Graphics Object Layer API > Object States > Common Object States > DRAW Macro


DRAW_FOCUS Macro

Contents | Index | Home
Previous | Up | Next
DRAW_FOCUS Macro
C
#define DRAW_FOCUS 0x2000
Description

Focus redraw state bit. The focus rectangle must be redrawn.

Library API > Graphics Object Layer API > Object States > Common Object States > DRAW_FOCUS Macro


DRAW_UPDATE Macro

Contents | Index | Home
Previous | Up | Next
DRAW_UPDATE Macro
C
#define DRAW_UPDATE 0x3C00
Description

Partial Object redraw state bit. A part or parts of of the Object must be redrawn to show updated state.

Library API > Graphics Object Layer API > Object States > Common Object States > DRAW_UPDATE Macro


GetState Macro

Contents | Index | Home
Previous | Up | Next
GetState Macro
C
#define GetState(pObj, stateBits) (((OBJ_HEADER *)pObj)->state & (stateBits))
Overview

This macro retrieves the current value of the state bits of an object. It is possible to get several state bits.

Input Parameters
Input Parameters | Description
pObj | Pointer to the object of interest.
stateBits | Defines which state bits are requested. Please refer to specific objects for object state bits definition for details
Returns

Macro returns a non-zero if any bit in the stateBits mask is set.

Preconditions

none

Side Effects

none

Example
Copy Code
#define BTN_HIDE 0x8000
BUTTON *pB;
// pB is created and initialized
// do something here to set state

// Hide the button (remove from screen)
if (GetState(pB,BTN_HIDE)) {
    SetColor(pB->pGolScheme->CommonBkColor);
    Bar(pB->left,pB->top,pB->right,pB->bottom);

}
Library API > Graphics Object Layer API > Object States > GetState Macro


ClrState Macro

Contents | Index | Home
Previous | Up | Next
ClrState Macro
C
#define ClrState(pObj, stateBits) ((OBJ_HEADER *)pObj)->state &= (~(stateBits))
Overview

This macro clear the state bits of an object. Object must be redrawn to display the changes. It is possible to clear several state bits with this macro.

Input Parameters
Input Parameters | Description
pObj | Pointer to the object of interest.
stateBits | Defines which state bits are to be cleared. Please refer to specific objects for object state bits definition for details
Returns

none

Preconditions

none

Side Effects

none

Example

See example for SetState().

Library API > Graphics Object Layer API > Object States > ClrState Macro


SetState Macro

Contents | Index | Home
Previous | Up | Next
SetState Macro
C
#define SetState(pObj, stateBits) ((OBJ_HEADER *)pObj)->state |= (stateBits)
Overview

This macro sets the state bits of an object. Object must be redrawn to display the changes. It is possible to set several state bits with this macro.

Input Parameters
Input Parameters | Description
pObj | Pointer to the object of interest.
stateBits | Defines which state bits are to be set. Please refer to specific objects for object state bits definition for details
Returns

none

Preconditions

none

Side Effects

none

Example
Copy Code
void BtnMsgDefault(WORD msg, BUTTON* pB){
    switch(msg){
        case BTN_MSG_PRESSED:
            // set pressed and redraw
            SetState(pB, BTN_PRESSED|BTN_DRAW);
            break;
        case BTN_MSG_RELEASED:
            ClrState(pB, BTN_PRESSED);       // reset pressed
            SetState(pB, BTN_DRAW);          // redraw
            break;
    }
}
Library API > Graphics Object Layer API > Object States > SetState Macro


Object Management

Contents | Index | Home
Previous | Up | Next
Object Management
Functions | Macros

This section describes the API functions and macros that are used to create, maintain and render individual and list of objects.

Functions
Name | Description
GOLAddObject | This function adds an object to the tail of the active list pointed to by _pGolObjects. The new list tail is set to point to NULL.
GOLFindObject | This function finds an object in the active list pointed to by _pGolObjects using the given object ID.
GOLRedrawRec | This function marks all objects in the active list intersected by the given rectangular area to be redrawn.
GOLDraw | This function loops through the active list and redraws objects that need to be redrawn. Partial redrawing or full redraw is performed depending on the drawing states of the objects. GOLDrawCallback() function is called by GOLDraw() when drawing of objects in the active list is completed.
GOLDrawCallback | GOLDrawCallback() function MUST BE implemented by the user. This is called inside the GOLDraw() function when the drawing of objects in the active list is completed. User drawing must be done here. Drawing color, line type, clipping region, graphic cursor position and current font will not be changed by GOL if this function returns a zero. To pass drawing control to GOL this function must return a non-zero value. If GOL messaging is not using the active link list, it is safe to modify the list here.
GOLFree | This function frees all the memory used by objects in the active list and initializes _pGolObjects pointer to NULL to start a new empty list. This function must be called only inside the GOLDrawCallback()function when using GOLDraw() and GOLMsg() functions. This requirement assures that primitive rendering settings are not altered by the rendering state machines of the objects.
GOLDeleteObject | deletes an object to the linked list objects for the current screen.
GOLDeleteObjectByID | Deletes an object in the current active linked list of objects using the ID parameter of the object.
GOLSetFocus | This function sets the keyboard input focus to the object. If the object cannot accept keyboard messages focus will not be changed. This function resets FOCUSED state for the object was in focus previously, set FOCUSED state for the required object and marks the objects to be redrawn.
GOLInit | This function initializes the graphics library and creates a default style scheme with default settings referenced by the global scheme pointer. GOLInit() function must be called before GOL functions can be used. It is not necessary to call GraphInit() function if this function is used.
GOLCanBeFocused | This function returns non-zero if the object can be focused. Only button, check box, radio button, slider, edit box, list box, scroll bar can accept focus. If the object is disabled it cannot be set to focused state.
GOLGetFocusNext | This function returns the pointer to the next object in the active linked list which is able to receive keyboard input.
GOLGetFocusPrev | This function returns the pointer to the previous object in the active linked list which is able to receive keyboard input.
GOLPanelDrawTsk | This function draws a panel on the screen with parameters set by GOLPanelDraw() macro. This function must be called repeatedly (depending on the return value) for a successful rendering of the panel.
GOLTwoTonePanelDrawTsk | This function draws a two tone panel on the screen with parameters set by GOLPanelDraw() macro. This function must be called repeatedly (depending on the return value) for a successful rendering of the panel.
Macros
Name
Description
GOLRedraw
This macro sets the object to be redrawn. For the redraw to be effective, the object must be in the current active list. If not, the redraw action will not be performed until the list where the object is currently inserted will be set to be the active list.
GOLDrawComplete
This macro resets the drawing states of the object (6 MSBits of the object’s state).
GetObjType
This macro returns the object type.
GetObjID
This macro returns the object ID.
GetObjNext
This macro returns the next object after the specified object.
GOLNewList
This macro starts a new linked list of objects and resets the keyboard focus to none. This macro assigns the current active list _pGolObjects and current receiving keyboard input _pObjectFocused object pointers to NULL. Any keyboard inputs at this point will be ignored. Previous active list must be saved in another pointer if to be referenced later. If not needed anymore memory used by that list should be freed by GOLFree() function.
GOLGetList
This macro gets the current active list.
GOLSetList
This macro sets the given object list as the active list and resets the keyboard focus to none. This macro assigns the receiving keyboard input object _pObjectFocused pointer to NULL. If the new active list has an object’s state set to focus, the _pObjectFocused pointer must be set to this object or the object’s state must be change to unfocused. This is to avoid two objects displaying a focused state when only one object in the active list must be set to a focused state at anytime.
IsObjUpdated
This macro tests if the object is pending to be redrawn. This is done by testing the 6 MSBits of object’s state to detect if the object must be redrawn.
GOLGetFocus
This macro returns the pointer to the current object receiving keyboard input.
GOLPanelDraw
This macro sets the parameters to draw a panel. Panel is not an object. It will not be added to the active list. Use GOLPanelDrawTsk() to display the panel on the screen. The following relationships of the parameters determines the general shape of the button:
  1. Panel width is determined by right - left.
  2. Panel height is determined by top - bottom.
  3. Panel radius - specifies if the panel will have a rounded edge. If zero then the panel will have sharp (cornered) edge.
  4. If 2*radius = height = width, the panel is circular.
Links
Functions, Graphics Object Layer API, Legend, Macros
Library API > Graphics Object Layer API > Object Management


GOLAddObject Function

Contents | Index | Home
Previous | Up | Next
GOLAddObject Function
C
void GOLAddObject(
    OBJ_HEADER * object
);
Overview

This function adds an object to the tail of the active list pointed to by _pGolObjects. The new list tail is set to point to NULL.

Input Parameters
Input Parameters | Description
pObj | Pointer to the object to be added on the current active list.
Returns

none

Preconditions

none

Side Effects

none

Example
Copy Code
void MoveObject(OBJ_HEADER *pSrcList, OBJ_HEADER *pDstList,
    OBJ_HEADER *pObjtoMove) {
    OBJ_HEADER *pTemp = pSrcList;

    if(pTemp != pObjtoMove) {
        while(pTemp->pNxtObj != pObjtoMove)
            pTemp = pTemp->pNxtObj;
    }

    pTemp->pNxtObj = pObjtoMove ->pNxt; // remove object from list
    GOLSetList(pDstList);               // destination as active list
    GOLAddObject(pObjtoMove);           // add object to active list
}
Library API > Graphics Object Layer API > Object Management > GOLAddObject Function


GOLFindObject Function

Contents | Index | Home
Previous | Up | Next
GOLFindObject Function
C
OBJ_HEADER * GOLFindObject(
    WORD ID
);
Overview

This function finds an object in the active list pointed to by _pGolObjects using the given object ID.

Input Parameters
Input Parameters | Description
WORD ID | User assigned value set during the creation of the object.
Returns

Pointer to the object with the given ID.

Preconditions

none

Side Effects

none

Example
Copy Code
void CopyObject(OBJ_HEADER *pSrcList, OBJ_HEADER *pDstList, WORD ID)
{
    OBJ_HEADER *pTemp;

    pTemp = GOLFindObject(ID);              // find the object
    if (pTemp != NULL) {
        GOLSetList(pDstList);               // destination as active list
        GOLAddObject(pObj);                 // add object to active list
    }
}
Library API > Graphics Object Layer API > Object Management > GOLFindObject Function


GOLRedraw Macro

Contents | Index | Home
Previous | Up | Next
GOLRedraw Macro
C
#define GOLRedraw(pObj) ((OBJ_HEADER *)pObj)->state |= 0x7c00;
Overview

This macro sets the object to be redrawn. For the redraw to be effective, the object must be in the current active list. If not, the redraw action will not be performed until the list where the object is currently inserted will be set to be the active list.

Input Parameters
Input Parameters | Description
pObj | Pointer to the object to be redrawn.
Returns

none

Preconditions

none

Side Effects

none

Example
Copy Code
void GOLRedrawRec(SHORT left, SHORT top, SHORT right, SHORT bottom) {
    // set all objects encompassed by the rectangle to be redrawn
    OBJ_HEADER *pCurrentObj;

    pCurrentObj = GOLGetList();
    while(pCurrentObj != NULL){
        if (
            ((pCurrentObj->left >= left) && (pCurrentObj->left <= right)) ||
            ((pCurrentObj->right >= left) && (pCurrentObj->right <= right))||
            ((pCurrentObj->top >= top) && (pCurrentObj->top <= bottom)) ||
            ((pCurrentObj->bottom >= top) && (pCurrentObj->bottom <= bottom))){
                GOLRedraw(pCurrentObj);
        }
        pCurrentObj = pCurrentObj->pNxtObj;
    }//end of while
}
Library API > Graphics Object Layer API > Object Management > GOLRedraw Macro


GOLRedrawRec Function

Contents | Index | Home
Previous | Up | Next
GOLRedrawRec Function
C
void GOLRedrawRec(
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom
);
Overview

This function marks all objects in the active list intersected by the given rectangular area to be redrawn.

Input Parameters
Input Parameters | Description
SHORT left | Defines the left most border of the rectangle area.
SHORT top | Defines the top most border of the rectangle area.
SHORT right | Defines the right most border of the rectangle area.
SHORT bottom | Defines the bottom most border of the rectangle area.
Returns

none

Preconditions

none

Side Effects

none

Example
Copy Code
OBJ_HEADER *pTemp;
OBJ_HEADER *pAllObjects;

// assume *pAllObjects points to a list of all existing objects
// created and initialized

// mark all objects inside the rectangle to be redrawn
GOLRedrawRec(10,10,100,100);

pTemp = pAllObjects;
GOLStartNewList();                      // reset active list
while(pTemp->pNxtObj != NULL) {
    if (pTemp->state&0x7C00)            // add only objects to be
    GOLAddObject(pTemp);                // redrawn to the active list
    pTemp = pTemp->pNxtObj;
}
GOLDraw();                              // redraw active list
Library API > Graphics Object Layer API > Object Management > GOLRedrawRec Function


GOLDraw Function

Contents | Index | Home
Previous | Up | Next
GOLDraw Function
C
WORD GOLDraw();
Overview

This function loops through the active list and redraws objects that need to be redrawn. Partial redrawing or full redraw is performed depending on the drawing states of the objects. GOLDrawCallback() function is called by GOLDraw() when drawing of objects in the active list is completed.

Returns

Non-zero if the active link list drawing is completed.

Preconditions

none

Side Effects

none

Example
Copy Code
// Assume objects are created & states are set to draw objects
while(1){
    if(GOLDraw()){              // parse active list and redraw objects that needs to be redrawn

        // here GOL drawing is completed
        // it is safe to modify objects states and linked list

        TouchGetMsg(&msg);      // evaluate messages from touch screen device

        GOLMsg(&msg);           // evaluate each object is affected by the message
    }
}
Library API > Graphics Object Layer API > Object Management > GOLDraw Function


GOLDrawComplete Macro

Contents | Index | Home
Previous | Up | Next
GOLDrawComplete Macro
C
#define GOLDrawComplete(pObj) ((OBJ_HEADER *)pObj)->state &= 0x03ff
Overview

This macro resets the drawing states of the object (6 MSBits of the object’s state).

Input Parameters
Input Parameters | Description
pObj | Pointer to the object of interest.
Returns

none

Preconditions

none

Side Effects

none

Example
Copy Code
// This function should be called again whenever an incomplete
// rendering (done = 0) of an object occurs.
// internal states in the BtnDraw() or WndDraw() should pickup
// on the state where it left off to continue rendering.
void GOLDraw() {
    static OBJ_HEADER *pCurrentObj = NULL;
    SHORT done;

    if(pCurrentObj == NULL) {
        if(GOLDrawCallback()) {
            // If it's last object jump to head
            pCurrentObj = GOLGetList();
        } else {
            return;
        }
    }
    done = 0;

    while(pCurrentObj != NULL) {
        if(IsObjUpdated(pCurrentObj)) {
            done = pCurrentObj->draw(pCurrentObj);

            if(done){
                GOLDrawComplete(pCurrentObj);
            }else{
                return;
            }
        }
        pCurrentObj = pCurrentObj->pNxtObj;
    }
}
Library API > Graphics Object Layer API > Object Management > GOLDrawComplete Macro


GOLDrawCallback Function

Contents | Index | Home
Previous | Up | Next
GOLDrawCallback Function
C
WORD GOLDrawCallback();
Overview

GOLDrawCallback() function MUST BE implemented by the user. This is called inside the GOLDraw() function when the drawing of objects in the active list is completed. User drawing must be done here. Drawing color, line type, clipping region, graphic cursor position and current font will not be changed by GOL if this function returns a zero. To pass drawing control to GOL this function must return a non-zero value. If GOL messaging is not using the active link list, it is safe to modify the list here.

Returns

Return a one if GOLDraw() will have drawing control on the active list. Return a zero if user wants to keep the drawing control.

Preconditions

none

Side Effects

none

Example
Copy Code
#define SIG_STATE_SET   0
#define SIG_STATE_DRAW  1
WORD GOLDrawCallback(){
    static BYTE state = SIG_STATE_SET;
    if(state == SIG_STATE_SET){
        // Draw the button with disabled colors
        GOLPanelDraw(SIG_PANEL_LEFT,SIG_PANEL_TOP,
                     SIG_PANEL_RIGHT,SIG_PANEL_BOTTOM, 0,
                     WHITE, altScheme->EmbossLtColor,
                     altScheme->EmbossDkColor,
                     NULL, GOL_EMBOSS_SIZE);

        state = SIG_STATE_DRAW;
    }

    if(!GOLPanelDrawTsk()){
        // do not return drawing control to GOL
        // drawing is not complete
        return 0;
    }else{
        state = SIG_STATE_SET;
        // return drawing control to GOL, drawing is complete
        return 1;
    }
}
Library API > Graphics Object Layer API > Object Management > GOLDrawCallback Function


GOLFree Function

Contents | Index | Home
Previous | Up | Next
GOLFree Function
C
void GOLFree();
Overview

This function frees all the memory used by objects in the active list and initializes _pGolObjects pointer to NULL to start a new empty list. This function must be called only inside the GOLDrawCallback()function when using GOLDraw() and GOLMsg() functions. This requirement assures that primitive rendering settings are not altered by the rendering state machines of the objects.

Returns

none

Preconditions

none

Side Effects

All objects in the active list are deleted from memory.

Example
Copy Code
void DeletePage(OBJ_HEADER *pPage) {
    OBJ_HEADER *pTemp;

    // assuming pPage is different from the current active list
    pTemp = GOLGetList();               // save the active list
    GOLSetList(pPage);                  // set list as active list
    GolFree();                          // pPage objects are deleted

    GOLSetList(pTemp);                  // restore the active list
}
Library API > Graphics Object Layer API > Object Management > GOLFree Function


GetObjType Macro

Contents | Index | Home
Previous | Up | Next
GetObjType Macro
C
#define GetObjType(pObj) ((OBJ_HEADER *)pObj)->type
Overview

This macro returns the object type.

Input Parameters
Input Parameters | Description
pObj | Pointer to the object of interest.
Returns

Returns the OBJ_TYPE of the object.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > Object Management > GetObjType Macro


GetObjID Macro

Contents | Index | Home
Previous | Up | Next
GetObjID Macro
C
#define GetObjID(pObj) ((OBJ_HEADER *)pObj)->ID
Overview

This macro returns the object ID.

Input Parameters
Input Parameters | Description
pObj | Pointer to the object of interest.
Returns

Returns the ID of the object.

Preconditions

none

Side Effects

none

Example
Copy Code
void UseOfGetObjID(OBJ_HEADER *pObj) {
    WORD id;
        switch(id = GetObjID(pObj)) {
            case ID_WINDOW1:
                // do something
            case ID_WINDOW2:
                // do something else
            case ID_WINDOW3:
                // do something else
            default:
                // do something else
        }
}
Library API > Graphics Object Layer API > Object Management > GetObjID Macro


GetObjNext Macro

Contents | Index | Home
Previous | Up | Next
GetObjNext Macro
C
#define GetObjNext(pObj) ((OBJ_HEADER *)pObj)->pNxtObj
Overview

This macro returns the next object after the specified object.

Input Parameters
Input Parameters | Description
pObj | Pointer to the object of interest.
Returns

Returns the pointer of the next object.

Preconditions

none

Side Effects

none

Example
Copy Code
// This is the same example for the GetObjType() macro
// We just replaced one line
void RedrawButtons(void) {
    OBJ_HEADER *pCurr;

    pCurr = GOLGetList();               // get active list
    while(pCurr->pNxtObj != NULL) {
        if (GetObjType(pCurr) == BUTTON)
            pCurr->state = BTN_DRAW;    // set button to be redrawn
        pCurr = GetObjNext(pCurr);      // Use of GetObjNext() macro
        // replaces the old line
    }
    GolDraw();                          // redraw all buttons in the
                                        // active list
}
Library API > Graphics Object Layer API > Object Management > GetObjNext Macro


GOLDeleteObject Function

Contents | Index | Home
Previous | Up | Next
GOLDeleteObject Function
C
BOOL GOLDeleteObject(
    OBJ_HEADER * object
);
Overview

deletes an object to the linked list objects for the current screen.

Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > Object Management > GOLDeleteObject Function


GOLDeleteObjectByID Function

Contents | Index | Home
Previous | Up | Next
GOLDeleteObjectByID Function
C
BOOL GOLDeleteObjectByID(
    WORD ID
);
Overview

Deletes an object in the current active linked list of objects using the ID parameter of the object.

Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > Object Management > GOLDeleteObjectByID Function


GOLNewList Macro

Contents | Index | Home
Previous | Up | Next
GOLNewList Macro
C
#define GOLNewList \
    _pGolObjects = NULL; \
    _pObjectFocused = NULL
Overview

This macro starts a new linked list of objects and resets the keyboard focus to none. This macro assigns the current active list _pGolObjects and current receiving keyboard input _pObjectFocused object pointers to NULL. Any keyboard inputs at this point will be ignored. Previous active list must be saved in another pointer if to be referenced later. If not needed anymore memory used by that list should be freed by GOLFree() function.

Returns

none

Preconditions

none

Side Effects

This macro sets the focused object pointer (_pObjectFocused) to NULL.

Example
Copy Code
OBJ_HEADER *pSave;

pSave = GOLGetList();            // save current list
GOLNewList();                    // start the new list
                                 // current list is now NULL

// assume that objects are already created
// you can now add objects to the new list
GOLAddObject(pButton);
GOLAddObject(pWindow);
GOLAddObject(pSlider);
Library API > Graphics Object Layer API > Object Management > GOLNewList Macro


GOLGetList Macro

Contents | Index | Home
Previous | Up | Next
GOLGetList Macro
C
#define GOLGetList _pGolObjects
Overview

This macro gets the current active list.

Returns

Returns the pointer to the current active list.

Preconditions

none

Side Effects

none

Example

See GOLNewList() example.

Library API > Graphics Object Layer API > Object Management > GOLGetList Macro


GOLSetList Macro

Contents | Index | Home
Previous | Up | Next
GOLSetList Macro
C
#define GOLSetList(objsList) \
    _pGolObjects = objsList;     \
    _pObjectFocused = NULL
Overview

This macro sets the given object list as the active list and resets the keyboard focus to none. This macro assigns the receiving keyboard input object _pObjectFocused pointer to NULL. If the new active list has an object’s state set to focus, the _pObjectFocused pointer must be set to this object or the object’s state must be change to unfocused. This is to avoid two objects displaying a focused state when only one object in the active list must be set to a focused state at anytime.

Input Parameters
Input Parameters | Description
objsList | The pointer to the new active list.
Returns

none

Preconditions

none

Side Effects

This macro sets the focused object pointer (_pObjectFocused) to NULL. Previous active list should be saved if needed to be referenced later. If not, use GOLFree() function to free the memory used by the objects before calling GOLSetList().

Example
Copy Code
OBJ_HEADER *pSave;
pSave = GOLGetList();           // save current list
GOLNewList();                   // start the new list
                                // current list is now NULL

// you can now add objects to the current list
// assume that objects are already created
GOLAddObject(pButton);
GOLAddObject(pWindow);
GOLAddObject(pSlider);

// do something here on the new list
// return the old list
GOLSetList(pSave);
Library API > Graphics Object Layer API > Object Management > GOLSetList Macro


GOLSetFocus Function

Contents | Index | Home
Previous | Up | Next
GOLSetFocus Function
C
void GOLSetFocus(
    OBJ_HEADER * object
);
Overview

This function sets the keyboard input focus to the object. If the object cannot accept keyboard messages focus will not be changed. This function resets FOCUSED state for the object was in focus previously, set FOCUSED state for the required object and marks the objects to be redrawn.

Input Parameters
Input Parameters | Description
OBJ_HEADER * object | Pointer to the object of interest.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > Object Management > GOLSetFocus Function


IsObjUpdated Macro

Contents | Index | Home
Previous | Up | Next
IsObjUpdated Macro
C
#define IsObjUpdated(pObj) (((OBJ_HEADER *)pObj)->state & 0xfc00)
Overview

This macro tests if the object is pending to be redrawn. This is done by testing the 6 MSBits of object’s state to detect if the object must be redrawn.

Input Parameters
Input Parameters | Description
pObj | Pointer to the object of interest.
Returns

Returns a nonzero value if the object needs to be redrawn. Zero if not.

Preconditions

none

Side Effects

none

Example
Copy Code
int DrawButtonWindowOnly() {
    static OBJ_HEADER *pCurrentObj = NULL;
    SHORT done = 0;

    if (pCurrentObj == NULL)
        pCurrentObj = GOLGetList();         // get current list

    while(pCurrentObj != NULL){
        if(IsObjUpdated(pCurrentObj)){
            done = pCurrentObj->draw(pCurrentObj);

            // reset state of object if done
            if (done)
                GOLDrawComplete(pCurrentObj)
            // Return if not done. This means that BtnDraw()
            // was terminated prematurely by device busy status
            // and must be recalled to finish rendering of
            // objects in the list that have new states.
            else
                return 0;
        }
        // go to the next object in the list
        pCurrentObj = pCurrentObj->pNxtObj;
    }
    return 1;
}
Library API > Graphics Object Layer API > Object Management > IsObjUpdated Macro


GOLInit Function

Contents | Index | Home
Previous | Up | Next
GOLInit Function
C
void GOLInit();
Overview

This function initializes the graphics library and creates a default style scheme with default settings referenced by the global scheme pointer. GOLInit() function must be called before GOL functions can be used. It is not necessary to call GraphInit() function if this function is used.

Returns

none

Preconditions

none

Side Effects

This sets the line type to SOLID_LINE, sets the screen to all BLACK, sets the current drawing color to WHITE, sets the graphic cursor position to upper left corner of the screen, sets active and visual pages to page #0, clears the active page and disables clipping. This also creates a default style scheme.

Library API > Graphics Object Layer API > Object Management > GOLInit Function


GOLGetFocus Macro

Contents | Index | Home
Previous | Up | Next
GOLGetFocus Macro
C
#define GOLGetFocus _pObjectFocused
Overview

This macro returns the pointer to the current object receiving keyboard input.

Returns

Returns the pointer to the object receiving keyboard input. If there is no object in focus NULL is returned.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > Object Management > GOLGetFocus Macro


GOLCanBeFocused Function

Contents | Index | Home
Previous | Up | Next
GOLCanBeFocused Function
C
WORD GOLCanBeFocused(
    OBJ_HEADER * object
);
Overview

This function returns non-zero if the object can be focused. Only button, check box, radio button, slider, edit box, list box, scroll bar can accept focus. If the object is disabled it cannot be set to focused state.

Input Parameters
Input Parameters | Description
OBJ_HEADER * object | Pointer to the object of interest.
Returns

This returns a non-zero if the object can be focused and zero if not.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > Object Management > GOLCanBeFocused Function


GOLGetFocusNext Function

Contents | Index | Home
Previous | Up | Next
GOLGetFocusNext Function
C
OBJ_HEADER * GOLGetFocusNext();
Overview

This function returns the pointer to the next object in the active linked list which is able to receive keyboard input.

Returns

This returns the pointer of the next object in the active list capable of receiving keyboard input. If there is no object capable of receiving keyboard inputs (i.e. none can be focused) NULL is returned.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > Object Management > GOLGetFocusNext Function


GOLGetFocusPrev Function

Contents | Index | Home
Previous | Up | Next
GOLGetFocusPrev Function
C
OBJ_HEADER * GOLGetFocusPrev();
Overview

This function returns the pointer to the previous object in the active linked list which is able to receive keyboard input.

Returns

This returns the pointer of the previous object in the active list capable of receiving keyboard input. If there is no object capable of receiving keyboard inputs (i.e. none can be focused) NULL is returned.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > Object Management > GOLGetFocusPrev Function


GOLPanelDraw Macro

Contents | Index | Home
Previous | Up | Next
GOLPanelDraw Macro
C
#define GOLPanelDraw(left, top, right, bottom, radius, faceClr, embossLtClr, embossDkClr, pBitmap, embossSize) \
    _rpnlX1 = left;                                                                                \
    _rpnlY1 = top;                                                                                 \
    _rpnlX2 = right;                                                                               \
    _rpnlY2 = bottom;                                                                              \
    _rpnlR = radius;                                                                               \
    _rpnlFaceColor = faceClr;                                                                      \
    _rpnlEmbossLtColor = embossLtClr;                                                              \
    _rpnlEmbossDkColor = embossDkClr;                                                              \
    _pRpnlBitmap = pBitmap;                                                                        \
    _rpnlEmbossSize = embossSize;
Overview

This macro sets the parameters to draw a panel. Panel is not an object. It will not be added to the active list. Use GOLPanelDrawTsk() to display the panel on the screen. The following relationships of the parameters determines the general shape of the button:

  1. Panel width is determined by right - left.
  2. Panel height is determined by top - bottom.
  3. Panel radius - specifies if the panel will have a rounded edge. If zero then the panel will have sharp (cornered) edge.
  4. If 2*radius = height = width, the panel is circular.

Input Parameters
Input Parameters | Description
left | Panel's left most position.
top | Panel's top most position.
right | Panel's right most position.
bottom | Panel's bottom most position.
radius | The radius of the rounded corner of the panel.
faceClr | Defines the face color of the panel.
embossLtClr | Defines the emboss light color.
embossDkClr | Defines the emboss dark color.
pBitmap | Defines the bitmap used in the face of the panel.
embossSize | Defines the emboss size of the panel.
Returns

none

Preconditions

none

Side Effects

none

Example
Copy Code
// Dimensions for signature box
#define SIG_PANEL_LEFT      10
#define SIG_PANEL_RIGHT    310
#define SIG_PANEL_TOP       50
#define SIG_PANEL_BOTTOM   170

#define SIG_STATE_SET   0
#define SIG_STATE_DRAW  1

GOL_SCHEME *altScheme;           // style scheme

// Draws box for signature
WORD PanelSignature() {
    static BYTE state = SIG_STATE_SET;

    if(state == SIG_STATE_SET){
        // set data for panel drawing (radius = 0)
        // assume altScheme is defined
        GOLPanelDraw(SIG_PANEL_LEFT,SIG_PANEL_TOP,
                     SIG_PANEL_RIGHT,SIG_PANEL_BOTTOM,0,
                     WHITE,
                     altScheme->EmbossLtColor,
                     altScheme->EmbossDkColor,
                     NULL, GOL_EMBOSS_SIZE);

        state = SIG_STATE_DRAW; // change state
    }

    if(!GOLPanelDrawTsk())
        return 0; // drawing is not completed
    } else {
        state = SIG_STATE_SET; // set state to initial
        return 1; // drawing is done
    }
}
Library API > Graphics Object Layer API > Object Management > GOLPanelDraw Macro


GOLPanelDrawTsk Function

Contents | Index | Home
Previous | Up | Next
GOLPanelDrawTsk Function
C
WORD GOLPanelDrawTsk();
Overview

This function draws a panel on the screen with parameters set by GOLPanelDraw() macro. This function must be called repeatedly (depending on the return value) for a successful rendering of the panel.

Returns

Returns the status of the panel rendering

Copy Code
       0 – Rendering of the panel is not yet finished.
       1 – Rendering of the panel is finished.
Preconditions

Parameters of the panel must be set by GOLPanelDraw() macro.

Side Effects

none

Example

See GOLPanelDraw() example.

Library API > Graphics Object Layer API > Object Management > GOLPanelDrawTsk Function


GOLTwoTonePanelDrawTsk Function

Contents | Index | Home
Previous | Up | Next
GOLTwoTonePanelDrawTsk Function
C
WORD GOLTwoTonePanelDrawTsk();
Overview

This function draws a two tone panel on the screen with parameters set by GOLPanelDraw() macro. This function must be called repeatedly (depending on the return value) for a successful rendering of the panel.

Returns

Returns the status of the panel rendering

Copy Code
       0 – Rendering of the panel is not yet finished.
       1 – Rendering of the panel is finished.
Preconditions

Parameters of the panel must be set by GOLPanelDraw() macro.

Side Effects

none

Example

Usage is similar to GOLPanelDraw() example.

Library API > Graphics Object Layer API > Object Management > GOLTwoTonePanelDrawTsk Function


GOL Messages

Contents | Index | Home
Previous | Up | Next
GOL Messages
Enumerations | Functions | Structures | Topics

To facilitate the processing of user actions on the objects, messaging are used.

User passes messages from the input devices to GOL using the GOL message structure. The structure is described by the following table.

Copy Code
    typedef struct {
        BYTE         type;
        BYTE         uiEvent;
        int          param1;
        int          param2;
    } GOL_MSG;

Field | Description
type | Defines the type of device where the message was created. These are the devices implemented in the User Interface Layer. Possible device types are the following: TYPE_UNKNOWN TYPE_KEYBOARD TYPE_TOUCHSCREEN TYPE_MOUSE
uiEvent | Event ID of the user or device type action on the object. Possible event IDs are the following: EVENT_INVALID EVENT_MOVE EVENT_PRESS EVENT_STILLPRESS EVENT_RELEASE EVENT_KEYSCAN EVENT_CHARCODE
param1 param2 | Parameters 1 and 2 definition varies from device types. For example, param1 and param2 are defined as x-coordinate position and y-coordinate position respectively for TYPE_TOUCHSCREEN. For TYPE_KEYBOARD, param1 is defined as the ID of the receiving object and param2 is defined as the keyboard scan or character code.

GOLMsg() function accepts this structure and processes the message for all objects in the active list.

Messaging Flow

The messaging mechanism follows this flow:

  1. User Interface Module (touch screen, keypad) sends a GOL message (the GOL_MSG structure).
  2. A loop evaluates which object is affected by the message. This is done inside GOLMsg() function.
  3. Affected object returns the translated message based on the GOL message parameters.
  4. User can change default action with the callback function. If the call back function returns a non-zero value message will be processed by default.
  5. Object should be redrawn to reflect new state.
The translated message is a set of actions unique to each object type. Please refer to each object translated message ID for details.

Objects that are disabled will not accept any messages. GOLMsg() function must be called when GOL drawing is completed. In this case all objects have been drawn and it is safe to change objects states. GOLMsg() call can be done if GOLDraw() function returns non-zero or inside GOLDrawCallback() function.

Enumerations
Name | Description
TRANS_MSG | This structure defines the list of translated messages for GOL Objects used in the library.
INPUT_DEVICE_EVENT | This structure defines the types of GOL message events used in the library.
INPUT_DEVICE_TYPE | This structure defines the types of input devices used in the library.
Functions
Name | Description
GOLMsg | This function receives a GOL message from user and loops through the active list of objects to check which object is affected by the message. For affected objects the message is translated and GOLMsgCallback() is called. In the call back function, user has the ability to implement action for the message. If the call back function returns non-zero OBJMsgDefault() is called to process message for the object by default. If zero is returned OBJMsgDefault() is not called. Please refer to GOL Messages section for deatils. This function should be called when GOL drawing is completed. It can be done... more
GOLMsgCallback | The user MUST implement this function. GOLMsg() calls this function when a valid message for an object in the active list is received. User action for the message should be implemented here. If this function returns non-zero, the message for the object will be processed by default. If zero is returned, GOL will not perform any action.
Structures
Name
Description
GOL_MSG
This structure defines the GOL message used in the library.
  • The types must be one of the INPUT_DEVICE_TYPE:
    • TYPE_UNKNOWN
    • TYPE_KEYBOARD
    • TYPE_TOUCHSCREEN
    • TYPE_MOUSE
  • uiEvent must be one of the INPUT_DEVICE_EVENT.
    • for touch screen:
      • EVENT_INVALID
      • EVENT_MOVE
      • EVENT_PRESS
      • EVENT_STILLPRESS
      • EVENT_RELEASE
    • for keyboard:
      • EVENT_KEYSCAN (param2 contains scan code)
      • EVENT_KEYCODE (param2 contains character code)
  • param1:
    • for touch screen is the x position
    • for keyboard ID of object receiving the message
  • param2
    • for touch screen y position
    • for keyboard scan or key code
Topics
Name | Description
Scan Key Codes | The defined scan codes for AT keyboard.
Links
Enumerations, Functions, Graphics Object Layer API, Legend, Structures, Topics
Library API > Graphics Object Layer API > GOL Messages


GOLMsg Function

Contents | Index | Home
Previous | Up | Next
GOLMsg Function
C
void GOLMsg(
    GOL_MSG * pMsg
);
Overview

This function receives a GOL message from user and loops through the active list of objects to check which object is affected by the message. For affected objects the message is translated and GOLMsgCallback() is called. In the call back function, user has the ability to implement action for the message. If the call back function returns non-zero OBJMsgDefault() is called to process message for the object by default. If zero is returned OBJMsgDefault() is not called. Please refer to GOL Messages section for deatils.

This function should be called when GOL drawing is completed. It can be done when GOLDraw() returns non-zero value or inside GOLDrawCallback() function.

Input Parameters
Input Parameters | Description
GOL_MSG * pMsg | Pointer to the GOL message from user.
Returns

none

Preconditions

none

Side Effects

none

Example
Copy Code
// Assume objects are created & states are set to draw objects
while(1){
    if(GOLDraw()){
        // GOL drawing is completed here
        // it is safe to change objects
        TouchGetMsg(&msg);         // from user interface module
        GOLMsg(&msg);
    }
}
Library API > Graphics Object Layer API > GOL Messages > GOLMsg Function


GOLMsgCallback Function

Contents | Index | Home
Previous | Up | Next
GOLMsgCallback Function
C
WORD GOLMsgCallback(
    WORD objMsg,
    OBJ_HEADER * pObj,
    GOL_MSG * pMsg
);
Overview

The user MUST implement this function. GOLMsg() calls this function when a valid message for an object in the active list is received. User action for the message should be implemented here. If this function returns non-zero, the message for the object will be processed by default. If zero is returned, GOL will not perform any action.

Input Parameters
Input Parameters | Description
WORD objMsg | Translated message for the object or the action ID response from the object.
OBJ_HEADER * pObj | Pointer to the object that processed the message.
GOL_MSG * pMsg | Pointer to the GOL message from user.
Returns

Return a non-zero if the message will be processed by default. If a zero is returned, the message will not be processed by GOL.

Preconditions

none

Side Effects

none

Example
Copy Code
WORD GOLMsgCallback(WORD objMsg, OBJ_HEADER* pObj, GOL_MSG *pMsg){
    static char focusSwitch = 1;

    switch(GetObjID(pObj)){
        case ID_BUTTON1:
            // Change text and focus state
            if(objMsg == BTN_MSG_RELEASED){
                focusSwitch ^= 1;
                if(focusSwitch){
                    BtnSetText((BUTTON*)pObj, "Focused");
                    SetState(pObj,BTN_FOCUSED);
                }else{
                    BtnSetText((BUTTON*)pObj, "Unfocused");
                    ClrState(pObj,BTN_FOCUSED);
                }
            }
            // Process by default
            return 1;
        case ID_BUTTON2:
            // Change text
            if(objMsg == BTN_MSG_PRESSED){
                BtnSetText((BUTTON*)pObj, "Pressed");
            }
            if(objMsg == BTN_MSG_RELEASED){
                BtnSetText((BUTTON*)pObj, "Released");
            }
            // Process by default
            return 1;
        case ID_BUTTON3:
            // Change face picture
            if(objMsg == BTN_MSG_PRESSED){
                BtnSetBitmap(pObj,arrowLeft);
            }
            if(objMsg == BTN_MSG_RELEASED){
                BtnSetBitmap(pObj,(char*)arrowRight);
            }
            // Process by default
            return 1;
        case ID_BUTTON_NEXT:
            if(objMsg == BTN_MSG_RELEASED){
                screenState = CREATE_CHECKBOXES;
            }
            // Process by default
            return 1;
        case ID_BUTTON_BACK:
            return 1;
        default:
            return 1;
    }
}
Library API > Graphics Object Layer API > GOL Messages > GOLMsgCallback Function


GOL_MSG Structure

Contents | Index | Home
Previous | Up | Next
GOL_MSG Structure
C
typedef struct {
  BYTE type;
  BYTE uiEvent;
  SHORT param1;
  SHORT param2;
} GOL_MSG;
Overview

This structure defines the GOL message used in the library.

  • The types must be one of the INPUT_DEVICE_TYPE:
    • TYPE_UNKNOWN
    • TYPE_KEYBOARD
    • TYPE_TOUCHSCREEN
    • TYPE_MOUSE
  • uiEvent must be one of the INPUT_DEVICE_EVENT.
    • for touch screen:
      • EVENT_INVALID
      • EVENT_MOVE
      • EVENT_PRESS
      • EVENT_STILLPRESS
      • EVENT_RELEASE
    • for keyboard:
      • EVENT_KEYSCAN (param2 contains scan code)
      • EVENT_KEYCODE (param2 contains character code)
  • param1:
    • for touch screen is the x position
    • for keyboard ID of object receiving the message
  • param2
    • for touch screen y position
    • for keyboard scan or key code

Members
Members | Description
BYTE type; | Type of input device.
BYTE uiEvent; | The generic events for input device.
SHORT param1; | Parameter 1 meaning is dependent on the type of input device.
SHORT param2; | Parameter 2 meaning is dependent on the type of input device.
Library API > Graphics Object Layer API > GOL Messages > GOL_MSG Structure


TRANS_MSG Enumeration

Contents | Index | Home
Previous | Up | Next
TRANS_MSG Enumeration
C
typedef enum {
  OBJ_MSG_INVALID = 0,
  CB_MSG_CHECKED,
  CB_MSG_UNCHECKED,
  RB_MSG_CHECKED,
  WND_MSG_CLIENT,
  WND_MSG_TITLE,
  BTN_MSG_PRESSED,
  BTN_MSG_STILLPRESSED,
  BTN_MSG_RELEASED,
  BTN_MSG_CANCELPRESS,
  PICT_MSG_SELECTED,
  GB_MSG_SELECTED,
  CC_MSG_SELECTED,
  SLD_MSG_INC,
  SLD_MSG_DEC,
  ST_MSG_SELECTED,
  DM_MSG_SELECTED,
  PB_MSG_SELECTED,
  RD_MSG_CLOCKWISE,
  RD_MSG_CTR_CLOCKWISE,
  MTR_MSG_SET,
  EB_MSG_CHAR,
  EB_MSG_DEL,
  EB_MSG_TOUCHSCREEN,
  LB_MSG_SEL,
  LB_MSG_MOVE,
  LB_MSG_TOUCHSCREEN,
  GRID_MSG_TOUCHED,
  GRID_MSG_ITEM_SELECTED,
  GRID_MSG_UP,
  GRID_MSG_DOWN,
  GRID_MSG_LEFT,
  GRID_MSG_RIGHT,
  CH_MSG_SELECTED,
  TE_MSG_RELEASED,
  TE_MSG_PRESSED,
  TE_MSG_ADD_CHAR,
  TE_MSG_DELETE,
  TE_MSG_SPACE,
  TE_MSG_ENTER,
  AC_MSG_PRESSED,
  AC_MSG_RELEASED,
  OBJ_MSG_PASSIVE
} TRANS_MSG;
Overview

This structure defines the list of translated messages for GOL Objects used in the library.

Members
Members | Description
OBJ_MSG_INVALID = 0 | Invalid message response.
CB_MSG_CHECKED | Check Box check action ID.
CB_MSG_UNCHECKED | Check Box un-check action ID.
RB_MSG_CHECKED | Radio Button check action ID.
WND_MSG_CLIENT | Window client area selected action ID.
WND_MSG_TITLE | Window title bar selected action ID.
BTN_MSG_PRESSED | Button pressed action ID.
BTN_MSG_STILLPRESSED | Button is continuously pressed ID.
BTN_MSG_RELEASED | Button released action ID.
BTN_MSG_CANCELPRESS | Button released action ID with button press canceled.
PICT_MSG_SELECTED | Picture selected action ID.
GB_MSG_SELECTED | Group Box selected action ID.
CC_MSG_SELECTED | Custom Control selected action ID.
SLD_MSG_INC | Slider or Scroll Bar increment action ID.
SLD_MSG_DEC | Slider or Scroll Bar decrement action ID.
ST_MSG_SELECTED | Static Text selected action ID.
DM_MSG_SELECTED | Digital Meter selected action ID.
PB_MSG_SELECTED | Progress Bar selected action ID.
RD_MSG_CLOCKWISE | Dial move clockwise action ID.
RD_MSG_CTR_CLOCKWISE | Dial move counter clockwise action ID.
MTR_MSG_SET | Meter set value action ID.
EB_MSG_CHAR | Edit Box insert character action ID.
EB_MSG_DEL | Edit Box remove character action ID.
EB_MSG_TOUCHSCREEN | Edit Box touchscreen selected action ID.
LB_MSG_SEL | List Box item select action ID.
LB_MSG_MOVE | List Box item move action ID.
LB_MSG_TOUCHSCREEN | List Box touchscreen selected action ID.
GRID_MSG_TOUCHED | Grid item touched action ID.
GRID_MSG_ITEM_SELECTED | Grid item selected action ID.
GRID_MSG_UP | Grid up action ID.
GRID_MSG_DOWN | Grid down action ID.
GRID_MSG_LEFT | Grid left action ID.
GRID_MSG_RIGHT | Grid right action ID.
CH_MSG_SELECTED | Chart selected action ID
TE_MSG_RELEASED | TextEntry released action ID
TE_MSG_PRESSED | TextEntry pressed action ID
TE_MSG_ADD_CHAR | TextEntry add character action ID
TE_MSG_DELETE | TextEntry delete character action ID
TE_MSG_SPACE | TextEntry add space character action ID
TE_MSG_ENTER | TextEntry enter action ID
AC_MSG_PRESSED | Analog Clock Pressed Action
AC_MSG_RELEASED | Analog Clock Released Action
OBJ_MSG_PASSIVE | Passive message response. No change in object needed.
Library API > Graphics Object Layer API > GOL Messages > TRANS_MSG Enumeration


INPUT_DEVICE_EVENT Enumeration

Contents | Index | Home
Previous | Up | Next
INPUT_DEVICE_EVENT Enumeration
C
typedef enum {
  EVENT_INVALID = 0,
  EVENT_MOVE,
  EVENT_PRESS,
  EVENT_STILLPRESS,
  EVENT_RELEASE,
  EVENT_KEYSCAN,
  EVENT_CHARCODE,
  EVENT_SET,
  EVENT_SET_STATE,
  EVENT_CLR_STATE
} INPUT_DEVICE_EVENT;
Overview

This structure defines the types of GOL message events used in the library.

Members
Members | Description
EVENT_INVALID = 0 | An invalid event.
EVENT_MOVE | A move event.
EVENT_PRESS | A press event.
EVENT_STILLPRESS | A continuous press event.
EVENT_RELEASE | A release event.
EVENT_KEYSCAN | A keyscan event, parameters has the object ID keyboard scan code.
EVENT_CHARCODE | Character code is presented at the parameters.
EVENT_SET | A generic set event.
EVENT_SET_STATE | A set state event.
EVENT_CLR_STATE | A clear state event.
Library API > Graphics Object Layer API > GOL Messages > INPUT_DEVICE_EVENT Enumeration


INPUT_DEVICE_TYPE Enumeration

Contents | Index | Home
Previous | Up | Next
INPUT_DEVICE_TYPE Enumeration
C
typedef enum {
  TYPE_UNKNOWN = 0,
  TYPE_KEYBOARD,
  TYPE_TOUCHSCREEN,
  TYPE_MOUSE,
  TYPE_TIMER,
  TYPE_SYSTEM
} INPUT_DEVICE_TYPE;
Overview

This structure defines the types of input devices used in the library.

Members
Members | Description
TYPE_UNKNOWN = 0 | Unknown device.
TYPE_KEYBOARD | Keyboard.
TYPE_TOUCHSCREEN | Touchscreen.
TYPE_MOUSE | Mouse.
TYPE_TIMER | Timer.
TYPE_SYSTEM | System Messages.
Library API > Graphics Object Layer API > GOL Messages > INPUT_DEVICE_TYPE Enumeration


Scan Key Codes

Contents | Index | Home
Previous | Up | Next
Scan Key Codes
Macros

The defined scan codes for AT keyboard.

Macros
Name | Description
SCAN_BS_PRESSED | Back space key pressed.
SCAN_BS_RELEASED | Back space key released.
SCAN_CR_PRESSED | Carriage return pressed.
SCAN_CR_RELEASED | Carriage return released.
SCAN_DEL_PRESSED | Delete key pressed.
SCAN_DEL_RELEASED | Delete key released.
SCAN_DOWN_PRESSED | Down key pressed.
SCAN_DOWN_RELEASED | Down key released.
SCAN_END_PRESSED | End key pressed.
SCAN_END_RELEASED | End key released.
SCAN_HOME_PRESSED | Home key pressed.
SCAN_HOME_RELEASED | Home key released.
SCAN_LEFT_PRESSED | Left key pressed.
SCAN_LEFT_RELEASED | Left key released.
SCAN_PGDOWN_PRESSED | Page down key pressed.
SCAN_PGDOWN_RELEASED | Page down key released.
SCAN_PGUP_PRESSED | Page up key pressed.
SCAN_PGUP_RELEASED | Page up key released.
SCAN_RIGHT_PRESSED | Right key pressed.
SCAN_RIGHT_RELEASED | Right key released.
SCAN_SPACE_PRESSED | Space key pressed.
SCAN_SPACE_RELEASED | Space key released.
SCAN_TAB_PRESSED | Tab key pressed.
SCAN_TAB_RELEASED | Tab key released.
SCAN_UP_PRESSED | Up key pressed.
SCAN_UP_RELEASED | Up key released.
Links
GOL Messages, Macros
Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes


SCAN_BS_PRESSED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_BS_PRESSED Macro
C
#define SCAN_BS_PRESSED 0x0E
Description

Back space key pressed.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_BS_PRESSED Macro


SCAN_BS_RELEASED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_BS_RELEASED Macro
C
#define SCAN_BS_RELEASED 0x8E
Description

Back space key released.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_BS_RELEASED Macro


SCAN_CR_PRESSED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_CR_PRESSED Macro
C
#define SCAN_CR_PRESSED 0x1C
Description

Carriage return pressed.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_CR_PRESSED Macro


SCAN_CR_RELEASED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_CR_RELEASED Macro
C
#define SCAN_CR_RELEASED 0x9C
Description

Carriage return released.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_CR_RELEASED Macro


SCAN_DEL_PRESSED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_DEL_PRESSED Macro
C
#define SCAN_DEL_PRESSED 0x53
Description

Delete key pressed.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_DEL_PRESSED Macro


SCAN_DEL_RELEASED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_DEL_RELEASED Macro
C
#define SCAN_DEL_RELEASED 0xD3
Description

Delete key released.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_DEL_RELEASED Macro


SCAN_DOWN_PRESSED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_DOWN_PRESSED Macro
C
#define SCAN_DOWN_PRESSED 0x50
Description

Down key pressed.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_DOWN_PRESSED Macro


SCAN_DOWN_RELEASED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_DOWN_RELEASED Macro
C
#define SCAN_DOWN_RELEASED 0xD0
Description

Down key released.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_DOWN_RELEASED Macro


SCAN_END_PRESSED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_END_PRESSED Macro
C
#define SCAN_END_PRESSED 0x4F
Description

End key pressed.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_END_PRESSED Macro


SCAN_END_RELEASED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_END_RELEASED Macro
C
#define SCAN_END_RELEASED 0xCF
Description

End key released.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_END_RELEASED Macro


SCAN_HOME_PRESSED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_HOME_PRESSED Macro
C
#define SCAN_HOME_PRESSED 0x47
Description

Home key pressed.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_HOME_PRESSED Macro


SCAN_HOME_RELEASED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_HOME_RELEASED Macro
C
#define SCAN_HOME_RELEASED 0xC7
Description

Home key released.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_HOME_RELEASED Macro


SCAN_LEFT_PRESSED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_LEFT_PRESSED Macro
C
#define SCAN_LEFT_PRESSED 0x4B
Description

Left key pressed.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_LEFT_PRESSED Macro


SCAN_LEFT_RELEASED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_LEFT_RELEASED Macro
C
#define SCAN_LEFT_RELEASED 0xCB
Description

Left key released.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_LEFT_RELEASED Macro


SCAN_PGDOWN_PRESSED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_PGDOWN_PRESSED Macro
C
#define SCAN_PGDOWN_PRESSED 0x51
Description

Page down key pressed.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_PGDOWN_PRESSED Macro


SCAN_PGDOWN_RELEASED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_PGDOWN_RELEASED Macro
C
#define SCAN_PGDOWN_RELEASED 0xD1
Description

Page down key released.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_PGDOWN_RELEASED Macro


SCAN_PGUP_PRESSED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_PGUP_PRESSED Macro
C
#define SCAN_PGUP_PRESSED 0x49
Description

Page up key pressed.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_PGUP_PRESSED Macro


SCAN_PGUP_RELEASED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_PGUP_RELEASED Macro
C
#define SCAN_PGUP_RELEASED 0xC9
Description

Page up key released.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_PGUP_RELEASED Macro


SCAN_RIGHT_PRESSED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_RIGHT_PRESSED Macro
C
#define SCAN_RIGHT_PRESSED 0x4D
Description

Right key pressed.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_RIGHT_PRESSED Macro


SCAN_RIGHT_RELEASED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_RIGHT_RELEASED Macro
C
#define SCAN_RIGHT_RELEASED 0xCD
Description

Right key released.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_RIGHT_RELEASED Macro


SCAN_SPACE_PRESSED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_SPACE_PRESSED Macro
C
#define SCAN_SPACE_PRESSED 0x39
Description

Space key pressed.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_SPACE_PRESSED Macro


SCAN_SPACE_RELEASED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_SPACE_RELEASED Macro
C
#define SCAN_SPACE_RELEASED 0xB9
Description

Space key released.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_SPACE_RELEASED Macro


SCAN_TAB_PRESSED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_TAB_PRESSED Macro
C
#define SCAN_TAB_PRESSED 0x0F
Description

Tab key pressed.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_TAB_PRESSED Macro


SCAN_TAB_RELEASED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_TAB_RELEASED Macro
C
#define SCAN_TAB_RELEASED 0x8F
Description

Tab key released.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_TAB_RELEASED Macro


SCAN_UP_PRESSED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_UP_PRESSED Macro
C
#define SCAN_UP_PRESSED 0x48
Description

Up key pressed.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_UP_PRESSED Macro


SCAN_UP_RELEASED Macro

Contents | Index | Home
Previous | Up | Next
SCAN_UP_RELEASED Macro
C
#define SCAN_UP_RELEASED 0xC8
Description

Up key released.

Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes > SCAN_UP_RELEASED Macro


Style Scheme

Contents | Index | Home
Previous | Up | Next
Style Scheme
Functions | Macros | Structures | Topics | Variables

All objects uses a style scheme structure that defines the font and colors used. Upon the object’s creation a user defined style scheme can be assigned to the object. In the absence of the user defined scheme, the default scheme is used.

Copy Code
    typedef struct {
        WORD               EmbossDkColor;
        WORD               EmbossLtColor;
        WORD               TextColor0;
        WORD               TextColor1;
        WORD               TextColorDisabled;
        WORD               Color0;
        WORD               Color1;
        WORD               ColorDisabled;
        WORD               CommonBkColor;
        BYTE               *pFont;
        BYTE               AlphaValue;
        GFX_GRADIENT_STYLE gradientScheme;
    } GOL_SCHEME;

Field | Description
EmbossDkColor | Dark emboss color used for the 3-D effect of the object.
EmbossLtColor | Light emboss color used for the 3-D effect of the object.
TextColor0 TextColor1 | Generic text colors used by the objects. Usage may vary from one object type to another.
TextColorDisabled | Text color used for objects that are disabled.
Color0 Color1 | Generic colors used to render objects. Usage may vary from one object type to another.
ColorDisabled | Color used to render objects that are disabled.
CommonBkColor | A common background color of objects. Typically used to hide objects from the screen.
pFont | Pointer to the font table used by the object.
AlphaValue | Alpha value used for alpha blending, this is only available only when USE_ALPHABLEND is defined in the GraphicsConfig.h.
gradientScheme | Gradient Scheme for supported widgets, this is available only when USE_GRADIENT is defined in the GraphicsConfig.h.

TextColorDisabled and ColorDisabled are used when the object is in the disabled state. Otherwise, TextColor0, TextColor1, Color0 and Color1 are used. When object Draw state is set to HIDE, the CommonBkColor is used to fill area occupied by object.

Style scheme can be created with GOLCreateScheme() function that returns a pointer to the newly created GOL_SCHEME structure with default values automatically assigned. The default settings of the style scheme for a 16bpp setup are shown below:

Style Parameter | Default Value
EmbossDkColor | EMBOSSDKCOLORDEFAULT
EmbossLtColor | EMBOSSLTCOLORDEFAULT
Textcolor0 | TEXTCOLOR0DEFAULT
Textcolor1 | TEXTCOLOR1DEFAULT
TextColorDisabled | TEXTCOLORDISABLEDDEFAULT
Color0 | COLOR0DEFAULT
Color1 | COLOR1DEFAULT
ColorDisabled | COLORDISABLEDDEFAULT
CommonBkColor | COMMONBACKGROUNDCOLORDEFAULT
pFont | FONTDEFAULT
AlphaValue | 0
gradientScheme | { GRAD_NONE, RGBConvert(0xA9, 0xDB, 0xEF), RGBConvert(0x26, 0xC7, 0xF2), 50 }

The default values can be changed in the GOLSchemeDefault.c file.

The application code can define its own default style scheme by defining the macro GFX_SCHEMEDEFAULT in the GraphicsConfig.h.

Then GOL_SCHEME GOLSchemeDefault must be defined in the application code with each structure member initialized to the desired values. See GOLSchemeDefault.c file for an example on how to initialize the style scheme.

Functions
Name | Description
GOLCreateScheme | This function creates a new style scheme object and initializes the parameters to default values. Default values are based on the GOLSchemeDefault defined in GOLSchemeDefault.c file. Application code can override this initialization, See GOLSchemeDefault.
Macros
Name | Description
GOLSetScheme | This macro sets the GOL scheme to be used for the object.
GOLGetScheme | This macro gets the GOL scheme used by the given object.
GOLGetSchemeDefault | This macro returns the default GOL scheme pointer.
GOL_EMBOSS_SIZE | This option defines the 3-D effect emboss size for objects. The default value of this is 3 set in GOL.h. If it is not defined in GraphicsConfig.h file then the default value is used.
RGBConvert | This macro converts the color data to the selected COLOR_DEPTH. This macro is only valid when COLOR_DEPTH is 8, 16, or 24.
Structures
Name | Description
GOL_SCHEME | GOL scheme defines the style scheme to be used by an object.
Topics
Name | Description
Default Style Scheme Settings | Lists the default settings for the style scheme.
Variables
Name | Description
GOLFontDefault | This is variable GOLFontDefault.
GOLSchemeDefault | This defines a default GOL scheme that gets populated when an application calls the GOLCreateScheme(). The application can override this definition by defining the macro GFX_SCHEMEDEFAULT in the GraphicsConfig.h header file and defining GOLSchemeDefault structure in the application code. It is important to use the same structure name since the library assumes that this object exists and assigns the default style scheme pointer to this object.
Links
Functions, Graphics Object Layer API, Legend, Macros, Structures, Topics, Variables
Library API > Graphics Object Layer API > Style Scheme


GOLCreateScheme Function

Contents | Index | Home
Previous | Up | Next
GOLCreateScheme Function
C
GOL_SCHEME * GOLCreateScheme();
Overview

This function creates a new style scheme object and initializes the parameters to default values. Default values are based on the GOLSchemeDefault defined in GOLSchemeDefault.c file. Application code can override this initialization, See GOLSchemeDefault.

Returns

Pointer to the new GOL_SCHEME created.

Preconditions

none

Side Effects

none

Example
Copy Code
extern const char Font22[] __attribute__((aligned(2)));
extern const char Font16[] __attribute__((aligned(2)));

GOLSCHEME *pScheme1, *pScheme2;
pScheme1 = GOLCreateScheme();
pScheme2 = GOLCreateScheme();

pScheme1->pFont = (BYTE*)Font22;
pScheme2->pFont = (BYTE*)Font16;
Library API > Graphics Object Layer API > Style Scheme > GOLCreateScheme Function


GOLSetScheme Macro

Contents | Index | Home
Previous | Up | Next
GOLSetScheme Macro
C
#define GOLSetScheme(pObj, pScheme) ((OBJ_HEADER *)pObj)->pGolScheme = pScheme
Overview

This macro sets the GOL scheme to be used for the object.

Input Parameters
Input Parameters | Description
pObj | Pointer to the object of interest.
pScheme | Pointer to the style scheme to be used.
Returns

none

Preconditions

none

Side Effects

none

Example
Copy Code
extern FONT_FLASH Gentium12;
GOLSCHEME *pScheme1;
BUTTON *pButton;

pScheme1 = GOLCreateScheme();
pScheme1->pFont = &Gentium12;

// assume button is created and initialized

// reassign the scheme used by pButton to pScheme1
GOLSetScheme(pButton, pScheme1);
Library API > Graphics Object Layer API > Style Scheme > GOLSetScheme Macro


GOLGetScheme Macro

Contents | Index | Home
Previous | Up | Next
GOLGetScheme Macro
C
#define GOLGetScheme(pObj) ((OBJ_HEADER *)pObj)->pGolScheme
Overview

This macro gets the GOL scheme used by the given object.

Input Parameters
Input Parameters | Description
pObj | Pointer to the object of interest.
Returns

Returns the style scheme used by the given object.

Preconditions

none

Side Effects

none

Example
Copy Code
GOLSCHEME *pScheme2;
BUTTON *pButton;

// assume button is created and initialized
// get the scheme assigned to pButton
pScheme2 = GOLGetScheme(pButton);
Library API > Graphics Object Layer API > Style Scheme > GOLGetScheme Macro


GOLGetSchemeDefault Macro

Contents | Index | Home
Previous | Up | Next
GOLGetSchemeDefault Macro
C
#define GOLGetSchemeDefault _pDefaultGolScheme
Overview

This macro returns the default GOL scheme pointer.

Returns

Returns the pointer to the default style scheme.

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > Style Scheme > GOLGetSchemeDefault Macro


GOL_SCHEME Structure

Contents | Index | Home
Previous | Up | Next
GOL_SCHEME Structure
C
typedef struct {
  GFX_COLOR EmbossDkColor;
  GFX_COLOR EmbossLtColor;
  GFX_COLOR TextColor0;
  GFX_COLOR TextColor1;
  GFX_COLOR TextColorDisabled;
  GFX_COLOR Color0;
  GFX_COLOR Color1;
  GFX_COLOR ColorDisabled;
  GFX_COLOR CommonBkColor;
  void * pFont;
  BYTE AlphaValue;
  GFX_GRADIENT_STYLE gradientScheme;
} GOL_SCHEME;
Overview

GOL scheme defines the style scheme to be used by an object.

Members
Members | Description
GFX_COLOR EmbossDkColor; | Emboss dark color used for 3d effect.
GFX_COLOR EmbossLtColor; | Emboss light color used for 3d effect.
GFX_COLOR TextColor0; | Character color 0 used for objects that supports text.
GFX_COLOR TextColor1; | Character color 1 used for objects that supports text.
GFX_COLOR TextColorDisabled; | Character color used when object is in a disabled state.
GFX_COLOR Color0; | Color 0 usually assigned to an Object state.
GFX_COLOR Color1; | Color 1 usually assigned to an Object state.
GFX_COLOR ColorDisabled; | Color used when an Object is in a disabled state.
GFX_COLOR CommonBkColor; | Background color used to hide Objects.
void * pFont; | Font selected for the scheme.
BYTE AlphaValue; | Alpha value used for alpha blending, this is available only when USE_ALPHABLEND is defined in the GraphicsConfig.h.
GFX_GRADIENT_STYLE gradientScheme; | Gradient Scheme for widgets, this is available only when USE_GRADIENT is defined in the GraphicsConfig.h.
Library API > Graphics Object Layer API > Style Scheme > GOL_SCHEME Structure


Default Style Scheme Settings

Contents | Index | Home
Previous | Up | Next
Default Style Scheme Settings
Variables

Lists the default settings for the style scheme.

Variables
Name | Description
FONTDEFAULT | Default GOL font.
Links
Style Scheme, Variables
Library API > Graphics Object Layer API > Style Scheme > Default Style Scheme Settings


FONTDEFAULT Variable

Contents | Index | Home
Previous | Up | Next
FONTDEFAULT Variable
C
const FONT_FLASH FONTDEFAULT;
Description

Default GOL font.

Library API > Graphics Object Layer API > Style Scheme > Default Style Scheme Settings > FONTDEFAULT Variable


GOLFontDefault Variable

Contents | Index | Home
Previous | Up | Next
GOLFontDefault Variable
C
const FONT_FLASH GOLFontDefault = { (FLASH | COMP_NONE), __GOLFontDefault };
Description

This is variable GOLFontDefault.

Library API > Graphics Object Layer API > Style Scheme > GOLFontDefault Variable


GOL_EMBOSS_SIZE Macro

Contents | Index | Home
Previous | Up | Next
GOL_EMBOSS_SIZE Macro
C
#define GOL_EMBOSS_SIZE 3
Overview

This option defines the 3-D effect emboss size for objects. The default value of this is 3 set in GOL.h. If it is not defined in GraphicsConfig.h file then the default value is used.

Library API > Graphics Object Layer API > Style Scheme > GOL_EMBOSS_SIZE Macro


GOLSchemeDefault Variable

Contents | Index | Home
Previous | Up | Next
GOLSchemeDefault Variable
C
const GOL_SCHEME GOLSchemeDefault = { BLACK, WHITE, WHITE, BLACK, WHITE, BLACK, WHITE, BLACK, BLACK, GRAY006, GRAY010, WHITE, BLACK, GRAY012, GRAY008, GRAY004, GRAY014, BLACK, RGBConvert(0x2B, 0x55, 0x87), RGBConvert(0xD4, 0xE4, 0xF7), RGBConvert(0x07, 0x1E, 0x48), RGBConvert(0xFF, 0xFF, 0xFF), RGBConvert(245, 245, 220), RGBConvert(0xA9, 0xDB, 0xEF), RGBConvert(0x26, 0xC7, 0xF2), RGBConvert(0xB6, 0xD2, 0xFB), RGBConvert(0xD4, 0xED, 0xF7), (void *)&FONTDEFAULT, 0, #error "The USE_GRADIENT feature is not currently supported when USE_PALETTE is enabled." { GRAD_NONE, RGBConvert(0xA9, 0xDB, 0xEF), RGBConvert(0x26, 0xC7, 0xF2), 50 } };
Overview

This defines a default GOL scheme that gets populated when an application calls the GOLCreateScheme(). The application can override this definition by defining the macro GFX_SCHEMEDEFAULT in the GraphicsConfig.h header file and defining GOLSchemeDefault structure in the application code. It is important to use the same structure name since the library assumes that this object exists and assigns the default style scheme pointer to this object.

Library API > Graphics Object Layer API > Style Scheme > GOLSchemeDefault Variable


RGBConvert Macro

Contents | Index | Home
Previous | Up | Next
RGBConvert Macro
C
#define RGBConvert(red, green, blue) (GFX_COLOR) (((GFX_COLOR)(red) << 16) | ((GFX_COLOR)(green) << 8) | (GFX_COLOR)(blue))
Overview

This macro converts the color data to the selected COLOR_DEPTH. This macro is only valid when COLOR_DEPTH is 8, 16, or 24.

COLOR_DEPTH | Conversion
8 | 8-8-8 to 3-3-2 conversion
16 | 8-8-8 to to 5-6-5 conversion
24 | 8-8-8 to 8-8-8 conversion or no conversion
Input Parameters
Input Parameters | Description
red | red component of the color.
green | green component of the color.
blue | blue component of the color.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Object Layer API > Style Scheme > RGBConvert Macro


GOL Global Variables

Contents | Index | Home
Previous | Up | Next
GOL Global Variables
Variables

Graphics Object Layer global variables.

Variables
Name
Description
_pDefaultGolScheme
Pointer to the GOL default scheme (GOL_SCHEME). This scheme is created in GOLInit() function. GOL scheme defines the style scheme to be used by an object. Use GOLGetSchemeDefault() to get this pointer.
_pGolObjects
Pointer to the current linked list of objects displayed and receiving messages. GOLDraw() and GOLMsg() process objects referenced by this pointer.
_pObjectFocused
Pointer to the object receiving keyboad input. This pointer is used or modified by the following APIs:
  • GOLSetFocus()
  • GOLGetFocus()
  • GOLGetFocusNext()
  • GOLGetFocusPrev()
  • GOLCanBeFocused()
Links
Graphics Object Layer API, Variables
Library API > Graphics Object Layer API > GOL Global Variables


_pDefaultGolScheme Variable

Contents | Index | Home
Previous | Up | Next
_pDefaultGolScheme Variable
C
GOL_SCHEME * _pDefaultGolScheme;
Overview

Pointer to the GOL default scheme (GOL_SCHEME). This scheme is created in GOLInit() function. GOL scheme defines the style scheme to be used by an object. Use GOLGetSchemeDefault() to get this pointer.

Library API > Graphics Object Layer API > GOL Global Variables > _pDefaultGolScheme Variable


_pGolObjects Variable

Contents | Index | Home
Previous | Up | Next
_pGolObjects Variable
C
OBJ_HEADER * _pGolObjects;
Overview

Pointer to the current linked list of objects displayed and receiving messages. GOLDraw() and GOLMsg() process objects referenced by this pointer.

Library API > Graphics Object Layer API > GOL Global Variables > _pGolObjects Variable


_pObjectFocused Variable

Contents | Index | Home
Previous | Up | Next
_pObjectFocused Variable
C
OBJ_HEADER * _pObjectFocused;
Overview

Pointer to the object receiving keyboad input. This pointer is used or modified by the following APIs:

  • GOLSetFocus()
  • GOLGetFocus()
  • GOLGetFocusNext()
  • GOLGetFocusPrev()
  • GOLCanBeFocused()

Library API > Graphics Object Layer API > GOL Global Variables > _pObjectFocused Variable


Graphics Primitive Layer API

Contents | Index | Home
Previous | Up | Next
Graphics Primitive Layer API
Enumerations | Structures | Topics
Enumerations
Name | Description
GFX_RESOURCE | Memory type enumeration to determine the source of data. Used in interpreting bitmap and font from different memory sources.
Structures
Name | Description
GFX_IMAGE_HEADER | Structure for images stored in various system memory (Flash, External Memory (SPI, Parallel Flash, or memory in EPMP).
IMAGE_FLASH | Structure for images stored in FLASH memory.
IMAGE_RAM | Structure for images stored in RAM memory.
GFX_EXTDATA | This structure is used to describe external memory.
Topics
Name | Description
Text Functions | This lists the Primitive level text functions.
Gradient | Gradients can be drawn dynamically with the Microchip Graphics Library.
Line Functions | This lists the Primitive line text functions.
Rectangle Functions | This lists the Primitive level rectangle functions.
Circle Functions | This lists the Primitive level circle functions.
Graphic Cursor | This lists the functions to control the graphics cursor.
Bitmap Functions | This lists the functions to display bitmaps.
External Memory | This lists the external memory access functions and descriptions.
Set Up Functions | This lists the Primitive set up and initialization functions.
Links
Enumerations, Library API, Structures, Topics
Library API > Graphics Primitive Layer API


Text Functions

Contents | Index | Home
Previous | Up | Next
Text Functions
Functions | Macros | Structures | Topics | Types

This lists the Primitive level text functions.

Functions
Name | Description
SetFont | This function sets the current font used in OutTextXY(), OutText() and OutChar() functions.
OutChar | This function outputs a character from the current graphic cursor position. OutChar() uses the current active font set with SetFont().
OutText | This function outputs a string of characters starting at the current graphic cursor position. The string must be terminated by a line feed or zero. For Non-Blocking configuration, OutText() may return control to the program due to display device busy status. When this happens zero is returned and OutText() must be called again to continue the outputting of the string. For Blocking configuration, this function always returns a 1. OutText() uses the current active font set with SetFont().
OutTextXY | This function outputs a string of characters starting at the given x, y position. The string must be terminated by a line feed or zero. For Non-Blocking configuration, OutTextXY() may return control to the program due to display device busy status. When this happens zero is returned and OutTextXY() must be called again to continue the outputting of the string. For Blocking configuration, this function always returns a 1. OutTextXY() uses the current active font set with SetFont().
GetTextHeight | This macro returns the height of the specified font. All characters in a given font table have a constant height.
GetTextWidth | This function returns the width of the specified string for the specified font. The string must be terminated by a line feed or zero.
Macros
Name | Description
GetFontOrientation | Returns font orientation.
SetFontOrientation | Sets font orientation vertical or horizontal.
GFX_Font_GetAntiAliasType | Returns the font anti-alias type.
GFX_Font_SetAntiAliasType | Sets font anti-alias type to either Translucent or opaque.
XCHAR | This macro sets the data type for the strings and characters. There are three types used for XCHAR and the type is selected by adding one of the macros in GraphicsConfig.h.
Structures
Name | Description
FONT_HEADER | Structure describing the font header.
FONT_FLASH | Structure for font stored in FLASH memory.
Topics
Name | Description
Anti-Alias Type | Anti-alias type definitions.
Types
Name | Description
FONT_EXTERNAL | Structure for font stored in EXTERNAL memory space. (example: External SPI or parallel Flash, EDS_EPMP)
Links
Functions, Graphics Primitive Layer API, Legend, Macros, Structures, Topics, Types
Library API > Graphics Primitive Layer API > Text Functions


FONT_HEADER Structure

Contents | Index | Home
Previous | Up | Next
FONT_HEADER Structure
C
typedef struct {
  BYTE fontID;
  BYTE extendedGlyphEntry : 1;
  BYTE res1 : 1;
  BYTE bpp : 2;
  BYTE orientation : 2;
  BYTE res2 : 2;
  WORD firstChar;
  WORD lastChar;
  WORD height;
} FONT_HEADER;
Overview

Structure describing the font header.

Members
Members
Description
BYTE fontID;
User assigned value
BYTE extendedGlyphEntry : 1;
Extended Glyph entry flag. When set font has extended glyph feature enabled.
BYTE res1 : 1;
Reserved for future use (must be set to 0)
BYTE bpp : 2;
Actual BPP = 2^bpp
BYTE orientation : 2;
Orientation of the character glyphs (0,90,180,270 degrees)
  • 00 - Normal
  • 01 - Characters rotated 270 degrees clockwise
  • 10 - Characters rotated 180 degrees
  • 11 - Characters rotated 90 degrees clockwise
BYTE res2 : 2;
Reserved for future use (must be set to 0).
WORD firstChar;
Character code of first character (e.g. 32).
WORD lastChar;
Character code of last character in font (e.g. 3006).
WORD height;
Font characters height in pixels.
Library API > Graphics Primitive Layer API > Text Functions > FONT_HEADER Structure


FONT_FLASH Structure

Contents | Index | Home
Previous | Up | Next
FONT_FLASH Structure
C
typedef struct {
  GFX_RESOURCE type;
  const char * address;
} FONT_FLASH;
Overview

Structure for font stored in FLASH memory.

Members
Members | Description
GFX_RESOURCE type; | must be FLASH
const char * address; | font image address in FLASH
Library API > Graphics Primitive Layer API > Text Functions > FONT_FLASH Structure


FONT_EXTERNAL Type

Contents | Index | Home
Previous | Up | Next
FONT_EXTERNAL Type
C
typedef GFX_EXTDATA FONT_EXTERNAL;
Overview

Structure for font stored in EXTERNAL memory space. (example: External SPI or parallel Flash, EDS_EPMP)

Library API > Graphics Primitive Layer API > Text Functions > FONT_EXTERNAL Type


SetFont Function

Contents | Index | Home
Previous | Up | Next
SetFont Function
C
void SetFont(
    void * pFont
);
Overview

This function sets the current font used in OutTextXY(), OutText() and OutChar() functions.

Input Parameters
Input Parameters | Description
void * pFont | Pointer to the new font image to be used.
Returns

none

Side Effects

none

Example

See OutTextXY() example.

Library API > Graphics Primitive Layer API > Text Functions > SetFont Function


GetFontOrientation Macro

Contents | Index | Home
Previous | Up | Next
GetFontOrientation Macro
C
#define GetFontOrientation _fontOrientation
Overview

Returns font orientation.

Returns

Return the current font orientation.

  • 1 when font orientation is vertical
  • 0 when font orientation is horizontal

Preconditions

none

Example
Copy Code
void PlaceText(SHORT x, SHORT y, WORD space, XCHAR *pString)
{
    SHORT width;

    SetColor(BRIGHTRED);                // set color
    SetFont(pMyFont);                   // set to use global font

    // get string width
    width = GetTextWidth(pString, pMyFont);

    // check if it fits
    if (space < width)
    {
        if (GetFontOrientation() == 0)
            // reset the orientation to vertical
            SetFontOrientation(1);
    }
    else
    {
        if (GetFontOrientation() == 1)
            // reset the orientation to horizontal
            SetFontOrientation(0);
    }
    // place string in the middle of the screen
    OutTextXY(x, y, pString);
}
Library API > Graphics Primitive Layer API > Text Functions > GetFontOrientation Macro


SetFontOrientation Macro

Contents | Index | Home
Previous | Up | Next
SetFontOrientation Macro
C
#define SetFontOrientation(orient) _fontOrientation = orient;
Overview

Sets font orientation vertical or horizontal.

Input Parameters
Input Parameters
Description
orient
sets font orientation when rendering characters and strings.
  • 1 when font orientation is vertical
  • 0 when font orientation is horizontal
Returns

none

Preconditions

none

Example

See GetFontOrientation() example.

Library API > Graphics Primitive Layer API > Text Functions > SetFontOrientation Macro


GFX_Font_GetAntiAliasType Macro

Contents | Index | Home
Previous | Up | Next
GFX_Font_GetAntiAliasType Macro
C
#define GFX_Font_GetAntiAliasType
Overview

Returns the font anti-alias type.

Returns

Return the current font anti-alias type.

  • ANTIALIAS_TRANSLUCENT - (or 1) when font anti-alias is type translucent
  • ANTIALIAS_OPAQUE - (or 0) when font anti-alias is type opaque

Preconditions

Compiler switch USE_ANTIALIASED_FONTS must be enabled

Library API > Graphics Primitive Layer API > Text Functions > GFX_Font_GetAntiAliasType Macro


GFX_Font_SetAntiAliasType Macro

Contents | Index | Home
Previous | Up | Next
GFX_Font_SetAntiAliasType Macro
C
#define GFX_Font_SetAntiAliasType(transparency)
Overview

Sets font anti-alias type to either Translucent or opaque.

Input Parameters
Input Parameters
Description
transparency
sets font font anti-alias type
  • ANTIALIAS_TRANSLUCENT - (or 1) when font anti-alias type is translucent
  • ANTIALIAS_OPAQUE - (or 0) when font anti-alias type is opaque
Returns

none

Preconditions

Compiler switch USE_ANTIALIASED_FONTS must be enabled

Library API > Graphics Primitive Layer API > Text Functions > GFX_Font_SetAntiAliasType Macro


OutChar Function

Contents | Index | Home
Previous | Up | Next
OutChar Function
C
WORD OutChar(
    XCHAR ch
);
Overview

This function outputs a character from the current graphic cursor position. OutChar() uses the current active font set with SetFont().

Input Parameters
Input Parameters | Description
XCHAR ch | The character code to be displayed.
Returns

For NON-Blocking configuration:

  • Returns 0 when device is busy and the character is not yet completely drawn.
  • Returns 1 when the character is completely drawn.
For Blocking configuration:
  • Always return 1.

Preconditions

none

Side Effects

After the function is completed, the graphic cursor position is moved in the horizontal direction by the character width. Vertical position of the graphic cursor is not changed.

Example
Copy Code
static WORD counter = 0;
XCHAR   ch;

// render characters until null character
while((XCHAR)(ch = *(textString + counter)) != 0)
{
    if(OutChar(ch) == 0)
        return (0);
    counter++;
}
Library API > Graphics Primitive Layer API > Text Functions > OutChar Function


OutText Function

Contents | Index | Home
Previous | Up | Next
OutText Function
C
WORD OutText(
    XCHAR * textString
);
Overview

This function outputs a string of characters starting at the current graphic cursor position. The string must be terminated by a line feed or zero. For Non-Blocking configuration, OutText() may return control to the program due to display device busy status. When this happens zero is returned and OutText() must be called again to continue the outputting of the string. For Blocking configuration, this function always returns a 1. OutText() uses the current active font set with SetFont().

Input Parameters
Input Parameters | Description
XCHAR * textString | Pointer to the string to be displayed.
Returns

For NON-Blocking configuration:

  • Returns 0 when string is not yet outputted completely.
  • Returns 1 when string is outputted completely.
For Blocking configuration:
  • Always return 1.

Side Effects

Current horizontal graphic cursor position will be moved to the end of the text. The vertical graphic cursor position will not be changed.

Example
Copy Code
    SetFont(pMyFont);
    SetColor(WHITE);
    // place the string at the upper left corner of the screen
    MoveTo(0, 0);
    OutText("Test String!");
Library API > Graphics Primitive Layer API > Text Functions > OutText Function


OutTextXY Function

Contents | Index | Home
Previous | Up | Next
OutTextXY Function
C
WORD OutTextXY(
    SHORT x,
    SHORT y,
    XCHAR * textString
);
Overview

This function outputs a string of characters starting at the given x, y position. The string must be terminated by a line feed or zero. For Non-Blocking configuration, OutTextXY() may return control to the program due to display device busy status. When this happens zero is returned and OutTextXY() must be called again to continue the outputting of the string. For Blocking configuration, this function always returns a 1. OutTextXY() uses the current active font set with SetFont().

Input Parameters
Input Parameters | Description
SHORT x | Defines the x starting position of the string.
SHORT y | Defines the y starting position of the string.
XCHAR * textString | Pointer to the string to be displayed.
Returns

For NON-Blocking configuration:

  • Returns 0 when string is not yet outputted completely.
  • Returns 1 when string is outputted completely.
For Blocking configuration:
  • Always return 1.

Side Effects

Current horizontal graphic cursor position will be moved to the end of the text. The vertical graphic cursor position will not be changed.

Example
Copy Code
void PlaceText(void)
{
    SHORT width, height;
    static const XCHAR text[] = "Touch screen to continue";

    SetColor(BRIGHTRED);                // set color
    SetFont(pMyFont);                   // set font to my font

    // get string width & height
    width = GetTextWidth(text, pMyFont);
    height = GetTextHeight(pMyFont);

    // place string in the middle of the screen
    OutTextXY(  (GetMaxX() - width) >> 1,
    (GetMaxY() – height) >> 1,
    (char*)text);
}
Library API > Graphics Primitive Layer API > Text Functions > OutTextXY Function


GetTextHeight Function

Contents | Index | Home
Previous | Up | Next
GetTextHeight Function
C
SHORT GetTextHeight(
    void * pFont
);
Overview

This macro returns the height of the specified font. All characters in a given font table have a constant height.

Input Parameters
Input Parameters | Description
void * pFont | Pointer to the font image.
Returns

Returns the font height.

Side Effects

none

Example

See OutTextXY() example.

Library API > Graphics Primitive Layer API > Text Functions > GetTextHeight Function


GetTextWidth Function

Contents | Index | Home
Previous | Up | Next
GetTextWidth Function
C
SHORT GetTextWidth(
    XCHAR * textString,
    void * pFont
);
Overview

This function returns the width of the specified string for the specified font. The string must be terminated by a line feed or zero.

Input Parameters
Input Parameters | Description
XCHAR * textString | Pointer to the string.
void * pFont | Pointer to the font image.
Returns

Returns the string width in the specified font.

Side Effects

none

Example

See OutTextXY() example.

Library API > Graphics Primitive Layer API > Text Functions > GetTextWidth Function


XCHAR Macro

Contents | Index | Home
Previous | Up | Next
XCHAR Macro
C
#define XCHAR char
Overview

This macro sets the data type for the strings and characters. There are three types used for XCHAR and the type is selected by adding one of the macros in GraphicsConfig.h.

In GraphicsConfig.h | XCHAR | Description
#define USE_MULTIBYTECHAR | #define XCHAR unsigned short | Use multibyte characters (0-2^16 range).
#define USE_UNSIGNED_XCHAR | #define XCHAR unsigned char | Use unsigned char (0-255 range).
none of the two defined | #define XCHAR char | Use signed char (0-127 range).
Library API > Graphics Primitive Layer API > Text Functions > XCHAR Macro


Anti-Alias Type

Contents | Index | Home
Previous | Up | Next
Anti-Alias Type
Macros

Anti-alias type definitions.

Macros
Name | Description
ANTIALIAS_OPAQUE | Mid colors are calculated only once while rendering each character. This is ideal for rendering text over a constant background.
ANTIALIAS_TRANSLUCENT | Mid values are calculated for every necessary pixel. This feature is useful when rendering text over an image or when the background is not one flat color.
Links
Text Functions, Macros
Library API > Graphics Primitive Layer API > Text Functions > Anti-Alias Type


ANTIALIAS_OPAQUE Macro

Contents | Index | Home
Previous | Up | Next
ANTIALIAS_OPAQUE Macro
C
#define ANTIALIAS_OPAQUE 0
Description

Mid colors are calculated only once while rendering each character. This is ideal for rendering text over a constant background.

Library API > Graphics Primitive Layer API > Text Functions > Anti-Alias Type > ANTIALIAS_OPAQUE Macro


ANTIALIAS_TRANSLUCENT Macro

Contents | Index | Home
Previous | Up | Next
ANTIALIAS_TRANSLUCENT Macro
C
#define ANTIALIAS_TRANSLUCENT 1
Description

Mid values are calculated for every necessary pixel. This feature is useful when rendering text over an image or when the background is not one flat color.

Library API > Graphics Primitive Layer API > Text Functions > Anti-Alias Type > ANTIALIAS_TRANSLUCENT Macro


Gradient

Contents | Index | Home
Previous | Up | Next
Gradient
Enumerations | Functions | Structures

Gradients can be drawn dynamically with the Microchip Graphics Library.

Enumerations
Name | Description
GFX_GRADIENT_TYPE | Enumeration for gradient type
Functions
Name | Description
BarGradient | This renders a bar onto the screen, but instead of one color, a gradient is drawn depending on the direction (GFX_GRADIENT_TYPE), length, and colors chosen. This function is a blocking call.
BevelGradient | This renders a filled bevel with gradient color on the fill. It works the same as the fillbevel function, except a gradient out of color1 and color2 is drawn depending on the direction (GFX_GRADIENT_TYPE). This function is a blocking call.
Structures
Name | Description
GFX_GRADIENT_STYLE | This structure is used to describe the gradient style.
Links
Enumerations, Functions, Graphics Primitive Layer API, Legend, Structures
Library API > Graphics Primitive Layer API > Gradient


BarGradient Function

Contents | Index | Home
Previous | Up | Next
BarGradient Function
C
WORD BarGradient(
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    GFX_COLOR color1,
    GFX_COLOR color2,
    DWORD length,
    BYTE direction
);
Overview

This renders a bar onto the screen, but instead of one color, a gradient is drawn depending on the direction (GFX_GRADIENT_TYPE), length, and colors chosen. This function is a blocking call.

Description

Input Parameters
Input Parameters | Description
SHORT left | x position of the left top corner.
SHORT top | y position of the left top corner.
SHORT right | x position of the right bottom corner.
SHORT bottom | y position of the right bottom corner.
GFX_COLOR color1 | start color for the gradient
GFX_COLOR color2 | end color for the gradient
DWORD length | From 0-100%. How much of a gradient is wanted
BYTE direction | Gradient Direction
Returns

Always returns a 1 since it is a blocking function.

Preconditions

USE_GRADIENT macro must be defined (in GraphicsConfig.h)

Side Effects

none

Example
Copy Code
// draw a full screen gradient background
// with color transitioning from BRIGHTRED to
// BLACK in the upward direction.

GFX_GRADIENT_STYLE  gradScheme;

gradScheme.gradientType         = GRAD_UP;
gradScheme.gradientStartColor   = BRIGHTRED;
gradScheme.gradientEndColor     = BLACK;

 BarGradient(0,                                         //left position
             0,                                         //top position
             GetMaxX(),                                 //right position
             GetMaxY(),                                 //bottom position
             gradScheme.gradientStartColor,
             gradScheme.gradientEndColor,
             50,                                        // at the halfway point (50%) of the rectangular area
                                                        // defined by the first 4 parameters (full screen),
                                                        // the color becomes BLACK and BLACK color is used until
                                                        // the rectangle defined is filled up
             gradScheme.gradientType);                  // see GFX_GRADIENT_TYPE
Library API > Graphics Primitive Layer API > Gradient > BarGradient Function


BevelGradient Function

Contents | Index | Home
Previous | Up | Next
BevelGradient Function
C
WORD BevelGradient(
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    SHORT rad,
    GFX_COLOR color1,
    GFX_COLOR color2,
    DWORD length,
    BYTE direction
);
Overview

This renders a filled bevel with gradient color on the fill. It works the same as the fillbevel function, except a gradient out of color1 and color2 is drawn depending on the direction (GFX_GRADIENT_TYPE). This function is a blocking call.

Description

Input Parameters
Input Parameters | Description
SHORT left | x coordinate position of the upper left center of the circle that draws the rounded corners.
SHORT top | y coordinate position of the upper left center of the circle that draws the rounded corners.
SHORT right | x coordinate position of the lower right center of the circle that draws the rounded corners.
SHORT bottom | y coordinate position of the lower right center of the circle that draws the rounded corners.
SHORT rad | defines the redius of the circle, that draws the rounded corners. When rad = 0, the object drawn is a rectangular gradient.
GFX_COLOR color1 | start color for the gradient
GFX_COLOR color2 | end color for the gradient
DWORD length | From 0-100%. How much of a gradient is wanted
BYTE direction | see GFX_GRADIENT_TYPE
Returns

Always returns a 1 since it is a blocking function.

Preconditions

USE_GRADIENT macro must be defined (in GraphicsConfig.h)

Side Effects

none

Library API > Graphics Primitive Layer API > Gradient > BevelGradient Function


GFX_GRADIENT_TYPE Enumeration

Contents | Index | Home
Previous | Up | Next
GFX_GRADIENT_TYPE Enumeration
C
typedef enum {
  GRAD_NONE = 0,
  GRAD_DOWN,
  GRAD_RIGHT,
  GRAD_UP,
  GRAD_LEFT,
  GRAD_DOUBLE_VER,
  GRAD_DOUBLE_HOR
} GFX_GRADIENT_TYPE;
Overview

Enumeration for gradient type

Members
Members | Description
GRAD_NONE = 0 | No Gradients to be drawn
GRAD_DOWN | gradient changes in the vertical direction
GRAD_RIGHT | gradient change in the horizontal direction
GRAD_UP | gradient changes in the vertical direction
GRAD_LEFT | gradient change in the horizontal direction
GRAD_DOUBLE_VER | two gradient transitions in the vertical direction
GRAD_DOUBLE_HOR | two gradient transitions in the horizontal direction
Library API > Graphics Primitive Layer API > Gradient > GFX_GRADIENT_TYPE Enumeration


GFX_GRADIENT_STYLE Structure

Contents | Index | Home
Previous | Up | Next
GFX_GRADIENT_STYLE Structure
C
typedef struct {
  GFX_GRADIENT_TYPE gradientType;
  DWORD gradientStartColor;
  DWORD gradientEndColor;
  DWORD gradientLength;
} GFX_GRADIENT_STYLE;
Overview

This structure is used to describe the gradient style.

Members
Members | Description
GFX_GRADIENT_TYPE gradientType; | selected the gradient type
DWORD gradientStartColor; | sets the starting color of gradient transition
DWORD gradientEndColor; | sets the ending color of gradient transition
DWORD gradientLength; | defines the length of the gradient transition in pixels
Library API > Graphics Primitive Layer API > Gradient > GFX_GRADIENT_STYLE Structure


Line Functions

Contents | Index | Home
Previous | Up | Next
Line Functions
Functions | Macros | Topics

This lists the Primitive line text functions.

Functions
Name | Description
Line | This function draws a line with the current line type from the start point to the end point.
Macros
Name | Description
LineRel | This macro draws a line with the current line type from the current graphic cursor position to the position defined by displacement.
LineTo | This macro draws a line with the current line type from the current graphic cursor position to the given x, y position.
SetLineThickness | This macro sets sets line thickness to 1 pixel or 3 pixels.
SetLineType | This macro sets the line type to draw.
Topics
Name | Description
Line Types | Line type definitions.
Line Size | Line sizes definition.
Links
Functions, Graphics Primitive Layer API, Legend, Macros, Topics
Library API > Graphics Primitive Layer API > Line Functions


Line Function

Contents | Index | Home
Previous | Up | Next
Line Function
C
WORD Line(
    SHORT x1,
    SHORT y1,
    SHORT x2,
    SHORT y2
);
Overview

This function draws a line with the current line type from the start point to the end point.

Input Parameters
Input Parameters | Description
SHORT x1 | x coordinate of the start point.
SHORT y1 | y coordinate of the start point.
SHORT x2 | x coordinate of the end point.
SHORT y2 | y coordinate of the end point.
Returns

For NON-Blocking configuration:

  • Returns 0 when device is busy and the shape is not yet completely drawn.
  • Returns 1 when the shape is completely drawn.
For Blocking configuration:
  • Always return 1.

Side Effects

The graphic cursor position is moved to the end point of the line.

Library API > Graphics Primitive Layer API > Line Functions > Line Function


LineRel Macro

Contents | Index | Home
Previous | Up | Next
LineRel Macro
C
#define LineRel(dX, dY) Line(GetX(), GetY(), GetX() + dX, GetY() + dY)
Overview

This macro draws a line with the current line type from the current graphic cursor position to the position defined by displacement.

Input Parameters
Input Parameters | Description
dX | Displacement from the current x position.
dY | Displacement from the current y position.
Returns

For NON-Blocking configuration:

  • Returns 0 when device is busy and the shape is not yet completely drawn.
  • Returns 1 when the shape is completely drawn.
For Blocking configuration:
  • Always return 1.

Side Effects

The graphic cursor position is moved to the end point of the line.

Library API > Graphics Primitive Layer API > Line Functions > LineRel Macro


LineTo Macro

Contents | Index | Home
Previous | Up | Next
LineTo Macro
C
#define LineTo(x, y) Line(_cursorX, _cursorY, x, y)
Overview

This macro draws a line with the current line type from the current graphic cursor position to the given x, y position.

Input Parameters
Input Parameters | Description
x | End point x position.
y | End point y poisiton.
Returns

For NON-Blocking configuration:

  • Returns 0 when device is busy and the shape is not yet completely drawn.
  • Returns 1 when the shape is completely drawn.
For Blocking configuration:
  • Always return 1.

Side Effects

The graphic cursor position is moved to the end point of the line.

Library API > Graphics Primitive Layer API > Line Functions > LineTo Macro


SetLineThickness Macro

Contents | Index | Home
Previous | Up | Next
SetLineThickness Macro
C
#define SetLineThickness(lnThickness) _lineThickness = lnThickness;
Overview

This macro sets sets line thickness to 1 pixel or 3 pixels.

Input Parameters
Input Parameters
Description
lnThickness
Line thickness code
  • NORMAL_LINE : 1 pixel
  • THICK_LINE : 3 pixels
Returns

none

Side Effects

none

Library API > Graphics Primitive Layer API > Line Functions > SetLineThickness Macro


SetLineType Macro

Contents | Index | Home
Previous | Up | Next
SetLineType Macro
C
#define SetLineType(lnType) _lineType = lnType;
Overview

This macro sets the line type to draw.

Input Parameters
Input Parameters
Description
lnType
The type of line to be used. Supported line types:
  • SOLID_LINE
  • DOTTED_LINE
  • DASHED_LINE
Returns

none

Side Effects

none

Library API > Graphics Primitive Layer API > Line Functions > SetLineType Macro


Line Types

Contents | Index | Home
Previous | Up | Next
Line Types
Macros

Line type definitions.

Macros
Name | Description
SOLID_LINE | Solid Line Style
DASHED_LINE | Dashed Line Style
DOTTED_LINE | Dotted Line Style
Links
Line Functions, Macros
Library API > Graphics Primitive Layer API > Line Functions > Line Types


SOLID_LINE Macro

Contents | Index | Home
Previous | Up | Next
SOLID_LINE Macro
C
#define SOLID_LINE 0
Description

Solid Line Style

Library API > Graphics Primitive Layer API > Line Functions > Line Types > SOLID_LINE Macro


DASHED_LINE Macro

Contents | Index | Home
Previous | Up | Next
DASHED_LINE Macro
C
#define DASHED_LINE 4
Description

Dashed Line Style

Library API > Graphics Primitive Layer API > Line Functions > Line Types > DASHED_LINE Macro


DOTTED_LINE Macro

Contents | Index | Home
Previous | Up | Next
DOTTED_LINE Macro
C
#define DOTTED_LINE 1
Description

Dotted Line Style

Library API > Graphics Primitive Layer API > Line Functions > Line Types > DOTTED_LINE Macro


Line Size

Contents | Index | Home
Previous | Up | Next
Line Size
Macros

Line sizes definition.

Macros
Name | Description
NORMAL_LINE | Normal Line (thickness is 1 pixel)
THICK_LINE | Thick Line (thickness is 3 pixels)
Links
Line Functions, Macros
Library API > Graphics Primitive Layer API > Line Functions > Line Size


NORMAL_LINE Macro

Contents | Index | Home
Previous | Up | Next
NORMAL_LINE Macro
C
#define NORMAL_LINE 0
Description

Normal Line (thickness is 1 pixel)

Library API > Graphics Primitive Layer API > Line Functions > Line Size > NORMAL_LINE Macro


THICK_LINE Macro

Contents | Index | Home
Previous | Up | Next
THICK_LINE Macro
C
#define THICK_LINE 1
Description

Thick Line (thickness is 3 pixels)

Library API > Graphics Primitive Layer API > Line Functions > Line Size > THICK_LINE Macro


Rectangle Functions

Contents | Index | Home
Previous | Up | Next
Rectangle Functions
Functions | Macros

This lists the Primitive level rectangle functions.

Functions
Name | Description
Bar | This function draws a bar given the left, top and right, bottom corners with the current color.
DrawPoly | This function draws a polygon with the current line type using the given number of points. The polygon points (polyPoints) are stored in an array arranged in the following order:
Macros
Name | Description
Rectangle | This macro draws a rectangle with the given left, top and right, bottom corners. Current line type is used.
Links
Functions, Graphics Primitive Layer API, Legend, Macros
Library API > Graphics Primitive Layer API > Rectangle Functions


Bar Function

Contents | Index | Home
Previous | Up | Next
Bar Function
C
WORD Bar(
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom
);
Overview

This function draws a bar given the left, top and right, bottom corners with the current color.

Input Parameters
Input Parameters | Description
SHORT left | x position of the left top corner.
SHORT top | y position of the left top corner.
SHORT right | x position of the right bottom corner.
SHORT bottom | y position of the right bottom corner.
Returns

For NON-Blocking configuration:

  • Returns 0 when device is busy and the shape is not yet completely drawn.
  • Returns 1 when the shape is completely drawn.
For Blocking configuration:
  • Always return 1.

Side Effects

none

Library API > Graphics Primitive Layer API > Rectangle Functions > Bar Function


Rectangle Macro

Contents | Index | Home
Previous | Up | Next
Rectangle Macro
C
#define Rectangle(left, top, right, bottom) Bevel(left, top, right, bottom, 0)
Overview

This macro draws a rectangle with the given left, top and right, bottom corners. Current line type is used.

Input Parameters
Input Parameters | Description
left | x position of the left top corner.
top | y position of the left top corner.
right | x position of the right bottom corner.
bottom | y position of the right bottom corner.
Returns

For NON-Blocking configuration:

  • Returns 0 when device is busy and the shape is not yet completely drawn.
  • Returns 1 when the shape is completely drawn.
For Blocking configuration:
  • Always return 1.

Side Effects

none

Library API > Graphics Primitive Layer API > Rectangle Functions > Rectangle Macro


DrawPoly Function

Contents | Index | Home
Previous | Up | Next
DrawPoly Function
C
WORD DrawPoly(
    SHORT numPoints,
    SHORT * polyPoints
);
Overview

This function draws a polygon with the current line type using the given number of points. The polygon points (polyPoints) are stored in an array arranged in the following order:

         SHORT polyPoints[size] = {x0, y0, x1, y1, x2, y2 … xn, yn};
         Where n = # of polygon sides
               size = numPoints * 2

DrawPoly() draws any shape defined by the polyPoints. The function will just draw the lines connecting all the x,y points enumerated by polyPoints[].

Input Parameters
Input Parameters | Description
SHORT numPoints | Defines the number of x,y points in the polygon.
SHORT * polyPoints | Pointer to the array of polygon points. The array defines the x,y points of the polygon. The sequence should be x0, y0, x1, y1, x2, y2, ... xn, yn where n is the # of polygon sides.
Returns

For NON-Blocking configuration:

  • Returns 0 when device is busy and the shape is not yet completely drawn.
  • Returns 1 when the shape is completely drawn.
For Blocking configuration:
  • Always return 1.

Side Effects

none

Example
Copy Code
    SHORT OpenShapeXYPoints[6] = {10, 10, 20, 10, 20, 20};
    SHORT ClosedShapeXYPoints[8] = {10, 10, 20, 10, 20, 20, 10, 10};

    SetColor(WHITE);                         // set color to WHITE
    SetLineType(SOLID_LINE);                 // set line to solid line
    SetLineThickness(THICK_LINE);            // set line to thick line
    DrawPoly(6, OpenShapeXYPoints);          // draw the open shape
    DrawPoly(8, ClosedShapeXYPoints);        // draw the closed shape
Library API > Graphics Primitive Layer API > Rectangle Functions > DrawPoly Function


Circle Functions

Contents | Index | Home
Previous | Up | Next
Circle Functions
Functions | Macros

This lists the Primitive level circle functions.

Functions
Name
Description
Arc
Draws the octant arc of the beveled figure with the given centers, radii and octant mask. When octant = 0xFF and the following are true:
  1. xL = xR, yT = yB , r1 = 0 and r2 = z, a filled circle is drawn with a radius of z.
  2. radii have values (where r1 < r2), a full ring with thickness of (r2-r1) is drawn.
  3. xL != xR, yT != yB , r1 = 0 and r2 = 0 (where xR > xL and yB > yT) a rectangle is drawn. xL, yT specifies the left top corner and xR,... more
DrawArc
This renders an arc with from startAngle to endAngle with the thickness of r2-r1. The function returns 1 when the arc is rendered successfuly and returns a 0 when it is not yet finished. The next call to the function will continue the rendering.
Bevel
Draws a beveled figure on the screen. When x1 = x2 and y1 = y2, a circular object is drawn. When x1 < x2 and y1 < y2 and rad (radius) = 0, a rectangular object is drawn.
FillBevel
Draws a filled beveled figure on the screen. For a filled circular object x1 = x2 and y1 = y2. For a filled rectangular object radius = 0.
Macros
Name | Description
Circle | This macro draws a circle with the given center and radius.
FillCircle | This macro draws a filled circle. Uses the FillBevel() function.
SetBevelDrawType | This macro sets the fill bevel type to be drawn.
Links
Functions, Graphics Primitive Layer API, Legend, Macros
Library API > Graphics Primitive Layer API > Circle Functions


Circle Macro

Contents | Index | Home
Previous | Up | Next
Circle Macro
C
#define Circle(x, y, radius) Bevel(x, y, x, y, radius)
Overview

This macro draws a circle with the given center and radius.

Input Parameters
Input Parameters | Description
x | Center x position.
y | Center y position.
radius | the radius of the circle.
Returns

For NON-Blocking configuration:

  • Returns 0 when device is busy and the shape is not yet completely drawn.
  • Returns 1 when the shape is completely drawn.
For Blocking configuration:
  • Always return 1.

Side Effects

none

Library API > Graphics Primitive Layer API > Circle Functions > Circle Macro


FillCircle Macro

Contents | Index | Home
Previous | Up | Next
FillCircle Macro
C
#define FillCircle(x1, y1, rad) FillBevel(x1, y1, x1, y1, rad)
Overview

This macro draws a filled circle. Uses the FillBevel() function.

Input Parameters
Input Parameters | Description
x1 | x coordinate position of the center of the circle.
y1 | y coordinate position of the center of the circle.
rad | defines the redius of the circle.
Returns

For NON-Blocking configuration:

  • Returns 0 when device is busy and the shape is not yet completely drawn.
  • Returns 1 when the shape is completely drawn.
For Blocking configuration:
  • Always return 1.

Side Effects

none

Library API > Graphics Primitive Layer API > Circle Functions > FillCircle Macro


Arc Function

Contents | Index | Home
Previous | Up | Next
Arc Function
C
WORD Arc(
    SHORT xL,
    SHORT yT,
    SHORT xR,
    SHORT yB,
    SHORT r1,
    SHORT r2,
    BYTE octant
);
Overview

Draws the octant arc of the beveled figure with the given centers, radii and octant mask. When octant = 0xFF and the following are true:

  1. xL = xR, yT = yB , r1 = 0 and r2 = z, a filled circle is drawn with a radius of z.
  2. radii have values (where r1 < r2), a full ring with thickness of (r2-r1) is drawn.
  3. xL != xR, yT != yB , r1 = 0 and r2 = 0 (where xR > xL and yB > yT) a rectangle is drawn. xL, yT specifies the left top corner and xR, yB specifies the right bottom corner.
When octant != 0xFF the figure drawn is the subsection of the 8 section figure where each non-zero bit of the octant value specifies the octants that will be drawn.

Description

Input Parameters
Input Parameters
Description
SHORT xL
x location of the upper left center in the x,y coordinate.
SHORT yT
y location of the upper left center in the x,y coordinate.
SHORT xR
x location of the lower right center in the x,y coordinate.
SHORT yB
y location of the lower right center in the x,y coordinate.
SHORT r1
The smaller radius of the two concentric cicles that defines the thickness of the object.
SHORT r2
The larger of radius the two concentric circles that defines the thickness of the object.
BYTE octant
Bitmask of the octant that will be drawn. Moving in a clockwise direction from x = 0, y = +radius
  • bit0 : first octant
  • bit1 : second octant
  • bit2 : third octant
  • bit3 : fourth octant
  • bit4 : fifth octant
  • bit5 : sixth octant
  • bit6 : seventh octant
  • bit7 : eight octant
Returns

Returns the rendering status. 1 - If the rendering was completed and 0 - If the rendering is not yet finished.

Preconditions

none

Side Effects

none

Library API > Graphics Primitive Layer API > Circle Functions > Arc Function


DrawArc Function

Contents | Index | Home
Previous | Up | Next
DrawArc Function
C
WORD DrawArc(
    SHORT cx,
    SHORT cy,
    SHORT r1,
    SHORT r2,
    SHORT startAngle,
    SHORT endAngle
);
Overview

This renders an arc with from startAngle to endAngle with the thickness of r2-r1. The function returns 1 when the arc is rendered successfuly and returns a 0 when it is not yet finished. The next call to the function will continue the rendering.

Input Parameters
Input Parameters | Description
SHORT cx | the location of the center of the arc in the x direction.
SHORT cy | the location of the center of the arc in the y direction.
SHORT r1 | the smaller radius of the arc.
SHORT r2 | the larger radius of the arc.
SHORT startAngle | start angle of the arc.
SHORT endAngle | end angle of the arc.
Returns

Returns 1 if the rendering is done, 0 if not yet done.

Preconditions

none

Side Effects

none

Library API > Graphics Primitive Layer API > Circle Functions > DrawArc Function


Bevel Function

Contents | Index | Home
Previous | Up | Next
Bevel Function
C
WORD Bevel(
    SHORT x1,
    SHORT y1,
    SHORT x2,
    SHORT y2,
    SHORT rad
);
Overview

Draws a beveled figure on the screen. When x1 = x2 and y1 = y2, a circular object is drawn. When x1 < x2 and y1 < y2 and rad (radius) = 0, a rectangular object is drawn.

Description

Input Parameters
Input Parameters | Description
SHORT x1 | x coordinate position of the upper left center of the circle that draws the rounded corners.
SHORT y1 | y coordinate position of the upper left center of the circle that draws the rounded corners.
SHORT x2 | x coordinate position of the lower right center of the circle that draws the rounded corners.
SHORT y2 | y coordinate position of the lower right center of the circle that draws the rounded corners.
SHORT rad | defines the redius of the circle, that draws the rounded corners.
Returns

For NON-Blocking configuration:

  • Returns 0 when device is busy and the shape is not yet completely drawn.
  • Returns 1 when the shape is completely drawn.
For Blocking configuration:
  • Always return 1.

Side Effects

none

Library API > Graphics Primitive Layer API > Circle Functions > Bevel Function


FillBevel Function

Contents | Index | Home
Previous | Up | Next
FillBevel Function
C
WORD FillBevel(
    SHORT x1,
    SHORT y1,
    SHORT x2,
    SHORT y2,
    SHORT rad
);
Overview

Draws a filled beveled figure on the screen. For a filled circular object x1 = x2 and y1 = y2. For a filled rectangular object radius = 0.

Description

Input Parameters
Input Parameters | Description
SHORT x1 | x coordinate position of the upper left center of the circle that draws the rounded corners.
SHORT y1 | y coordinate position of the upper left center of the circle that draws the rounded corners.
SHORT x2 | x coordinate position of the lower right center of the circle that draws the rounded corners.
SHORT y2 | y coordinate position of the lower right center of the circle that draws the rounded corners.
SHORT rad | defines the redius of the circle, that draws the rounded corners.
Returns

For NON-Blocking configuration:

  • Returns 0 when device is busy and the shape is not yet completely drawn.
  • Returns 1 when the shape is completely drawn.
For Blocking configuration:
  • Always return 1.

Side Effects

none

Library API > Graphics Primitive Layer API > Circle Functions > FillBevel Function


SetBevelDrawType Macro

Contents | Index | Home
Previous | Up | Next
SetBevelDrawType Macro
C
#define SetBevelDrawType(type) (_bevelDrawType = type)
Overview

This macro sets the fill bevel type to be drawn.

Input Parameters
Input Parameters
Description
type
is set using the following.
  • DRAWFULLBEVEL to draw the full shape
  • DRAWTOPBEVEL to draw the upper half portion
  • DRAWBOTTOMBEVEL to draw the lower half portion
Returns

none

Side Effects

none

Library API > Graphics Primitive Layer API > Circle Functions > SetBevelDrawType Macro


Graphic Cursor

Contents | Index | Home
Previous | Up | Next
Graphic Cursor
Macros

This lists the functions to control the graphics cursor.

Macros
Name | Description
GetX | This macro returns the current graphic cursor x-coordinate.
GetY | This macro returns the current graphic cursor y-coordinate.
MoveRel | This macro moves the graphic cursor relative to the current location. The given dX and dY displacement can be positive or negative numbers.
MoveTo | This macro moves the graphic cursor to new x,y position.
Links
Graphics Primitive Layer API, Macros
Library API > Graphics Primitive Layer API > Graphic Cursor


GetX Macro

Contents | Index | Home
Previous | Up | Next
GetX Macro
C
#define GetX _cursorX
Overview

This macro returns the current graphic cursor x-coordinate.

Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Primitive Layer API > Graphic Cursor > GetX Macro


GetY Macro

Contents | Index | Home
Previous | Up | Next
GetY Macro
C
#define GetY _cursorY
Overview

This macro returns the current graphic cursor y-coordinate.

Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Primitive Layer API > Graphic Cursor > GetY Macro


MoveRel Macro

Contents | Index | Home
Previous | Up | Next
MoveRel Macro
C
#define MoveRel(dX, dY) \
    _cursorX += dX;         \
    _cursorY += dY;
Overview

This macro moves the graphic cursor relative to the current location. The given dX and dY displacement can be positive or negative numbers.

Input Parameters
Input Parameters | Description
dX | Specifies the displacement of the graphic cursor for the horizontal direction.
dY | Specifies the displacement of the graphic cursor for the vertical direction.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Primitive Layer API > Graphic Cursor > MoveRel Macro


MoveTo Macro

Contents | Index | Home
Previous | Up | Next
MoveTo Macro
C
#define MoveTo(x, y) \
    _cursorX = x;        \
    _cursorY = y;
Overview

This macro moves the graphic cursor to new x,y position.

Input Parameters
Input Parameters | Description
x | Specifies the new x position of the graphic cursor.
y | Specifies the new y position of the graphic cursor.
Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Primitive Layer API > Graphic Cursor > MoveTo Macro


Bitmap Functions

Contents | Index | Home
Previous | Up | Next
Bitmap Functions
Functions | Structures | Topics

This lists the functions to display bitmaps.

Functions
Name | Description
PutImage | This function outputs image starting from left,top coordinates.
GetImageHeight | This function returns the image height.
GetImageWidth | This function returns the image width.
Structures
Name | Description
BITMAP_HEADER | Structure describing the bitmap header.
Topics
Name | Description
Bitmap Settings | Bitmap rendering settings.
Bitmap Source | Bitmap data structure is dependent on the location.
Links
Functions, Graphics Primitive Layer API, Legend, Structures, Topics
Library API > Graphics Primitive Layer API > Bitmap Functions


PutImage Function

Contents | Index | Home
Previous | Up | Next
PutImage Function
C
WORD PutImage(
    SHORT left,
    SHORT top,
    void * bitmap,
    BYTE stretch
);
Overview

This function outputs image starting from left,top coordinates.

Input Parameters
Input Parameters | Description
SHORT left | x coordinate position of the left top corner.
SHORT top | y coordinate position of the left top corner.
void * bitmap | pointer to the bitmap.
BYTE stretch | The image stretch factor.
Returns

For NON-Blocking configuration:

  • Returns 0 when device is busy and the image is not yet completely drawn.
  • Returns 1 when the image is completely drawn.
For Blocking configuration:
  • Always return 1.

Side Effects

none

Library API > Graphics Primitive Layer API > Bitmap Functions > PutImage Function


GetImageHeight Function

Contents | Index | Home
Previous | Up | Next
GetImageHeight Function
C
SHORT GetImageHeight(
    void * bitmap
);
Overview

This function returns the image height.

Input Parameters
Input Parameters | Description
void * bitmap | Pointer to the bitmap.
Returns

Returns the image height in pixels.

Side Effects

none

Library API > Graphics Primitive Layer API > Bitmap Functions > GetImageHeight Function


GetImageWidth Function

Contents | Index | Home
Previous | Up | Next
GetImageWidth Function
C
SHORT GetImageWidth(
    void * bitmap
);
Overview

This function returns the image width.

Input Parameters
Input Parameters | Description
void * bitmap | Pointer to the bitmap.
Returns

Returns the image width in pixels.

Side Effects

none

Library API > Graphics Primitive Layer API > Bitmap Functions > GetImageWidth Function


BITMAP_HEADER Structure

Contents | Index | Home
Previous | Up | Next
BITMAP_HEADER Structure
C
typedef struct {
  BYTE compression;
  BYTE colorDepth;
  SHORT height;
  SHORT width;
} BITMAP_HEADER;
Overview

Structure describing the bitmap header.

Members
Members | Description
BYTE compression; | Compression setting
BYTE colorDepth; | Color depth used
SHORT height; | Image height
SHORT width; | Image width
Library API > Graphics Primitive Layer API > Bitmap Functions > BITMAP_HEADER Structure


Bitmap Settings

Contents | Index | Home
Previous | Up | Next
Bitmap Settings
Macros

Bitmap rendering settings.

Macros
Name | Description
IMAGE_NORMAL | Normal image stretch code
IMAGE_X2 | Stretched image stretch code
Links
Bitmap Functions, Macros
Library API > Graphics Primitive Layer API > Bitmap Functions > Bitmap Settings


IMAGE_NORMAL Macro

Contents | Index | Home
Previous | Up | Next
IMAGE_NORMAL Macro
C
#define IMAGE_NORMAL 1
Description

Normal image stretch code

Library API > Graphics Primitive Layer API > Bitmap Functions > Bitmap Settings > IMAGE_NORMAL Macro


IMAGE_X2 Macro

Contents | Index | Home
Previous | Up | Next
IMAGE_X2 Macro
C
#define IMAGE_X2 2
Description

Stretched image stretch code

Library API > Graphics Primitive Layer API > Bitmap Functions > Bitmap Settings > IMAGE_X2 Macro


Bitmap Source

Contents | Index | Home
Previous | Up | Next
Bitmap Source

Bitmap data structure is dependent on the location.

Links
Bitmap Functions
Library API > Graphics Primitive Layer API > Bitmap Functions > Bitmap Source


External Memory

Contents | Index | Home
Previous | Up | Next
External Memory
Functions | Macros | Topics

Bitmaps and Fonts can be located in external memory. To refer the data, EXTDATA structure is used:

Copy Code
typedef struct _EXTDATA_
{
   TYPE_MEMORY   type;         // must be set to EXTERNAL
   WORD          ID;           // memory ID
   DWORD         address;      // bitmap or font image address
} EXTDATA;

where:

  • type – shows type of memory used.
    • 0 – internal
    • 1 - external.
  • ID – unique number must be assigned by application to have a way distinguishing memory chips if the application has several of them.
  • address – start address of the bitmap or font image in the external memory.
To use the bitmap or font the pointer to EXTDATA structure must be passed into corresponding function (PutImage() or SetFont()). Each time the library will need data it will call special call back function ExternalMemoryCallback().

This function must be implemented in the application. Inside, the application must copy requested bytes quantity into the buffer provided. Data start address can be calculated as a sum of the start image address specified in EXTDATA structure and offset provided.

Functions
Name | Description
ExternalMemoryCallback | This function must be implemented in the application. The library will call this function each time when the external memory data will be required. The application must copy requested bytes quantity into the buffer provided. Data start address in external memory is a sum of the address in GFX_EXTDATA structure and offset.
Macros
Name | Description
EXTERNAL_FONT_BUFFER_SIZE | This defines the size of the buffer used by font functions to retrieve font data from the external memory. The buffer size can be increased to accommodate large font sizes. The user must be aware of the expected glyph sizes of the characters stored in the font table. To modify the size used, declare this macro in the GraphicsConfig.h file with the desired size.
Topics
Name | Description
Memory Type | Memory type enumeration to determine the source of data. Used in interpreting bitmap and font from different memory sources.
Links
Functions, Graphics Primitive Layer API, Legend, Macros, Topics
Library API > Graphics Primitive Layer API > External Memory


ExternalMemoryCallback Function

Contents | Index | Home
Previous | Up | Next
ExternalMemoryCallback Function
C
WORD ExternalMemoryCallback(
    GFX_EXTDATA * memory,
    LONG offset,
    WORD nCount,
    void * buffer
);
Overview

This function must be implemented in the application. The library will call this function each time when the external memory data will be required. The application must copy requested bytes quantity into the buffer provided. Data start address in external memory is a sum of the address in GFX_EXTDATA structure and offset.

Input Parameters
Input Parameters | Description
GFX_EXTDATA * memory | Pointer to the external memory bitmap or font structures (FONT_EXTERNAL or BITMAP_EXTERNAL).
LONG offset | Data offset.
WORD nCount | Number of bytes to be transferred into the buffer.
void * buffer | Pointer to the buffer.
Returns

Returns the number of bytes were transferred.

Side Effects

none

Example
Copy Code
// If there are several memories in the system they can be selected by IDs.
// In this example, ID for memory device used is assumed to be 0.
#define X_MEMORY 0

WORD ExternalMemoryCallback(GFX_EXTDATA* memory, LONG offset, WORD nCount, void* buffer) {
    int i;
    long address;

    // Address of the requested data is a start address of the object referred by GFX_EXTDATA structure plus offset
    address = memory->address+offset;

    if(memory->ID == X_MEMORY){
        // MemoryXReadByte() is some function implemented to access external memory.
        // Implementation will be specific to the memory used. In this example
        // it reads byte each time it is called.
        i = 0;
        while (i < nCount) {
            (BYTE*)buffer = MemoryXReadByte(address++);
            i++;
        }
   }
   // return the actual number of bytes retrieved
   return (i);
}
Library API > Graphics Primitive Layer API > External Memory > ExternalMemoryCallback Function


EXTERNAL_FONT_BUFFER_SIZE Macro

Contents | Index | Home
Previous | Up | Next
EXTERNAL_FONT_BUFFER_SIZE Macro
C
#define EXTERNAL_FONT_BUFFER_SIZE 600
Overview

This defines the size of the buffer used by font functions to retrieve font data from the external memory. The buffer size can be increased to accommodate large font sizes. The user must be aware of the expected glyph sizes of the characters stored in the font table. To modify the size used, declare this macro in the GraphicsConfig.h file with the desired size.

Library API > Graphics Primitive Layer API > External Memory > EXTERNAL_FONT_BUFFER_SIZE Macro


Memory Type

Contents | Index | Home
Previous | Up | Next
Memory Type

Memory type enumeration to determine the source of data. Used in interpreting bitmap and font from different memory sources.

Links
External Memory
Library API > Graphics Primitive Layer API > External Memory > Memory Type


Set Up Functions

Contents | Index | Home
Previous | Up | Next
Set Up Functions
Functions

This lists the Primitive set up and initialization functions.

Functions
Name | Description
ClearDevice | This function clears the screen with the current color and sets the graphic cursor position to (0, 0). Clipping is NOT supported by ClearDevice().
InitGraph | This function initializes the display controller, sets the line type to SOLID_LINE, sets the screen to all BLACK, sets the current drawing color to WHITE, sets the graphic cursor position to upper left corner of the screen, sets active and visual pages to page #0, clears the active page and disables clipping. This function should be called before using the Graphics Primitive Layer.
Links
Functions, Graphics Primitive Layer API, Legend
Library API > Graphics Primitive Layer API > Set Up Functions


ClearDevice Function

Contents | Index | Home
Previous | Up | Next
ClearDevice Function
C
void ClearDevice();
Overview

This function clears the screen with the current color and sets the graphic cursor position to (0, 0). Clipping is NOT supported by ClearDevice().

Returns

none

Side Effects

none

Example
Copy Code
void ClearScreen(void)
{
    SetColor(WHITE);        // set color to WHITE
    ClearDevice();          // set screen to all WHITE
}
Library API > Graphics Primitive Layer API > Set Up Functions > ClearDevice Function


InitGraph Function

Contents | Index | Home
Previous | Up | Next
InitGraph Function
C
void InitGraph();
Overview

This function initializes the display controller, sets the line type to SOLID_LINE, sets the screen to all BLACK, sets the current drawing color to WHITE, sets the graphic cursor position to upper left corner of the screen, sets active and visual pages to page #0, clears the active page and disables clipping. This function should be called before using the Graphics Primitive Layer.

Returns

none

Preconditions

none

Side Effects

none

Library API > Graphics Primitive Layer API > Set Up Functions > InitGraph Function


GFX_RESOURCE Enumeration

Contents | Index | Home
Previous | Up | Next
GFX_RESOURCE Enumeration
C
typedef enum {
  FLASH = 0x0000,
  EXTERNAL = 0x0001,
  FLASH_JPEG = 0x0002,
  EXTERNAL_JPEG = 0x0003,
  RAM = 0x0004,
  EDS_EPMP = 0x0005,
  IMAGE_MBITMAP = 0x0000,
  IMAGE_JPEG = 0x0100,
  COMP_NONE = 0x0000,
  COMP_RLE = 0x1000,
  COMP_IPU = 0x2000
} GFX_RESOURCE;
Overview

Memory type enumeration to determine the source of data. Used in interpreting bitmap and font from different memory sources.

Members
Members | Description
FLASH = 0x0000 | internal flash
EXTERNAL = 0x0001 | external memory
FLASH_JPEG = 0x0002 | internal flash
EXTERNAL_JPEG = 0x0003 | external memory
RAM = 0x0004 | RAM
EDS_EPMP = 0x0005 | memory in EPMP, base addresses are are set in the hardware profile
IMAGE_MBITMAP = 0x0000 | data resource is type Microchip bitmap
IMAGE_JPEG = 0x0100 | data resource is type JPEG
COMP_NONE = 0x0000 | no compression
COMP_RLE = 0x1000 | compressed with RLE
COMP_IPU = 0x2000 | compressed with DEFLATE (for IPU)
Library API > Graphics Primitive Layer API > GFX_RESOURCE Enumeration


GFX_IMAGE_HEADER Structure

Contents | Index | Home
Previous | Up | Next
GFX_IMAGE_HEADER Structure
C
typedef struct {
  GFX_RESOURCE type;
  WORD ID;
  union {
    DWORD extAddress;
    FLASH_BYTE * progByteAddress;
    FLASH_WORD * progWordAddress;
    const char * constAddress;
    char * ramAddress;
    __eds__ char * edsAddress;
  } LOCATION;
  WORD width;
  WORD height;
  DWORD param1;
  DWORD param2;
  WORD colorDepth;
} GFX_IMAGE_HEADER;
Overview

Structure for images stored in various system memory (Flash, External Memory (SPI, Parallel Flash, or memory in EPMP).

Members
Members | Description
GFX_RESOURCE type; | Graphics resource type, determines the type and location of data
WORD ID; | memory ID, user defined value to differentiate between graphics resources of the same type When using EDS_EPMP the following ID values are reserved and used by the Microchip display driver 0 - reserved (do not use) 1 - reserved for base address of EPMP CS1 2 - reserved for base address of EPMP CS2
DWORD extAddress; | generic address
FLASH_BYTE * progByteAddress; | for addresses in program section
FLASH_WORD * progWordAddress; | for addresses in program section
const char * constAddress; | for addresses in FLASH
char * ramAddress; | for addresses in RAM
__eds__ char * edsAddress; | for addresses in EDS
WORD width; | width of the image
WORD height; | height of the image
DWORD param1; | Parameters used for the GFX_RESOURCE. Depending on the GFX_RESOURCE type definition of param1 can change. For IPU and RLE compressed images, param1 indicates the compressed size of the image.
DWORD param2; | Parameters used for the GFX_RESOURCE. Depending on the GFX_RESOURCE type definition of param2 can change. For IPU and RLE compressed images, param2 indicates the uncompressed size of the image.
WORD colorDepth; | color depth of the image
Library API > Graphics Primitive Layer API > GFX_IMAGE_HEADER Structure


IMAGE_FLASH Structure

Contents | Index | Home
Previous | Up | Next
IMAGE_FLASH Structure
C
typedef struct {
  GFX_RESOURCE type;
  FLASH_BYTE * address;
} IMAGE_FLASH;
Overview

Structure for images stored in FLASH memory.

Members
Members | Description
GFX_RESOURCE type; | must be FLASH
FLASH_BYTE * address; | image address in FLASH
Library API > Graphics Primitive Layer API > IMAGE_FLASH Structure


IMAGE_RAM Structure

Contents | Index | Home
Previous | Up | Next
IMAGE_RAM Structure
C
typedef struct {
  GFX_RESOURCE type;
  DWORD * address;
} IMAGE_RAM;
Overview

Structure for images stored in RAM memory.

Members
Members | Description
GFX_RESOURCE type; | must be RAM
DWORD * address; | image address in RAM
Library API > Graphics Primitive Layer API > IMAGE_RAM Structure


GFX_EXTDATA Structure

Contents | Index | Home
Previous | Up | Next
GFX_EXTDATA Structure
C
typedef struct {
  GFX_RESOURCE type;
  WORD ID;
  DWORD address;
} GFX_EXTDATA;
Overview

This structure is used to describe external memory.

Members
Members
Description
GFX_RESOURCE type;
Resource type. Valid types are:
  • EXTERNAL
  • EDS_EPMP
WORD ID;
Memory ID, user defined value to differentiate between graphics resources of the same type. When using EDS_EPMP the following ID values are reserved and used by the Microchip display driver
  • 0 - reserved (do not use)
  • 1 - reserved for base address of EPMP CS1
  • 2 - reserved for base address of EPMP CS2
DWORD address;
Data image address (user data, bitmap or font)
Library API > Graphics Primitive Layer API > GFX_EXTDATA Structure


Display Device Driver Layer API

Contents | Index | Home
Previous | Up | Next
Display Device Driver Layer API
Modules | Topics
Modules
Name | Description
Advanced Display Driver Features | This section lists advanced Display Device Driver Features implemented in select Display Device Driver.
Topics
Name | Description
Display Device Driver Level Primitives | This lists the Device Level Primitive rendering functions and macros.
Display Device Driver Control | This lists the device control functions and macros.
Links
Library API, Modules, Topics
Library API > Display Device Driver Layer API


Display Device Driver Level Primitives

Contents | Index | Home
Previous | Up | Next
Display Device Driver Level Primitives
Functions | Macros | Topics
Functions
Name | Description
GetPixel | Returns pixel color at the given x,y coordinate position.
PutPixel | Puts pixel with the given x,y coordinate position.
SetClip | Enables/disables clipping.
SetClipRgn | Sets clipping region.
TransparentColorEnable | Sets current transparent color. PutImage() will not render pixels that matches the set transparent color. To enable Transparent Color feature, define the macro USE_TRANSPARENT_COLOR in the GraphicsConfig.h file.
DisplayBrightness | Sets the brightness of the display.
CopyBlock | Copies a block of data from source specified by srcAddr and srcOffset to the destination specified by dstAddr and dstOffset. This is similar to the CopyWindow() and but instead of using left, top position of the source and destination, it uses offsets instead. This is a blocking function.
CopyPageWindow | This is a blocking call. A windows is a rectangular area with the given width and height of a page. The source and destination window can be located in different pages and each page is assumed to have the same dimensions (equal width and height).
CopyWindow | A windows is a rectangular area with the given width and height located in the given base source address. The source and destination window can be located in the same base address. If this is the case, then srcAddr = dstAddr. The operation is similar to CopyPageWindow() but instead of using page numbers, addresses are used for versatility. This is a blocking function.
SetActivePage | Sets active graphic page.
SetVisualPage | Sets graphic page to display.
Macros
Name | Description
GetColor | Returns current drawing color.
SetColor | Sets current drawing color.
GetMaxX | Returns maximum horizontal coordinate.
GetMaxY | Returns maximum vertical coordinate.
GetClipBottom | Returns bottom clipping border.
GetClipLeft | Returns left clipping border.
GetClipRight | Returns right clipping border.
GetClipTop | Returns top clipping border.
CLIP_DISABLE | Disables clipping.
CLIP_ENABLE | Enables clipping.
TransparentColorDisable | Disables the transparent color function.
GetTransparentColorStatus | Returns the current transparent color function enable status.
GetTransparentColor | Returns the current transparent color value.
TRANSPARENT_COLOR_DISABLE | Check of transparent color is not performed
TRANSPARENT_COLOR_ENABLE | Check pixel if color is equal to transparent color, if equal do not render pixel
GetPageAddress | Returns the address of the given page.
Topics
Name | Description
Color Definition | The device driver must also implement the definition of standard color set based on the color format used.
Links
Functions, Display Device Driver Layer API, Legend, Macros, Topics
Library API > Display Device Driver Layer API > Display Device Driver Level Primitives


GetPixel Function

Contents | Index | Home
Previous | Up | Next
GetPixel Function
C
GFX_COLOR GetPixel(
    SHORT x,
    SHORT y
);
Overview

Returns pixel color at the given x,y coordinate position.

Input Parameters
Input Parameters | Description
SHORT x | x position of the pixel.
SHORT y | y position of the pixel.
Returns

pixel color

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > GetPixel Function


PutPixel Function

Contents | Index | Home
Previous | Up | Next
PutPixel Function
C
void PutPixel(
    SHORT x,
    SHORT y
);
Overview

Puts pixel with the given x,y coordinate position.

Input Parameters
Input Parameters | Description
SHORT x | x position of the pixel.
SHORT y | y position of the pixel.
Returns

none

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > PutPixel Function


GetColor Macro

Contents | Index | Home
Previous | Up | Next
GetColor Macro
C
#define GetColor _color
Overview

Returns current drawing color.

Returns

Color where coding is based on GFX_COLOR definition. GFX_COLOR definition is based on the color depth (COLOR_DEPTH) used.

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > GetColor Macro


SetColor Macro

Contents | Index | Home
Previous | Up | Next
SetColor Macro
C
#define SetColor(color) _color = (color)
Overview

Sets current drawing color.

Input Parameters
Input Parameters | Description
color | Color coding is based on GFX_COLOR definition. GFX_COLOR definition is based on the color depth (COLOR_DEPTH) used.
Returns

none

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > SetColor Macro


GetMaxX Macro

Contents | Index | Home
Previous | Up | Next
GetMaxX Macro
C
#define GetMaxX (DISP_HOR_RESOLUTION - 1)
Overview

Returns maximum horizontal coordinate.

Returns

Maximum horizontal coordinate.

Preconditions

none

Side Effects

none

Example
Copy Code
// Create a window that will occupy the whole screen.
WndCreate(0xFF,                     // ID
          0,0,
          GetMaxX(),GetMaxY(),      // dimension
          WND_DRAW,                 // will be dislayed after creation
          (void*)&mchpIcon,         // use icon used
          pText,                    // set to text pointed to by pText
          NULL);                    // use default scheme
Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > GetMaxX Macro


GetMaxY Macro

Contents | Index | Home
Previous | Up | Next
GetMaxY Macro
C
#define GetMaxY (DISP_VER_RESOLUTION - 1)
Overview

Returns maximum vertical coordinate.

Returns

Maximum vertical coordinate.

Preconditions

none

Side Effects

none

Example

(see GetMaxX()) example.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > GetMaxY Macro


SetClip Function

Contents | Index | Home
Previous | Up | Next
SetClip Function
C
void SetClip(
    BYTE control
);
Overview

Enables/disables clipping.

Input Parameters
Input Parameters
Description
BYTE control
Enables or disables the clipping.
  • CLIP_DISABLE: Disable clipping
  • CLIP_ENABLE: Enable clipping
Returns

none

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > SetClip Function


SetClipRgn Function

Contents | Index | Home
Previous | Up | Next
SetClipRgn Function
C
void SetClipRgn(
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom
);
Overview

Sets clipping region.

Input Parameters
Input Parameters | Description
SHORT left | Defines the left clipping region border.
SHORT top | Defines the top clipping region border.
SHORT right | Defines the right clipping region border.
SHORT bottom | Defines the bottom clipping region border.
Returns

none

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > SetClipRgn Function


GetClipBottom Macro

Contents | Index | Home
Previous | Up | Next
GetClipBottom Macro
C
#define GetClipBottom _clipBottom
Overview

Returns bottom clipping border.

Returns

Bottom clipping border.

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > GetClipBottom Macro


GetClipLeft Macro

Contents | Index | Home
Previous | Up | Next
GetClipLeft Macro
C
#define GetClipLeft _clipLeft
Overview

Returns left clipping border.

Returns

Left clipping border.

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > GetClipLeft Macro


GetClipRight Macro

Contents | Index | Home
Previous | Up | Next
GetClipRight Macro
C
#define GetClipRight _clipRight
Overview

Returns right clipping border.

Returns

Right clipping border.

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > GetClipRight Macro


GetClipTop Macro

Contents | Index | Home
Previous | Up | Next
GetClipTop Macro
C
#define GetClipTop _clipTop
Overview

Returns top clipping border.

Returns

Top clipping border.

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > GetClipTop Macro


CLIP_DISABLE Macro

Contents | Index | Home
Previous | Up | Next
CLIP_DISABLE Macro
C
#define CLIP_DISABLE 0   // Disables clipping.
Description

Disables clipping.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > CLIP_DISABLE Macro


CLIP_ENABLE Macro

Contents | Index | Home
Previous | Up | Next
CLIP_ENABLE Macro
C
#define CLIP_ENABLE 1   // Enables clipping.
Description

Enables clipping.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > CLIP_ENABLE Macro


TransparentColorEnable Function

Contents | Index | Home
Previous | Up | Next
TransparentColorEnable Function
C
void TransparentColorEnable(
    GFX_COLOR color
);
Overview

Sets current transparent color. PutImage() will not render pixels that matches the set transparent color. To enable Transparent Color feature, define the macro USE_TRANSPARENT_COLOR in the GraphicsConfig.h file.

Description

Input Parameters
Input Parameters | Description
GFX_COLOR color | Chosen transparent color.
Returns

none

Preconditions

none

Side Effects

None

Example
Copy Code
TransparentColorEnable(BLACK);
PutImage(0,0, (void*)&ScreenBackground);
PutImage(0,0, (void*)&RibbonIcon);
Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > TransparentColorEnable Function


TransparentColorDisable Macro

Contents | Index | Home
Previous | Up | Next
TransparentColorDisable Macro
C
#define TransparentColorDisable _colorTransparentEnable = TRANSPARENT_COLOR_DISABLE;
Overview

Disables the transparent color function.

Returns

none

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > TransparentColorDisable Macro


GetTransparentColorStatus Macro

Contents | Index | Home
Previous | Up | Next
GetTransparentColorStatus Macro
C
#define GetTransparentColorStatus _colorTransparentEnable
Overview

Returns the current transparent color function enable status.

Returns

Returns the current transparent color function enable status

Copy Code
       0 – Transparent color function is disabled.
       1 – Transparent color function is enabled.
Preconditions

none

Side Effects

None

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > GetTransparentColorStatus Macro


GetTransparentColor Macro

Contents | Index | Home
Previous | Up | Next
GetTransparentColor Macro
C
#define GetTransparentColor _colorTransparent
Overview

Returns the current transparent color value.

Returns

Returns the current transparent color used.

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > GetTransparentColor Macro


TRANSPARENT_COLOR_DISABLE Macro

Contents | Index | Home
Previous | Up | Next
TRANSPARENT_COLOR_DISABLE Macro
C
#define TRANSPARENT_COLOR_DISABLE 0   // Check of transparent color is not performed
Description

Check of transparent color is not performed

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > TRANSPARENT_COLOR_DISABLE Macro


TRANSPARENT_COLOR_ENABLE Macro

Contents | Index | Home
Previous | Up | Next
TRANSPARENT_COLOR_ENABLE Macro
C
#define TRANSPARENT_COLOR_ENABLE 1   // Check pixel if color is equal to transparent color, if equal do not render pixel
Description

Check pixel if color is equal to transparent color, if equal do not render pixel

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > TRANSPARENT_COLOR_ENABLE Macro


DisplayBrightness Function

Contents | Index | Home
Previous | Up | Next
DisplayBrightness Function
C
void DisplayBrightness(
    WORD level
);
Overview

Sets the brightness of the display.

Input Parameters
Input Parameters
Description
WORD level
Brightness level. Valid values are 0 to 100.
  • 0: brightness level is zero or display is turned off
  • 1: brightness level is maximum
Returns

none

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > DisplayBrightness Function


GetPageAddress Macro

Contents | Index | Home
Previous | Up | Next
GetPageAddress Macro
C
#define GetPageAddress(page) (_PageTable[page])
Overview

Returns the address of the given page.

Returns

Address in memory of the given page number. The number of pages is dictated by GFX_DRV_PAGE_COUNT value defined in the hardware profile. GFX_DRV_PAGE_COUNT is not mandatory. Drivers that do not have enough memory for paging may not define this constant. If GFX_DRV_PAGE_COUNT is not defined, all API's related to paging operation is will not be available.

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > GetPageAddress Macro


CopyBlock Function

Contents | Index | Home
Previous | Up | Next
CopyBlock Function
C
WORD CopyBlock(
    DWORD srcAddr,
    DWORD dstAddr,
    DWORD srcOffset,
    DWORD dstOffset,
    WORD width,
    WORD height
);
Overview

Copies a block of data from source specified by srcAddr and srcOffset to the destination specified by dstAddr and dstOffset. This is similar to the CopyWindow() and but instead of using left, top position of the source and destination, it uses offsets instead. This is a blocking function.

Input Parameters
Input Parameters | Description
DWORD srcAddr | the base address of the data to be moved
DWORD dstAddr | the base address of the new location of the moved data
DWORD srcOffset | offset of the data to be moved with respect to the source base address.
DWORD dstOffset | offset of the new location of the moved data respect to the source base address.
WORD width | width of the block of data to be moved
WORD height | height of the block of data to be moved
Returns

none

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > CopyBlock Function


CopyPageWindow Function

Contents | Index | Home
Previous | Up | Next
CopyPageWindow Function
C
void CopyPageWindow(
    BYTE srcPage,
    BYTE dstPage,
    \ WORD srcX,
    WORD srcY,
    \ WORD dstX,
    WORD dstY,
    \ WORD width,
    WORD height
);
Overview

This is a blocking call. A windows is a rectangular area with the given width and height of a page. The source and destination window can be located in different pages and each page is assumed to have the same dimensions (equal width and height).

Input Parameters
Input Parameters | Description
BYTE srcPage | page number of the source window,
BYTE dstPage | page number of the destination window,
\ WORD srcX | x location of the left top corner of the source window respect to the srcPage.
WORD srcY | y location of the left top corner of the source window respect to the srcPage.
\ WORD dstX | x location of the left top corner of the destination window respect to the dstPage.
WORD dstY | y location of the left top corner of the destination window respect to the dstPage.
\ WORD width | the width in pixels of the window to copy
WORD height | the height in pixels of the window to copy
Returns

None

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > CopyPageWindow Function


CopyWindow Function

Contents | Index | Home
Previous | Up | Next
CopyWindow Function
C
WORD CopyWindow(
    DWORD srcAddr,
    DWORD dstAddr,
    \ WORD srcX,
    WORD srcY,
    \ WORD dstX,
    WORD dstY,
    \ WORD width,
    WORD height
);
Overview

A windows is a rectangular area with the given width and height located in the given base source address. The source and destination window can be located in the same base address. If this is the case, then srcAddr = dstAddr. The operation is similar to CopyPageWindow() but instead of using page numbers, addresses are used for versatility. This is a blocking function.

Input Parameters
Input Parameters | Description
DWORD srcAddr | Base Address of the source window,
\ WORD srcX | x location of the left top corner of the source window respect to the srcPage.
WORD srcY | y location of the left top corner of the source window respect to the srcPage.
\ WORD dstX | x location of the left top corner of the destination window respect to the dstPage.
WORD dstY | y location of the left top corner of the destination window respect to the dstPage.
\ WORD width | the width in pixels of the window to copy
WORD height | the height in pixels of the window to copy
dstPage | Base Address of the destination window,
Returns

None

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > CopyWindow Function


SetActivePage Function

Contents | Index | Home
Previous | Up | Next
SetActivePage Function
C
void SetActivePage(
    WORD page
);
Overview

Sets active graphic page.

Description

Functions: SetActivePage(page)

Input Parameters
Input Parameters | Description
WORD page | Graphic page number.
Returns

none

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > SetActivePage Function


SetVisualPage Function

Contents | Index | Home
Previous | Up | Next
SetVisualPage Function
C
void SetVisualPage(
    WORD page
);
Overview

Sets graphic page to display.

Description

Functions: SetVisualPage(page)

Input Parameters
Input Parameters | Description
WORD page | Graphic page number
Returns

none

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > SetVisualPage Function


Color Definition

Contents | Index | Home
Previous | Up | Next
Color Definition
Macros

The following lists sample color definitions for a 16-bpp color encoding.

Macros
Name | Description
BLACK | not USE_PALETTE
BLUE | This is macro BLUE.
BRIGHTBLUE | This is macro BRIGHTBLUE.
BRIGHTCYAN | This is macro BRIGHTCYAN.
BRIGHTGREEN | This is macro BRIGHTGREEN.
BRIGHTMAGENTA | This is macro BRIGHTMAGENTA.
BRIGHTRED | This is macro BRIGHTRED.
BRIGHTYELLOW | This is macro BRIGHTYELLOW.
BROWN | This is macro BROWN.
CYAN | This is macro CYAN.
DARKGRAY | This is macro DARKGRAY.
GRAY0 | This is macro GRAY0.
GRAY1 | This is macro GRAY1.
GRAY2 | This is macro GRAY2.
GRAY3 | This is macro GRAY3.
GRAY4 | This is macro GRAY4.
GRAY5 | This is macro GRAY5.
GRAY6 | This is macro GRAY6.
GREEN | This is macro GREEN.
LIGHTBLUE | This is macro LIGHTBLUE.
LIGHTCYAN | This is macro LIGHTCYAN.
LIGHTGRAY | This is macro LIGHTGRAY.
LIGHTGREEN | This is macro LIGHTGREEN.
LIGHTMAGENTA | This is macro LIGHTMAGENTA.
LIGHTRED | This is macro LIGHTRED.
MAGENTA | This is macro MAGENTA.
RED | This is macro RED.
WHITE | This is macro WHITE.
YELLOW | This is macro YELLOW.
Links
Display Device Driver Level Primitives, Macros
Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition


BLACK Macro

Contents | Index | Home
Previous | Up | Next
BLACK Macro
C
#define BLACK RGBConvert(0, 0, 0)
Description

not USE_PALETTE

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > BLACK Macro


BLUE Macro

Contents | Index | Home
Previous | Up | Next
BLUE Macro
C
#define BLUE RGBConvert(0, 0, 128)
Description

This is macro BLUE.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > BLUE Macro


BRIGHTBLUE Macro

Contents | Index | Home
Previous | Up | Next
BRIGHTBLUE Macro
C
#define BRIGHTBLUE RGBConvert(0, 0, 255)
Description

This is macro BRIGHTBLUE.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > BRIGHTBLUE Macro


BRIGHTCYAN Macro

Contents | Index | Home
Previous | Up | Next
BRIGHTCYAN Macro
C
#define BRIGHTCYAN RGBConvert(0, 255, 255)
Description

This is macro BRIGHTCYAN.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > BRIGHTCYAN Macro


BRIGHTGREEN Macro

Contents | Index | Home
Previous | Up | Next
BRIGHTGREEN Macro
C
#define BRIGHTGREEN RGBConvert(0, 255, 0)
Description

This is macro BRIGHTGREEN.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > BRIGHTGREEN Macro


BRIGHTMAGENTA Macro

Contents | Index | Home
Previous | Up | Next
BRIGHTMAGENTA Macro
C
#define BRIGHTMAGENTA RGBConvert(255, 0, 255)
Description

This is macro BRIGHTMAGENTA.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > BRIGHTMAGENTA Macro


BRIGHTRED Macro

Contents | Index | Home
Previous | Up | Next
BRIGHTRED Macro
C
#define BRIGHTRED RGBConvert(255, 0, 0)
Description

This is macro BRIGHTRED.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > BRIGHTRED Macro


BRIGHTYELLOW Macro

Contents | Index | Home
Previous | Up | Next
BRIGHTYELLOW Macro
C
#define BRIGHTYELLOW RGBConvert(255, 255, 0)
Description

This is macro BRIGHTYELLOW.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > BRIGHTYELLOW Macro


BROWN Macro

Contents | Index | Home
Previous | Up | Next
BROWN Macro
C
#define BROWN RGBConvert(255, 128, 0)
Description

This is macro BROWN.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > BROWN Macro


CYAN Macro

Contents | Index | Home
Previous | Up | Next
CYAN Macro
C
#define CYAN RGBConvert(0, 128, 128)
Description

This is macro CYAN.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > CYAN Macro


DARKGRAY Macro

Contents | Index | Home
Previous | Up | Next
DARKGRAY Macro
C
#define DARKGRAY RGBConvert(64, 64, 64)
Description

This is macro DARKGRAY.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > DARKGRAY Macro


GRAY0 Macro

Contents | Index | Home
Previous | Up | Next
GRAY0 Macro
C
#define GRAY0 RGBConvert(224, 224, 224)
Description

This is macro GRAY0.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > GRAY0 Macro


GRAY1 Macro

Contents | Index | Home
Previous | Up | Next
GRAY1 Macro
C
#define GRAY1 RGBConvert(192, 192, 192)
Description

This is macro GRAY1.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > GRAY1 Macro


GRAY2 Macro

Contents | Index | Home
Previous | Up | Next
GRAY2 Macro
C
#define GRAY2 RGBConvert(160, 160, 160)
Description

This is macro GRAY2.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > GRAY2 Macro


GRAY3 Macro

Contents | Index | Home
Previous | Up | Next
GRAY3 Macro
C
#define GRAY3 RGBConvert(128, 128, 128)
Description

This is macro GRAY3.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > GRAY3 Macro


GRAY4 Macro

Contents | Index | Home
Previous | Up | Next
GRAY4 Macro
C
#define GRAY4 RGBConvert(96, 96, 96)
Description

This is macro GRAY4.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > GRAY4 Macro


GRAY5 Macro

Contents | Index | Home
Previous | Up | Next
GRAY5 Macro
C
#define GRAY5 RGBConvert(64, 64, 64)
Description

This is macro GRAY5.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > GRAY5 Macro


GRAY6 Macro

Contents | Index | Home
Previous | Up | Next
GRAY6 Macro
C
#define GRAY6 RGBConvert(32, 32, 32)
Description

This is macro GRAY6.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > GRAY6 Macro


GREEN Macro

Contents | Index | Home
Previous | Up | Next
GREEN Macro
C
#define GREEN RGBConvert(0, 128, 0)
Description

This is macro GREEN.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > GREEN Macro


LIGHTBLUE Macro

Contents | Index | Home
Previous | Up | Next
LIGHTBLUE Macro
C
#define LIGHTBLUE RGBConvert(128, 128, 255)
Description

This is macro LIGHTBLUE.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > LIGHTBLUE Macro


LIGHTCYAN Macro

Contents | Index | Home
Previous | Up | Next
LIGHTCYAN Macro
C
#define LIGHTCYAN RGBConvert(128, 255, 255)
Description

This is macro LIGHTCYAN.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > LIGHTCYAN Macro


LIGHTGRAY Macro

Contents | Index | Home
Previous | Up | Next
LIGHTGRAY Macro
C
#define LIGHTGRAY RGBConvert(128, 128, 128)
Description

This is macro LIGHTGRAY.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > LIGHTGRAY Macro


LIGHTGREEN Macro

Contents | Index | Home
Previous | Up | Next
LIGHTGREEN Macro
C
#define LIGHTGREEN RGBConvert(128, 255, 128)
Description

This is macro LIGHTGREEN.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > LIGHTGREEN Macro


LIGHTMAGENTA Macro

Contents | Index | Home
Previous | Up | Next
LIGHTMAGENTA Macro
C
#define LIGHTMAGENTA RGBConvert(255, 128, 255)
Description

This is macro LIGHTMAGENTA.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > LIGHTMAGENTA Macro


LIGHTRED Macro

Contents | Index | Home
Previous | Up | Next
LIGHTRED Macro
C
#define LIGHTRED RGBConvert(255, 128, 128)
Description

This is macro LIGHTRED.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > LIGHTRED Macro


MAGENTA Macro

Contents | Index | Home
Previous | Up | Next
MAGENTA Macro
C
#define MAGENTA RGBConvert(128, 0, 128)
Description

This is macro MAGENTA.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > MAGENTA Macro


RED Macro

Contents | Index | Home
Previous | Up | Next
RED Macro
C
#define RED RGBConvert(128, 0, 0)
Description

This is macro RED.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > RED Macro


WHITE Macro

Contents | Index | Home
Previous | Up | Next
WHITE Macro
C
#define WHITE RGBConvert(255, 255, 255)
Description

This is macro WHITE.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > WHITE Macro


YELLOW Macro

Contents | Index | Home
Previous | Up | Next
YELLOW Macro
C
#define YELLOW RGBConvert(255, 255, 128)
Description

This is macro YELLOW.

Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition > YELLOW Macro


Display Device Driver Control

Contents | Index | Home
Previous | Up | Next
Display Device Driver Control
Functions
Functions
Name | Description
IsDeviceBusy | Returns non-zero if LCD controller is busy (previous drawing operation is not completed).
ResetDevice | Initializes LCD module.
Links
Functions, Display Device Driver Layer API, Legend
Library API > Display Device Driver Layer API > Display Device Driver Control


IsDeviceBusy Function

Contents | Index | Home
Previous | Up | Next
IsDeviceBusy Function
C
WORD IsDeviceBusy();
Overview

Returns non-zero if LCD controller is busy (previous drawing operation is not completed).

Returns

Busy status.

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Display Device Driver Control > IsDeviceBusy Function


ResetDevice Function

Contents | Index | Home
Previous | Up | Next
ResetDevice Function
C
void ResetDevice();
Overview

Initializes LCD module.

Returns

none

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Display Device Driver Control > ResetDevice Function


Advanced Display Driver Features

Contents | Index | Home
Previous | Up | Next
Advanced Display Driver Features
Topics
Topics
Name | Description
Alpha Blending | The following APIs are used to implement alpha blending features in the Epson S1D13517 Controller.
Transitions | This section describes screen transition effect when changing screens.
Microchip Graphics Controller | This is the generic display driver is intended for the Microchip Graphics Controller Module implemented in PIC24F device family. This driver will drive TFT, CSTN and STN displays.
Links
Display Device Driver Layer API, Topics
Library API > Display Device Driver Layer API > Advanced Display Driver Features


Alpha Blending

Contents | Index | Home
Previous | Up | Next
Alpha Blending
Functions | Advanced Display Driver Features

Alpha Blending in Epson Controller uses blocks of pixels in the memory called Windows. A window can be any rectangular area in a display buffer. The display buffer is also considered as a page. For a QVGA display buffer a page would be 320x240 pixels. A window is a certain width and height contained inside a page.

Alpha blending equation:

OutPut Window = Foreground Window * (Alpha) + Background Window * (1-Alpha)

when done in software requires a lot of CPU bandwith. Epson Controller implements alpha blending in hardware which offloads the CPU.

The Display Driver Layer of the Graphics Library utilizes the Epson Controller alpha blending through the AlphaBlendWindow() function. Three windows are specified with equal widths and heights. An alpha parameter is passed to define the level of alpha blending. The logical flow of the operation is shown below:

An icon image with a given width (w) and height (h) is needed to be alpha blended into the display buffer.

  • Buffer A is allocated in memory and its location set by foregroundWindowAddr
  • Buffer B is allocated in memory and its location set by backgroundWindowAddr and
  • Buffer C is allocated in memory and its location set by destinationWindowAddr. Note that the destination window can be located within the display buffer. Doing this removes an intermediate step after AlphaBlendWindow() call to put the result of alpha blend in the display buffer.
The final location of the icon on the Display Buffer is used to locate the affected pixels in the Display Buffer. These affected pixels are copied into Buffer B while Buffer A is filled up with the Icon Image. Once Buffers A and B are ready they are alpha blended to Buffer C. Buffer C is then copied to the Display Buffer.

Note that the Icon Image has a background color of ORANGE. To have the effect of the final output Display Buffer, set the Epson Controllers transparent color to ORANGE. This is set in the TRANSPARENTCOLOR macro defined in the Epson S1D13517 Driver. This TRANSPARENTCOLOR macro is not to be confused with the TransparentColorEnable() function of the Display Device Driver Level Primitives. TRANSPARENTCOLOR is set at build time. In the future release of the Epson driver, this will be converted to use the TransparentColorEnable() function.

Functions
Name | Description
AlphaBlendWindow | This alphablends a foreground and a background stored in frames to a destination window. The function uses windows insides frames. Each window shares the same width and height parameters.
GFXGetPageOriginAddress | This function calculates the address of a certain 0,0 location of a page in memory
GFXGetPageXYAddress | This function calculates the address of a certain x,y location in memory
Module

Advanced Display Driver Features

Links
Functions, Legend, Advanced Display Driver Features
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Alpha Blending


AlphaBlendWindow Function

Contents | Index | Home
Previous | Up | Next
AlphaBlendWindow Function
C
void AlphaBlendWindow(
    DWORD foregroundWindowAddr,
    DWORD backgroundWindowAddr,
    DWORD destinationWindowAddr,
    WORD width,
    WORD height,
    BYTE alphaPercentage
);
Overview

This alphablends a foreground and a background stored in frames to a destination window. The function uses windows insides frames. Each window shares the same width and height parameters.

Input Parameters
Input Parameters | Description
DWORD foregroundWindowAddr | the starting address of the foreground window
DWORD backgroundWindowAddr | the starting address of the background window
DWORD destinationWindowAddr | the starting address of the destination window
WORD width | the width of the alpha blend window
WORD height | the height of the alpha blend window
BYTE alphaPercentage | the amount of transparency to give the foreground Window
Returns

none

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Alpha Blending > AlphaBlendWindow Function


GFXGetPageOriginAddress Function

Contents | Index | Home
Previous | Up | Next
GFXGetPageOriginAddress Function
C
DWORD GFXGetPageOriginAddress(
    SHORT pageNumber
);
Overview

This function calculates the address of a certain 0,0 location of a page in memory

Input Parameters
Input Parameters | Description
SHORT pageNumber | the page number
Returns

The address of the start of a certain page in memory

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Alpha Blending > GFXGetPageOriginAddress Function


GFXGetPageXYAddress Function

Contents | Index | Home
Previous | Up | Next
GFXGetPageXYAddress Function
C
DWORD GFXGetPageXYAddress(
    SHORT pageNumber,
    WORD x,
    WORD y
);
Overview

This function calculates the address of a certain x,y location in memory

Input Parameters
Input Parameters | Description
SHORT pageNumber | the page number
WORD x | the x (horizontal) offset from 0,0 of the pagenumber
WORD y | the y (vertical) offset from the 0,0 of the pagenumber
Returns

The address of an XY position of a certain page in memory

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Alpha Blending > GFXGetPageXYAddress Function


Transitions

Contents | Index | Home
Previous | Up | Next
Transitions
Enumerations | Functions | Advanced Display Driver Features

Applications often require some transition effects while changing screens in order to enhance the look and feel which can be achieved by using Transition APIs provided with the Microchip Graphics Library. Refer to Appendix C of the application note [image] AN1368: Developing Embedded Graphics Applications using PIC® Microcontrollers with Integrated Graphics Controller for a graphical illustration of how transitions can be achieved.

In order to translate a new screen, the new screen has to be developed in a separate buffer and has to be copied to the frame buffer (visible display buffer) part by part. The way the new screen data is copied into the frame buffer determines the transition effect. A number of transition effects can be achieved by using the API: GFXTransition(left, top, right, bottom, type, srcpageaddr, destpageaddr, delay_ms, param1, param2). This API copies the rectangular area defined by left, top, right and bottom from address defined by srcpageaddr to the destpageaddr as per the transition defined by type, param1 and param2. The srcpageaddr should contain the new screen data and the destpageaddr must be the frame buffer address. The speed of the transition can be configured by the parameter delay_ms which determines the delay between each copy operations. Note that this API must be called only at the end of GOLDrawCallback() function in order to ensure that the new screen is fully created in the RAM.

If double buffering is enabled, then using transitions is made easier by another API: GFXSetupTransition(left, top, right, bottom, type, delay_ms, param1, param2). This API can be called immediately after creating the new screen and the graphics library will store the request and initiate the transition after the new screen is fully created in the RAM. Note that this API doesn’t have address parameters as the address of draw-buffer is already known to the double buffering subsystem of the graphics engine.

Enumerations
Name | Description
GFX_TRANSITION_DIRECTION | Direction enumeration to determine the direction of the selected GFX_TRANSITION_TYPE.
GFX_TRANSITION_TYPE | Transition type enumeration to determine the type of the transition. Each type will require specific parameters when setting up the transition operation (GFXSetupTransition() or GFXTransition()).
Functions
Name | Description
GFXTransition | This immediately executes the transition effect using the GFX_TRANSITION_TYPE and the given parameters.
GFXSetupTransition | This sets up the transition effect using the GFX_TRANSITION_TYPE and the given parameters. The actual transition execution will occur when GFXExecutePendingTransition() is called. When DOUBLE_BUFFERING is enabled, GFXExecutePendingTransition() is executed after the current screen is fully rendered.
GFXExecutePendingTransition | This function executes the transition that was set up by GFXSetupTransition(). Status of the transition is returned to indicate if the transition was executed or not. This function is used by the double buffering feature (USE_DOUBLE_BUFFERING) to perform transition operation after the current screen is fully rendered. This function assumes that the source page and destination page are already set up.
GFXIsTransitionPending | This function returns the status of a pending transition, set up by GFXSetupTransition(), waiting to be executed.
Module

Advanced Display Driver Features

Links
Enumerations, Functions, Legend, Advanced Display Driver Features
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Transitions


GFXTransition Function

Contents | Index | Home
Previous | Up | Next
GFXTransition Function
C
BYTE GFXTransition(
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    GFX_TRANSITION_TYPE type,
    DWORD srcpageaddr,
    DWORD destpageaddr,
    WORD delay_ms,
    WORD param1,
    WORD param2
);
Overview

This immediately executes the transition effect using the GFX_TRANSITION_TYPE and the given parameters.

Input Parameters
Input Parameters | Description
SHORT left | left x coordinate
SHORT top | top y coordinate
SHORT right | right x coordinate
SHORT bottom | bottom y coordinate
GFX_TRANSITION_TYPE type | Transition type
DWORD srcpageaddr | Source page address for the transition
DWORD destpageaddr | Destination page address for the transition
WORD delay_ms | Delay in milli seconds between redraws in the screen while executing the transition
WORD param1 | Transition-type specific parameter
WORD param2 | Transition-type specific parameter
Returns

Returns status of transition

  • 0 : Transition executed successfully
  • -1 : Transition not executed

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Transitions > GFXTransition Function


GFXSetupTransition Function

Contents | Index | Home
Previous | Up | Next
GFXSetupTransition Function
C
BYTE GFXSetupTransition(
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    GFX_TRANSITION_TYPE type,
    WORD delay_ms,
    WORD param1,
    WORD param2
);
Overview

This sets up the transition effect using the GFX_TRANSITION_TYPE and the given parameters. The actual transition execution will occur when GFXExecutePendingTransition() is called. When DOUBLE_BUFFERING is enabled, GFXExecutePendingTransition() is executed after the current screen is fully rendered.

Input Parameters
Input Parameters | Description
SHORT left | left x coordinate
SHORT top | top y coordinate
SHORT right | right x coordinate
SHORT bottom | bottom y coordinate
GFX_TRANSITION_TYPE type | Transition type
WORD delay_ms | Delay in milli seconds between redraws in the screen while executing the transition
WORD param1 | Transition-type specific parameter
WORD param2 | Transition-type specific parameter
Returns

Returns success of the setup

  • 0 : Parameters successfully saved for the new transition
  • -1 : Parameters not saved, there is a pending transition

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Transitions > GFXSetupTransition Function


GFXExecutePendingTransition Function

Contents | Index | Home
Previous | Up | Next
GFXExecutePendingTransition Function
C
BYTE GFXExecutePendingTransition(
    DWORD srcpageaddr,
    DWORD destpageaddr
);
Overview

This function executes the transition that was set up by GFXSetupTransition(). Status of the transition is returned to indicate if the transition was executed or not. This function is used by the double buffering feature (USE_DOUBLE_BUFFERING) to perform transition operation after the current screen is fully rendered. This function assumes that the source page and destination page are already set up.

Input Parameters
Input Parameters | Description
DWORD srcpageaddr | Source page address for the transition
DWORD destpageaddr | Destination page address for the transition
Returns

Returns status of transition

  • 0 : Transition executed successfully
  • -1 : Transition not executed

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Transitions > GFXExecutePendingTransition Function


GFXIsTransitionPending Function

Contents | Index | Home
Previous | Up | Next
GFXIsTransitionPending Function
C
BYTE GFXIsTransitionPending();
Overview

This function returns the status of a pending transition, set up by GFXSetupTransition(), waiting to be executed.

Returns

Returns transition status

  • 0 : No pending transition
  • 1 : There is a pending transition

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Transitions > GFXIsTransitionPending Function


GFX_TRANSITION_DIRECTION Enumeration

Contents | Index | Home
Previous | Up | Next
GFX_TRANSITION_DIRECTION Enumeration
C
typedef enum {
  LEFT_TO_RIGHT = 0,
  RIGHT_TO_LEFT,
  TOP_TO_BOTTOM,
  BOTTOM_TO_TOP,
  HORIZONTAL,
  VERTICAL
} GFX_TRANSITION_DIRECTION;
Overview

Direction enumeration to determine the direction of the selected GFX_TRANSITION_TYPE.

Members
Members | Description
LEFT_TO_RIGHT = 0 | option used in SLIDE, PUSH transition type (GFX_TRANSITION_TYPE)
RIGHT_TO_LEFT | option used in SLIDE, PUSH transition type (GFX_TRANSITION_TYPE)
TOP_TO_BOTTOM | option used in SLIDE, PUSH transition type (GFX_TRANSITION_TYPE)
BOTTOM_TO_TOP | option used in SLIDE, PUSH transition type (GFX_TRANSITION_TYPE)
HORIZONTAL | option used in EXPANDING_LINE and CONTRACTING_LINE transition type (GFX_TRANSITION_TYPE)
VERTICAL | option used in EXPANDING_LINE and CONTRACTING_LINE transition type (GFX_TRANSITION_TYPE)
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Transitions > GFX_TRANSITION_DIRECTION Enumeration


GFX_TRANSITION_TYPE Enumeration

Contents | Index | Home
Previous | Up | Next
GFX_TRANSITION_TYPE Enumeration
C
typedef enum {
  PLAIN = 0,
  SLIDE,
  PUSH,
  EXPANDING_RECTANGLE,
  CONTRACTING_RECTANGLE,
  EXPANDING_LINE,
  CONTRACTING_LINE
} GFX_TRANSITION_TYPE;
Overview

Transition type enumeration to determine the type of the transition. Each type will require specific parameters when setting up the transition operation (GFXSetupTransition() or GFXTransition()).

GFX_TRANSITION_TYPE | param1 | param2 (sets the direction of transition)
PLAIN | pixel block size | not used
EXPANDING_RECTANGLE | pixel block size | not used
CONTRACTING_RECTANGLE | pixel block size | not used
SLIDE | pixel block size | LEFT_TO_RIGHT, RIGHT_TO_LEFT, TOP_TO_BOTTOM, BOTTOM_TO_TOP
PUSH | pixel block size | LEFT_TO_RIGHT, RIGHT_TO_LEFT, TOP_TO_BOTTOM, BOTTOM_TO_TOP
EXPANDING_LINE | pixel block size | HORIZONTAL, VERTICAL
CONTRACTING_LINE | pixel block size | HORIZONTAL, VERTICAL
Members
Members | Description
PLAIN = 0 | no transition effect
SLIDE | param1 -> Pixel-block size, param2 -> Sliding direction LEFT_TO_RIGHT/RIGHT_TO_LEFT/TOP_TO_BOTTOM/BOTTOM_TO_TOP
PUSH | param1 -> Pixel-block size, param2 -> Sliding direction LEFT_TO_RIGHT/RIGHT_TO_LEFT/TOP_TO_BOTTOM/BOTTOM_TO_TOP
EXPANDING_RECTANGLE | param1 -> Pixel-block size
CONTRACTING_RECTANGLE | param1 -> Pixel-block size
EXPANDING_LINE | param1 -> Pixel-block size, param2 -> direction HORIZONTAL/VERTICAL
CONTRACTING_LINE | param1 -> Pixel-block size, param2 -> direction HORIZONTAL/VERTICAL
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Transitions > GFX_TRANSITION_TYPE Enumeration


Microchip Graphics Controller

Contents | Index | Home
Previous | Up | Next
Microchip Graphics Controller
Advanced Display Driver Features | Topics

The Microchip Graphics Controller has several advanced features that can be enabled by declaring macros in the Graphics Config (GraphicsConfig.h) and Hardware Profile (HardwareProfile.h) of the project. Below is a summary of all macros that pertains to the Microchip Graphics Controller driver.

Macro Name
Description
Location
GFX_DISPLAY_BUFFER_START_ADDRESS
Defines the starting address of the display buffer.
Hardware Profile
GFX_DISPLAY_BUFFER_LENGTH
Defines the size of the display buffer. This macro is used to map memory in RAM when:
  1. Double buffering is enabled. This is enabled by the macro USE_DOUBLE_BUFFERING
  2. IPU module is used. This is enabled by the macro USE_COMP_IPU
If the application is designed to fit into the internal memory, and with the If the double buffering and/or IPU module is enabled, the memory required must fit into the internal memory.

NOTE: If the display buffer is located in external memory (i.e in PIC24FJ256DA210) then GFX_DISPLAY_BUFFER_LENGTH must be less than or equal to the chip select region size
  • GFX_DISPLAY_BUFFER_LENGTH <= GFX_EPMP_CS1_MEMORY_SIZE if located in chip select 1 (CS1) region
  • GFX_DISPLAY_BUFFER_LENGTH <= GFX_EPMP_CS2_MEMORY_SIZE if located in chip select 2 (CS2) region
Hardware Profile
USE_PALETTE
Macro that enables the palette mode in Graphics Library and the Microchip Graphics Controller.
Graphics Config
USE_DOUBLE_BUFFERING
Optional feature. This enables the double buffering feature. Memory required for display buffer will double in size. There will be two display buffers used and these buffers are swapped automatically by the library draw operations or application can manage the swapping. See Double Buffering for details.
Buffer Location (Mapping):
Display Buffer 1 = GFX_DISPLAY_BUFFER_START_ADDRESS
Display Buffer 2 = GFX_DISPLAY_BUFFER_START_ADDRESS + GFX_DISPLAY_BUFFER_LENGTH

NOTE: If the display buffers are located in external memory (i.e in PIC24FJ256DA210) then the total display buffer memory needed must be less than or equal to the chip select region size
  • (GFX_DISPLAY_BUFFER_LENGTH * 2) <= GFX_EPMP_CS1_MEMORY_SIZE if located in chip select 1 (CS1) region
  • (GFX_DISPLAY_BUFFER_LENGTH * 2) <= GFX_EPMP_CS2_MEMORY_SIZE if located in chip select 2 (CS2) region
USE_COMP_IPU
Optional feature. This enables the usage of the IPU module in the Microchip Graphics Controller. Memory required for IPU is dictated by the location of the compressed data:

When compressed data is from external memory or program memory:
GFX_COMPRESSED_BUFFER_SIZE - defines the memory cache size needed for compressed data
GFX_DECOMPRESSED_BUFFER_SIZE - defines the memory cache size needed for decompressed data
GFX_IPU_TEMP_DATA_TRANSFER_ARRAY_SIZE - defines the memory cache size needed for transferring the compressed data from external memory (not mapped to EDS) or program memory to RAM location. This cache memory is created at initialization and will automatically be mapped. The size cannot not be greater than 32K.

Buffer Location (Mapping) (double buffering enabled):
Display Buffer = GFX_DISPLAY_BUFFER_START_ADDRESS
Decompressed Data Buffer = GFX_DISPLAY_BUFFER_START_ADDRESS + (GFX_DISPLAY_BUFFER_LENGTH*2)
Compressed Data Buffer = Decompressed Data Buffer + GFX_DECOMPRESSED_BUFFER_SIZE

Buffer Location (Mapping) (double buffering disabled):
Display Buffer = GFX_DISPLAY_BUFFER_START_ADDRESS
Decompressed Data Buffer = GFX_DISPLAY_BUFFER_START_ADDRESS + GFX_DISPLAY_BUFFER_LENGTH
Compressed Data Buffer = Decompressed Data Buffer + GFX_DECOMPRESSED_BUFFER_SIZE

When compressed data is Extended Data Space (RAM or external memory mapped in EDS):
GFX_DECOMPRESSED_BUFFER_SIZE - defines the memory cache size needed for decompressed data

Buffer Location (Mapping) (double buffering enabled):
Display Buffer = GFX_DISPLAY_BUFFER_START_ADDRESS
Decompressed Data Buffer = GFX_DISPLAY_BUFFER_START_ADDRESS + (GFX_DISPLAY_BUFFER_LENGTH*2)

Buffer Location (Mapping) (double buffering disabled):
Display Buffer = GFX_DISPLAY_BUFFER_START_ADDRESS
Decompressed Data Buffer = GFX_DISPLAY_BUFFER_START_ADDRESS + GFX_DISPLAY_BUFFER_LENGTH

NOTE: If the display buffers are located in external memory (i.e in PIC24FJ256DA210) then the total display, compressed and uncompressed buffers needed must be less than or equal to the chip select region size
External CS Memory Requirement
  • Double Buffering disabled:
    • (GFX_DISPLAY_BUFFER_LENGTH + GFX_COMPRESSED_BUFFER_SIZE + GFX_DECOMPRESSED_BUFFER_SIZE ) <= GFX_EPMP_CS1_MEMORY_SIZE if located in chip select 1 (CS1) region
    • (GFX_DISPLAY_BUFFER_LENGTH + GFX_COMPRESSED_BUFFER_SIZE + GFX_DECOMPRESSED_BUFFER_SIZE ) <= GFX_EPMP_CS2_MEMORY_SIZE if located in chip select 2 (CS2) region
  • Double Buffering enabled:
    • ((GFX_DISPLAY_BUFFER_LENGTH * 2) + GFX_COMPRESSED_BUFFER_SIZE + GFX_DECOMPRESSED_BUFFER_SIZE ) <= GFX_EPMP_CS1_MEMORY_SIZE if located in chip select 1 (CS1) region
    • ((GFX_DISPLAY_BUFFER_LENGTH * 2) + GFX_COMPRESSED_BUFFER_SIZE + GFX_DECOMPRESSED_BUFFER_SIZE ) <= GFX_EPMP_CS2_MEMORY_SIZE if located in chip select 2 (CS2) region
Graphics Config
GFX_EPMP_CS1_BASE_ADDRESS
For PIC Device Families with Enhanced Parallel Master Port (EPMP) (example PIC24FJ256DA210 Family of Devices).
Defines the location of the EPMP Chip Select 1 base address. When this macro is defined, the driver automatically enables the EPMP. The GFX_EPMP_CS1_MEMORY_SIZE macro determines how many address lines of the EPMP will be enabled.
Use this macro together with GFX_EPMP_CS1_MEMORY_SIZE to map external memory to EPMP Chip Select 1 for use by the Microchip Graphics Controller.
Hardware Profile
GFX_EPMP_CS1_MEMORY_SIZE
Defines the size of the memory mapped to EPMP Chip Select 1. Always used with GFX_EPMP_CS1_BASE_ADDRESS macro.

NOTE: Refer to GFX_DISPLAY_BUFFER_LENGTH, USE_DOUBLE_BUFFERING and USE_COMP_IPU description for the relationship between GFX_EPMP_CS1_MEMORY_SIZE and the total memory requirements when external memory is used for display buffers.
Hardware Profile
GFX_EPMP_CS2_BASE_ADDRESS
For PIC Device Families with Enhanced Parallel Master Port (EPMP) (example PIC24FJ256DA210 Family of Devices).
Defines the location of the EPMP Chip Select 2 base address.
Hardware Profile
GFX_EPMP_CS2_MEMORY_SIZE
Defines the size of the memory mapped to EPMP Chip Select 2. Always used with GFX_EPMP_CS2_BASE_ADDRESS macro.

NOTE: Refer to GFX_DISPLAY_BUFFER_LENGTH, USE_DOUBLE_BUFFERING and USE_COMP_IPU description for the relationship between GFX_EPMP_CS1_MEMORY_SIZE and the total memory requirements when external memory is used for display buffers.
Hardware Profile
GFX_COMPRESSED_BUFFER_SIZE
Macro used with USE_COMP_IPU to define the memory cache size needed for compressed data.
The value chosen is based on the largest compressed data when multiple compressed images/data are used.
Hardware Profile
GFX_DECOMPRESSED_BUFFER_SIZE
Macro used with USE_COMP_IPU to define the memory cache size needed for decompressed data.
The value chosen is based on the largest decompressed data when multiple compressed images/data are used.
Hardware Profile
GFX_IPU_TEMP_DATA_TRANSFER_ARRAY_SIZE
Macro used with USE_COMP_IPU to define the memory cache size needed for transferring the compressed data from external memory (not mapped to EDS) or program memory to RAM location.
The size chosen must not exceed 32Kbytes. Allowed size is further reduced by application variables and dynamic memory requirements.
Hardware Profile

Enabling Internal/External Memory

The Microchip Graphics Controller can use internal memory or external memory for the display buffers. The driver decides on the location of the buffers based on the GFX_DISPLAY_BUFFER_START_ADDRESS macro. For the PIC24FJ256DA210 device family, there are two variants for internal memory sizes, 96 Kbytes and 24 Kbytes. For the 96 Kbytes variants, the external memory can be immediately mapped after the internal RAM address. for the 24KBytes variants, the external memory cannot be mapped after the internal RAM address. Refer to the PIC24FJ256DA210 Family Data Sheet for details on the mapping of external memory (Section 4.2 Data Memory Space).

External Memory Example:

Copy Code
// Settings for Hardware Profile to use External Memory
// on PIC24FJ256DA210 Development Board

// Microchip Development Board Specific macros
  #define PIC24FJ256DA210_DEV_BOARD                    // development board used
  #define GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E // display panel used

// Microchip Graphics Controller specific macros
  // PMP port data bus width (for Microchip Graphics Controller only 16bit is allowed)
  #define USE_16BIT_PMP
  // Use Microchip Display Controller
  #define GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210
  // Microchip Graphics Controller pixel clock divider
  // The value used is derived from display's refresh rate requirement (usually 60 Hz)
  #define GFX_GCLK_DIVIDER 61

  // Display Buffer start address
  // Note that the value is mapped to external memory location
  // see  PIC24FJ256DA210 Family Data Sheet for details
  #define GFX_DISPLAY_BUFFER_START_ADDRESS 0x00020000ul
  // Display Buffer size
  #define GFX_DISPLAY_BUFFER_LENGTH 0x00025800ul

  // Since Display Buffer is mapped to external memory
  // EPMP needs to be enabled
  #define GFX_EPMP_CS1_BASE_ADDRESS 0x00020000ul
  #define GFX_EPMP_CS1_MEMORY_SIZE 0x80000ul

  // EPMP CS2 can also be used as an external memory resource
  #define GFX_EPMP_CS2_BASE_ADDRESS (0x00020000ul + GFX_EPMP_CS1_MEMORY_SIZE )
  #define GFX_EPMP_CS2_MEMORY_SIZE 0x80000ul

Internal Memory Example:

Copy Code
// Settings for Hardware Profile to use Internal Memory
// on PIC24FJ256DA210 Development Board

// Hardware Profile
// Microchip Development Board Specific macros
  #define PIC24FJ256DA210_DEV_BOARD                    // development board used
  #define GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E // display panel used

// Microchip Graphics Controller specific macros
  // Use Microchip Display Controller
  #define GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210
  // Microchip Graphics Controller pixel clock divider
  // The value used is derived from display's refresh rate requirement (usually 60 Hz)
  #define GFX_GCLK_DIVIDER 61

  // Display Buffer start address
  // Note that the value is mapped to external memory location
  // see  PIC24FJ256DA210 Family Data Sheet for details
  #define GFX_DISPLAY_BUFFER_START_ADDRESS 0x00004B00ul
  // Display Buffer size
  #define GFX_DISPLAY_BUFFER_LENGTH 0x0004B000ul

Enabling Double Buffering

See Double Buffering.

Enabling Color Look Up Table

The Graphics Controller Module can be set to operate on 1, 2, 4, 8 and 16 bpp. Color depths 1, 2, 4, and 8 can be used with the 256 entries Color Look Up Table (CLUT). When using external memory, only the 8bpp mode can be used with the CLUT enabled. When using internal memory, 1,2,4 and 8 bpp can be used.

Enabling Color Look Up Table Example:

Copy Code
// Settings for GraphicsConfig.h to use the CLUT at 8BPP mode.

  // enable the palette mode
  #define USE_PALETTE

  // set the color depth
  #define COLOR_DEPTH    8

Enabling the IPU Module

Currently, the IPU module is an option to reduce memory external or internal flash memory when storing images for the Graphics Library. The Graphics Resource Converter tool provides an option to convert images to be saved in compressed format for IPU decompression.

Enabling IPU Decompression Example:

Copy Code
// Settings for GraphicsConfig.h to use the IPU Module.

  // enable the use of IPU module
  #define USE_COMP_IPU

Copy Code
// Settings for Hardware Profile to use IPU Module
// on PIC24FJ256DA210 Development Board
// Use this when compressed data is from memory not mapped to EDS

  // define the size of the compressed buffer
  #define GFX_COMPRESSED_BUFFER_SIZE              (13950)

  // define the size of the decompressed buffer
  #define GFX_DECOMPRESSED_BUFFER_SIZE            (19216)

  // define the size of the temporary buffer to transfer compressed
  // data from memory not mapped in EDS
  // (example: External SPI memory, Program Flash)
  #define GFX_IPU_TEMP_DATA_TRANSFER_ARRAY_SIZE   (1024)

Copy Code
// Settings for Hardware Profile to use IPU Module
// on PIC24FJ256DA210 Development Board
// Use this when compressed data is from memory mapped to EDS

  // define the size of the decompressed buffer
  #define GFX_DECOMPRESSED_BUFFER_SIZE            (19216)
Module

Advanced Display Driver Features

Topics
Name | Description
Rectangle Copy Operations | The following APIs are used move blocks of data from one memory location to another.
Double Buffering | In the Microchip Graphics Library, if double-buffering is enabled, the frame buffer and draw buffer are exchanged after the changes of all the widgets on a screen are done (i.e., the new screen appears after the whole screen is updated and not after updating an individual widget).
Decompressing DEFLATEd data | The Microchip Graphics Controller features a decompression module for data compressed using the DEFLATE algorithm. Compressed data are limited to fixed huffman codes. Compressed data with dynamic huffman codes are not supported.
Palette Mode | The Microchip Graphics Controller features a palette mode for a smaller frame buffer requirement. This option uses the built-in 256 entry Color Look-up Table (CLUT) to represent pixels from the display buffer in memory. If the CLUT is enabled, each pixel in the display buffer is assumed to contain the color index. This color index is used as the address of the CLUT entry that contains the color value that will be used for the given pixel.
Set Up Display Interface |
External or Internal Memory and Palettes | This section shows examples on how to set up applications using external memory, internal memory or use palettes for Microchip Graphics Module.
Links
Advanced Display Driver Features, Topics
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller


Rectangle Copy Operations

Contents | Index | Home
Previous | Up | Next
Rectangle Copy Operations
Functions | Macros
Functions
Name | Description
ROPBlock | Performs a Raster Operation (ROP) on source and destination. The type of ROP is decided by the rop and the copyOp parameter.
Scroll | Scrolls the rectangular area defined by left, top, right, bottom by delta pixels.
Macros
Name
Description
RCC_SRC_ADDR_CONTINUOUS
Source (S) and Destination (D) data type. When performing executing commands on the Rectangle Copy Processing Unit (RCCGPU). The source and destination data can be treated as a continuous block of data in memory or a discontinuous data in memory. This gives flexibility to the operation where an copy operation can be performed to data already present in the display buffer or anywhere else in data memory. Both source and destination data can be set to continuous or discontinuous data. These macros are only used in RCCGPU operations.
  • RCC_SRC_ADDR_CONTINUOUS - source data is continuous
  • RCC_SRC_ADDR_DISCONTINUOUS - source data is discontinuous... more
RCC_SRC_ADDR_DISCONTINUOUS
Source (S) and Destination (D) data type. When performing executing commands on the Rectangle Copy Processing Unit (RCCGPU). The source and destination data can be treated as a continuous block of data in memory or a discontinuous data in memory. This gives flexibility to the operation where an copy operation can be performed to data already present in the display buffer or anywhere else in data memory. Both source and destination data can be set to continuous or discontinuous data. These macros are only used in RCCGPU operations.
  • RCC_SRC_ADDR_CONTINUOUS - source data is continuous
  • RCC_SRC_ADDR_DISCONTINUOUS - source data is discontinuous... more
RCC_DEST_ADDR_CONTINUOUS
Source (S) and Destination (D) data type. When performing executing commands on the Rectangle Copy Processing Unit (RCCGPU). The source and destination data can be treated as a continuous block of data in memory or a discontinuous data in memory. This gives flexibility to the operation where an copy operation can be performed to data already present in the display buffer or anywhere else in data memory. Both source and destination data can be set to continuous or discontinuous data. These macros are only used in RCCGPU operations.
  • RCC_SRC_ADDR_CONTINUOUS - source data is continuous
  • RCC_SRC_ADDR_DISCONTINUOUS - source data is discontinuous... more
RCC_DEST_ADDR_DISCONTINUOUS
Source (S) and Destination (D) data type. When performing executing commands on the Rectangle Copy Processing Unit (RCCGPU). The source and destination data can be treated as a continuous block of data in memory or a discontinuous data in memory. This gives flexibility to the operation where an copy operation can be performed to data already present in the display buffer or anywhere else in data memory. Both source and destination data can be set to continuous or discontinuous data. These macros are only used in RCCGPU operations.
  • RCC_SRC_ADDR_CONTINUOUS - source data is continuous
  • RCC_SRC_ADDR_DISCONTINUOUS - source data is discontinuous... more
RCC_ROP_0
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_1
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_2
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_3
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_4
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_5
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_6
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_7
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_8
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_9
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_A
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_B
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_C
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_D
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_E
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_F
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_COPY
Type of Rectangle Copy Operations. Select one of the following rectangle copy operations and together with the ROP; the source, destination, current color set and transparency are evaluated on each pixel and the result written to the destination.
  • RCC_COPY - Copies the source data to the destination address with the selected ROP.
  • RCC_SOLID_FILL - Fills the specified rectangle with the current color set.
  • RCC_TRANSPARENT_COPY - Operation is the same as the COPY operation except that the source data is compared against the current color set. If the values match, the source data is not written to the destination. The source... more
RCC_SOLID_FILL
Type of Rectangle Copy Operations. Select one of the following rectangle copy operations and together with the ROP; the source, destination, current color set and transparency are evaluated on each pixel and the result written to the destination.
  • RCC_COPY - Copies the source data to the destination address with the selected ROP.
  • RCC_SOLID_FILL - Fills the specified rectangle with the current color set.
  • RCC_TRANSPARENT_COPY - Operation is the same as the COPY operation except that the source data is compared against the current color set. If the values match, the source data is not written to the destination. The source... more
RCC_TRANSPARENT_COPY
Type of Rectangle Copy Operations. Select one of the following rectangle copy operations and together with the ROP; the source, destination, current color set and transparency are evaluated on each pixel and the result written to the destination.
  • RCC_COPY - Copies the source data to the destination address with the selected ROP.
  • RCC_SOLID_FILL - Fills the specified rectangle with the current color set.
  • RCC_TRANSPARENT_COPY - Operation is the same as the COPY operation except that the source data is compared against the current color set. If the values match, the source data is not written to the destination. The source... more
Links
Functions, Microchip Graphics Controller, Legend, Macros
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Rectangle Copy Operations


ROPBlock Function

Contents | Index | Home
Previous | Up | Next
ROPBlock Function
C
WORD ROPBlock(
    DWORD srcAddr,
    DWORD dstAddr,
    DWORD srcOffset,
    DWORD dstOffset,
    WORD srcType,
    WORD dstType,
    WORD copyOp,
    WORD rop,
    WORD color,
    WORD width,
    WORD height
);
Overview

Performs a Raster Operation (ROP) on source and destination. The type of ROP is decided by the rop and the copyOp parameter.

Input Parameters
Input Parameters
Description
DWORD srcAddr
the base address of the data to be moved
DWORD dstAddr
the base address of the new location of the moved data
DWORD srcOffset
offset of the data to be moved with respect to the source base address.
DWORD dstOffset
offset of the new location of the moved data respect to the source base address.
WORD srcType
sets the source type (GFX_DATA_CONTINUOUS or GFX_DATA_DISCONTINUOUS)
WORD dstType
sets the destination type (GFX_DATA_CONTINUOUS or GFX_DATA_DISCONTINUOUS)
WORD copyOp
sets the type of copy operation
  • RCC_SOLID_FILL: Solid fill of the set color
  • RCC_COPY: direct copy of source to destination
  • RCC_TRANSPARENT_COPY: copy with transparency. Transparency color is set by color
WORD rop
sets the raster operation equation
  • RCC_ROP_0: Solid black color fill
  • RCC_ROP_1: not (Source or Destination)
  • RCC_ROP_2: (not Source) and Destination
  • RCC_ROP_3: not Source
  • RCC_ROP_4: Source and (not Destination)
  • RCC_ROP_5: not Destination
  • RCC_ROP_6: Source xor Destination
  • RCC_ROP_7: not (Source and Destination)
  • RCC_ROP_8: Source and Destination
  • RCC_ROP_9: not (Source xor Destination)
  • RCC_ROP_A: Destination
  • RCC_ROP_B: (not Source) or Destination
  • RCC_ROP_C: Source
  • RCC_ROP_D: Source or (not Destination)
  • RCC_ROP_E: Source or Destination
  • RCC_ROP_F: Solid white color fill
WORD color
color value used when transparency operation is set or using solid color fill
WORD width
width of the block of data to be moved
WORD height
height of the block of data to be moved
Returns

For NON-Blocking configuration:

  • Returns 0 when device is busy and operation is not completely performed.
  • Returns 1 when the operation is completely performed.
For Blocking configuration:
  • Always return 1.

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Rectangle Copy Operations > ROPBlock Function


Scroll Function

Contents | Index | Home
Previous | Up | Next
Scroll Function
C
WORD Scroll(
    SHORT left,
    SHORT top,
    SHORT right,
    SHORT bottom,
    SHORT delta,
    WORD dir
);
Overview

Scrolls the rectangular area defined by left, top, right, bottom by delta pixels.

Input Parameters
Input Parameters
Description
SHORT left
left position of the scrolled rectangle
SHORT top
top position of the scrolled rectangle
SHORT right
right position of the scrolled rectangle
SHORT bottom
bottom position of the scrolled rectangle
SHORT delta
defines the scroll delta
WORD dir
defines the direction of the scroll.
  • 0 : scroll to the left
  • 1 : scroll to the right
Returns

none

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Rectangle Copy Operations > Scroll Function


RCC_SRC_ADDR_CONTINUOUS Macro

Contents | Index | Home
Previous | Up | Next
RCC_SRC_ADDR_CONTINUOUS Macro
C
#define RCC_SRC_ADDR_CONTINUOUS 0x00000002ul
#define RCC_SRC_ADDR_DISCONTINUOUS 0x00000000ul
#define RCC_DEST_ADDR_CONTINUOUS 0x00000004ul
#define RCC_DEST_ADDR_DISCONTINUOUS 0x00000000ul
Overview

Source (S) and Destination (D) data type. When performing executing commands on the Rectangle Copy Processing Unit (RCCGPU). The source and destination data can be treated as a continuous block of data in memory or a discontinuous data in memory. This gives flexibility to the operation where an copy operation can be performed to data already present in the display buffer or anywhere else in data memory. Both source and destination data can be set to continuous or discontinuous data. These macros are only used in RCCGPU operations.

  • RCC_SRC_ADDR_CONTINUOUS - source data is continuous
  • RCC_SRC_ADDR_DISCONTINUOUS - source data is discontinuous
  • RCC_DEST_ADDR_CONTINUOUS - destination data is continuous
  • RCC_DEST_ADDR_DISCONTINUOUS - destination data is discontinuous

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Rectangle Copy Operations > RCC_SRC_ADDR_CONTINUOUS Macro


RCC_ROP_0 Macro

Contents | Index | Home
Previous | Up | Next
RCC_ROP_0 Macro
C
#define RCC_ROP_0 0x00000000ul
#define RCC_ROP_1 0x00000008ul        // not (S or D)
#define RCC_ROP_2 0x00000010ul        // (not S) and D
#define RCC_ROP_3 0x00000018ul        // not (S)
#define RCC_ROP_4 0x00000020ul        // S and not (D)
#define RCC_ROP_5 0x00000028ul        // not (D)
#define RCC_ROP_6 0x00000030ul        // S xor D
#define RCC_ROP_7 0x00000038ul        // not (S and D)
#define RCC_ROP_8 0x00000040ul        // S and D
#define RCC_ROP_9 0x00000048ul        // not (S xor D)
#define RCC_ROP_A 0x00000050ul        // D
#define RCC_ROP_B 0x00000058ul        // not (S) or D
#define RCC_ROP_C 0x00000060ul        // S
#define RCC_ROP_D 0x00000068ul        // S or not (D)
#define RCC_ROP_E 0x00000070ul        // S or D
#define RCC_ROP_F 0x00000078ul        // 1 (WHITE)
Overview

Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).

  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B - not (S) or D
  • RCC_ROP_C - S
  • RCC_ROP_D - S or not (D)
  • RCC_ROP_E - S or D
  • RCC_ROP_F - 1 (WHITE)

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Rectangle Copy Operations > RCC_ROP_0 Macro


RCC_COPY Macro

Contents | Index | Home
Previous | Up | Next
RCC_COPY Macro
C
#define RCC_COPY 0x00000080ul
#define RCC_SOLID_FILL 0x00000000ul
#define RCC_TRANSPARENT_COPY 0x00000300ul
Overview

Type of Rectangle Copy Operations. Select one of the following rectangle copy operations and together with the ROP; the source, destination, current color set and transparency are evaluated on each pixel and the result written to the destination.

  • RCC_COPY - Copies the source data to the destination address with the selected ROP.
  • RCC_SOLID_FILL - Fills the specified rectangle with the current color set.
  • RCC_TRANSPARENT_COPY - Operation is the same as the COPY operation except that the source data is compared against the current color set. If the values match, the source data is not written to the destination. The source image is, therefore, transparent at such a location, allowing

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Rectangle Copy Operations > RCC_COPY Macro


Double Buffering

Contents | Index | Home
Previous | Up | Next
Double Buffering
Functions

Manipulating pixels on the screen requires direct writes to the frame buffer. While these changes are being executed, the screen is also refreshed. This means that the changes are displayed immediately as the frame buffer is being updated. This is not a suitable scheme when the changes are slow, for example, decoding an image or having a large number of widgets on a screen. The display may appear slow in that case. One solution to this problem is to use a double-buffering scheme supported by the Microchip Graphics Library. In this scheme, the changes are not directly written to the frame buffer, but instead, they are written to a separate buffer, called the ‘Draw Buffer’. After all the changes are made, the draw buffer and frame buffer are exchanged. Now the draw buffer becomes the frame buffer, and because of all the changes drawn there, the changes appear spontaneous to the user. Of course, there will be a delay, as all the changes have to be written to the draw buffer before displaying it. This delay is generally more tolerable than displaying the changes slowly. After exchanging of the buffers, the latest buffer (which is now the frame buffer) is copied to the new draw buffer in the background and then the new draw buffer is in sync with what is being displayed. New changes are then written to the draw buffer and the cycle continues. As the double-buffering scheme uses two buffers, the RAM requirement will double.

In the Microchip Graphics Library, if double-buffering is enabled, the frame buffer and draw buffer are exchanged after the changes of all the widgets on a screen are done (i.e., the new screen appears after the whole screen is updated and not after updating an individual widget).

The work flow of double-buffering is graphically explained along with tips on deciding when to use double buffering in the APPENDIX B of the Application note AN1368: Developing Embedded Graphics Applications using PIC® Microcontrollers with Integrated Graphics Controller.

To use double buffering in an application, follow the steps described below:

1. Enable the option USE_DOUBLE_BUFFERING in GraphicsConfig.h

2. Update GFX_DISPLAY_BUFFER_LENGTH to include both the buffers in HardwareProfile.h. Note that when using external memory the GFX_DISPLAY_BUFFER_LENGTH must fit into the external memory size. For example in PIC24FJ256DA210 external memory can be added using EPMP. External memory mapped to the EPMP must be big enough to accommodate the display buffers required by double buffering. See Set Up Display Interface for more information on memory requirements.

3. Check the jumper settings to enable the required RAM address space on the development board

If Graphics Objects Layer (GOL) is used in the application, the switching of buffers is handled automatically in order to keep the switching task transparent to the users. If double buffering is enabled in applications using only the Primitive layer, then the switching of buffers has to be handled by the application itself as explained in the following steps.

Steps required for manually handling the switching of buffers:

1. After InitGraph() is called, call the APIs InvalidateAll() followed by UpdateDisplayNow(). The two buffers are properly setup after these calls and from this point onwards, the drawing happens on the draw-buffer.

2. When a shape is drawn on the draw buffer, that rectangular area has to be marked as invalid by using the API InvalidateRectangle(left, top, right, bottom). Only the invalidated rectangular areas are copied to the frame buffer in order to reduce the copy operations thereby reducing the overall time and energy required to sync the two buffers. Hence, it is important to invalidate the changed rectangular areas failing which the change doesn’t show up on the display.

3. Call either RequestDisplayUpdate() or UpdateDisplayNow() to sync the two buffers and as a result the changes appear on the display. The former API exchanges the buffers during the next display blanking period on TFT LCDs causing the change to appear smooth and immediate whereas the latter API exchanges the two buffers at the time of the API call probably causing a slight flicker on the display. On displays which doesn’t support blanking periods (e.g. CSTN LCDs), the effect of RequestDisplayUpdate() is same as that of UpdateDisplayNow().

Even if double buffering is enabled at compile time, it can be switched off and on at run time using APIs SwitchOffDoubleBuffering() and SwitchOnDoubleBuffering(). Switching double buffering on/off at runtime is useful in applications which need some screens having fast updates like waveform or animation which requires double buffering to be switched off and some other screens where double buffering is beneficial.

Note: In applications using Graphics Objects Layer and double buffering, the double buffering is not immediately enabled after the API GOLInit() is called in order to support hassles splash screens but is automatically enabled from the second screen update onwards. If double buffering is needed from the first screen itself, then follow step 1 immediately after calling GOLInit().

Functions
Name | Description
SwitchOffDoubleBuffering | Switches off the double buffering. All rendering will be performed on the frame buffer. Calls to UpdateDisplayNow() or RequestDisplayUpdate() will have no effect.
SwitchOnDoubleBuffering | Switches on the double buffering. Double buffering utilizes two buffers. The frame buffer and the draw buffer. The frame buffer is the buffer that is being displayed while the draw buffer is used for all rendering. When this function is called, it copies the contents of the frame buffer to the draw buffer once and all succeeding rendering will be performed on the draw buffer. To update the frame buffer with newly drawn items on the draw buffer call UpdateDisplayNow() or RequestDisplayUpdate().
InvalidateRectangle | Invalidates the specified rectangular area. This increments the number of invalidated areas and if the number of invalidated areas exceed the GFX_MAX_INVALIDATE_AREAS, the whole frame buffer is invalidated.
RequestDisplayUpdate | Synchronizes the draw and frame buffers at next VBlank
UpdateDisplayNow | Synchronizes the draw and frame buffers immediately.
Links
Functions, Microchip Graphics Controller, Legend
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Double Buffering


SwitchOffDoubleBuffering Function

Contents | Index | Home
Previous | Up | Next
SwitchOffDoubleBuffering Function
C
void SwitchOffDoubleBuffering();
Overview

Switches off the double buffering. All rendering will be performed on the frame buffer. Calls to UpdateDisplayNow() or RequestDisplayUpdate() will have no effect.

Returns

none

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Double Buffering > SwitchOffDoubleBuffering Function


SwitchOnDoubleBuffering Function

Contents | Index | Home
Previous | Up | Next
SwitchOnDoubleBuffering Function
C
void SwitchOnDoubleBuffering();
Overview

Switches on the double buffering. Double buffering utilizes two buffers. The frame buffer and the draw buffer. The frame buffer is the buffer that is being displayed while the draw buffer is used for all rendering. When this function is called, it copies the contents of the frame buffer to the draw buffer once and all succeeding rendering will be performed on the draw buffer. To update the frame buffer with newly drawn items on the draw buffer call UpdateDisplayNow() or RequestDisplayUpdate().

Returns

none

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Double Buffering > SwitchOnDoubleBuffering Function


InvalidateRectangle Function

Contents | Index | Home
Previous | Up | Next
InvalidateRectangle Function
C
void InvalidateRectangle(
    WORD left,
    WORD top,
    WORD right,
    WORD bottom
);
Overview

Invalidates the specified rectangular area. This increments the number of invalidated areas and if the number of invalidated areas exceed the GFX_MAX_INVALIDATE_AREAS, the whole frame buffer is invalidated.

Input Parameters
Input Parameters | Description
WORD left | left position
WORD top | top position
WORD right | right position
WORD bottom | bottom position
Returns

None

Preconditions

None

Side Effects

Copies back the invalidated areas only to the draw buffer after the exchange of draw and frame buffers.

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Double Buffering > InvalidateRectangle Function


RequestDisplayUpdate Function

Contents | Index | Home
Previous | Up | Next
RequestDisplayUpdate Function
C
void RequestDisplayUpdate();
Overview

Synchronizes the draw and frame buffers at next VBlank

Returns

none

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Double Buffering > RequestDisplayUpdate Function


UpdateDisplayNow Function

Contents | Index | Home
Previous | Up | Next
UpdateDisplayNow Function
C
void UpdateDisplayNow();
Overview

Synchronizes the draw and frame buffers immediately.

Returns

none

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Double Buffering > UpdateDisplayNow Function


Decompressing DEFLATEd data

Contents | Index | Home
Previous | Up | Next
Decompressing DEFLATEd data
Functions
Functions
Name | Description
Decompress | Decompresses the nbytes number of data at SrcAddress and places starting from DestAddress. (Blocking)
Links
Functions, Microchip Graphics Controller, Legend
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Decompressing DEFLATEd data


Decompress Function

Contents | Index | Home
Previous | Up | Next
Decompress Function
C
BYTE Decompress(
    DWORD SrcAddress,
    DWORD DestAddress,
    DWORD nbytes
);
Overview

Decompresses the nbytes number of data at SrcAddress and places starting from DestAddress. (Blocking)

Input Parameters
Input Parameters | Description
DWORD SrcAddress | Source address
DWORD DestAddress | Destination address
DWORD nbytes | Number of bytes to be decompressed
Returns

error flag

Preconditions

SrcAddress must point to the start of a compressed block.

Side Effects

Modifies workarea_1 & workarea_2 registers.

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Decompressing DEFLATEd data > Decompress Function


Palette Mode

Contents | Index | Home
Previous | Up | Next
Palette Mode
Files | Functions | Macros | Structures | Types
Files
Name | Description
Palette.h | This is file Palette.h.
Functions
Name | Description
ClearPaletteChangeError | Clears the Palette change error status
DisablePalette | Disables the Palette mode.
EnablePalette | Enables the Palette mode.
GetPaletteChangeError | Returns the Palette change error status
IsPaletteEnabled | Returns if the Palette mode is enabled or not.
PaletteInit | Initializes the color look up table (CLUT).
RequestPaletteChange | Loads the palettes from the flash during vertical blanking period if possible, otherwise loads immediately.
SetPalette | Programs a block of palette entries starting from startEntry and until startEntry + length from the flash immediately.
SetPaletteBpp | Sets the color look up table (CLUT) number of valid entries.
SetPaletteFlash | Loads the palettes from the flash immediately.
Macros
Name | Description
RequestEntirePaletteChange | Loads all the palette entries from the flash during vertical blanking period if possible, otherwise loads immediately.
SetEntirePalette | Programs the whole 256 entry palette with new color values from flash.
Structures
Name | Description
PALETTE_FLASH | Structure for the palette stored in FLASH memory.
PALETTE_HEADER | Structure for the palette header.
Types
Name | Description
PALETTE_EXTERNAL | Structure for palette stored in EXTERNAL memory space. (example: External SPI or parallel Flash, EDS_EPMP)
Links
Files, Functions, Microchip Graphics Controller, Legend, Macros, Structures, Types
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode


ClearPaletteChangeError Function

Contents | Index | Home
Previous | Up | Next
ClearPaletteChangeError Function
Palette.h
C
void ClearPaletteChangeError();
Overview

Clears the Palette change error status

Returns

none

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode > ClearPaletteChangeError Function


DisablePalette Function

Contents | Index | Home
Previous | Up | Next
DisablePalette Function
Palette.h
C
void DisablePalette();
Overview

Disables the Palette mode.

Returns

none

Preconditions

none

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode > DisablePalette Function


EnablePalette Function

Contents | Index | Home
Previous | Up | Next
EnablePalette Function
Palette.h
C
void EnablePalette();
Overview

Enables the Palette mode.

Returns

none

Preconditions

none

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode > EnablePalette Function


GetPaletteChangeError Function

Contents | Index | Home
Previous | Up | Next
GetPaletteChangeError Function
Palette.h
C
BYTE GetPaletteChangeError();
Overview

Returns the Palette change error status

Returns

Returns the palette change status. 1 - If the palette change error occured 0 - If no palette change error occured

Preconditions

none

Side Effects

none

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode > GetPaletteChangeError Function


IsPaletteEnabled Function

Contents | Index | Home
Previous | Up | Next
IsPaletteEnabled Function
Palette.h
C
BYTE IsPaletteEnabled();
Overview

Returns if the Palette mode is enabled or not.

Returns

Returns the palette mode status. 1 - If the palette mode is enabled 0 - If the palette mode is disabled

Preconditions

none

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode > IsPaletteEnabled Function


PaletteInit Function

Contents | Index | Home
Previous | Up | Next
PaletteInit Function
Palette.h
C
void PaletteInit();
Overview

Initializes the color look up table (CLUT).

Returns

none

Preconditions

none

Side Effects

All rendering will use the new palette entries.

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode > PaletteInit Function


RequestPaletteChange Function

Contents | Index | Home
Previous | Up | Next
RequestPaletteChange Function
Palette.h
C
void RequestPaletteChange(
    void * pPalette,
    WORD startEntry,
    WORD length
);
Overview

Loads the palettes from the flash during vertical blanking period if possible, otherwise loads immediately.

Input Parameters
Input Parameters | Description
void * pPalette | Pointer to the palette structure
WORD startEntry | Start entry to load (inclusive)
WORD length | Number of entries
Returns

none

Preconditions

Palette must be initialized by PaletteInit().

Side Effects

There may be a slight flicker when the Palette entries are getting loaded one by one.

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode > RequestPaletteChange Function


SetPalette Function

Contents | Index | Home
Previous | Up | Next
SetPalette Function
Palette.h
C
BYTE SetPalette(
    void * pPalette,
    WORD startEntry,
    WORD length
);
Overview

Programs a block of palette entries starting from startEntry and until startEntry + length from the flash immediately.

Input Parameters
Input Parameters | Description
void * pPalette | Pointer to the palette structure
WORD startEntry | Start entry to load (inclusive)
WORD length | Number of entries
Returns

Returns the status of the palette set. 0 - Set was successful 1 - Set was not successful

Preconditions

Palette must be initialized by PaletteInit().

Side Effects

There may be a slight flicker when the Palette entries are getting loaded one by one.

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode > SetPalette Function


SetPaletteBpp Function

Contents | Index | Home
Previous | Up | Next
SetPaletteBpp Function
Palette.h
C
BYTE SetPaletteBpp(
    BYTE bpp
);
Overview

Sets the color look up table (CLUT) number of valid entries.

Input Parameters
Input Parameters | Description
BYTE bpp | Bits per pixel
Returns

Returns the status of the change. 0 - Change was successful 1 - Change was not successful

Preconditions

Palette must be initialized by PaletteInit().

Side Effects

none

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode > SetPaletteBpp Function


SetPaletteFlash Function

Contents | Index | Home
Previous | Up | Next
SetPaletteFlash Function
Palette.h
C
BYTE SetPaletteFlash(
    PALETTE_ENTRY * pPaletteEntry,
    WORD startEntry,
    WORD length
);
Overview

Loads the palettes from the flash immediately.

Input Parameters
Input Parameters | Description
PALETTE_ENTRY * pPaletteEntry | Pointer to the palette table in ROM
WORD startEntry | Start entry to load (inclusive)
WORD length | Number of entries
Returns

Returns the status of the palette set. 0 - Set was successful 1 - Set was not successful

Preconditions

Palette must be initialized by PaletteInit().

Side Effects

There may be a slight flicker when the Palette entries are getting loaded one by one.

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode > SetPaletteFlash Function


PALETTE_FLASH Structure

Contents | Index | Home
Previous | Up | Next
PALETTE_FLASH Structure
Palette.h
C
typedef struct {
  SHORT type;
  PALETTE_HEADER header;
  PALETTE_ENTRY * pPaletteEntry;
} PALETTE_FLASH;
Overview

Structure for the palette stored in FLASH memory.

Members
Members | Description
SHORT type; | Type must be FLASH
PALETTE_HEADER header; | Contains information on the palette
PALETTE_ENTRY * pPaletteEntry; | Pointer to the palette. Number of entries is determined by the header.
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode > PALETTE_FLASH Structure


PALETTE_HEADER Structure

Contents | Index | Home
Previous | Up | Next
PALETTE_HEADER Structure
Palette.h
C
typedef struct {
  WORD id;
  WORD length;
} PALETTE_HEADER;
Overview

Structure for the palette header.

Members
Members | Description
WORD id; | User defined ID
WORD length; | number of palette entries (number of colors in the palette)
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode > PALETTE_HEADER Structure


PALETTE_EXTERNAL Type

Contents | Index | Home
Previous | Up | Next
PALETTE_EXTERNAL Type
Palette.h
C
typedef GFX_EXTDATA PALETTE_EXTERNAL;
Overview

Structure for palette stored in EXTERNAL memory space. (example: External SPI or parallel Flash, EDS_EPMP)

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode > PALETTE_EXTERNAL Type


RequestEntirePaletteChange Macro

Contents | Index | Home
Previous | Up | Next
RequestEntirePaletteChange Macro
Palette.h
C
#define RequestEntirePaletteChange(pPalette) RequestPaletteChange(pPalette, 0, 256)
Overview

Loads all the palette entries from the flash during vertical blanking period if possible, otherwise loads immediately.

Input Parameters
Input Parameters | Description
pPalette | Pointer to the palette structure
Returns

none

Preconditions

PPalette must be initialized by PaletteInit().

Side Effects

There may be a slight flicker when the Palette entries are getting loaded one by one.

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode > RequestEntirePaletteChange Macro


SetEntirePalette Macro

Contents | Index | Home
Previous | Up | Next
SetEntirePalette Macro
Palette.h
C
#define SetEntirePalette(pPalette) SetPalette(pPalette, 0, 256)
Overview

Programs the whole 256 entry palette with new color values from flash.

Input Parameters
Input Parameters | Description
pPalette | Pointer to the palette structure
Returns

Returns the status of the palette set. 0 - Set was successful 1 - Set was not successful

Preconditions

Palette must be initialized by PaletteInit().

Side Effects

There may be a slight flicker when the Palette entries are getting loaded one by one.

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode > SetEntirePalette Macro


Palette.h

Contents | Index | Home
Previous | Up | Next
Palette.h
Functions | Macros | Structures | Types

This is file Palette.h.

Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode > Palette.h


Set Up Display Interface

Contents | Index | Home
Previous | Up | Next
Set Up Display Interface
Macros
Macros
Name
Description
GFX_GCLK_DIVIDER
The following are additional Hardware Profile macros used when using the driver for the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family) (PIC24FJ256DA210_DEV_BOARD).
  • When using internal or external memory
    • GFX_GCLK_DIVIDER - Set the clock divider for the pixel clock.
    • GFX_DISPLAY_BUFFER_START_ADDRESS - Set the Display Buffer location.
    • GFX_DISPLAY_BUFFER_LENGTH - Set the Display Buffer length (size) in bytes. This is calculated by the display's width*height*(color depth/2).
  • When using external memory only. External memory may be placed in chip select 1 (CS1) and/or chip select 2 (CS2) regions. Refer to EPMP Family Reference Manual for details on... more
GFX_EPMP_CS1_BASE_ADDRESS
The following are additional Hardware Profile macros used when using the driver for the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family) (PIC24FJ256DA210_DEV_BOARD).
  • When using internal or external memory
    • GFX_GCLK_DIVIDER - Set the clock divider for the pixel clock.
    • GFX_DISPLAY_BUFFER_START_ADDRESS - Set the Display Buffer location.
    • GFX_DISPLAY_BUFFER_LENGTH - Set the Display Buffer length (size) in bytes. This is calculated by the display's width*height*(color depth/2).
  • When using external memory only. External memory may be placed in chip select 1 (CS1) and/or chip select 2 (CS2) regions. Refer to EPMP Family Reference Manual for details on... more
GFX_EPMP_CS1_MEMORY_SIZE
The following are additional Hardware Profile macros used when using the driver for the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family) (PIC24FJ256DA210_DEV_BOARD).
  • When using internal or external memory
    • GFX_GCLK_DIVIDER - Set the clock divider for the pixel clock.
    • GFX_DISPLAY_BUFFER_START_ADDRESS - Set the Display Buffer location.
    • GFX_DISPLAY_BUFFER_LENGTH - Set the Display Buffer length (size) in bytes. This is calculated by the display's width*height*(color depth/2).
  • When using external memory only. External memory may be placed in chip select 1 (CS1) and/or chip select 2 (CS2) regions. Refer to EPMP Family Reference Manual for details on... more
GFX_EPMP_CS2_BASE_ADDRESS
The following are additional Hardware Profile macros used when using the driver for the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family) (PIC24FJ256DA210_DEV_BOARD).
  • When using internal or external memory
    • GFX_GCLK_DIVIDER - Set the clock divider for the pixel clock.
    • GFX_DISPLAY_BUFFER_START_ADDRESS - Set the Display Buffer location.
    • GFX_DISPLAY_BUFFER_LENGTH - Set the Display Buffer length (size) in bytes. This is calculated by the display's width*height*(color depth/2).
  • When using external memory only. External memory may be placed in chip select 1 (CS1) and/or chip select 2 (CS2) regions. Refer to EPMP Family Reference Manual for details on... more
GFX_EPMP_CS2_MEMORY_SIZE
The following are additional Hardware Profile macros used when using the driver for the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family) (PIC24FJ256DA210_DEV_BOARD).
  • When using internal or external memory
    • GFX_GCLK_DIVIDER - Set the clock divider for the pixel clock.
    • GFX_DISPLAY_BUFFER_START_ADDRESS - Set the Display Buffer location.
    • GFX_DISPLAY_BUFFER_LENGTH - Set the Display Buffer length (size) in bytes. This is calculated by the display's width*height*(color depth/2).
  • When using external memory only. External memory may be placed in chip select 1 (CS1) and/or chip select 2 (CS2) regions. Refer to EPMP Family Reference Manual for details on... more
GFX_DISPLAY_BUFFER_LENGTH
The following are additional Hardware Profile macros used when using the driver for the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family) (PIC24FJ256DA210_DEV_BOARD).
  • When using internal or external memory
    • GFX_GCLK_DIVIDER - Set the clock divider for the pixel clock.
    • GFX_DISPLAY_BUFFER_START_ADDRESS - Set the Display Buffer location.
    • GFX_DISPLAY_BUFFER_LENGTH - Set the Display Buffer length (size) in bytes. This is calculated by the display's width*height*(color depth/2).
  • When using external memory only. External memory may be placed in chip select 1 (CS1) and/or chip select 2 (CS2) regions. Refer to EPMP Family Reference Manual for details on... more
GFX_DISPLAY_BUFFER_START_ADDRESS
The following are additional Hardware Profile macros used when using the driver for the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family) (PIC24FJ256DA210_DEV_BOARD).
  • When using internal or external memory
    • GFX_GCLK_DIVIDER - Set the clock divider for the pixel clock.
    • GFX_DISPLAY_BUFFER_START_ADDRESS - Set the Display Buffer location.
    • GFX_DISPLAY_BUFFER_LENGTH - Set the Display Buffer length (size) in bytes. This is calculated by the display's width*height*(color depth/2).
  • When using external memory only. External memory may be placed in chip select 1 (CS1) and/or chip select 2 (CS2) regions. Refer to EPMP Family Reference Manual for details on... more
Links
Microchip Graphics Controller, Macros
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Set Up Display Interface


GFX_GCLK_DIVIDER Macro

Contents | Index | Home
Previous | Up | Next
GFX_GCLK_DIVIDER Macro
C
#define GFX_GCLK_DIVIDER 61
Overview

The following are additional Hardware Profile macros used when using the driver for the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family) (PIC24FJ256DA210_DEV_BOARD).

  • When using internal or external memory
    • GFX_GCLK_DIVIDER - Set the clock divider for the pixel clock.
    • GFX_DISPLAY_BUFFER_START_ADDRESS - Set the Display Buffer location.
    • GFX_DISPLAY_BUFFER_LENGTH - Set the Display Buffer length (size) in bytes. This is calculated by the display's width*height*(color depth/2).
  • When using external memory only. External memory may be placed in chip select 1 (CS1) and/or chip select 2 (CS2) regions. Refer to EPMP Family Reference Manual for details on how to use EPMP for graphics applications.
    • GFX_EPMP_CS1_BASE_ADDRESS - Set the location of the external memory mapped to the EPMP CS1.
    • GFX_EPMP_CS2_BASE_ADDRESS - Set the location of the external memory mapped to the EPMP CS2.
    • GFX_EPMP_CS1_MEMORY_SIZE - Set the size of the memory mapped to the EPMP CS1. This value sets how many EPMP address lines will be used.
    • GFX_EPMP_CS2_MEMORY_SIZE - Set the size of the memory mapped to the EPMP CS2. This value sets how many EPMP address lines will be used.
If the display buffer is located in external memory (i.e in PIC24FJ256DA210) then the memory requirement for the graphics use must fit into the chip select region size. The table below summarizes the requirements.

Buffer Name | Enabled Features | External Memory Required | Display Buffer Location
GFX_EPMP_CS1_MEMORY_SIZE | none | EQ1 | chip select 1 region.
GFX_EPMP_CS1_MEMORY_SIZE | USE_DOUBLE_BUFFERING | EQ2 | chip select 1 region.
GFX_EPMP_CS1_MEMORY_SIZE | USE_DOUBLE_BUFFERING + USE_COMP_IPU | EQ3 | chip select 1 region.
GFX_EPMP_CS2_MEMORY_SIZE | none | EQ4 | chip select 2 region.
GFX_EPMP_CS2_MEMORY_SIZE | USE_DOUBLE_BUFFERING | EQ5 | chip select 2 region.
GFX_EPMP_CS2_MEMORY_SIZE | USE_DOUBLE_BUFFERING + USE_COMP_IPU | EQ6 | chip select 2 region.

Equation | Description
EQ1 | GFX_EPMP_CS1_MEMORY_SIZE >= GFX_DISPLAY_BUFFER_LENGTH
EQ2 | GFX_EPMP_CS1_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2)
EQ3 | GFX_EPMP_CS1_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2) + GFX_COMPRESSED_BUFFER_SIZE + GFX_DECOMPRESSED_BUFFER_SIZE
EQ4 | GFX_EPMP_CS2_MEMORY_SIZE >= GFX_DISPLAY_BUFFER_LENGTH
EQ5 | GFX_EPMP_CS2_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2)
EQ6 | GFX_EPMP_CS2_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2) + GFX_COMPRESSED_BUFFER_SIZE + GFX_DECOMPRESSED_BUFFER_SIZE
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Set Up Display Interface > GFX_GCLK_DIVIDER Macro


GFX_EPMP_CS1_BASE_ADDRESS Macro

Contents | Index | Home
Previous | Up | Next
GFX_EPMP_CS1_BASE_ADDRESS Macro
C
#define GFX_EPMP_CS1_BASE_ADDRESS 0x00020000ul            // <COPY GFX_GCLK_DIVIDER>
Overview

The following are additional Hardware Profile macros used when using the driver for the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family) (PIC24FJ256DA210_DEV_BOARD).

  • When using internal or external memory
    • GFX_GCLK_DIVIDER - Set the clock divider for the pixel clock.
    • GFX_DISPLAY_BUFFER_START_ADDRESS - Set the Display Buffer location.
    • GFX_DISPLAY_BUFFER_LENGTH - Set the Display Buffer length (size) in bytes. This is calculated by the display's width*height*(color depth/2).
  • When using external memory only. External memory may be placed in chip select 1 (CS1) and/or chip select 2 (CS2) regions. Refer to EPMP Family Reference Manual for details on how to use EPMP for graphics applications.
    • GFX_EPMP_CS1_BASE_ADDRESS - Set the location of the external memory mapped to the EPMP CS1.
    • GFX_EPMP_CS2_BASE_ADDRESS - Set the location of the external memory mapped to the EPMP CS2.
    • GFX_EPMP_CS1_MEMORY_SIZE - Set the size of the memory mapped to the EPMP CS1. This value sets how many EPMP address lines will be used.
    • GFX_EPMP_CS2_MEMORY_SIZE - Set the size of the memory mapped to the EPMP CS2. This value sets how many EPMP address lines will be used.
If the display buffer is located in external memory (i.e in PIC24FJ256DA210) then the memory requirement for the graphics use must fit into the chip select region size. The table below summarizes the requirements.

Buffer Name | Enabled Features | External Memory Required | Display Buffer Location
GFX_EPMP_CS1_MEMORY_SIZE | none | EQ1 | chip select 1 region.
GFX_EPMP_CS1_MEMORY_SIZE | USE_DOUBLE_BUFFERING | EQ2 | chip select 1 region.
GFX_EPMP_CS1_MEMORY_SIZE | USE_DOUBLE_BUFFERING + USE_COMP_IPU | EQ3 | chip select 1 region.
GFX_EPMP_CS2_MEMORY_SIZE | none | EQ4 | chip select 2 region.
GFX_EPMP_CS2_MEMORY_SIZE | USE_DOUBLE_BUFFERING | EQ5 | chip select 2 region.
GFX_EPMP_CS2_MEMORY_SIZE | USE_DOUBLE_BUFFERING + USE_COMP_IPU | EQ6 | chip select 2 region.

Equation | Description
EQ1 | GFX_EPMP_CS1_MEMORY_SIZE >= GFX_DISPLAY_BUFFER_LENGTH
EQ2 | GFX_EPMP_CS1_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2)
EQ3 | GFX_EPMP_CS1_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2) + GFX_COMPRESSED_BUFFER_SIZE + GFX_DECOMPRESSED_BUFFER_SIZE
EQ4 | GFX_EPMP_CS2_MEMORY_SIZE >= GFX_DISPLAY_BUFFER_LENGTH
EQ5 | GFX_EPMP_CS2_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2)
EQ6 | GFX_EPMP_CS2_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2) + GFX_COMPRESSED_BUFFER_SIZE + GFX_DECOMPRESSED_BUFFER_SIZE
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Set Up Display Interface > GFX_EPMP_CS1_BASE_ADDRESS Macro


GFX_EPMP_CS1_MEMORY_SIZE Macro

Contents | Index | Home
Previous | Up | Next
GFX_EPMP_CS1_MEMORY_SIZE Macro
C
#define GFX_EPMP_CS1_MEMORY_SIZE 0x40000ul                // <COPY GFX_GCLK_DIVIDER>
Overview

The following are additional Hardware Profile macros used when using the driver for the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family) (PIC24FJ256DA210_DEV_BOARD).

  • When using internal or external memory
    • GFX_GCLK_DIVIDER - Set the clock divider for the pixel clock.
    • GFX_DISPLAY_BUFFER_START_ADDRESS - Set the Display Buffer location.
    • GFX_DISPLAY_BUFFER_LENGTH - Set the Display Buffer length (size) in bytes. This is calculated by the display's width*height*(color depth/2).
  • When using external memory only. External memory may be placed in chip select 1 (CS1) and/or chip select 2 (CS2) regions. Refer to EPMP Family Reference Manual for details on how to use EPMP for graphics applications.
    • GFX_EPMP_CS1_BASE_ADDRESS - Set the location of the external memory mapped to the EPMP CS1.
    • GFX_EPMP_CS2_BASE_ADDRESS - Set the location of the external memory mapped to the EPMP CS2.
    • GFX_EPMP_CS1_MEMORY_SIZE - Set the size of the memory mapped to the EPMP CS1. This value sets how many EPMP address lines will be used.
    • GFX_EPMP_CS2_MEMORY_SIZE - Set the size of the memory mapped to the EPMP CS2. This value sets how many EPMP address lines will be used.
If the display buffer is located in external memory (i.e in PIC24FJ256DA210) then the memory requirement for the graphics use must fit into the chip select region size. The table below summarizes the requirements.

Buffer Name | Enabled Features | External Memory Required | Display Buffer Location
GFX_EPMP_CS1_MEMORY_SIZE | none | EQ1 | chip select 1 region.
GFX_EPMP_CS1_MEMORY_SIZE | USE_DOUBLE_BUFFERING | EQ2 | chip select 1 region.
GFX_EPMP_CS1_MEMORY_SIZE | USE_DOUBLE_BUFFERING + USE_COMP_IPU | EQ3 | chip select 1 region.
GFX_EPMP_CS2_MEMORY_SIZE | none | EQ4 | chip select 2 region.
GFX_EPMP_CS2_MEMORY_SIZE | USE_DOUBLE_BUFFERING | EQ5 | chip select 2 region.
GFX_EPMP_CS2_MEMORY_SIZE | USE_DOUBLE_BUFFERING + USE_COMP_IPU | EQ6 | chip select 2 region.

Equation | Description
EQ1 | GFX_EPMP_CS1_MEMORY_SIZE >= GFX_DISPLAY_BUFFER_LENGTH
EQ2 | GFX_EPMP_CS1_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2)
EQ3 | GFX_EPMP_CS1_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2) + GFX_COMPRESSED_BUFFER_SIZE + GFX_DECOMPRESSED_BUFFER_SIZE
EQ4 | GFX_EPMP_CS2_MEMORY_SIZE >= GFX_DISPLAY_BUFFER_LENGTH
EQ5 | GFX_EPMP_CS2_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2)
EQ6 | GFX_EPMP_CS2_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2) + GFX_COMPRESSED_BUFFER_SIZE + GFX_DECOMPRESSED_BUFFER_SIZE
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Set Up Display Interface > GFX_EPMP_CS1_MEMORY_SIZE Macro


GFX_EPMP_CS2_BASE_ADDRESS Macro

Contents | Index | Home
Previous | Up | Next
GFX_EPMP_CS2_BASE_ADDRESS Macro
C
#define GFX_EPMP_CS2_BASE_ADDRESS 0x00020000ul            // <COPY GFX_GCLK_DIVIDER>
Overview

The following are additional Hardware Profile macros used when using the driver for the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family) (PIC24FJ256DA210_DEV_BOARD).

  • When using internal or external memory
    • GFX_GCLK_DIVIDER - Set the clock divider for the pixel clock.
    • GFX_DISPLAY_BUFFER_START_ADDRESS - Set the Display Buffer location.
    • GFX_DISPLAY_BUFFER_LENGTH - Set the Display Buffer length (size) in bytes. This is calculated by the display's width*height*(color depth/2).
  • When using external memory only. External memory may be placed in chip select 1 (CS1) and/or chip select 2 (CS2) regions. Refer to EPMP Family Reference Manual for details on how to use EPMP for graphics applications.
    • GFX_EPMP_CS1_BASE_ADDRESS - Set the location of the external memory mapped to the EPMP CS1.
    • GFX_EPMP_CS2_BASE_ADDRESS - Set the location of the external memory mapped to the EPMP CS2.
    • GFX_EPMP_CS1_MEMORY_SIZE - Set the size of the memory mapped to the EPMP CS1. This value sets how many EPMP address lines will be used.
    • GFX_EPMP_CS2_MEMORY_SIZE - Set the size of the memory mapped to the EPMP CS2. This value sets how many EPMP address lines will be used.
If the display buffer is located in external memory (i.e in PIC24FJ256DA210) then the memory requirement for the graphics use must fit into the chip select region size. The table below summarizes the requirements.

Buffer Name | Enabled Features | External Memory Required | Display Buffer Location
GFX_EPMP_CS1_MEMORY_SIZE | none | EQ1 | chip select 1 region.
GFX_EPMP_CS1_MEMORY_SIZE | USE_DOUBLE_BUFFERING | EQ2 | chip select 1 region.
GFX_EPMP_CS1_MEMORY_SIZE | USE_DOUBLE_BUFFERING + USE_COMP_IPU | EQ3 | chip select 1 region.
GFX_EPMP_CS2_MEMORY_SIZE | none | EQ4 | chip select 2 region.
GFX_EPMP_CS2_MEMORY_SIZE | USE_DOUBLE_BUFFERING | EQ5 | chip select 2 region.
GFX_EPMP_CS2_MEMORY_SIZE | USE_DOUBLE_BUFFERING + USE_COMP_IPU | EQ6 | chip select 2 region.

Equation | Description
EQ1 | GFX_EPMP_CS1_MEMORY_SIZE >= GFX_DISPLAY_BUFFER_LENGTH
EQ2 | GFX_EPMP_CS1_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2)
EQ3 | GFX_EPMP_CS1_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2) + GFX_COMPRESSED_BUFFER_SIZE + GFX_DECOMPRESSED_BUFFER_SIZE
EQ4 | GFX_EPMP_CS2_MEMORY_SIZE >= GFX_DISPLAY_BUFFER_LENGTH
EQ5 | GFX_EPMP_CS2_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2)
EQ6 | GFX_EPMP_CS2_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2) + GFX_COMPRESSED_BUFFER_SIZE + GFX_DECOMPRESSED_BUFFER_SIZE
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Set Up Display Interface > GFX_EPMP_CS2_BASE_ADDRESS Macro


GFX_EPMP_CS2_MEMORY_SIZE Macro

Contents | Index | Home
Previous | Up | Next
GFX_EPMP_CS2_MEMORY_SIZE Macro
C
#define GFX_EPMP_CS2_MEMORY_SIZE 0x40000ul                // <COPY GFX_GCLK_DIVIDER>
Overview

The following are additional Hardware Profile macros used when using the driver for the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family) (PIC24FJ256DA210_DEV_BOARD).

  • When using internal or external memory
    • GFX_GCLK_DIVIDER - Set the clock divider for the pixel clock.
    • GFX_DISPLAY_BUFFER_START_ADDRESS - Set the Display Buffer location.
    • GFX_DISPLAY_BUFFER_LENGTH - Set the Display Buffer length (size) in bytes. This is calculated by the display's width*height*(color depth/2).
  • When using external memory only. External memory may be placed in chip select 1 (CS1) and/or chip select 2 (CS2) regions. Refer to EPMP Family Reference Manual for details on how to use EPMP for graphics applications.
    • GFX_EPMP_CS1_BASE_ADDRESS - Set the location of the external memory mapped to the EPMP CS1.
    • GFX_EPMP_CS2_BASE_ADDRESS - Set the location of the external memory mapped to the EPMP CS2.
    • GFX_EPMP_CS1_MEMORY_SIZE - Set the size of the memory mapped to the EPMP CS1. This value sets how many EPMP address lines will be used.
    • GFX_EPMP_CS2_MEMORY_SIZE - Set the size of the memory mapped to the EPMP CS2. This value sets how many EPMP address lines will be used.
If the display buffer is located in external memory (i.e in PIC24FJ256DA210) then the memory requirement for the graphics use must fit into the chip select region size. The table below summarizes the requirements.

Buffer Name | Enabled Features | External Memory Required | Display Buffer Location
GFX_EPMP_CS1_MEMORY_SIZE | none | EQ1 | chip select 1 region.
GFX_EPMP_CS1_MEMORY_SIZE | USE_DOUBLE_BUFFERING | EQ2 | chip select 1 region.
GFX_EPMP_CS1_MEMORY_SIZE | USE_DOUBLE_BUFFERING + USE_COMP_IPU | EQ3 | chip select 1 region.
GFX_EPMP_CS2_MEMORY_SIZE | none | EQ4 | chip select 2 region.
GFX_EPMP_CS2_MEMORY_SIZE | USE_DOUBLE_BUFFERING | EQ5 | chip select 2 region.
GFX_EPMP_CS2_MEMORY_SIZE | USE_DOUBLE_BUFFERING + USE_COMP_IPU | EQ6 | chip select 2 region.

Equation | Description
EQ1 | GFX_EPMP_CS1_MEMORY_SIZE >= GFX_DISPLAY_BUFFER_LENGTH
EQ2 | GFX_EPMP_CS1_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2)
EQ3 | GFX_EPMP_CS1_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2) + GFX_COMPRESSED_BUFFER_SIZE + GFX_DECOMPRESSED_BUFFER_SIZE
EQ4 | GFX_EPMP_CS2_MEMORY_SIZE >= GFX_DISPLAY_BUFFER_LENGTH
EQ5 | GFX_EPMP_CS2_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2)
EQ6 | GFX_EPMP_CS2_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2) + GFX_COMPRESSED_BUFFER_SIZE + GFX_DECOMPRESSED_BUFFER_SIZE
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Set Up Display Interface > GFX_EPMP_CS2_MEMORY_SIZE Macro


GFX_DISPLAY_BUFFER_LENGTH Macro

Contents | Index | Home
Previous | Up | Next
GFX_DISPLAY_BUFFER_LENGTH Macro
C
#define GFX_DISPLAY_BUFFER_LENGTH 0x00025800ul            // <COPY GFX_GCLK_DIVIDER>
Overview

The following are additional Hardware Profile macros used when using the driver for the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family) (PIC24FJ256DA210_DEV_BOARD).

  • When using internal or external memory
    • GFX_GCLK_DIVIDER - Set the clock divider for the pixel clock.
    • GFX_DISPLAY_BUFFER_START_ADDRESS - Set the Display Buffer location.
    • GFX_DISPLAY_BUFFER_LENGTH - Set the Display Buffer length (size) in bytes. This is calculated by the display's width*height*(color depth/2).
  • When using external memory only. External memory may be placed in chip select 1 (CS1) and/or chip select 2 (CS2) regions. Refer to EPMP Family Reference Manual for details on how to use EPMP for graphics applications.
    • GFX_EPMP_CS1_BASE_ADDRESS - Set the location of the external memory mapped to the EPMP CS1.
    • GFX_EPMP_CS2_BASE_ADDRESS - Set the location of the external memory mapped to the EPMP CS2.
    • GFX_EPMP_CS1_MEMORY_SIZE - Set the size of the memory mapped to the EPMP CS1. This value sets how many EPMP address lines will be used.
    • GFX_EPMP_CS2_MEMORY_SIZE - Set the size of the memory mapped to the EPMP CS2. This value sets how many EPMP address lines will be used.
If the display buffer is located in external memory (i.e in PIC24FJ256DA210) then the memory requirement for the graphics use must fit into the chip select region size. The table below summarizes the requirements.

Buffer Name | Enabled Features | External Memory Required | Display Buffer Location
GFX_EPMP_CS1_MEMORY_SIZE | none | EQ1 | chip select 1 region.
GFX_EPMP_CS1_MEMORY_SIZE | USE_DOUBLE_BUFFERING | EQ2 | chip select 1 region.
GFX_EPMP_CS1_MEMORY_SIZE | USE_DOUBLE_BUFFERING + USE_COMP_IPU | EQ3 | chip select 1 region.
GFX_EPMP_CS2_MEMORY_SIZE | none | EQ4 | chip select 2 region.
GFX_EPMP_CS2_MEMORY_SIZE | USE_DOUBLE_BUFFERING | EQ5 | chip select 2 region.
GFX_EPMP_CS2_MEMORY_SIZE | USE_DOUBLE_BUFFERING + USE_COMP_IPU | EQ6 | chip select 2 region.

Equation | Description
EQ1 | GFX_EPMP_CS1_MEMORY_SIZE >= GFX_DISPLAY_BUFFER_LENGTH
EQ2 | GFX_EPMP_CS1_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2)
EQ3 | GFX_EPMP_CS1_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2) + GFX_COMPRESSED_BUFFER_SIZE + GFX_DECOMPRESSED_BUFFER_SIZE
EQ4 | GFX_EPMP_CS2_MEMORY_SIZE >= GFX_DISPLAY_BUFFER_LENGTH
EQ5 | GFX_EPMP_CS2_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2)
EQ6 | GFX_EPMP_CS2_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2) + GFX_COMPRESSED_BUFFER_SIZE + GFX_DECOMPRESSED_BUFFER_SIZE
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Set Up Display Interface > GFX_DISPLAY_BUFFER_LENGTH Macro


GFX_DISPLAY_BUFFER_START_ADDRESS Macro

Contents | Index | Home
Previous | Up | Next
GFX_DISPLAY_BUFFER_START_ADDRESS Macro
C
#define GFX_DISPLAY_BUFFER_START_ADDRESS 0x00020000ul    // <COPY GFX_GCLK_DIVIDER>
Overview

The following are additional Hardware Profile macros used when using the driver for the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family) (PIC24FJ256DA210_DEV_BOARD).

  • When using internal or external memory
    • GFX_GCLK_DIVIDER - Set the clock divider for the pixel clock.
    • GFX_DISPLAY_BUFFER_START_ADDRESS - Set the Display Buffer location.
    • GFX_DISPLAY_BUFFER_LENGTH - Set the Display Buffer length (size) in bytes. This is calculated by the display's width*height*(color depth/2).
  • When using external memory only. External memory may be placed in chip select 1 (CS1) and/or chip select 2 (CS2) regions. Refer to EPMP Family Reference Manual for details on how to use EPMP for graphics applications.
    • GFX_EPMP_CS1_BASE_ADDRESS - Set the location of the external memory mapped to the EPMP CS1.
    • GFX_EPMP_CS2_BASE_ADDRESS - Set the location of the external memory mapped to the EPMP CS2.
    • GFX_EPMP_CS1_MEMORY_SIZE - Set the size of the memory mapped to the EPMP CS1. This value sets how many EPMP address lines will be used.
    • GFX_EPMP_CS2_MEMORY_SIZE - Set the size of the memory mapped to the EPMP CS2. This value sets how many EPMP address lines will be used.
If the display buffer is located in external memory (i.e in PIC24FJ256DA210) then the memory requirement for the graphics use must fit into the chip select region size. The table below summarizes the requirements.

Buffer Name | Enabled Features | External Memory Required | Display Buffer Location
GFX_EPMP_CS1_MEMORY_SIZE | none | EQ1 | chip select 1 region.
GFX_EPMP_CS1_MEMORY_SIZE | USE_DOUBLE_BUFFERING | EQ2 | chip select 1 region.
GFX_EPMP_CS1_MEMORY_SIZE | USE_DOUBLE_BUFFERING + USE_COMP_IPU | EQ3 | chip select 1 region.
GFX_EPMP_CS2_MEMORY_SIZE | none | EQ4 | chip select 2 region.
GFX_EPMP_CS2_MEMORY_SIZE | USE_DOUBLE_BUFFERING | EQ5 | chip select 2 region.
GFX_EPMP_CS2_MEMORY_SIZE | USE_DOUBLE_BUFFERING + USE_COMP_IPU | EQ6 | chip select 2 region.

Equation | Description
EQ1 | GFX_EPMP_CS1_MEMORY_SIZE >= GFX_DISPLAY_BUFFER_LENGTH
EQ2 | GFX_EPMP_CS1_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2)
EQ3 | GFX_EPMP_CS1_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2) + GFX_COMPRESSED_BUFFER_SIZE + GFX_DECOMPRESSED_BUFFER_SIZE
EQ4 | GFX_EPMP_CS2_MEMORY_SIZE >= GFX_DISPLAY_BUFFER_LENGTH
EQ5 | GFX_EPMP_CS2_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2)
EQ6 | GFX_EPMP_CS2_MEMORY_SIZE >= (GFX_DISPLAY_BUFFER_LENGTH*2) + GFX_COMPRESSED_BUFFER_SIZE + GFX_DECOMPRESSED_BUFFER_SIZE
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Set Up Display Interface > GFX_DISPLAY_BUFFER_START_ADDRESS Macro


External or Internal Memory and Palettes

Contents | Index | Home
Previous | Up | Next
External or Internal Memory and Palettes

Applications can run in in PIC24FJ256DA210 Device Family using internal memory or external memory with palette enabled or disabled. The table below summarizes the allowed color depth when combining palette with the use of internal or external memory.

Memory Location | Palette Mode | Color Depth (BPP) | Notes
Internal | enabled | 1, 2, 4, 8 | When using internal memory and running TFT display, palette mode must be enabled.
External | enabled | 8, 16 | Palette mode can only be used for 8BPP color depth when using external memory.
External | disabled | 16 | When using external memory and palette is disabled and running TFT display, 16 BPP color depth must be used.

Applications Using Palettes

Settings in Graphics Configuration (GraphicsConfig.h)

Copy Code
#define USE_PALETTE                                     // to include code for palette
#define USE_PALETTE_EXTERNAL                            // define this if palette data
                                                        // will be in the external memory

// (note: PIC24FJ256DA210 Device Family color palette has a maximum of 256
// entries, therefore the maximum color depth that can be used for applications
// using palette is 8 BPP)
#define COLOR_DEPTH   8                                 // define the color depth to use

Settings in Hardware Profile (HardwareProfile.h)

Copy Code
/////////////////////////////////////////////////////
// Microchip Specific Development Tools
/////////////////////////////////////////////////////
#define PIC24FJ256DA210_DEV_BOARD                       // to use PIC24FJ256DA210 Development Board
#define GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E    // to use the Truly 3.2" display panel

/////////////////////////////////////////////////////
// PIC24FJ256DA210 Graphics Module required settings
/////////////////////////////////////////////////////
#define GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210           // to use the mchpGfxDrv.c and mchpGfxDrv.h driver

#define GFX_GCLK_DIVIDER 38                             // set divider to generate required GCLK pin
                                                        // frequency (check display panel data sheet)
#define GFX_DISPLAY_BUFFER_START_ADDRESS 0x00004B00ul   // set the display buffer starting address
                                                        // (address can be located in internal or
                                                        // external memory)
#define GFX_DISPLAY_BUFFER_LENGTH 0x0004B000ul          // set the display buffer length in bytes (value
                                                        // is derived from width, height and color depth
                                                        // (COLOR_DEPTH)). If using external memory,
                                                        // size must fit into the external memory size.

// If using external memory add macros to enable EPMP CS1 or CS2 here and adjust
// location of  GFX_DISPLAY_BUFFER_START_ADDRESS (see Application Using External Memory)

In application code initialize and enable palette before initializing the Graphics Library

Copy Code
// set the palette color depth
SetPaletteBpp(8);
// initialize the palette
SetPalette((void*)&MainPalette, 0, 256);

// enable the use of the palette
EnablePalette();

Applications Using Internal Memory

Settings in Graphics Configuration (GraphicsConfig.h)

Copy Code
// define the color depth to use (1, 2, 4, or 8BPP)
#define COLOR_DEPTH   8

Settings in Graphics Configuration (GraphicsConfig.h) Settings in Hardware Profile (HardwareProfile.h)

Copy Code
/////////////////////////////////////////////////////
// Microchip Specific Development Tools
/////////////////////////////////////////////////////
#define PIC24FJ256DA210_DEV_BOARD                       // to use PIC24FJ256DA210 Development Board
#define GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E    // to use the Truly 3.2" display panel

/////////////////////////////////////////////////////
// PIC24FJ256DA210 Graphics Module required settings
/////////////////////////////////////////////////////
#define GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210           // to use the mchpGfxDrv.c and mchpGfxDrv.h driver

#define GFX_GCLK_DIVIDER 38                             // set divider to generate required GCLK pin
                                                        // frequency (check display panel data sheet)
#define GFX_DISPLAY_BUFFER_START_ADDRESS 0x00004B00ul   // set the display buffer starting address
                                                        // (address must be located in internal memory)

#define GFX_DISPLAY_BUFFER_LENGTH 0x0004B000ul          // set the display buffer length in bytes (value
                                                        // is derived from width, height and color depth
                                                        // (COLOR_DEPTH)). Size must fit into internal memory

Applications Using External Memory

Settings in Graphics Configuration (GraphicsConfig.h)

Copy Code
// define the color depth to use (8 or 16BPP)
#define COLOR_DEPTH   16

Settings in Hardware Profile (HardwareProfile.h)

Copy Code
/////////////////////////////////////////////////////
// Microchip Specific Development Tools
/////////////////////////////////////////////////////
#define PIC24FJ256DA210_DEV_BOARD                       // to use PIC24FJ256DA210 Development Board
#define GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E    // to use the Truly 3.2" display panel

/////////////////////////////////////////////////////
// PIC24FJ256DA210 Graphics Module required settings
/////////////////////////////////////////////////////
#define GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210           // to use the mchpGfxDrv.c and mchpGfxDrv.h driver

#define GFX_GCLK_DIVIDER 61                             // set divider to generate required GCLK pin
                                                        // frequency (check display panel data sheet)
#define USE_16BIT_PMP                                   // enable the use of EPMP
#define GFX_DISPLAY_BUFFER_START_ADDRESS 0x00020000ul   // set the display buffer starting address
                                                        // (address will be located in external memory)

#define GFX_DISPLAY_BUFFER_LENGTH 0x00025800ul          // set the display buffer length in bytes (value
                                                        // is derived from width, height and color depth
                                                        // (COLOR_DEPTH)). Size must fit into external
                                                        // memory region

#define GFX_EPMP_CS1_BASE_ADDRESS 0x00020000ul          // if using EPMP CS1 set the starting address
                                                        // of EPMP CS1 region
#define GFX_EPMP_CS1_MEMORY_SIZE 0x80000ul              // set the EPMP CS1 region size (in bytes)
                                                        // size defines the number of EPMP Address lines to use

#define GFX_EPMP_CS2_BASE_ADDRESS 0x000A0000ul          // if using EPMP CS2 set the starting address
                                                        // of EPMP CS2 region
#define GFX_EPMP_CS2_MEMORY_SIZE 0x80000ul              // set the EPMP CS2 region size (in bytes)
                                                        // size defines the number of EPMP Address lines to use
Links
Microchip Graphics Controller
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > External or Internal Memory and Palettes


Image Decoders

Contents | Index | Home
Previous | Next
Image Decoders
Demo Project

The Image Decoder Library supports the decoding of images in JPEG, BMP, and GIF format in PIC24, dsPIC, and PIC32 devices. This is a supplement to the Graphics Library but could be used without the Graphics Library. It not only supports input data through the Microchip's MDD file system but it can also be configured to support user specific inputs from ROM, external EEPROM, etc. The output can be sent to the Graphics Display through the driver provided with the Graphics Library or to a callback function where user can further render the decoded image (even if Graphics Library is not used). The individual decoders provided uses the stack for the work memory and hence a heap is not required.

Design

The Image Decoder library includes the following files:

  1. Configuration file
    • ImageDecoderConfig.h
  2. Header files
    • Main Header
      • ImageDecoder.h
    • Individual decoder headers
      • JpegDecoder.h
      • BmpDecoder.h
      • GifDecoder.h
  3. Source files
    • Main Source file
      • ImageDecoder.c
    • Individual Source files
      • JpegDecoder.c
      • BmpDecoder.c
      • GifDecoder.c
  4. Support files
    • jidctint.c

This can be diagrammatically explained as below:

The user application interacts with the Image Decoder Library as per the diagram below:

User can use the Graphics Library for output or can provide his/her own output pixel handler callback function. Similarly, user can use MDD file system or provide his/her own input source which implements some specific APIs explained later.

Configuration

The compile time configurations can be done using the ImageDecoderConfig.h file. This file must be copied into the application folder like the other config files. The options provided are as explained below:

1. Image format support

The image formats which are not required can be compiled out by commenting out the respective defines. The below section says that GIF support to be excluded.

Copy Code
/* Comment out the image formats which are not required */
#define IMG_SUPPORT_BMP
#define IMG_SUPPORT_JPEG
//#define IMG_SUPPORT_GIF

2. Optimize for Graphics Library

If user application requires to output the image directly to the display without any double buffering, then the code can be optimized by defining as below:

Copy Code
/* Comment out if output has to be given through a callback function */
/* If defined, the code is optimized to use only the graphics driver, only 16-bit-565-color-format is supported */
#define IMG_USE_ONLY_565_GRAPHICS_DRIVER_FOR_OUTPUT

If either double buffering has to be done or if user specific rendering has to be done, comment out the above mentioned line and provide a callback function to render the pixel values. The callback function will be explained in the API section. If commented out, then the width and height of the display screen has to be provided using the following defines

Copy Code
/* If the above define is commented out (Graphics driver is not included by default), then the below defines has to be set by the user */
#ifndef IMG_USE_ONLY_565_GRAPHICS_DRIVER_FOR_OUTPUT
        #define DISP_HOR_RESOLUTION       320
        #define DISP_VER_RESOLUTION       240
#endif

3. Optimize for MDD file system

If user application uses only the MDD file system provided by Microchip Technology Inc., the code can be optimized by defining as below:

Copy Code
/* If defined, the code is optimized to use only the MDD file system */
#define IMG_USE_ONLY_MDD_FILE_SYSTEM_FOR_INPUT

If MDD file system is not used or if additional input formats have to be supported, the above define has to be commented out and a structure pointing to the required APIs (IMG_FILE_SYSTEM_API defined in ImageDecoder.h) must be provided by the user.

4. Loop callback support

Since decoder takes up significant amount of time decoding an image and user may want to update some information on the display or to send/receive data through communication channel, etc… it is possible to release processing power in the middle of decoding process by calling a callback function provided by the user. The user can do all the housekeeping activities inside the function. This option can be enabled by defining as below:

Copy Code
/* If defined, the a loop callback function is called in every
   decoding loop so that application can do maintenance activities such as
   getting data, updating display, etc... */
#define IMG_SUPPORT_IMAGE_DECODER_LOOP_CALLBACK

The JPEG decoder calls the callback function after every 8x8 pixel block decode while the BMP and GIF decoders calls after every row decode.

If this support is not required, then this define can be commented out.

Footprint

The following are typical values for PIC24 with default compiler configuration. Actual values may vary with various factors such as compiler optimization levels and device used (PIC24/PIC32).

 | RAM (stack) | ROM (no compiler optimizations) |
Image Decoder Core Code | 30 Bytes | 1 KBytes |
Image Types |  |  | Decode Time (in seconds) Using 16 MIPS & Compiler Optimization Level 3
BMP | 1 KBytes | 10 KBytes | 21
JPEG | 3 KBytes | 13 KBytes | 21
GIF | 11 KBytes(13 KBytes2) | 6 KBytes | 21

(1) Approximate value for average quality image file with a pixel resolution of 320x240. Additional variance in time can be observed due to image quality/image size and file access time.

(2) GIF code "Crush" optimization (GIF_CRUSH_PREV_SYMBOL_PTR_TABLE) is turned off. This compile switch can be found in GifDecoder.h file. Enabling this will have an additional effect on the GIF decoding time.

Demo Project
Name | Description
Image Decoder Demo | This demo demonstrates the decoding of images with JPEG and BMP file formats.
Links
Demo Project
Image Decoders


Image Decoders API

Contents | Index | Home
Previous | Next
Image Decoders API
Functions | Macros | Structures | Topics

The Image Decoder Library distributed with the Graphics Library supports the decoding of images in JPEG, BMP, and GIF format in PIC24, dsPIC, and PIC32 devices. This is a supplement to the Graphics Library but could be used without the Graphics Library. This section describes the APIs for Image Decoder Library.

Functions
Name | Description
ImageDecode | This function decodes and displays the image on the screen
ImageDecoderInit | This function initializes the global variables to 0 and then initializes the driver. This must be called once before any other function of the library is called
ImageLoopCallbackRegister | This function registers the loop callback function so that the decoder calls this function in every decoding loop. This can be used by the application program to do maintainance activities such as fetching data, updating the display, etc...
ImageDecodeTask | This function completes one small part of the image decode function
Macros
Name | Description
ImageFullScreenDecode | This function decodes and displays the image on the screen in fullscreen mode with center aligned and downscaled if required
ImageAbort | This function sets the Image Decoder's Abort flag so that decoding aborts in the next decoding loop.
Structures
Name | Description
_BMPDECODER | DATA STRUCTURES
_GIFDECODER | DATA STRUCTURES
_JPEGDECODER | DATA STRUCTURES
Topics
Name | Description
Image Decoder Configuration | The Image Decoder Library can be customized by adding or specifying the compile time options located in the application file named ImageDecoderConfig.h.
Links
Functions, Legend, Macros, Structures, Topics
Image Decoders API


Image Decoder Configuration

Contents | Index | Home
Previous | Up | Next
Image Decoder Configuration
Macros
Macros
Name | Description
IMG_SUPPORT_BMP | Add this macro in ImageDecoderConfig.h to enable support for bitmap image format decoding.
IMG_SUPPORT_GIF | Add this macro in ImageDecoderConfig.h to enable support for gif image format decoding.
IMG_SUPPORT_JPEG | Add this macro in ImageDecoderConfig.h to enable support for jpeg image format decoding.
IMG_SUPPORT_IMAGE_DECODER_LOOP_CALLBACK | The decoder may takes up significant amount of time decoding an image and user may want to update some information on the display or to send/receive data through some communication channels. It is possible to release processing power in the middle of decoding process by calling a callback function provided by the user. The user should do all the housekeeping activities inside the function. This option can be enabled by adding this macro in ImageDecoderConfig.h.
IMG_USE_ONLY_565_GRAPHICS_DRIVER_FOR_OUTPUT | Add this macro in ImageDecoderConfig.h to optimize code for graphics driver that supports 16-bit 5-6-5 color format and rendering is done directly to the display buffer. If either double buffering has to be done or if user specific rendering has to be done, comment out the above mentioned line and provide a callback function to render the pixel values. The callback function will be explained in the API section. If commented out, then the width and height of the display screen has to be provided using the following defines
IMG_USE_ONLY_MDD_FILE_SYSTEM_FOR_INPUT | Add this macro in ImageDecoderConfig.h to optimize code to use Memory Disk Drive File System(MDDFS) of Microchip MDD File System Interface Library .
Links
Image Decoders API, Macros
Image Decoders API > Image Decoder Configuration


IMG_SUPPORT_BMP Macro

Contents | Index | Home
Previous | Up | Next
IMG_SUPPORT_BMP Macro
C
#define IMG_SUPPORT_BMP
Overview

Add this macro in ImageDecoderConfig.h to enable support for bitmap image format decoding.

Image Decoders API > Image Decoder Configuration > IMG_SUPPORT_BMP Macro


IMG_SUPPORT_GIF Macro

Contents | Index | Home
Previous | Up | Next
IMG_SUPPORT_GIF Macro
C
#define IMG_SUPPORT_GIF
Overview

Add this macro in ImageDecoderConfig.h to enable support for gif image format decoding.

Image Decoders API > Image Decoder Configuration > IMG_SUPPORT_GIF Macro


IMG_SUPPORT_JPEG Macro

Contents | Index | Home
Previous | Up | Next
IMG_SUPPORT_JPEG Macro
C
#define IMG_SUPPORT_JPEG
Overview

Add this macro in ImageDecoderConfig.h to enable support for jpeg image format decoding.

Image Decoders API > Image Decoder Configuration > IMG_SUPPORT_JPEG Macro


IMG_SUPPORT_IMAGE_DECODER_LOOP_CALLBACK Macro

Contents | Index | Home
Previous | Up | Next
IMG_SUPPORT_IMAGE_DECODER_LOOP_CALLBACK Macro
C
#define IMG_SUPPORT_IMAGE_DECODER_LOOP_CALLBACK
Overview

The decoder may takes up significant amount of time decoding an image and user may want to update some information on the display or to send/receive data through some communication channels. It is possible to release processing power in the middle of decoding process by calling a callback function provided by the user. The user should do all the housekeeping activities inside the function. This option can be enabled by adding this macro in ImageDecoderConfig.h.

Image Decoders API > Image Decoder Configuration > IMG_SUPPORT_IMAGE_DECODER_LOOP_CALLBACK Macro


IMG_USE_ONLY_565_GRAPHICS_DRIVER_FOR_OUTPUT Macro

Contents | Index | Home
Previous | Up | Next
IMG_USE_ONLY_565_GRAPHICS_DRIVER_FOR_OUTPUT Macro
C
#define IMG_USE_ONLY_565_GRAPHICS_DRIVER_FOR_OUTPUT
Overview

Add this macro in ImageDecoderConfig.h to optimize code for graphics driver that supports 16-bit 5-6-5 color format and rendering is done directly to the display buffer. If either double buffering has to be done or if user specific rendering has to be done, comment out the above mentioned line and provide a callback function to render the pixel values. The callback function will be explained in the API section. If commented out, then the width and height of the display screen has to be provided using the following defines

Image Decoders API > Image Decoder Configuration > IMG_USE_ONLY_565_GRAPHICS_DRIVER_FOR_OUTPUT Macro


IMG_USE_ONLY_MDD_FILE_SYSTEM_FOR_INPUT Macro

Contents | Index | Home
Previous | Up | Next
IMG_USE_ONLY_MDD_FILE_SYSTEM_FOR_INPUT Macro
C
#define IMG_USE_ONLY_MDD_FILE_SYSTEM_FOR_INPUT
Overview

Add this macro in ImageDecoderConfig.h to optimize code to use Memory Disk Drive File System(MDDFS) of Microchip MDD File System Interface Library .

Image Decoders API > Image Decoder Configuration > IMG_USE_ONLY_MDD_FILE_SYSTEM_FOR_INPUT Macro


ImageDecode Function

Contents | Index | Home
Previous | Up | Next
ImageDecode Function
C
BYTE ImageDecode(
    IMG_FILE * pImageFile,
    IMG_FILE_FORMAT eImgFormat,
    WORD wStartx,
    WORD wStarty,
    WORD wWidth,
    WORD wHeight,
    WORD wFlags,
    IMG_FILE_SYSTEM_API * pFileAPIs,
    IMG_PIXEL_OUTPUT pPixelOutput
);
Overview

This function decodes and displays the image on the screen

Returns

Error code -> 0 means no error

Side Effects

None

Example
void main(void)
{
    IMG_FILE pImageFile;
    IMG_vInitialize();
    pImageFile = IMG_FOPEN("Image.jpg", "r");
    if(pImageFile == NULL)
    {
              <- Error handling ->
    }
    IMG_bDecode(pImageFile, IMG_JPEG, 0, 0, 320, 240, 0, NULL, NULL);
    IMG_FCLOSE(pImageFile);
    while(1);
}
Image Decoders API > ImageDecode Function


ImageDecoderInit Function

Contents | Index | Home
Previous | Up | Next
ImageDecoderInit Function
C
void ImageDecoderInit();
Overview

This function initializes the global variables to 0 and then initializes the driver. This must be called once before any other function of the library is called

Returns

None

Side Effects

The graphics driver will be reset

Example
void main(void)
{
    ImageInit();
    ...
}
Image Decoders API > ImageDecoderInit Function


ImageLoopCallbackRegister Function

Contents | Index | Home
Previous | Up | Next
ImageLoopCallbackRegister Function
C
void ImageLoopCallbackRegister(
    IMG_LOOP_CALLBACK pFn
);
Overview

This function registers the loop callback function so that the decoder calls this function in every decoding loop. This can be used by the application program to do maintainance activities such as fetching data, updating the display, etc...

Returns

None

Side Effects

The graphics driver will be reset

Example
void Mainantance(void)
{
    ...
}

void main(void)
{
    ImageInit();
    ImageLoopCallbackRegister(Mainantance);
    ...
}
Image Decoders API > ImageLoopCallbackRegister Function


ImageDecodeTask Function

Contents | Index | Home
Previous | Up | Next
ImageDecodeTask Function
C
BYTE ImageDecodeTask();
Overview

This function completes one small part of the image decode function

Returns

Status code - '1' means decoding is completed

  • '0' means decoding is not yet completed, call this function again

Side Effects

None

Example
    IMG_bFullScreenDecode(pImageFile, IMG_JPEG, NULL, NULL);
    while(!ImageDecodeTask());
Image Decoders API > ImageDecodeTask Function


ImageFullScreenDecode Macro

Contents | Index | Home
Previous | Up | Next
ImageFullScreenDecode Macro
C
#define ImageFullScreenDecode(pImageFile, eImgFormat, pFileAPIs, pPixelOutput) \
        ImageDecode(pImageFile, eImgFormat, 0, 0, IMG_SCREEN_WIDTH, IMG_SCREEN_HEIGHT, (IMG_ALIGN_CENTER | IMG_DOWN_SCALE), pFileAPIs, pPixelOutput)
Overview

This function decodes and displays the image on the screen in fullscreen mode with center aligned and downscaled if required

Returns

Error code -> 0 means no error

Side Effects

None

Example
void main(void)
{
    IMG_FILE pImageFile;
    IMG_vInitialize();
    pImageFile = IMG_FOPEN("Image.jpg", "r");
    if(pImageFile == NULL)
    {
              <- Error handling ->
    }
    IMG_bFullScreenDecode(pImageFile, IMG_JPEG, NULL, NULL);
    IMG_FCLOSE(pImageFile);
    while(1);
}
Image Decoders API > ImageFullScreenDecode Macro


ImageAbort Macro

Contents | Index | Home
Previous | Up | Next
ImageAbort Macro
C
#define ImageAbort IMG_blAbortImageDecoding = 1;
Overview

This function sets the Image Decoder's Abort flag so that decoding aborts in the next decoding loop.

Returns

None

Side Effects

None

Example
void callback(void);
void main(void)
{
    IMG_FILE pImageFile;
    IMG_vInitialize();
    ImageLoopCallbackRegister(callback);
    pImageFile = IMG_FOPEN("Image.jpg", "r");
    if(pImageFile == NULL)
    {
              <- Error handling ->
    }
    IMG_bFullScreenDecode(pImageFile, IMG_JPEG, NULL, NULL);
    IMG_FCLOSE(pImageFile);
    while(1);
}

void callback(void)
{
    if(<- check for abort condition ->)
    {
        ImageAbort();
    }
}
Image Decoders API > ImageAbort Macro


_BMPDECODER Structure

Contents | Index | Home
Previous | Up | Next
_BMPDECODER Structure
C
struct _BMPDECODER {
  IMG_FILE * pImageFile;
  LONG lWidth;
  LONG lHeight;
  LONG lImageOffset;
  WORD wPaletteEntries;
  BYTE bBitsPerPixel;
  BYTE bHeaderType;
  BYTE blBmMarkerFlag : 1;
  BYTE blCompressionType : 3;
  BYTE bNumOfPlanes : 3;
  BYTE b16bit565flag : 1;
  BYTE aPalette[256][3];
};
Description

DATA STRUCTURES

Members
Members | Description
IMG_FILE * pImageFile; | Image file pointer
BYTE aPalette[256][3]; | Each palette entry has RGB
Image Decoders API > _BMPDECODER Structure


_GIFDECODER Structure

Contents | Index | Home
Previous | Up | Next
_GIFDECODER Structure
C
struct _GIFDECODER {
  IMG_FILE * pImageFile;
  WORD wImageWidth;
  WORD wImageHeight;
  WORD wImageX;
  WORD wImageY;
  WORD wScreenWidth;
  WORD wScreenHeight;
  WORD wGlobalPaletteEntries;
  WORD wLocalPaletteEntries;
  BYTE bBgColorIndex;
  BYTE bPixelAspectRatio;
  BYTE blGifMarkerFlag : 1;
  BYTE blGloabalColorTableFlag : 1;
  BYTE blLocalColorTableFlag : 1;
  BYTE blInterlacedFlag : 1;
  BYTE blFirstcodeFlag : 1;
  BYTE bInterlacePass : 3;
  BYTE aPalette[256][3];
  WORD awPalette[256];
  BYTE abSymbol[4096];
  WORD awPrevSymbolPtr[(4096 * 3)/4];
  WORD wInitialSymbols;
  WORD wMaxSymbol;
  BYTE bInitialSymbolBits;
  BYTE bMaxSymbolBits;
  LONG lGlobalColorTablePos;
  BYTE bWorkBits;
  BYTE bRemainingDataInBlock;
  BYTE bRemainingBits;
  WORD wCurrentX;
  WORD wCurrentY;
};
Description

DATA STRUCTURES

Members
Members | Description
IMG_FILE * pImageFile; | Image file pointer
BYTE aPalette[256][3]; | Each palette entry has RGB
WORD awPalette[256]; | Each palette entry has RGB
BYTE abSymbol[4096]; | For decoding
BYTE bWorkBits; | Work memory
Image Decoders API > _GIFDECODER Structure


_JPEGDECODER Structure

Contents | Index | Home
Previous | Up | Next
_JPEGDECODER Structure
C
struct _JPEGDECODER {
  IMG_FILE * pImageFile;
  BYTE blJFIF;
  BYTE bMajorRev;
  BYTE bMinorRev;
  BYTE bDataBits;
  WORD wWidth;
  WORD wHeight;
  BYTE bChannels;
  BYTE abChannelType[MAX_CHANNELS];
  BYTE abChannelHSampFactor[MAX_CHANNELS];
  BYTE abChannelVSampFactor[MAX_CHANNELS];
  BYTE abChannelQuantTableMap[MAX_CHANNELS];
  BYTE blQuantUses16bits;
  WORD awQuantTable[MAX_CHANNELS][64];
  WORD wRestartInterval;
  BYTE bHuffTables;
  BYTE abHuffAcSymLen[MAX_HUFF_TABLES][16];
  BYTE abHuffAcSymbol[MAX_HUFF_TABLES][256];
  BYTE abHuffDcSymLen[MAX_HUFF_TABLES][16];
  BYTE abHuffDcSymbol[MAX_HUFF_TABLES][16];
  WORD awHuffAcSymStart[MAX_HUFF_TABLES][16];
  WORD awHuffDcSymStart[MAX_HUFF_TABLES][16];
  BYTE abChannelHuffAcTableMap[MAX_CHANNELS];
  BYTE abChannelHuffDcTableMap[MAX_CHANNELS];
  BYTE bError;
  WORD wWorkBits;
  BYTE bBitsAvailable;
  BYTE bBlocksInOnePass;
  SHORT asOneBlock[MAX_BLOCKS][64];
  WORD wBlockNumber;
  BYTE abChannelMap[MAX_BLOCKS];
  BYTE bSubSampleType;
  SHORT asPrevDcValue[MAX_CHANNELS];
  BYTE * pbCurrentHuffSymLenTable;
  BYTE * pbCurrentHuffSymbolTable;
  WORD * pwCurrentHuffSymStartTable;
  WORD * pwCurrentQuantTable;
  BYTE abDataBuffer[MAX_DATA_BUF_LEN];
  WORD wBufferLen;
  WORD wBufferIndex;
  BYTE bFirstBit;
  WORD wPrevX;
  WORD wPrevY;
};
Description

DATA STRUCTURES

Members
Members | Description
IMG_FILE * pImageFile; | Image file pointer
BYTE blJFIF; | JFIF marker found flag
BYTE bMajorRev; | Should be 1
BYTE bMinorRev; | Should be 0-2 but is not a show stopper ------- The x/y densities and thumbnail data are ignored
BYTE bDataBits; | Data precision, can be 8(, 12 or 16)
WORD wWidth; | Width in pixels
WORD wHeight; | Height in pixels
BYTE bChannels; | Number of channels e.g. YCbCr = 3
BYTE blQuantUses16bits; | If flag is set, it is an error as 16 bit is not supported
WORD awQuantTable[MAX_CHANNELS][64]; | Supports only 8 & 16 bit resolutions
WORD wRestartInterval; | The restart interval in blocks
BYTE bHuffTables; | From DHT
BYTE abHuffAcSymLen[MAX_HUFF_TABLES][16]; | Supports only 8 bit resolution
BYTE abHuffAcSymbol[MAX_HUFF_TABLES][256]; | Maximum possible symbols are 256
BYTE abHuffDcSymLen[MAX_HUFF_TABLES][16]; | Supports only 8 bit resolution
BYTE abHuffDcSymbol[MAX_HUFF_TABLES][16]; | Maximum possible symbols are 16 for DC :-)
WORD awHuffAcSymStart[MAX_HUFF_TABLES][16]; | Starting symbol for each length
WORD awHuffDcSymStart[MAX_HUFF_TABLES][16]; | Starting symbol for each length
BYTE abChannelHuffAcTableMap[MAX_CHANNELS]; | From SOS
WORD wWorkBits; | Work memory
SHORT asOneBlock[MAX_BLOCKS][64]; | Temporary storage for a 8x8 block
Image Decoders API > _JPEGDECODER Structure


Miscellaneous Topics

Contents | Index | Home
Previous | Next
Miscellaneous Topics
Topics

This section contains common procedures to start using the library or to modify the library.

Topics
Name | Description
Starting a New Project | This outlines the procedure to create a new project that uses the Microchip Graphics Library from scratch.
Changing the default Font | The library comes with the default font (Gentium 18). This font can be changed in two ways.
Advanced Font Features | Fonts used in the library can be configured to use anti-aliasing and extended glyph support.
Using Primitive Rendering Functions in Blocking and Non-Blocking Modes | Basic rendering functions such as Line(), Rectangle(), Circle() etc are referred to as functions in the Graphics Primitive Layer. These functions can also be implemented in the device driver layer if the display device supports hardware acceleration of the function. Applications that directly calls these functions can take advantage of the hardware accelerated primitives. How these functions are used will depend on the "Configuration Setting".
Using Microchip Graphics Module Color Look Up Table in Applications | Utilizing the Color Look Up Table (CLUT) of the Microchip Graphics Module saves memory for both storage and display buffer. This short instructional manual outlines the procedure to create source code files to use the CLUT of the Microchip Graphics Module and enable the Microchip Graphics Library to use the hardware feature.
Converting Images to Use a Common Palette in GIMP | This manual describes how to convert an image or a set of images to use a common palette in GIMP.
How to Define Colors in your Applications | In most cases, the application will define its own set of colors and not use the default colors that comes with the Graphics Library. This section shows an example on how to do it.
Connecting RGB data bus | Display glasses will require 24 bit or 18 bit RGB color data. How do you do the connection when your display controller only puts out 16 bit RGB data bus?
Adding New Device Driver | This is a summary of the requirements to add a new device driver.
Links
Topics
Miscellaneous Topics


Starting a New Project

Contents | Index | Home
Previous | Up | Next
Starting a New Project

The following is a step by step instruction to create a New Project from scratch with the Microchip Graphics Library

Step 1: Install the Microchip Application Libraries to get the Microchip Graphics Library. The Microchip Application Library installer can be downloaded from [image] www.microchip.com/MLA. Once installed the Microchip Graphics Library files will be located in the directory structure shown below.

Copy Code
 <MyProjects>
    |
    Board Support Package
    Graphics
    GraphicsProjects1
    Microchip
        |
        Help
        Graphics
            |
            Drivers
        Include
            |
            Graphics

  • MyProjects can be any name and is the directory name that you chose when you installed the Microchip Application Libraries.
  • Graphics directory will contain demos distributed with the Graphics Library.
  • Board Support Package directory will contain drivers for components on Microchip Development Boards that are used by the demos.
  • GraphicsProject1 directory can be any directory name that you specify later for your own project.
  • Microchip directory will contain all the library files.
  • Under Microchip directory, the Help directory will contain the "Graphics.chm" file.
  • Under Microchip directory, the Graphics directory under the Microchip directory will contain all the source (C) files for the Graphics Library except the actual display driver files. Under the Drivers directory, all the supported driver files released with the library is located.
  • Under Microchip directory, the Include directory will have another Graphics directory that will contain all the header files for the Graphics Library. All other header files will be located under Microchip/Include directory.

Step 2: Creating the MPLAB project

  1. Open MPLAB Project.
  2. Go to Project tab and select New

  3. New Project dialog box will appear. In this dialog box enter your Project Name and Project Directory. Click OK. Project will be created or prompted to create the directory if your project directory does not exist (refer to figure below).

  4. The MPLAB Project view will appear as soon as the project is created. If it does not appear go to View tab and click Project.

  5. Right click on the Source Files and click Add Files. Browse to MyApplication->Microchip->Graphics directory. Select appropriate c files and click Open. The C files that you select will depend on the application that you will be creating. The following tables shows the minimum files required for each layer of the Graphics Library.

Display Driver Layer |
DisplayDriver.h | Header that contains required APIs for display driver to be compatible with Microchip Graphics Library.
gfxepmp.c gfxepmp.h | Required if using display drivers for external display controller that will use the Enhanced Parallel Master Port (EPMP) for display controller communications.
gfxpmp.h | Required if using display drivers for external display controller that will use the Parallel Master Port (PMP) for display controller communications.
gfxtcon.h | Required if using Microchip supplied display drivers that requires timing controller initialization. If creating your own display controller driver, you may integrate the timing controller initialization into your display driver file.
Display Driver c and h files | These are the display driver files needed. These can be your own created display driver or Microchip supplied display drivers distributed with the Graphics Library.

Primitive Layer |
Primitive.c Primitive.h | These two files implements the Primitive Layer of the Microchip Graphics Library.
Transitions.c Transitions.h Transitions_weak.c | Implements the extended primitive functions for screen transitions. The Screen Transition features are only supported by the Epson driver (S1D13517.c and S1D13517.h) and the PIC24FJ256DA210 driver (mchpGfxDrv.c and mchpGfxDrv.h)

Graphics Object Layer |
GOL.c GOL.h | These two files along with the individual widget files implements the Graphics Object Layer of the Microchip Graphics Library.
GOLFontDefault.c | This is the default font used for the Graphics Object Layer.
GOLSchemeDefault.c | This is the default style scheme used for the Graphics Object Layer.
Widget files (example: Button.c Button.h) | Required files when using the widgets in the Graphics Object Layer.

Configuration |
Graphics.h | Required file that loads the different components of the Graphics Library.
GraphicsConfig.h | Required file to determine the features and modes that are enabled in the Graphics Library.
HardwareProfile.h | Required file when running demos distributed with the Microchip Graphics Library or using drivers distributed in "Board Support Package".

  6. Right click on the Header Files and click Add Files. Browse to MyApplication->Microchip->Include directory. Select GenericTypeDefs.h file and click Open.
  7. Right click on the Header Files and click Add Files. Browse to MyApplication->Microchip->Include->Graphics directory. Select all the h files and click Open. The header files to include will depend on the application as described in 5.

Step 3: Setting the project directories.

  1. In MPLAB Project, go to Project tab and point to Build Options.

  2. A menu will appear showing all your files and the Project option. Select the Project option. The Build Options window will open.
  3. Select the Directories tab.

  4. In the Directories tab, Directories and Search Paths group box and Show directories for: select Include Search Path. Click New.
  5. Click the button with (…) and browse and select your project directory. Click OK. This will add your project directory.

  6. Click New again for each of the following paths:
    1. .
    2. ..\..\Microchip\Include
    3. ..\..\Board Support Package (do this only if you are using the drivers supplied in the "Board Support Package" director_)
  7. Directories and Search Paths group box and Show directories for: select Library Search Path. Click New.
  8. Enter the path to the MPLAB C30 lib. For example: C:\Program Files\Microchip\MPLAB C30\lib. Click OK.

  9. Change from the Directories tab to MPLAB LINK 30 tab. In the Generate Command Line group box enter 3000 in the Heap Size setting.

10. Click Apply and then OK.

Step 4: Create your application files.

  1. In MPLAB Project, select File tab and click New. The file editor will open.
  2. Create your GraphicsConfig.h file. For now add the following lines:

Copy Code
#define USE_NONBLOCKING_CONFIG // Comment this line to use blocking configuration
#define USE_BUTTON             // Enable Button Object.
#define USE_SLIDER             // Enable Slider or Scroll Bar Object.

#define USE_FONT_FLASH         // Support for fonts located in internal flash
#define USE_BITMAP_FLASH       // Support for bitmaps located in internal flash

The file name is important. If the file name is changed, library will not compile properly.

  3. Save the file into your GraphicsProject1 directory.
  4. Similarly, create your application header file code by following steps 1 and 2. For simplicity just use this code for now:

Copy Code
#define SYSCLK 32000000        // 8MHz x 4PLL Oscillator frequency
// includes
#include <p24Fxxxx.h>
#include "GenericTypeDefs.h"
#include "Graphics.h"

  5. Save the file in your GraphicsProject1 directory.
  6. After saving the two header files, add these files to your project.
  7. Create your application code. For simplicity just use this code for now:

Copy Code
#include "GraphicsProject.h"        // header file you saved earlier
// Configuration bits
_CONFIG2(FNOSC_PRIPLL & POSCMOD_XT) // Primary XT OSC with PLL
_CONFIG1(JTAGEN_OFF & FWDTEN_OFF)   // JTAG off, watchdog timer off

int main(void){

    GOL_MSG msg; // GOL message structure to interact with GOL
Copy Code
    GOLInit(); // initialize graphics library &
Copy Code

Copy Code

    BtnCreate( 1,                   // object’s ID
               20, 160, 150, 210,   // object’s dimension
               0,                   // radius of the rounded edge
               BTN_DRAW,            // draw the object after creation
               NULL,                // no bitmap used
               "LEFT",              // use this text
               NULL);               // use alternative style scheme

Copy Code

Copy Code

    BtnCreate( 2,
               170, 160, 300, 210,
               0,
               BTN_DRAW,
               NULL,
               "RIGHT",
               NULL);

Copy Code

Copy Code

    SldCreate(3,                    // object’s ID
              20, 105, 300, 150,    // object’s dimension
              SLD_DRAW,             // draw the object after creation
              100,                  // range
              5,                    // page
              50,                   // initial position
              NULL);                // use default style scheme

Copy Code

    while(1){
        if (GOLDraw()) {            // Draw GOL object
        }
    }
}

WORD GOLMsgCallback(WORD objMsg, OBJ_HEADER* pObj, GOL_MSG* pMsg){
    return 1;
}

WORD GOLDrawCallback(){
    return 1;
}

  8. Save the file in your GraphicsProject1 directory.
    9.

  9. After saving the application file, add the file to your project.
    10.

Step 5 Now build your project. To build go to MPLAB Project tab and click Build All. Notice there will be some warnings that may come out in the build log. This is due to the fact that we have not used most of the Objects. We only used the Slider and Button.

Step 6: Downloading your application - To download your generated code to the Explorer 16 board follow the steps below.

  1. In the MPLAB Programmer tab click Select Programmer.
    2.

  2. Select MPLAB ICD2 or REAL ICE depending on your setup.
    3.

  3. After connection and testing is done go to Programmer tab and click Program.
    4.

Note that you can also do the steps in the Downloading the Demos sub-section in the Getting Started section to download your application to the Explorer 16 board using your generated hex file.

Links

Miscellaneous Topics

Miscellaneous Topics > Starting a New Project


Changing the default Font

Contents | Index | Home
Previous | Up | Next
Changing the default Font

This instructions assumes that you have performed the conversion of your raster font or True Type font into C file. For the conversion of your raster font please see the help file of the Graphics Resource Converter utility that comes with the Graphics Library.

There are two ways to replace the default font in the Graphics Library.

Renaming User Font to GOLFontDefault:

  1. Open the generated font file (generated by the "Graphics Resource Converter" utility) and change the font structure name to GOLFontDefault (see figure below).

  2. Remove the file GOLFONTDefault.c in the project and replace it with your own font file that contains the GOLFontDefault.
  3. Build and test your new font.

Replacing the GOLFontDefault with any user defined fonts

  1. Open the GraphicsConfig.h file and add the following lines:

Copy Code
#define FONTDEFAULT yourFontName

  2. In the project, add the generated font file (generated by the "Graphics Resource Converter" utility).
  3. Build and test your new font.
In this method, GOL.h and GOLFontDefault.c files checks if FONTDEFAULT is defined. If it is, it skips the declaration of the GOLFontDefault and uses the user defined font.

Links
Miscellaneous Topics
Miscellaneous Topics > Changing the default Font


Advanced Font Features

Contents | Index | Home
Previous | Up | Next
Advanced Font Features

Font Anti-Aliasing

Anti-aliasing is a technique used to make the edges of text appear smooth. This is useful especially with characters like 'A', 'O', etc which has slant or curved lines. Since the pixels of the display are arranged in rectangular fashion, slant edges can't be represented smoothly. To make them appear smooth, a pixel adjacent to the pixels is painted with an average of the foreground and background colors as depicted in Figure 1.

Figure 1: Font with Anti-Aliasing

Figure 2: Font with No Anti-Aliasing

When anti-aliasing is turned off, the pixels abruptly changes from background color to foreground color shown in Figure 2. To implement anti-aliasing, adjacent pixels transitions from background to foreground color using 25% or 75% mid-color values from background to foreground colors. This feature in fonts will require roughly twice the size of memory storage required for font glyphs with no anti-aliasing.

Since the average of foreground and background colors needs to be calculated at runtime, the rendering of anti-aliased fonts take more time than rendering normal fonts. To optimize the rendering speed, a macro named GFX_Font_SetAntiAliasType() is available where anti-alias type can be set to ANTIALIAS_OPAQUE or ANTIALIAS_TRANSLUCENT.

  • ANTIALIAS_OPAQUE (default after initialization of graphics) - mid colors are calculated once while rendering each character which is ideal for rendering text over a constant background.
  • ANTIALIAS_TRANSLUCENT - the mid values are calculated for every necessary pixel and this feature is useful while rendering text over an image or on a non-constant color background.
As a result, rendering anti-aliased text takes longer with ANTIALIAS_TRANSLUCENT type than compared to ANTIALIAS_OPAQUE type.

To use anti-aliasing, enable the compiler switch #define USE_ANTIALIASED_FONTS in the GraphicsConfig.h file and enable the anti-alias checkbox in the Graphics Resource Converter (GRC) tool while selecting the font.

Note: Even when anti-aliasing is enabled, normal fonts can be used without the antialias effect.

Extended Glyphs

Extended glyphs are needed to render characters of certain languages which use more than one byte to represent a single character. For example: Asian languages like Thai, Hindi, etc. In these character set, more than one glyph overlaps each other to form a single character of that language as shown in Figure 3. To use this feature, enable the Extended Glyph checkbox in the Graphics Resource Converter (GRC) tool while selecting the font.

Figure 3: Example of a Character that is Formed by Two Overlapping Glyphs

Note: The fonts used with extended glyphs are normal ANSI fonts and not Unicode fonts.

Links
Miscellaneous Topics
Miscellaneous Topics > Advanced Font Features


Using Primitive Rendering Functions in Blocking and Non-Blocking Modes

Contents | Index | Home
Previous | Up | Next
Using Primitive Rendering Functions in Blocking and Non-Blocking Modes

All primitive rendering functions returns a status.

  • 0 – when the primitive was not successfully rendered
  • 1 – when the primitive was successfully rendered
When using Graphics Library you can enable the non-blocking mode when calling drawing/rendering functions. This is done by adding this line in your GraphicsConfig.h file:

Copy Code
#define USE_NONBLOCKING_CONFIG // Comment this line to use blocking configuration

When using a display controller with hardware accelerated primitives (like SSD1926 which is on the Graphics PICtail™ Plus Board Version 3 (AC164127-3) faster primitive rendering on Line(), Rectangle() and Bar() functions will be performed. Compiling with the Blocking or Non-Blocking mode set will still use the accelerated primitives but the application code directly calling the primitive functions will have to be coded accordingly.

To explain the two modes when directly calling the primitive functions please take a look at the example below.

Case 1: USE_NONBLOCKING_CONFIG disabled

Copy Code
// all primitives are blocking calls
Line(a,b);
Rectangle(c,d,e,f);
Bar(c+2, d+2, e-2, f-2)

Case 2: USE_NONBLOCKING_CONFIG enabled

Copy Code
// all primitives are non-blocking calls
while(!Line(a,b));
while(!Rectangle(c,d,e,f));
while(!Bar(c+2, d+2, e-2, f-2));

If the while check is not in place, it possible that the only primitive that you will see in the screen is the Line().

For case 2, one can also be creative in the application code and implement some form of non-blocking scheme and make use of the time while waiting for the primitives to render.

Another example for case 2:

Copy Code
WORD DrawMyFigure(a, b, c, d, e, f)
{
    typedef enum {
       DRAW_LINE,
       DRAW_RECT,
       DRAW_BAR,
} DRAW_MYFIGURE_STATES;
static DRAW_MYFIGURE_STATES state = DRAW_LINE;

    if(IsDeviceBusy()) // checks if the hardware is still busy
        return 0;

    switch(state){
        case DRAW_LINE:
            if (!Line(a, b))
                return 0;
            state = DRAW_RECT;
        case DRAW_RECT:
            if(!Rectangle(c,d,e,f))
                return 0;
            state = DRAW_BAR;
        case DRAW_BAR:
            if(!Bar(c+2, d+2, e-2, f-2));
                return 0;
            state = DRAW_LINE;
            return 1;
    }
}

This non-blocking code can be used in the application and the application can do other tasks whenever DrawMyFigure() returns 0. Application should call DrawMyFigure() again until it return a 1 signifying that the Line, Rectangle and Bar were drawn successfully.

Links
Miscellaneous Topics
Miscellaneous Topics > Using Primitive Rendering Functions in Blocking and Non-Blocking Modes


Using Microchip Graphics Module Color Look Up Table in Applications

Contents | Index | Home
Previous | Up | Next
Using Microchip Graphics Module Color Look Up Table in Applications

Apart from regular RGB scheme of representing colors, colors may also be represented using a Color Look Up Table (CLUT) also called Palette table, where there is a table of colors and the color is specified by the index of the table. Depending on the size of the table, the bits used to represent the index will vary. For example 256 entries of RGB (8 bit index), 16 entries of RGB (4 bit index), 4 entries of RGB (2 bit index) and 2 entries of RGB (1 bit index). This scheme is mainly used to save memory. See Figure-1 for an example of 16-entry (4-bit) CLUT where a shade of Green is represented by an index value of 3 consuming 4-bits. To figure the memory requirement for a give screen size at a color depth, bits per pixel, the follow equations is used: total number of pixels x bits per pixel / 8 bits per byte. For example the memory required for a 320x240 with 16 BPP screen; (320 x 240) x (16 / 8) = 153,600 Bytes. If only 16 different colors are used in the screen, then instead of using raw RGB, a 16-entry (4-bit) CLUT may be used requiring a memory of (320 x 240) x (4/8) = 38,400 bytes; thereby saving 75% of memory.

Figure 1. A 16-Entry (4-bit) Color Look Up Table

If the display driver hardware supports CLUT, the index values are translated to the RGB values by the hardware automatically when the signals are sent out to the display.

If the CLUT is enabled, since a CLUT affects the whole screen, all the color patterns like basic shapes and images which are displayed on the screen must use the same CLUT. It means that color defines like RED, GREEN, etc… must use the index values instead of the absolute RGB values. The bitmap images used must also use the same CLUT in order to appear properly on the screen. Note that the chosen CLUT length (1, 4, 16, or 256) must accommodate all the different colors needed by a screen. The following section explains how to create such a CLUT for a screen.

Creating CLUT

Creating CLUT has 2 steps:

  1. Creating a part of CLUT manually.
  2. Filling the remaining part with the colors of the images used.
  3. Using the Graphics Resource Converter to generate a CLUt based on the images to convert.
Creating a part of CLUT manually - Since users need to select specific colors for the shapes and the widgets, they must enter these specific colors in the CLUT. This can be done by manually creating a new CLUT table using a text editor. Create a text file and save it with a .gpl extension with the form:

Copy Code
GIMP Palette
Name: 16_colors
Columns: 4
#
  0   0   0    BLACK
  0   0   128  BLUE
  128 0   0    RED
  0   0   0    Unused
  0   0   0    Unused

The second line specifies the name of the palette which must be unique. The palette table data starts with line 5 which represent index 0 with the RGB values and a caption. The number of such data lines must be equal to the length of the CLUT. In the example, only 3 colors are used.

Filling the remaining part with the colors of the images used - Suppose 256 entries CLUT is being used, since 3 colors are manually set, only 256 – 3 = 253 entries are available for the images to be displayed on the same screen. If more than one image is used on the screen, it further implies that

  • All images on the screen must use the same CLUT table.
  • Different colors used for all the images along with the fixed colors must not exceed the size of the CLUT table being used.
If the source images are of RGB type, they must be converted into CLUT based images. This can be done using free PC tools like GIMP (www.gimp.org).

The following steps shows how to convert the images using GIMP:

Step 1:

Create a new image with sufficient size to paste all the images required on the screen using File->New in the GIMP (see Figure-2).

Figure 2. Creating New File in GIMP

Step 2:

Copy and paste all the images to be displayed on the screen into this image like in Figure 3. If 256 colors is enough for the entire application, a single CLUT can be used. If not multiple CLUT can be used. Each CLUT can be configured to use one or more screens. In this case, switching from one screen to another may require re-initializing the hardware CLUT entries before the screen is displayed.

Figure 3. Images Used in One Screen

Step 3:

Set the mode to CLUT by selecting Image->Mode->Indexed in the GIMP. Select to generate optimum palette with 256 – 3 = 253 entries (because we already have 3 fixed entries) as shown in Figure 4 and save it as a BMP (e.g. Collage.bmp) image by selecting File->SaveAs menu.

Figure 4. Generate a Palette Table (CLUT)

Step 4:

The next step is to extract the CLUT from the generated image. To do that, go to the palette selection mode by selecting Image->Mode->RGB and then again Image->Mode->Indexed. Select Use Custom Palette and open the palette selection dialog as shown in Figure 5 and import the previously saved bitmap image (Collage.bmp) as shown in Figure 6 and Figure 7. The palette file will be created in the [Home Folder]\.gimp-x.y\palettes folder as a *.gpl file.

Figure 5. Palette Selection Dialog

Figure 6. Import Palette Dialog

Figure 7. Import Collage Bitmap

Step 5:

Manually edit this and add the fixed color entries from the previously stored fixed palette file. (Manual step). Now a master palette file is created which has to be used in the application.

Step 6:

Open individual images in GIMP and apply this master palette to all of them through Image->Mode->Indexed and selecting Use Custom Palette. Select the master palette which was generated and save the images. This will make all the images palette ready.

Step 7:

The next step is to convert this Palette.gpl and the images into the format recognizable by the Microchip Graphics Library. Start the Microchip’s Graphics Resource Converter tool and enable the C30 Build (palette support is currently on selected PIC24F devices only) mode as shown in Figure 8. Open the master palette file previously generated by pressing Add Palette button and save it as a .c file (for storing in internal flash) or as a .hex file (for storing in external memory) similar to bitmap or font conversion as shown in Figure 10.

Figure 8. Load Palette

Figure 9. Convert Palette

Step 8:

Convert all the palette ready images to C file (*.c) or Hex file (*.hex) by pressing the Add Images button.

Step 9:

Import the palette with the extern statement like in “extern const PALETTE_FLASH _GOL_Palette_Demo;” in the application. See MainDemo.c in “Graphics Object Layer Palette Demo”. Set the palette using the APIs SetPaletteBpp() and SetPalette() and then enable the palette using the API EnablePalette() as shown in the below code example.

Copy Code
GOLInit();
SetPaletteBpp(8);
SetPalette((void*)&_GOL_Palette_Demo, 0, 256);
EnablePalette();

Step 10:

Import the images as usual and use them after setting and enabling the palette.

See “Graphics Object Layer Palette Demo” as a practical example.

Using the Graphis Resource Converter to generate a CLUT based on the images to convert - The Graphics Resource Converter will generate a CLUT based on the images to be converted. Please refer to the Graphics Resource Converter help file for more information.

Links
Miscellaneous Topics
Miscellaneous Topics > Using Microchip Graphics Module Color Look Up Table in Applications


Converting Images to Use a Common Palette in GIMP

Contents | Index | Home
Previous | Up | Next
Converting Images to Use a Common Palette in GIMP

INTRODUCTION

Some controllers have predefined palettes associated with them. The palette’s colors can not be altered. When converting images, it is desired to have the images use the controller’s predefined color palette. For example, a controller may have a grayscale palette of 16 colors. An image may use a palette of 16 grayscale colors, but the palette may define grayscale colors that are not the same as the controller’s palette. By using the GNU Image Manipulation Program, GIMP, images can be converted using a palette matching the grayscale colors of the controller. After converting the image to use this palette, it can be converted by the Graphics Resource Converter, GRC, to be used by Microchip’s Graphics Library.

DOWNLOADS

The following are helpful websites for downloaded the tools and firmware needed:

  • GIMP 2.6 – GNU Image Manipulation Program ( [image] www.gimp.org)
  • Graphics Library – This library is part of the Microchip Application Libraries ( [image] www.microchip.com/mla)

CONVERTING AN IMAGE

Follow these steps to convert an image to use a predefined color palette (for this example, that palette will be a 16 grayscale colors):

  1. Open the GIMP application.
  2. Load the image. FILE->Open
    • If the image is not a Bitmap, you will need to save it as one.
      1. FILE-Save as…
      2. Choose the Select File Type (By Extension)
      3. Select Windows BMP Image
      4. Select Save
      5. Select Save under the Save as BMP dialog
  3. Select WINDOWS->Dockable Dialogs->Palettes
    • The Palette Dialog will appear.
  4. In the Palette Dialog Select Import Palette.
    • The Import Palette Dialog will appear.
  5. Select the Palette file radio button.
    • Select the palette file .gpl (For example: Grayscale-Palette-4bpp.gpl)
  6. Select the Import button.
    • The palette, Grayscale-Palette-4bpp, will show up in the Palette Dialog.
  7. Select IMAGE->Mode->Indexed…
  8. In the Indexed Color Conversion dialog, select the Use custom palette radio button
    • Type Grayscale Palette 4bpp to use this palette.
    • Select Convert
  9. The image will now be converted using a 16 grayscale color palette.
  10. Save the image as a Bitmap.

This image can now be converted by the GRC for use with the Microchip Graphics Library.

Here is an example of a palette file *.gpl (Grayscale-Palette-4bpp.gpl)

Copy Code
GIMP Palette
Name: Greyscale Palette 4bpp
Columns: 0
#
  0   0   0    BLACK
 17  17  17    Untitled
 34  34  34    Untitled
 51  51  51    Untitled
 68  68  68    Untitled
 85  85  85    Untitled
102 102 102    Untitled
119 119 119    Untitled
136 136 136    Untitled
153 153 153    Untitled
170 170 170    Untitled
187 187 187    Untitled
204 204 204    Untitled
221 221 221    Untitled
238 238 238    Untitled
255 255 255    WHITE
Links
Miscellaneous Topics
Miscellaneous Topics > Converting Images to Use a Common Palette in GIMP


How to Define Colors in your Applications

Contents | Index | Home
Previous | Up | Next
How to Define Colors in your Applications

To override or define a new set of colors follow this steps:

  1. Create a new color header file. The color values and data types will depend on the GFX_COLOR type used. This data type is defined by the COLOR_DEPTH macro. See COLOR_DEPTH for details.
  2. In the application code, include the created color header file ahead of the #include "Graphics/Graphics.h". When Graphics.h includes the gfxcolors.h it will ignore color macros that has been defined already in the new color header file.
In the GOL Palette Demo, there is an example on how it is done. In that project there is a file in the application (or project directory) named PaletteColorDefines.h. This file contains all the color definition used in the demo. The main header file of the demo (Main.h) includes the PaletteColorDefines.h file ahead of the Graphics Library header files. Since the PaletteColorDefines.h declared the color values, the macros redefined in gfxcolors.h will be ignored. How is this done? If you look at the gfxcolors.h file you will notice that all colors defined have a check (for example BLACK):

#ifndef BLACK

#define BLACK 0

#endif

So if BLACK is defined previously, the definition in gfxcolors.h will not take effect.

Links
Miscellaneous Topics
Miscellaneous Topics > How to Define Colors in your Applications


Connecting RGB data bus

Contents | Index | Home
Previous | Up | Next
Connecting RGB data bus

To connect the 16-bit RGB data bus to a 24-bit or 18-bit RGB data bus of a display glass follow the recommended connection to evenly spread the color coverage.

16-bit (5-6-5) RGB Display Controller Data Bus | 18-bit (6-6-6) RGB Display Data Bus | 24-bit (8-8-8) RGB Display Data Bus
Red[4:0] |  |
Controller Red[4:0] | Display Red[5:1] | Display Red[7:3]
Controller Red[4] | Display Red[0] | Display Red[2:0]
Green[4:0] |  |
Controller Green[5:0] | Display Green[5:0] | Display Green[7:2]
Controller Green[5] | Display Green[5] | Display Green[1:0]
Blue[4:0] |  |
Controller Blue[4:0] | Display Blue[5:1] | Display Blue[7:3]
Controller Blue[4] | Display Blue[0] | Display Blue[2:0]

To illustrate the connection take the Red for example:

To connect the Display Controller Red Data Bus to the Red data bus of a RGB Glass with 18 bit color data bus.

Connect the 5 Red signals from the display controller to the most significant bits of the glass red signals.

Controller Red[4:0] -> Display Red[5:1]

The remaining Display Red[0] signal will be connected to the most significant bit of the display controller red.

Controller Red[4] -> Display Red[0]

To connect the Display Controller Red Data Bus to the Red data bus of a RGB Glass with 24 bit color data bus.

Connect the 5 Red signals from the display controller to the most significant bits of the glass red signals.

Controller Red[4:0] -> Display Red[7:3]

The remaining Display Red[2:0] signals will be connected to the most significant bit of the display controller red.

Controller Red[4] -> Display Red[2]

Controller Red[4] -> Display Red[1]

Controller Red[4] -> Display Red[0]

Doing this spreads out the color coverage while at the same time pure black and pure white colors are achieved.

Links
Miscellaneous Topics
Miscellaneous Topics > Connecting RGB data bus


Adding New Device Driver

Contents | Index | Home
Previous | Up | Next
Adding New Device Driver

Adding a new display device driver requires the following functions and macros to be implemented. Please refer to the API section of the Device Driver Layer for details.

Function/Macro | Description
ResetDevice() | Initializes the display device.
GetMaxX() | Returns the maximum x-coordinate for the display.
GetMaxY() | Returns the maximum y-coordinate for the display.
SetColor() | Sets the current drawing color.
GetColor() | Returns the current drawing color.
SetActivePage() | Sets the current active graphic page (optional).
SetVisualPage() | Sets the current visual graphic page (optional).
PutPixel() | Modifies pixel on the screen.
GetPixel() | Returns the pixel color.
PutImage() | Renders an image on the screen. This function is dependent on the color format used.
SetClipRgn() | Set the current clipping region borders.
GetClipLeft(), GetClipTop(), GetClipRight(), GetClipBottom() | Returns the left, top, right and bottom clipping borders.
SetClip() | Enables or disables the clipping region.
IsDeviceBusy() | Checks if the display controller is busy executing the previous rendering operation.
SetPalette() | Sets the palette register of the device.

Adding new Display Device Drivers

The DisplayDriver.h file should be used as a guide to make your new driver compatible with the Microchip Graphics Library. All the API's defined in this header file are required functions to be implemented in the driver. There are portions of that file that states optional functions. These functions are not needed to interface to the Graphics Library. These are only implemented if the display controller used has hardware features that can implement these functions.

The best way to implement this is to try to find the nearest existing driver and modify the C and H files. Most graphics controllers has a lot of control registers to be initialized. Values programmed into the registers depends on the specification of the LCD glass used. If LCD module has a built-in graphics controller, initialization code for the glass can be found in the LCD specifications or get this information from the manufacturer.

Links
Miscellaneous Topics
Miscellaneous Topics > Adding New Device Driver


References

Contents | Index | Home
Previous
References

  1. " [image] MPLAB C32 C COMPILER USER'S GUIDE" (DS51686), Microchip Technology Incorporated.
  2. " [image] MPLAB C COMPILER FOR PIC24 MCUs AND dsPIC DSCs USER'S GUIDE" (DS51284), Microchip Technology Incorporated.
  3. Microchip Application Note [image] AN1136, “How to Use Widgets in Microchip Graphics Library” (DS01136), Microchip Technology Incorporated.
  4. Microchip Application Note [image] AN1182, “Fonts in the Microchip Graphics Library” (DS01182), Microchip Technology Incorporated.
  5. Microchip Application Note [image] AN1227, “Using a Keyboard with the Microchip Graphics Library” (DS01227), Microchip Technology Incorporated.
  6. Microchip Application Note [image] AN1246, “How to Create Widgets in Microchip Graphics Library” (DS01246), Microchip Technology Incorporated.
  7. HIF 2131 – Designing with Microchip Graphics Library, Microchip Regional Training Center web site ( [image] www.microchip.com/rtc).

References


Topics

Contents | Index | Home
Topics
Microchip Graphics Controller
Topics
Name | Description
Rectangle Copy Operations | The following APIs are used move blocks of data from one memory location to another.
Double Buffering | In the Microchip Graphics Library, if double-buffering is enabled, the frame buffer and draw buffer are exchanged after the changes of all the widgets on a screen are done (i.e., the new screen appears after the whole screen is updated and not after updating an individual widget).
Decompressing DEFLATEd data | The Microchip Graphics Controller features a decompression module for data compressed using the DEFLATE algorithm. Compressed data are limited to fixed huffman codes. Compressed data with dynamic huffman codes are not supported.
Palette Mode | The Microchip Graphics Controller features a palette mode for a smaller frame buffer requirement. This option uses the built-in 256 entry Color Look-up Table (CLUT) to represent pixels from the display buffer in memory. If the CLUT is enabled, each pixel in the display buffer is assumed to contain the color index. This color index is used as the address of the CLUT entry that contains the color value that will be used for the given pixel.
Set Up Display Interface |
External or Internal Memory and Palettes | This section shows examples on how to set up applications using external memory, internal memory or use palettes for Microchip Graphics Module.
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller


Topics

Contents | Index | Home
Topics
Advanced Display Driver Features
Topics
Name | Description
Alpha Blending | The following APIs are used to implement alpha blending features in the Epson S1D13517 Controller.
Transitions | This section describes screen transition effect when changing screens.
Microchip Graphics Controller | This is the generic display driver is intended for the Microchip Graphics Controller Module implemented in PIC24F device family. This driver will drive TFT, CSTN and STN displays.
Library API > Display Device Driver Layer API > Advanced Display Driver Features


Advanced Font Features Selection Macros

Contents | Index | Home
Advanced Font Features Selection Macros
Advanced Font Features Selection
Macros
Name | Description
USE_ANTIALIASED_FONTS | To enable support for Anti-aliased fonts. Use this feature if the font table generated through the "Graphics Resource Converter" tool has the anti-aliasing enabled. Define this in GraphicsConfig.h
Library API > Graphics Library Configuration > Graphics Primitive Layer Configuration > Advanced Font Features Selection


Topics

Contents | Index | Home
Topics
Miscellaneous Topics
Topics
Name | Description
Starting a New Project | This outlines the procedure to create a new project that uses the Microchip Graphics Library from scratch.
Changing the default Font | The library comes with the default font (Gentium 18). This font can be changed in two ways.
Advanced Font Features | Fonts used in the library can be configured to use anti-aliasing and extended glyph support.
Using Primitive Rendering Functions in Blocking and Non-Blocking Modes | Basic rendering functions such as Line(), Rectangle(), Circle() etc are referred to as functions in the Graphics Primitive Layer. These functions can also be implemented in the device driver layer if the display device supports hardware acceleration of the function. Applications that directly calls these functions can take advantage of the hardware accelerated primitives. How these functions are used will depend on the "Configuration Setting".
Using Microchip Graphics Module Color Look Up Table in Applications | Utilizing the Color Look Up Table (CLUT) of the Microchip Graphics Module saves memory for both storage and display buffer. This short instructional manual outlines the procedure to create source code files to use the CLUT of the Microchip Graphics Module and enable the Microchip Graphics Library to use the hardware feature.
Converting Images to Use a Common Palette in GIMP | This manual describes how to convert an image or a set of images to use a common palette in GIMP.
How to Define Colors in your Applications | In most cases, the application will define its own set of colors and not use the default colors that comes with the Graphics Library. This section shows an example on how to do it.
Connecting RGB data bus | Display glasses will require 24 bit or 18 bit RGB color data. How do you do the connection when your display controller only puts out 16 bit RGB data bus?
Adding New Device Driver | This is a summary of the requirements to add a new device driver.
Miscellaneous Topics


Alpha Blending Functions

Contents | Index | Home
Alpha Blending Functions
Alpha Blending
Functions
Name | Description
AlphaBlendWindow | This alphablends a foreground and a background stored in frames to a destination window. The function uses windows insides frames. Each window shares the same width and height parameters.
GFXGetPageOriginAddress | This function calculates the address of a certain 0,0 location of a page in memory
GFXGetPageXYAddress | This function calculates the address of a certain x,y location in memory
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Alpha Blending


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Alpha Blending


Legend

Contents | Index | Home
Legend
Alpha Blending
Legend
Method
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Alpha Blending


Analog Clock Functions

Contents | Index | Home
Analog Clock Functions
Analog Clock
Functions
Name | Description
AcCreate | This function creates an Analog Clock object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
AcDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set.
AcSetHour | Sets the hour value of the analog clock.
AcSetMinute | Sets the minute value of the analog clock.
AcSetSecond | Sets the second value of the analog clock.
Library API > Graphics Object Layer API > GOL Objects > Analog Clock


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Analog Clock


Legend

Contents | Index | Home
Legend
Analog Clock
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Analog Clock


Analog Clock Structures

Contents | Index | Home
Analog Clock Structures
Analog Clock
Structures
Name
Description
ANALOGCLOCK
Defines the parameters required for a clock Object. The following relationships of the parameters determines the general shape of the clock:
  1. centerx and centery determine the middle of the clock.
  2. radius defines the radius of the clock.
  4. *pBitmap points to the background image for the analog clock.
Library API > Graphics Object Layer API > GOL Objects > Analog Clock


Topics

Contents | Index | Home
Topics
Analog Clock
Topics
Name | Description
Analog Clock States | List of Analog Clock bit states.
Library API > Graphics Object Layer API > GOL Objects > Analog Clock


Analog Clock States Macros

Contents | Index | Home
Analog Clock States Macros
Analog Clock States
Macros
Name | Description
AC_DRAW | Bit to indicate button must be redrawn.
AC_DISABLED | Bit for disabled state.
AC_HIDE | Bit to indicate button must be removed from screen.
AC_PRESSED | Bit for press state.
AC_TICK | Bit to tick second hand
UPDATE_HOUR | Bit to indicate hour hand must be redrawn
UPDATE_MINUTE | Bit to indicate minute hand must be redrawn
UPDATE_SECOND | Bit to indicate minute hand must be redrawn
Library API > Graphics Object Layer API > GOL Objects > Analog Clock > Analog Clock States


Anti-Alias Type Macros

Contents | Index | Home
Anti-Alias Type Macros
Anti-Alias Type
Macros
Name | Description
ANTIALIAS_OPAQUE | Mid colors are calculated only once while rendering each character. This is ideal for rendering text over a constant background.
ANTIALIAS_TRANSLUCENT | Mid values are calculated for every necessary pixel. This feature is useful when rendering text over an image or when the background is not one flat color.
Library API > Graphics Primitive Layer API > Text Functions > Anti-Alias Type


Bitmap Functions Functions

Contents | Index | Home
Bitmap Functions Functions
Bitmap Functions
Functions
Name | Description
PutImage | This function outputs image starting from left,top coordinates.
GetImageHeight | This function returns the image height.
GetImageWidth | This function returns the image width.
Library API > Graphics Primitive Layer API > Bitmap Functions


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Primitive Layer API > Bitmap Functions


Legend

Contents | Index | Home
Legend
Bitmap Functions
Legend
Method
Library API > Graphics Primitive Layer API > Bitmap Functions


Bitmap Functions Structures

Contents | Index | Home
Bitmap Functions Structures
Bitmap Functions
Structures
Name | Description
BITMAP_HEADER | Structure describing the bitmap header.
Library API > Graphics Primitive Layer API > Bitmap Functions


Topics

Contents | Index | Home
Topics
Bitmap Functions
Topics
Name | Description
Bitmap Settings | Bitmap rendering settings.
Bitmap Source | Bitmap data structure is dependent on the location.
Library API > Graphics Primitive Layer API > Bitmap Functions


Bitmap Settings Macros

Contents | Index | Home
Bitmap Settings Macros
Bitmap Settings
Macros
Name | Description
IMAGE_NORMAL | Normal image stretch code
IMAGE_X2 | Stretched image stretch code
Library API > Graphics Primitive Layer API > Bitmap Functions > Bitmap Settings


Image Source Selection Macros

Contents | Index | Home
Image Source Selection Macros
Image Source Selection
Macros
Name
Description
USE_BITMAP_FLASH
Similar to Font data bitmaps can also be placed in two locations. One is in FLASH memory and the other is from external memory. Definining one or both enables the support for bitmaps located in internal flash and external memory. Define this in GraphicsConfig.h
  • USE_BITMAP_FLASH - Images located in internal flash memory.
  • USE_BITMAP_EXTERNAL - Images located in external memory (including external memory mapped to EDS)..
USE_BITMAP_EXTERNAL
Similar to Font data bitmaps can also be placed in two locations. One is in FLASH memory and the other is from external memory. Definining one or both enables the support for bitmaps located in internal flash and external memory. Define this in GraphicsConfig.h
  • USE_BITMAP_FLASH - Images located in internal flash memory.
  • USE_BITMAP_EXTERNAL - Images located in external memory (including external memory mapped to EDS)..
Library API > Graphics Library Configuration > Application Configuration > Image Source Selection


Button Functions

Contents | Index | Home
Button Functions
Button
Functions
Name | Description
BtnCreate | This function creates a BUTTON object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
BtnDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. The text on the face of the button is drawn on top of the bitmap. Text is always rendered centered on the face of the button. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid... more
BtnSetText | This function sets the string used for the object.
BtnMsgDefault | This function performs the actual state change based on the translated message given. The following state changes are supported:
BtnTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Library API > Graphics Object Layer API > GOL Objects > Button


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Button


Legend

Contents | Index | Home
Legend
Button
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Button


Button Macros

Contents | Index | Home
Button Macros
Button
Macros
Name | Description
BtnGetText | This macro returns the address of the current text string used for the object.
BtnGetBitmap | This macro returns the location of the currently used bitmap for the object.
BtnSetBitmap | This macro sets the bitmap used in the object. The size of the bitmap must match the face of the button.
Library API > Graphics Object Layer API > GOL Objects > Button


Button Structures

Contents | Index | Home
Button Structures
Button
Structures
Name
Description
BUTTON
Defines the parameters required for a button Object. The following relationships of the parameters determines the general shape of the button:
  1. Width is determined by right - left.
  2. Height is determined by top - bottom.
  3. Radius - specifies if the button will have a rounded edge. If zero then the button will have sharp (cornered) edge.
  4. If 2*radius = height = width, the button is a circular button.
Library API > Graphics Object Layer API > GOL Objects > Button


Topics

Contents | Index | Home
Topics
Button
Topics
Name | Description
Button States | List of Button bit states.
Library API > Graphics Object Layer API > GOL Objects > Button


Button States Macros

Contents | Index | Home
Button States Macros
Button States
Macros
Name | Description
BTN_DISABLED | Bit for disabled state.
BTN_DRAW | Bit to indicate button must be redrawn.
BTN_DRAW_FOCUS | Bit to indicate focus must be redrawn.
BTN_FOCUSED | Bit for focus state.
BTN_HIDE | Bit to indicate button must be removed from screen.
BTN_PRESSED | Bit for press state.
BTN_TEXTBOTTOM | Bit to indicate text is top aligned.
BTN_TEXTLEFT | Bit to indicate text is left aligned.
BTN_TEXTRIGHT | Bit to indicate text is right aligned.
BTN_TEXTTOP | Bit to indicate text is bottom aligned.
BTN_TOGGLE | Bit to indicate button will have a toggle behavior.
BTN_TWOTONE | Bit to indicate the button is a two tone type.
BTN_NOPANEL | Bit to indicate the button will be drawn without a panel (for faster drawing when the button image used is larger than the button panel).
Library API > Graphics Object Layer API > GOL Objects > Button > Button States


Chart Functions

Contents | Index | Home
Chart Functions
Chart
Functions
Name | Description
ChCreate | This function creates a CHART object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
ChDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. The colors of the bars of the bar chart or sectors of the pie chart can be the default color table or user defined color table set by ChSetColorTable() function. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is... more
ChAddDataSeries | This function creates a DATASERIES object and populates the structure with the given parameters.
ChRemoveDataSeries | This function removes DATASERIES object from the list of DATASERIES objects and frees the memory used of that removed object. The position of the object to be removed is specified by the number parameter. If the list has only one member, it removes the member regardless of the number given.
ChSetValueRange | This function sets the minimum and maximum range of values that the bar chart will show. The criteria is that min <= max.
ChSetPercentRange | This function sets the minimum and maximum range of percentage that the bar chart will show. The criteria is that min <= max. This affects bar charts only and CH_PERCENTAGE bit state is set.
ChSetSampleRange | This function sets the sample start and sample end when drawing the chart. Together with the data series' SHOW_DATA flags the different way of displaying the chart data is achieved.
ChFreeDataSeries | This function removes DATASERIES object from the list of DATASERIES objects and frees the memory used of that removed object.
ChTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Library API > Graphics Object Layer API > GOL Objects > Chart


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Chart


Legend

Contents | Index | Home
Legend
Chart
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Chart


Chart Macros

Contents | Index | Home
Chart Macros
Chart
Macros
Name | Description
ChShowSeries | This macro sets the specified data series number show flag to be set to SHOW_DATA.
ChHideSeries | This macro sets the specified data series number show flag to be set to HIDE_DATA.
ChGetShowSeriesCount | This macro shows the number of data series that has its show flag set to SHOW_DATA
ChGetShowSeriesStatus | This macro returns the show ID status of the DATASERIES.
ChSetValueLabel | This macro sets the address of the current text string used for the value axis label of the bar chart.
ChGetValueLabel | This macro returns the address of the current text string used for the value axis label of the bar chart.
ChGetValueMax | This macro returns the current maximum value that will be drawn for bar charts.
ChGetValueMin | This macro returns the current minimum value that will be drawn for bar charts.
ChGetValueRange | This macro gets the current range for bar charts. The value returned is calculated from the current (valMax - valMin) set. To get the minimum use ChGetValueMin() and to get the maximum use ChGetValueMax().
ChSetSampleLabel | This macro sets the address of the current text string used for the sample axis label of the bar chart.
ChGetSampleLabel | This macro returns the address of the current text string used for the sample axis label of the bar chart.
ChGetSampleStart | This macro returns the sampling start value.
ChGetSampleEnd | This macro returns the sampling end value.
ChGetPercentRange | This macro gets the percentage range for bar charts. The value returned is calculated from percentage max - min. To get the minimum use ChGetPercentMin() and to get the maximum use ChGetPercentMax().
ChGetSampleRange | This macro gets the sample range for pie or bar charts. The value returned is calculated from smplEnd - smplStart.
ChGetPercentMax | This macro returns the current maximum value of the percentage range that will be drawn for bar charts when CH_PERCENTAGE bit state is set.
ChGetPercentMin | This macro returns the current minimum value of the percentage range that will be drawn for bar charts when CH_PERCENTAGE bit state is set.
ChSetColorTable | This macro sets the color table used to draw the data in pie and bar charts.
ChGetColorTable | This macro returns the current color table used for the pie and bar charts.
ChSetTitle | This macro sets the address of the current text string used for the title of the chart.
ChGetTitle | This macro returns the address of the current text string used for the title of the chart.
ChSetTitleFont | This macro sets the location of the font used for the title of the chart.
ChGetTitleFont | This macro returns the location of the font used for the title of the chart.
ChGetAxisLabelFont | This macro returns the location of the font used for the X and Y axis labels of the chart.
ChSetAxisLabelFont | This macro sets the location of the font used for the X and Y axis labels of the chart.
ChGetGridLabelFont | This macro returns the location of the font used for the X and Y axis grid labels of the chart.
ChSetGridLabelFont | This macro sets the location of the font used for the X and Y axis grid labels of the chart.
Library API > Graphics Object Layer API > GOL Objects > Chart


Chart Structures

Contents | Index | Home
Chart Structures
Chart
Structures
Name | Description
CHART | Defines the parameters required for a chart Object.
DATASERIES | Defines a variable for the CHART object. It specifies the number of samples, pointer to the array of samples for the data series and pointer to the next data series. A member of this structure (show) is used as a flag to determine if the series is to be drawn or not. Together with the smplStart and smplEnd it will determine what kind of chart will be drawn.
CHARTPARAM | Defines the parameters for the CHART object.
Library API > Graphics Object Layer API > GOL Objects > Chart


Topics

Contents | Index | Home
Topics
Chart
Topics
Name | Description
Chart States | List of Chart bit states.
Data Series Status Settings | Data Series show status flag settings.
Chart Examples | Examples of generated bar charts based on settings.
Color Table | Default color table used to draw data points in a chart.
Library API > Graphics Object Layer API > GOL Objects > Chart


Chart States Macros

Contents | Index | Home
Chart States Macros
Chart States
Macros
Name | Description
CH_DISABLED | Bit for disabled state.
CH_DRAW | Bit to indicate chart must be redrawn.
CH_DRAW_DATA | Bit to indicate data portion of the chart must be redrawn.
CH_3D_ENABLE | Bit to indicate that bar charts are to be drawn with 3-D effect
CH_BAR | Bit to indicate the chart is type bar. If both PIE and BAR types are set BAR type has higher priority.
CH_BAR_HOR | These bits (with CH_BAR bit set), sets the bar chart to be drawn horizontally.
CH_DONUT | These bits (with CH_PIE bit set), sets the pie chart to be drawn in a donut shape.
CH_LEGEND | Bit to indicate that legend is to be shown. Usable only when seriesCount > 1.
CH_NUMERIC | This bit is used only for bar charts. If this bit is set, it indicates that the bar chart labels for variables are numeric. If this bit is not set, it indicates that the bar chart labels for variables are alphabets.
CH_PERCENT | Bit to indicate that the pie chart will be drawn with percentage values shown for the sample data. For bar chart, if CH_VALUE is set, it toggles the value shown to percentage.
CH_PIE | Bit to indicate the chart is type pie. If both PIE and BAR types are set BAR type has higher priority.
CH_VALUE | Bit to indicate that the values of the bar chart data or pie chart data are to be shown
CH_HIDE | Bit to indicate chart must be removed from screen.
Library API > Graphics Object Layer API > GOL Objects > Chart > Chart States


Check Box States Macros

Contents | Index | Home
Check Box States Macros
Check Box States
Macros
Name | Description
CB_CHECKED | Checked state
CB_DISABLED | Disabled state
CB_DRAW | Whole check box must be redrawn
CB_DRAW_CHECK | Check box mark should be redrawn
CB_DRAW_FOCUS | Focus must be redrawn
CB_FOCUSED | Focus state
CB_HIDE | Check box must be removed from screen
Library API > Graphics Object Layer API > GOL Objects > Checkbox > Check Box States


Checkbox Functions

Contents | Index | Home
Checkbox Functions
Checkbox
Functions
Name | Description
CbCreate | This function creates a CHECKBOX object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
CbDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
CbSetText | This function sets the text that will be used.
CbMsgDefault | This function performs the actual state change based on the translated message given. The following state changes are supported:
CbTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Library API > Graphics Object Layer API > GOL Objects > Checkbox


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Checkbox


Legend

Contents | Index | Home
Legend
Checkbox
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Checkbox


Checkbox Macros

Contents | Index | Home
Checkbox Macros
Checkbox
Macros
Name | Description
CbGetText | This macro returns the location of the text used for the check box.
Library API > Graphics Object Layer API > GOL Objects > Checkbox


Checkbox Structures

Contents | Index | Home
Checkbox Structures
Checkbox
Structures
Name | Description
CHECKBOX | The structure contains check box data
Library API > Graphics Object Layer API > GOL Objects > Checkbox


Topics

Contents | Index | Home
Topics
Checkbox
Topics
Name | Description
Check Box States | List of Checkbox bit states.
Library API > Graphics Object Layer API > GOL Objects > Checkbox


Circle Functions Functions

Contents | Index | Home
Circle Functions Functions
Circle Functions
Functions
Name
Description
Arc
Draws the octant arc of the beveled figure with the given centers, radii and octant mask. When octant = 0xFF and the following are true:
  1. xL = xR, yT = yB , r1 = 0 and r2 = z, a filled circle is drawn with a radius of z.
  2. radii have values (where r1 < r2), a full ring with thickness of (r2-r1) is drawn.
  3. xL != xR, yT != yB , r1 = 0 and r2 = 0 (where xR > xL and yB > yT) a rectangle is drawn. xL, yT specifies the left top corner and xR,... more
DrawArc
This renders an arc with from startAngle to endAngle with the thickness of r2-r1. The function returns 1 when the arc is rendered successfuly and returns a 0 when it is not yet finished. The next call to the function will continue the rendering.
Bevel
Draws a beveled figure on the screen. When x1 = x2 and y1 = y2, a circular object is drawn. When x1 < x2 and y1 < y2 and rad (radius) = 0, a rectangular object is drawn.
FillBevel
Draws a filled beveled figure on the screen. For a filled circular object x1 = x2 and y1 = y2. For a filled rectangular object radius = 0.
Library API > Graphics Primitive Layer API > Circle Functions


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Primitive Layer API > Circle Functions


Legend

Contents | Index | Home
Legend
Circle Functions
Legend
Method
Library API > Graphics Primitive Layer API > Circle Functions


Circle Functions Macros

Contents | Index | Home
Circle Functions Macros
Circle Functions
Macros
Name | Description
Circle | This macro draws a circle with the given center and radius.
FillCircle | This macro draws a filled circle. Uses the FillBevel() function.
SetBevelDrawType | This macro sets the fill bevel type to be drawn.
Library API > Graphics Primitive Layer API > Circle Functions


Color Table Macros

Contents | Index | Home
Color Table Macros
Color Table
Macros
Name | Description
CH_CLR0 | Bright Blue
CH_CLR1 | Bright Red
CH_CLR2 | Bright Green
CH_CLR3 | Bright Yellow
CH_CLR4 | Orange
CH_CLR5 | Blue
CH_CLR6 | Red
CH_CLR7 | Green
CH_CLR8 | Yellow
CH_CLR9 | Dark Orange
CH_CLR10 | Light Blur
CH_CLR11 | Light Red
CH_CLR12 | Light Green
CH_CLR13 | Light Yellow
CH_CLR14 | Light Orange
CH_CLR15 | Gold
Library API > Graphics Object Layer API > GOL Objects > Chart > Color Table


Common Object States Macros

Contents | Index | Home
Common Object States Macros
Common Object States
Macros
Name | Description
FOCUSED | Focus state bit.
DISABLED | Disabled state bit.
HIDE | Object hide state bit. Object will be hidden from the screen by drawing over it the common background color.
DRAW | Object redraw state bit. The whole Object must be redrawn.
DRAW_FOCUS | Focus redraw state bit. The focus rectangle must be redrawn.
DRAW_UPDATE | Partial Object redraw state bit. A part or parts of of the Object must be redrawn to show updated state.
Library API > Graphics Object Layer API > Object States > Common Object States


Configuration Setting Macros

Contents | Index | Home
Configuration Setting Macros
Configuration Setting
Macros
Name | Description
USE_NONBLOCKING_CONFIG | Blocking and Non-Blocking configuration selection. To enable non-blocking configuration USE_NONBLOCKING_CONFIG must be defined. If this is not defined, blocking configuration is assumed. Define this in GraphicsConfig.h
Library API > Graphics Library Configuration > Application Configuration > Configuration Setting


Data Series Status Settings Macros

Contents | Index | Home
Data Series Status Settings Macros
Data Series Status Settings
Macros
Name | Description
HIDE_DATA | Macro used to reset the data series show flag or indicate that the data series will be not be shown when the chart is drawn.
SHOW_DATA | Macro used to set the data series show flag or indicate that the data series will be shown when the chart is drawn.
Library API > Graphics Object Layer API > GOL Objects > Chart > Data Series Status Settings


Decompressing DEFLATEd data Functions

Contents | Index | Home
Decompressing DEFLATEd data Functions
Decompressing DEFLATEd data
Functions
Name | Description
Decompress | Decompresses the nbytes number of data at SrcAddress and places starting from DestAddress. (Blocking)
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Decompressing DEFLATEd data


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Decompressing DEFLATEd data


Legend

Contents | Index | Home
Legend
Decompressing DEFLATEd data
Legend
Method
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Decompressing DEFLATEd data


Color Definition Macros

Contents | Index | Home
Color Definition Macros
Color Definition
Macros
Name | Description
BLACK | not USE_PALETTE
BLUE | This is macro BLUE.
BRIGHTBLUE | This is macro BRIGHTBLUE.
BRIGHTCYAN | This is macro BRIGHTCYAN.
BRIGHTGREEN | This is macro BRIGHTGREEN.
BRIGHTMAGENTA | This is macro BRIGHTMAGENTA.
BRIGHTRED | This is macro BRIGHTRED.
BRIGHTYELLOW | This is macro BRIGHTYELLOW.
BROWN | This is macro BROWN.
CYAN | This is macro CYAN.
DARKGRAY | This is macro DARKGRAY.
GRAY0 | This is macro GRAY0.
GRAY1 | This is macro GRAY1.
GRAY2 | This is macro GRAY2.
GRAY3 | This is macro GRAY3.
GRAY4 | This is macro GRAY4.
GRAY5 | This is macro GRAY5.
GRAY6 | This is macro GRAY6.
GREEN | This is macro GREEN.
LIGHTBLUE | This is macro LIGHTBLUE.
LIGHTCYAN | This is macro LIGHTCYAN.
LIGHTGRAY | This is macro LIGHTGRAY.
LIGHTGREEN | This is macro LIGHTGREEN.
LIGHTMAGENTA | This is macro LIGHTMAGENTA.
LIGHTRED | This is macro LIGHTRED.
MAGENTA | This is macro MAGENTA.
RED | This is macro RED.
WHITE | This is macro WHITE.
YELLOW | This is macro YELLOW.
Library API > Display Device Driver Layer API > Display Device Driver Level Primitives > Color Definition


Default Style Scheme Settings Variables

Contents | Index | Home
Default Style Scheme Settings Variables
Default Style Scheme Settings
Variables
Name | Description
FONTDEFAULT | Default GOL font.
Library API > Graphics Object Layer API > Style Scheme > Default Style Scheme Settings


Topics

Contents | Index | Home
Topics
Demo Projects
Topics
Name | Description
Demo Summary | This is the current list of demo projects released with the Graphics Library.
Microchip Application Library Abbreviations | Summary of Microchip Applications Library Abbreviations used.
Demo Compatibility Matrix | Refer to the Demo Compatibility matrix located in the <install directory>/Microchip/Graphics/Documents/Getting Started/Getting Started - Demo Compatibility Matrix.htm for details.
Demo Projects


Development Platform Used Macros

Contents | Index | Home
Development Platform Used Macros
Development Platform Used
Macros
Name
Description
EXPLORER_16
Specifies the Development Platform used for the Microchip Graphics Library demos.
  • EXPLORER_16 - Using the Explorer 16 Development Board (DM240001).
  • PIC24FJ256DA210_DEV_BOARD - Using the PIC24FJ256DA210 Development Board (DM240312).
  • MEB_BOARD - Using the Multi-Media Expansion Board (DM320005).
  • PIC_SK - Using PIC32 or dsPIC Starter Kit (examples: PIC32 Starter Kit (DM320001), PIC32 USB Starter Kit II (DM320003-2), PIC32 Ethernet Starter Kit (DM320004)).
PIC24FJ256DA210_DEV_BOARD
Specifies the Development Platform used for the Microchip Graphics Library demos.
  • EXPLORER_16 - Using the Explorer 16 Development Board (DM240001).
  • PIC24FJ256DA210_DEV_BOARD - Using the PIC24FJ256DA210 Development Board (DM240312).
  • MEB_BOARD - Using the Multi-Media Expansion Board (DM320005).
  • PIC_SK - Using PIC32 or dsPIC Starter Kit (examples: PIC32 Starter Kit (DM320001), PIC32 USB Starter Kit II (DM320003-2), PIC32 Ethernet Starter Kit (DM320004)).
MEB_BOARD
Specifies the Development Platform used for the Microchip Graphics Library demos.
  • EXPLORER_16 - Using the Explorer 16 Development Board (DM240001).
  • PIC24FJ256DA210_DEV_BOARD - Using the PIC24FJ256DA210 Development Board (DM240312).
  • MEB_BOARD - Using the Multi-Media Expansion Board (DM320005).
  • PIC_SK - Using PIC32 or dsPIC Starter Kit (examples: PIC32 Starter Kit (DM320001), PIC32 USB Starter Kit II (DM320003-2), PIC32 Ethernet Starter Kit (DM320004)).
PIC_SK
Specifies the Development Platform used for the Microchip Graphics Library demos.
  • EXPLORER_16 - Using the Explorer 16 Development Board (DM240001).
  • PIC24FJ256DA210_DEV_BOARD - Using the PIC24FJ256DA210 Development Board (DM240312).
  • MEB_BOARD - Using the Multi-Media Expansion Board (DM320005).
  • PIC_SK - Using PIC32 or dsPIC Starter Kit (examples: PIC32 Starter Kit (DM320001), PIC32 USB Starter Kit II (DM320003-2), PIC32 Ethernet Starter Kit (DM320004)).
Library API > Graphics Library Configuration > Hardware Profile > Development Platform Used


Device Driver Options Macros

Contents | Index | Home
Device Driver Options Macros
Device Driver Options
Macros
Name
Description
DISP_DATA_WIDTH
Defines the display controller's physical interface to the display panel. Valid Values:
  • 1, 4, 8, 16, 18, 24
  • 1, 4, 8 are usually used in MSTN and CSTN displays
  • 16, 18 and 24 are usually used in TFT displays.
DISP_ORIENTATION
Defines the display rotation with respect to its native orientation. For example, if the display has a resolution specifications that says 240x320 (QVGA), the display is natively in portrait mode. If the application uses the display in landscape mode (320x240), then the orientation must be defined as 90 or 180 degree rotation. Graphics Library will calculate the actual pixel location to rotate the contents of the screen. So when users view the display, the image on the screen will come out in the correct orientation. Valid values:
  • 0 : display in its native orientation
  • 90 : rotated 90 degrees clockwise... more
DISP_HOR_RESOLUTION
Defines the native horizontal dimension of the screen. This is the horizontal pixel count given by the display's data sheet. For example a 320x240 display will have DISP_HOR_RESOLUTION of 320. Valid Values:
  • dependent on the display glass resolution used.
DISP_VER_RESOLUTION
Defines the native vertical dimension of the screen. This is the vertical pixel count given by the display's data sheet. For xxample a 320x240 display will have DISP_VER_RESOLUTION of 240. Valid Values:
  • dependent on the display glass resolution used.
DISP_HOR_FRONT_PORCH
Defines the horizontal front porch. DISP_HOR_BACK_PORCH + DISP_HOR_FRONT_PORCH + DISP_HOR_PULSE_WIDTH makes up the horizontal blanking period. Value used will be based on the display panel used.
DISP_HOR_BACK_PORCH
Defines the horizontal back porch. DISP_HOR_BACK_PORCH + DISP_HOR_FRONT_PORCH + DISP_HOR_PULSE_WIDTH makes up the horizontal blanking period. Value used will be based on the display panel used.
DISP_VER_FRONT_PORCH
Defines the vertical front porch. DISP_VER_BACK_PORCH + DISP_VER_FRONT_PORCH + DISP_VER_PULSE_WIDTH makes up the vertical blanking period. Value used will be based on the display panel used.
DISP_VER_BACK_PORCH
Defines the vertical back porch. DISP_VER_BACK_PORCH + DISP_VER_FRONT_PORCH + DISP_VER_PULSE_WIDTH makes up the vertical blanking period. Value used will be based on the display panel used.
DISP_HOR_PULSE_WIDTH
Defines the horizontal sync signal pulse width in pixels. Value used will be based on the display panel used.
DISP_VER_PULSE_WIDTH
Defines the vertical sync signal pulse width in lines. Value used will be based on the display panel used.
DISP_INV_LSHIFT
Indicates that the color data is sampled in the falling edge of the pixel clock.
Library API > Graphics Library Configuration > Hardware Profile > Device Driver Options


Display Device Driver Control Functions

Contents | Index | Home
Display Device Driver Control Functions
Display Device Driver Control
Functions
Name | Description
IsDeviceBusy | Returns non-zero if LCD controller is busy (previous drawing operation is not completed).
ResetDevice | Initializes LCD module.
Library API > Display Device Driver Layer API > Display Device Driver Control


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Display Device Driver Layer API > Display Device Driver Control


Legend

Contents | Index | Home
Legend
Display Device Driver Control
Legend
Method
Library API > Display Device Driver Layer API > Display Device Driver Control


Round Dial Functions

Contents | Index | Home
Round Dial Functions
Round Dial
Functions
Name | Description
RdiaCreate | This function creates a ROUNDDIAL object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
RdiaDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the center (x,y) postion and the radius parameters. The colors used are dependent on the state of the object. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
RdiaMsgDefault | This function performs the actual state change based on the translated message given. The following state changes are supported:
RdiaTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen inputs.
Library API > Graphics Object Layer API > GOL Objects > Round Dial


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Round Dial


Legend

Contents | Index | Home
Legend
Round Dial
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Round Dial


Round Dial Macros

Contents | Index | Home
Round Dial Macros
Round Dial
Macros
Name | Description
RdiaIncVal | Used to directly increment the value. The delta change used is the resolution setting (res).
RdiaDecVal | Used to directly decrement the value. The delta change used is the resolution setting (res).
RdiaGetVal | Returns the current dial value. Value is always in the 0-max range inclusive.
RdiaSetVal | Sets the value to the given new value. Value set must be in 0-max range inclusive.
Library API > Graphics Object Layer API > GOL Objects > Round Dial


Round Dial Structures

Contents | Index | Home
Round Dial Structures
Round Dial
Structures
Name | Description
ROUNDDIAL | Defines the parameters required for a dial Object. The curr_xPos, curr_yPos, new_xPos and new_yPos parameters are internally generated to aid in the redrawing of the dial. User must avoid modifying these values.
Library API > Graphics Object Layer API > GOL Objects > Round Dial


Topics

Contents | Index | Home
Topics
Round Dial
Topics
Name | Description
Dial States | List of Dial bit states.
Library API > Graphics Object Layer API > GOL Objects > Round Dial


Dial States Macros

Contents | Index | Home
Dial States Macros
Dial States
Macros
Name | Description
RDIA_DISABLED | Bit for disabled state.
RDIA_DRAW | Bit to indicate object must be redrawn.
RDIA_HIDE | Bit to indicate object must be removed from screen.
RDIA_ROT_CCW | Bit for rotate counter clockwise state.
RDIA_ROT_CW | Bit for rotate clockwise state.
Library API > Graphics Object Layer API > GOL Objects > Round Dial > Dial States


Digital Meter Functions

Contents | Index | Home
Digital Meter Functions
Digital Meter
Functions
Name | Description
DmCreate | This function creates a DIGITALMETER object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
DmDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
DmSetValue | This function sets the value that will be used for the object.
DmTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Library API > Graphics Object Layer API > GOL Objects > Digital Meter


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Digital Meter


Legend

Contents | Index | Home
Legend
Digital Meter
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Digital Meter


Digital Meter Macros

Contents | Index | Home
Digital Meter Macros
Digital Meter
Macros
Name | Description
DmGetValue | This macro returns the current value used for the object.
DmDecVal | This macro is used to directly decrement the value.
DmIncVal | This macro is used to directly increment the value.
Library API > Graphics Object Layer API > GOL Objects > Digital Meter


Digital Meter Structures

Contents | Index | Home
Digital Meter Structures
Digital Meter
Structures
Name | Description
DIGITALMETER | Defines the parameters required for a Digital Meter Object.
Library API > Graphics Object Layer API > GOL Objects > Digital Meter


Topics

Contents | Index | Home
Topics
Digital Meter
Topics
Name | Description
Digital Meter States | List of Digital Meter bit states.
Library API > Graphics Object Layer API > GOL Objects > Digital Meter


Digital Meter States Macros

Contents | Index | Home
Digital Meter States Macros
Digital Meter States
Macros
Name | Description
DM_DISABLED | Bit for disabled state.
DM_DRAW | Bit to indicate object must be redrawn.
DM_HIDE | Bit to remove object from screen.
DM_CENTER_ALIGN | Bit to indicate value is center aligned.
DM_RIGHT_ALIGN | Bit to indicate value is left aligned.
DM_FRAME | Bit to indicate frame is displayed.
DM_UPDATE | Bit to indicate that only text must be redrawn.
Library API > Graphics Object Layer API > GOL Objects > Digital Meter > Digital Meter States


Display Controller Used Macros

Contents | Index | Home
Display Controller Used Macros
Display Controller Used
Macros
Name
Description
GFX_USE_DISPLAY_CONTROLLER_DMA
Specifies the controller used in the Graphics Library supplied demo.
  • GFX_USE_DISPLAY_CONTROLLER_DMA - Using the PIC32 Low Cost Controllerless (LCC) solution.
  • GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210 - Use the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family)
  • GFX_USE_DISPLAY_CONTROLLER_SSD1926 - Using the Solomon Systech SSD1926 Display Controller.
  • GFX_USE_DISPLAY_CONTROLLER_S1D13517 - Using the Epson S1D13517 Display Controller.
GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210
Specifies the controller used in the Graphics Library supplied demo.
  • GFX_USE_DISPLAY_CONTROLLER_DMA - Using the PIC32 Low Cost Controllerless (LCC) solution.
  • GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210 - Use the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family)
  • GFX_USE_DISPLAY_CONTROLLER_SSD1926 - Using the Solomon Systech SSD1926 Display Controller.
  • GFX_USE_DISPLAY_CONTROLLER_S1D13517 - Using the Epson S1D13517 Display Controller.
GFX_USE_DISPLAY_CONTROLLER_S1D13517
Specifies the controller used in the Graphics Library supplied demo.
  • GFX_USE_DISPLAY_CONTROLLER_DMA - Using the PIC32 Low Cost Controllerless (LCC) solution.
  • GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210 - Use the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family)
  • GFX_USE_DISPLAY_CONTROLLER_SSD1926 - Using the Solomon Systech SSD1926 Display Controller.
  • GFX_USE_DISPLAY_CONTROLLER_S1D13517 - Using the Epson S1D13517 Display Controller.
GFX_USE_DISPLAY_CONTROLLER_SSD1926
Specifies the controller used in the Graphics Library supplied demo.
  • GFX_USE_DISPLAY_CONTROLLER_DMA - Using the PIC32 Low Cost Controllerless (LCC) solution.
  • GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210 - Use the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family)
  • GFX_USE_DISPLAY_CONTROLLER_SSD1926 - Using the Solomon Systech SSD1926 Display Controller.
  • GFX_USE_DISPLAY_CONTROLLER_S1D13517 - Using the Epson S1D13517 Display Controller.
Library API > Graphics Library Configuration > Hardware Profile > Display Controller Used


Modules

Contents | Index | Home
Modules
Display Device Driver Layer API
Modules
Name | Description
Advanced Display Driver Features | This section lists advanced Display Device Driver Features implemented in select Display Device Driver.
Library API > Display Device Driver Layer API


Topics

Contents | Index | Home
Topics
Display Device Driver Layer API
Topics
Name | Description
Display Device Driver Level Primitives | This lists the Device Level Primitive rendering functions and macros.
Display Device Driver Control | This lists the device control functions and macros.
Library API > Display Device Driver Layer API


Display Device Driver Layer Configuration Macros

Contents | Index | Home
Display Device Driver Layer Configuration Macros
Display Device Driver Layer Configuration
Macros
Name
Description
USE_ALPHABLEND
To enable support for Alpha Blending. Use this feature only if the display driver used can support alpha blending. Define this in GraphicsConfig.h
USE_DOUBLE_BUFFERING
To enable support for double buffering. Use this feature only if the display driver used can support double buffering. Define this in GraphicsConfig.h
GFX_LCD_TYPE
Sets the type of display glass used. Define this in the Hardware Profile.
  • #define GFX_LCD_TYPE GFX_LCD_TFT - sets type TFT display
  • #define GFX_LCD_TYPE GFX_LCD_CSTN - sets type color STN display
  • #define GFX_LCD_TYPE GFX_LCD_MSTN - sets type mon STN display
  • #define GFX_LCD_TYPE GFX_LCD_OFF - display is turned off
STN_DISPLAY_WIDTH
Sets the STN glass data width. Define this in the Hardware Profile.
  • #define STN_DISPLAY_WIDTH STN_DISPLAY_WIDTH_4 - use 4-bit wide interface
  • #define STN_DISPLAY_WIDTH STN_DISPLAY_WIDTH_8 - Use 8-bit wide interface
  • #define STN_DISPLAY_WIDTH STN_DISPLAY_WIDTH_16 - Use 16-bit wide interface
Library API > Graphics Library Configuration > Display Device Driver Layer Configuration


Display Panel Used Macros

Contents | Index | Home
Display Panel Used Macros
Display Panel Used
Macros
Name
Description
GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q
Specifies the Graphics Display Panel used.
  • GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E - 3.2 inch QVGA Truly TFT Display Board (AC164127-4)
  • GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q - 4.3 inch WQVGA Powertip TFT Display Board (AC164127-6)
  • GFX_USE_DISPLAY_PANEL_TFT_640480_8_E - 5.7 inch VGA Truly TFT Display Board (AC164127-8)
  • GFX_USE_DISPLAY_PANEL_TFT_800480_33_E - 7 inch WVGA Truly TFT Display Board (AC164127-8)
GFX_USE_DISPLAY_PANEL_TFT_640480_8_E
Specifies the Graphics Display Panel used.
  • GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E - 3.2 inch QVGA Truly TFT Display Board (AC164127-4)
  • GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q - 4.3 inch WQVGA Powertip TFT Display Board (AC164127-6)
  • GFX_USE_DISPLAY_PANEL_TFT_640480_8_E - 5.7 inch VGA Truly TFT Display Board (AC164127-8)
  • GFX_USE_DISPLAY_PANEL_TFT_800480_33_E - 7 inch WVGA Truly TFT Display Board (AC164127-8)
GFX_USE_DISPLAY_PANEL_TFT_800480_33_E
Specifies the Graphics Display Panel used.
  • GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E - 3.2 inch QVGA Truly TFT Display Board (AC164127-4)
  • GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q - 4.3 inch WQVGA Powertip TFT Display Board (AC164127-6)
  • GFX_USE_DISPLAY_PANEL_TFT_640480_8_E - 5.7 inch VGA Truly TFT Display Board (AC164127-8)
  • GFX_USE_DISPLAY_PANEL_TFT_800480_33_E - 7 inch WVGA Truly TFT Display Board (AC164127-8)
GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E
Specifies the Graphics Display Panel used.
  • GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E - 3.2 inch QVGA Truly TFT Display Board (AC164127-4)
  • GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q - 4.3 inch WQVGA Powertip TFT Display Board (AC164127-6)
  • GFX_USE_DISPLAY_PANEL_TFT_640480_8_E - 5.7 inch VGA Truly TFT Display Board (AC164127-8)
  • GFX_USE_DISPLAY_PANEL_TFT_800480_33_E - 7 inch WVGA Truly TFT Display Board (AC164127-8)
Library API > Graphics Library Configuration > Hardware Profile > Display Panel Used


Double Buffering Functions

Contents | Index | Home
Double Buffering Functions
Double Buffering
Functions
Name | Description
SwitchOffDoubleBuffering | Switches off the double buffering. All rendering will be performed on the frame buffer. Calls to UpdateDisplayNow() or RequestDisplayUpdate() will have no effect.
SwitchOnDoubleBuffering | Switches on the double buffering. Double buffering utilizes two buffers. The frame buffer and the draw buffer. The frame buffer is the buffer that is being displayed while the draw buffer is used for all rendering. When this function is called, it copies the contents of the frame buffer to the draw buffer once and all succeeding rendering will be performed on the draw buffer. To update the frame buffer with newly drawn items on the draw buffer call UpdateDisplayNow() or RequestDisplayUpdate().
InvalidateRectangle | Invalidates the specified rectangular area. This increments the number of invalidated areas and if the number of invalidated areas exceed the GFX_MAX_INVALIDATE_AREAS, the whole frame buffer is invalidated.
RequestDisplayUpdate | Synchronizes the draw and frame buffers at next VBlank
UpdateDisplayNow | Synchronizes the draw and frame buffers immediately.
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Double Buffering


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Double Buffering


Legend

Contents | Index | Home
Legend
Double Buffering
Legend
Method
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Double Buffering


Edit Box Functions

Contents | Index | Home
Edit Box Functions
Edit Box
Functions
Name | Description
EbCreate | This function creates a EDITBOX object with the parameters given and initializes the default settings. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
EbDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
EbSetText | This function sets the text to be used for the object.
EbAddChar | This function inserts a character at the end of the text used by the object.
EbDeleteChar | This function removes a character at the end of the text used by the object.
EbMsgDefault | This function performs the actual state change based on the translated message given. The following state changes are supported:
EbTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Library API > Graphics Object Layer API > GOL Objects > Edit Box


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Edit Box


Legend

Contents | Index | Home
Legend
Edit Box
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Edit Box


Edit Box Macros

Contents | Index | Home
Edit Box Macros
Edit Box
Macros
Name | Description
EbGetText | This macro returns the address of the current text string used for the object.
Library API > Graphics Object Layer API > GOL Objects > Edit Box


Edit Box Structures

Contents | Index | Home
Edit Box Structures
Edit Box
Structures
Name | Description
EDITBOX | Defines the parameters required for a Edit Box Object.
Library API > Graphics Object Layer API > GOL Objects > Edit Box


Topics

Contents | Index | Home
Topics
Edit Box
Topics
Name | Description
Edit Box States | List of Edit Box bit states.
Library API > Graphics Object Layer API > GOL Objects > Edit Box


Edit Box States Macros

Contents | Index | Home
Edit Box States Macros
Edit Box States
Macros
Name | Description
EB_CENTER_ALIGN | Bit to indicate text is center aligned.
EB_DISABLED | Bit for disabled state.
EB_DRAW | Bit to indicate whole edit box must be redrawn.
EB_HIDE | Bit to remove object from screen.
EB_FOCUSED | Bit for focused state. Cursor caret will be drawn when EB_DRAW_CARET is also set.
EB_RIGHT_ALIGN | Bit to indicate text is left aligned.
EB_DRAW_CARET | Bit to indicate the cursor caret will be drawn if EB_FOCUSED state bit is set and erase when EB_FOCUSED state bit is not set.
EB_CARET | Bit to indicate the cursor caret will always be shown.
Library API > Graphics Object Layer API > GOL Objects > Edit Box > Edit Box States


External Memory Functions

Contents | Index | Home
External Memory Functions
External Memory
Functions
Name | Description
ExternalMemoryCallback | This function must be implemented in the application. The library will call this function each time when the external memory data will be required. The application must copy requested bytes quantity into the buffer provided. Data start address in external memory is a sum of the address in GFX_EXTDATA structure and offset.
Library API > Graphics Primitive Layer API > External Memory


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Primitive Layer API > External Memory


Legend

Contents | Index | Home
Legend
External Memory
Legend
Method
Library API > Graphics Primitive Layer API > External Memory


External Memory Macros

Contents | Index | Home
External Memory Macros
External Memory
Macros
Name | Description
EXTERNAL_FONT_BUFFER_SIZE | This defines the size of the buffer used by font functions to retrieve font data from the external memory. The buffer size can be increased to accommodate large font sizes. The user must be aware of the expected glyph sizes of the characters stored in the font table. To modify the size used, declare this macro in the GraphicsConfig.h file with the desired size.
Library API > Graphics Primitive Layer API > External Memory


Topics

Contents | Index | Home
Topics
External Memory
Topics
Name | Description
Memory Type | Memory type enumeration to determine the source of data. Used in interpreting bitmap and font from different memory sources.
Library API > Graphics Primitive Layer API > External Memory


Focus Support Selection Macros

Contents | Index | Home
Focus Support Selection Macros
Focus Support Selection
Macros
Name | Description
USE_FOCUS | Keyboard control on some objects can be used by enabling the GOL Focus (USE_FOCUS)support. Define this in GraphicsConfig.h
Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Focus Support Selection


Font Source Selection Macros

Contents | Index | Home
Font Source Selection Macros
Font Source Selection
Macros
Name
Description
USE_FONT_FLASH
Font data can be placed in two locations. One is in FLASH memory and the other is from external memory. Definining one or both enables the support for fonts located in internal flash and external memory. Define this in GraphicsConfig.h
  • USE_FONT_FLASH - Font in internal flash memory support.
  • USE_FONT_EXTERNAL - Font in external memory support (including external memory mapped to EDS).
USE_FONT_EXTERNAL
Font data can be placed in two locations. One is in FLASH memory and the other is from external memory. Definining one or both enables the support for fonts located in internal flash and external memory. Define this in GraphicsConfig.h
  • USE_FONT_FLASH - Font in internal flash memory support.
  • USE_FONT_EXTERNAL - Font in external memory support (including external memory mapped to EDS).
Library API > Graphics Library Configuration > Application Configuration > Font Source Selection


GFX_LCD_TYPE Macro Macros

Contents | Index | Home
GFX_LCD_TYPE Macro Macros
GFX_LCD_TYPE Macro
Macros
Name | Description
GFX_LCD_CSTN | Type Color STN Display
GFX_LCD_MSTN | Type Mono STN Display
GFX_LCD_OFF | display is turned off
GFX_LCD_TFT | Type TFT Display
Library API > Graphics Library Configuration > Display Device Driver Layer Configuration > GFX_LCD_TYPE Macro


GOL Global Variables Variables

Contents | Index | Home
GOL Global Variables Variables
GOL Global Variables
Variables
Name
Description
_pDefaultGolScheme
Pointer to the GOL default scheme (GOL_SCHEME). This scheme is created in GOLInit() function. GOL scheme defines the style scheme to be used by an object. Use GOLGetSchemeDefault() to get this pointer.
_pGolObjects
Pointer to the current linked list of objects displayed and receiving messages. GOLDraw() and GOLMsg() process objects referenced by this pointer.
_pObjectFocused
Pointer to the object receiving keyboad input. This pointer is used or modified by the following APIs:
  • GOLSetFocus()
  • GOLGetFocus()
  • GOLGetFocusNext()
  • GOLGetFocusPrev()
  • GOLCanBeFocused()
Library API > Graphics Object Layer API > GOL Global Variables


GOL Messages Enumerations

Contents | Index | Home
GOL Messages Enumerations
GOL Messages
Enumerations
Name | Description
TRANS_MSG | This structure defines the list of translated messages for GOL Objects used in the library.
INPUT_DEVICE_EVENT | This structure defines the types of GOL message events used in the library.
INPUT_DEVICE_TYPE | This structure defines the types of input devices used in the library.
Library API > Graphics Object Layer API > GOL Messages


GOL Messages Functions

Contents | Index | Home
GOL Messages Functions
GOL Messages
Functions
Name | Description
GOLMsg | This function receives a GOL message from user and loops through the active list of objects to check which object is affected by the message. For affected objects the message is translated and GOLMsgCallback() is called. In the call back function, user has the ability to implement action for the message. If the call back function returns non-zero OBJMsgDefault() is called to process message for the object by default. If zero is returned OBJMsgDefault() is not called. Please refer to GOL Messages section for deatils. This function should be called when GOL drawing is completed. It can be done... more
GOLMsgCallback | The user MUST implement this function. GOLMsg() calls this function when a valid message for an object in the active list is received. User action for the message should be implemented here. If this function returns non-zero, the message for the object will be processed by default. If zero is returned, GOL will not perform any action.
Library API > Graphics Object Layer API > GOL Messages


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Object Layer API > GOL Messages


Legend

Contents | Index | Home
Legend
GOL Messages
Legend
Method
Library API > Graphics Object Layer API > GOL Messages


GOL Messages Structures

Contents | Index | Home
GOL Messages Structures
GOL Messages
Structures
Name
Description
GOL_MSG
This structure defines the GOL message used in the library.
  • The types must be one of the INPUT_DEVICE_TYPE:
    • TYPE_UNKNOWN
    • TYPE_KEYBOARD
    • TYPE_TOUCHSCREEN
    • TYPE_MOUSE
  • uiEvent must be one of the INPUT_DEVICE_EVENT.
    • for touch screen:
      • EVENT_INVALID
      • EVENT_MOVE
      • EVENT_PRESS
      • EVENT_STILLPRESS
      • EVENT_RELEASE
    • for keyboard:
      • EVENT_KEYSCAN (param2 contains scan code)
      • EVENT_KEYCODE (param2 contains character code)
  • param1:
    • for touch screen is the x position
    • for keyboard ID of object receiving the message
  • param2
    • for touch screen y position
    • for keyboard scan or key code
Library API > Graphics Object Layer API > GOL Messages


Topics

Contents | Index | Home
Topics
GOL Messages
Topics
Name | Description
Scan Key Codes | The defined scan codes for AT keyboard.
Library API > Graphics Object Layer API > GOL Messages


GOL Objects Enumerations

Contents | Index | Home
GOL Objects Enumerations
GOL Objects
Enumerations
Name | Description
GOL_OBJ_TYPE | This structure defines the Object types used in the library.
Library API > Graphics Object Layer API > GOL Objects


Modules

Contents | Index | Home
Modules
GOL Objects
Modules
Name | Description
Analog Clock | Analog Clock is an Object that emulates an analog clock with moving hands. It can be used with or without a bitmap image as the background source.
Button | Button is an Object that emulates a press and release effect when operated upon.
Chart | Chart is an Object that draws a bar chart or a pie chart representation of a single data or series of data.
Checkbox | Check Box is an Object that simulates a check box on paper. Usually it is used as an option setting where the checked or filled state means the option is enabled and the unfilled or unchecked state means the option is disabled.
Round Dial | Dial is an Object that can be used to display emulate a turn dial that can both go in clockwise or counterclockwise.
Digital Meter | DigitalMeter is an Object that can be used to display a value of a sampled variable. This Object is ideal when fast refresh of the value is needed. The Object refreshes only the digits that needs to change. A limitation of this Object is that the font used should have equal character widths.
Edit Box | Edit Box is is an Object that emulates a cell or a text area that can be edited dynamically.
Grid | Grid is an Object that draws a grid on the screen with each cell capable of displaying an image or a string.
Group Box | Group Box is an Object that can be used to group Objects together in the screen.
List Box | List Box is an Object that defines a scrollable area where items are listed. User can select a single item or set of items.
Meter | Meter is an Object that can be used to graphically display a sampled input.
Picture Control | Picture is an Object that can be used to transform a bitmap to be an Object in the screen and have control on the bitmap rendering. This object can be used to create animation using a series of bitmaps.
Progress Bar | Progress Bar is an Object that can be used to display the progress of a task such as a file download or transfer.
Radio Button | Radio Button is an Object that can be used to offer set of choices to the user. Only one of the choices is selectable. Changing selection automatically removes the selection on the previous option.
Slider/Scroll Bar | Slider or Scrollbar is an Object that can be used to display a value or scrolling location in a predefined area.
Static Text | Static Text is an Object that can be used to display a single or multi-line string of text in a predefined location.
Text Entry | Text Entry is an Object that can be used to emulate a key pad entry with a display area for the entered characters. The Object has a feature where you can define a key to reply with a translated message that signifies a command key was pressed. A command key example can be your enter or carriage return key or an escape key. Multiple keys can be assigned command keys. Application can utilize the command key to define the behavior of the program based on a command key press.
Window | Window is an Object that can be used to encapsulate objects into a group. Unlike the Group Box Object, the Window Object has additional features such as displaying an icon or a small bitmap on its Title Bar. It also has additional controls for both Title Bar and Client Area.
Library API > Graphics Object Layer API > GOL Objects


GOL Objects Structures

Contents | Index | Home
GOL Objects Structures
GOL Objects
Structures
Name | Description
OBJ_HEADER | This structure defines the first nine fields of the Objects structure. This allows generic operations on library Objects.
Library API > Graphics Object Layer API > GOL Objects


GOL Objects Types

Contents | Index | Home
GOL Objects Types
GOL Objects
Types
Name | Description
DRAW_FUNC | object draw function pointer typedef
FREE_FUNC | object free function pointer typedef
MSG_DEFAULT_FUNC | object default message function pointer typedef
MSG_FUNC | object message function pointer typedef
Library API > Graphics Object Layer API > GOL Objects


Gradient Bar Rendering Macros

Contents | Index | Home
Gradient Bar Rendering Macros
Gradient Bar Rendering
Macros
Name | Description
USE_GRADIENT | To enable support for Gradient bars and bevel primitives. Define this in GraphicsConfig.h.
Library API > Graphics Library Configuration > Graphics Primitive Layer Configuration > Gradient Bar Rendering


Gradient Enumerations

Contents | Index | Home
Gradient Enumerations
Gradient
Enumerations
Name | Description
GFX_GRADIENT_TYPE | Enumeration for gradient type
Library API > Graphics Primitive Layer API > Gradient


Gradient Functions

Contents | Index | Home
Gradient Functions
Gradient
Functions
Name | Description
BarGradient | This renders a bar onto the screen, but instead of one color, a gradient is drawn depending on the direction (GFX_GRADIENT_TYPE), length, and colors chosen. This function is a blocking call.
BevelGradient | This renders a filled bevel with gradient color on the fill. It works the same as the fillbevel function, except a gradient out of color1 and color2 is drawn depending on the direction (GFX_GRADIENT_TYPE). This function is a blocking call.
Library API > Graphics Primitive Layer API > Gradient


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Primitive Layer API > Gradient


Legend

Contents | Index | Home
Legend
Gradient
Legend
Method
Library API > Graphics Primitive Layer API > Gradient


Gradient Structures

Contents | Index | Home
Gradient Structures
Gradient
Structures
Name | Description
GFX_GRADIENT_STYLE | This structure is used to describe the gradient style.
Library API > Graphics Primitive Layer API > Gradient


Graphic Cursor Macros

Contents | Index | Home
Graphic Cursor Macros
Graphic Cursor
Macros
Name | Description
GetX | This macro returns the current graphic cursor x-coordinate.
GetY | This macro returns the current graphic cursor y-coordinate.
MoveRel | This macro moves the graphic cursor relative to the current location. The given dX and dY displacement can be positive or negative numbers.
MoveTo | This macro moves the graphic cursor to new x,y position.
Library API > Graphics Primitive Layer API > Graphic Cursor


Topics

Contents | Index | Home
Topics
Application Configuration
Topics
Name | Description
Configuration Setting | This selects the configuration of the library. When Non-blocking configuration is selected, state machine based rendering is used to perform object rendering. When blocking configuration is used, this line MUST be commented. In this case object rendering will not exit until the object is fully rendered. The USE_NONBLOCKING_CONFIG option is located in the GraphicsConfig.h header file.
Font Source Selection | Font data can be placed in multiple locations. Set these options in the GraphicsConfig.h header file. - USE_FONT_FLASH - Font in internal flash memory support. - USE_FONT_EXTERNAL - Font in external memory support. Use this for fonts located in external memory like SPI Flash or external memory mapped to Extended Data Space.
Image Source Selection | Similar to Font data bitmaps can also be placed in two locations. One is in FLASH memory and the other is from external memory. Definining one or both enables the support for bitmaps located in internal flash and external memory. The USE_BITMAP_FLASH and USE_BITMAP_EXTERNAL options are located in the GraphicsConfig.h header file.
Miscellaneous | This contains miscellaneous macros and functions that can be redefined for various system support such as Operating System defined functions.
GraphicsConfig.h Example | This is an example of the GraphicsConfig.h file implementation:
Library API > Graphics Library Configuration > Application Configuration


Topics

Contents | Index | Home
Topics
Graphics Library Configuration
Topics
Name | Description
Graphics Object Layer Configuration | The following compile time options configures the Graphics Library's Object Layer.
Graphics Primitive Layer Configuration | The following compile time options configures the Graphics Library's Primitive Layer.
Display Device Driver Layer Configuration | The following compile time options configures the Graphics Library's Display Device Driver Layer. The choices are based on the specific hardware used. See Hardware Profile for more options.
Application Configuration |
Hardware Profile | These functions and macros are used to determine hardware profile settings on the chosen PIC microcontroller and hardware such as demo boards used.
Library API > Graphics Library Configuration


Topics

Contents | Index | Home
Topics
Library Architecture
Topics
Name | Description
Graphics Object Layer | Describes the Graphics Object Layer (GOL) structure and its components.
Graphics Primitive Layer | Describes the Graphics Primitive Layer structure and its components.
Display Device Driver Layer | Describes the Display Driver Layer structure and its components.
Library Architecture


Topics

Contents | Index | Home
Topics
Graphics Object Layer API
Topics
Name | Description
GOL Objects | The Graphics Object Layer (GOL) contains the Advanced Graphics Objects or commonly known as widgets.
Object States | Objects rendered on the display are based on their current Property States and the Drawing States.
Object Management | This section describes the API functions and macros that are used to create, maintain and render individual and list of objects.
GOL Messages | The library provides an interface to accept messages from the input devices.
Style Scheme | All objects uses a style scheme structure that defines the font and colors used.
GOL Global Variables | Graphics Object Layer global variables.
Library API > Graphics Object Layer API


Topics

Contents | Index | Home
Topics
Graphics Object Layer Configuration
Topics
Name
Description
Input Device Selection
The Graphics Library comes with two pre-defined user interface. These are the:
  • Keyboard interface
  • Touchscreen interface
Enabling one or both requires the declaration of the compile switch macros in the GraphicsConfig.h file.
GOL widgets which supports the enabled input device's messages will respond to the user inputs.
For Example:
When using Button Widget.
#define USE_TOUCHSCREEN - will enable the buttons response to user touch on the button widget. The button will automatically be drawn with a pressed state when pressed and release state when user removes the touch on the screen.

The compile option selects the input devices used by... more
Focus Support Selection
This compile option allows keyboard input focus. GOLSetFocus(), GOLGetFocus(), GOLCanBeFocused(), GOLGetFocusNext() functions will be available. Focus is also changed by touch screen.
The USE_FOCUS option is located in the GraphicsConfig.h header file.
Graphics Object Selection
These compile options selects objects used. Remove definitions for unused objects to reduce code size.
The USE_GOL and USE_OBJECT options are located in the GraphicsConfig.h header file. USE_GOL should be included if any of the objects are to be used.
Library API > Graphics Library Configuration > Graphics Object Layer Configuration


Topics

Contents | Index | Home
Topics
Graphics Object Layer
Topics
Name | Description
Object Rendering | Describes the difference between the Blocking or Non-Blocking configuration when rendering Objects.
Library Architecture > Graphics Object Layer


Graphics Object Selection Macros

Contents | Index | Home
Graphics Object Selection Macros
Graphics Object Selection
Macros
Name | Description
USE_ANALOGCLOCK | Enable Analog Clock Object.
USE_BUTTON | Enable Button Object.
USE_BUTTON_MULTI_LINE | Enable Multi-Line Button Object
USE_CHECKBOX | Enable Checkbox Object.
USE_DIGITALMETER | Enable DigitalMeter Object.
USE_EDITBOX | Enable Edit Box Object.
USE_GROUPBOX | Enable Group Box Object.
USE_LISTBOX | Enable List Box Object.
USE_METER | Enable Meter Object.
USE_PICTURE | Enable Picture Object.
USE_PROGRESSBAR | Enable Progress Bar Object.
USE_RADIOBUTTON | Enable Radio Button Object.
USE_ROUNDDIAL | Enable Dial Object.
USE_SLIDER | Enable Slider or Scroll Bar Object.
USE_STATICTEXT | Enable Static Text Object.
USE_WINDOW | Enable Window Object.
USE_CUSTOM | Enable Custom Control Object (an example to create customized Object).
USE_GOL | Enable Graphics Object Layer.
USE_TEXTENTRY | Enable TextEntry Object.
Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Graphics Object Selection


Graphics PICtail Used Macros

Contents | Index | Home
Graphics PICtail Used Macros
Graphics PICtail Used
Macros
Name
Description
GFX_PICTAIL_LCC
Specifies the Graphics PICtail Display Panel used.
  • GFX_PICTAIL_V3 - Graphics LCD Controller PICtail Plus SSD1926 Board (AC164127-5)
  • GFX_PICTAIL_V3E - Graphics LCD Controller PICtail Plus S1D13517 Board (AC164127-7)
  • GFX_PICTAIL_LCC - Low Cost Controllerless (LCC) Graphics PICtail™ Plus Board (AC164144)
GFX_PICTAIL_V3
Specifies the Graphics PICtail Display Panel used.
  • GFX_PICTAIL_V3 - Graphics LCD Controller PICtail Plus SSD1926 Board (AC164127-5)
  • GFX_PICTAIL_V3E - Graphics LCD Controller PICtail Plus S1D13517 Board (AC164127-7)
  • GFX_PICTAIL_LCC - Low Cost Controllerless (LCC) Graphics PICtail™ Plus Board (AC164144)
GFX_PICTAIL_V3E
Specifies the Graphics PICtail Display Panel used.
  • GFX_PICTAIL_V3 - Graphics LCD Controller PICtail Plus SSD1926 Board (AC164127-5)
  • GFX_PICTAIL_V3E - Graphics LCD Controller PICtail Plus S1D13517 Board (AC164127-7)
  • GFX_PICTAIL_LCC - Low Cost Controllerless (LCC) Graphics PICtail™ Plus Board (AC164144)
Library API > Graphics Library Configuration > Hardware Profile > Graphics PICtail Used


Graphics Primitive Layer API Enumerations

Contents | Index | Home
Graphics Primitive Layer API Enumerations
Graphics Primitive Layer API
Enumerations
Name | Description
GFX_RESOURCE | Memory type enumeration to determine the source of data. Used in interpreting bitmap and font from different memory sources.
Library API > Graphics Primitive Layer API


Graphics Primitive Layer API Structures

Contents | Index | Home
Graphics Primitive Layer API Structures
Graphics Primitive Layer API
Structures
Name | Description
GFX_IMAGE_HEADER | Structure for images stored in various system memory (Flash, External Memory (SPI, Parallel Flash, or memory in EPMP).
IMAGE_FLASH | Structure for images stored in FLASH memory.
IMAGE_RAM | Structure for images stored in RAM memory.
GFX_EXTDATA | This structure is used to describe external memory.
Library API > Graphics Primitive Layer API


Topics

Contents | Index | Home
Topics
Graphics Primitive Layer API
Topics
Name | Description
Text Functions | This lists the Primitive level text functions.
Gradient | Gradients can be drawn dynamically with the Microchip Graphics Library.
Line Functions | This lists the Primitive line text functions.
Rectangle Functions | This lists the Primitive level rectangle functions.
Circle Functions | This lists the Primitive level circle functions.
Graphic Cursor | This lists the functions to control the graphics cursor.
Bitmap Functions | This lists the functions to display bitmaps.
External Memory | This lists the external memory access functions and descriptions.
Set Up Functions | This lists the Primitive set up and initialization functions.
Library API > Graphics Primitive Layer API


Topics

Contents | Index | Home
Topics
Graphics Primitive Layer Configuration
Topics
Name | Description
Image Compression Option | These compile options to set if the images used for OutImage() are RLE compressed or IPU compressed.
Font Type Selection | This compile option selects if the support for unicode fonts, unsigned char or the default signed char type fonts. There are three types of font (characters) that can be used in the Graphics Library. This gives the user the option to implement multi-language application or use the default signed char type.
Advanced Font Features Selection | This compile option enables the advanced font features.
Gradient Bar Rendering | This compile option enables the usage of the Gradient Bar and Bevel function in the Primitive Layer.
Transparent Color Feature in PutImage() | This compile option enables the transparent color feature in PutImage().
External Memory Buffer | see EXTERNAL_FONT_BUFFER_SIZE
Library API > Graphics Library Configuration > Graphics Primitive Layer Configuration


Grid Functions

Contents | Index | Home
Grid Functions
Grid
Functions
Name | Description
GridCreate | This function creates a GRID object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
GridDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
GridClearCellState | This function clears the state of the cell (or Grid Item) specified by the column and row.
GridFreeItems | This function removes all grid items for the given Grid and frees the memory used.
GridGetCell | This function removes all grid items for the given Grid and frees the memory used.
GridSetCell | This function sets the Grid Item state and data.
GridSetCellState | This function sets the state of the Grid Item or cell.
GridSetFocus | This function sets the focus of the specified Grid Item or cell.
GridMsgDefault | This function performs the actual state change based on the translated message given. The following state changes are supported:
GridTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Library API > Graphics Object Layer API > GOL Objects > Grid


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Grid


Legend

Contents | Index | Home
Legend
Grid
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Grid


Grid Macros

Contents | Index | Home
Grid Macros
Grid
Macros
Name | Description
GridGetFocusX | This macro returns the x position of the focused cell.
GridGetFocusY | This macro returns the y position of the focused cell.
GRID_OUT_OF_BOUNDS | Status of an out of bounds cell GridSetCell() operation.
GRID_SUCCESS | Status of a successful GridSetCell() operation.
Library API > Graphics Object Layer API > GOL Objects > Grid


Grid Structures

Contents | Index | Home
Grid Structures
Grid
Structures
Name | Description
GRID | Defines the parameters required for a grid Object. Clipping is not supported in grid object.
GRIDITEM | Defines the grid item.
Library API > Graphics Object Layer API > GOL Objects > Grid


Topics

Contents | Index | Home
Topics
Grid
Topics
Name | Description
Grid States | List of Grid bit states.
Grid Item States | List of Grid Items bit states.
Library API > Graphics Object Layer API > GOL Objects > Grid


Grid Item States Macros

Contents | Index | Home
Grid Item States Macros
Grid Item States
Macros
Name | Description
GRIDITEM_SELECTED | The cell is selected.
GRIDITEM_IS_TEXT | The grid item is a text string.
GRIDITEM_IS_BITMAP | The grid item is a bitmap.
GRIDITEM_TEXTBOTTOM | Bit to indicate text is top aligned.
GRIDITEM_TEXTLEFT | Text in the cell is left aligned.
GRIDITEM_TEXTRIGHT | Text in the cell is right aligned.
GRIDITEM_TEXTTOP | Bit to indicate text is bottom aligned.
GRIDITEM_DRAW | Draw this cell
Library API > Graphics Object Layer API > GOL Objects > Grid > Grid Item States


Grid States Macros

Contents | Index | Home
Grid States Macros
Grid States
Macros
Name | Description
GRID_FOCUSED | Bit for focused state
GRID_DISABLED | Bit for disabled state
GRID_SHOW_LINES | Display grid lines
GRID_SHOW_FOCUS | Highlight the focused cell.
GRID_SHOW_BORDER_ONLY | Draw only the outside border of the grid.
GRID_SHOW_SEPARATORS_ONLY | Draw only the lines between cells (like Tic-tac-toe)
GRID_DRAW_ITEMS | Bit to indicate that at least one item must be redrawn, but not the entire grid.
GRID_DRAW_ALL | Bit to indicate whole edit box must be redrawn
GRID_HIDE | Bit to remove object from screen
Library API > Graphics Object Layer API > GOL Objects > Grid > Grid States


Group Box Functions

Contents | Index | Home
Group Box Functions
Group Box
Functions
Name | Description
GbCreate | This function creates a GROUPBOX object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
GbDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
GbSetText | This function sets the text used by passing the pointer to the static string.
GbTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen inputs.
Library API > Graphics Object Layer API > GOL Objects > Group Box


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Group Box


Legend

Contents | Index | Home
Legend
Group Box
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Group Box


Group Box Macros

Contents | Index | Home
Group Box Macros
Group Box
Macros
Name | Description
GbGetText | This macro returns the location of the text used.
Library API > Graphics Object Layer API > GOL Objects > Group Box


Group Box Structures

Contents | Index | Home
Group Box Structures
Group Box
Structures
Name | Description
GROUPBOX | Defines the parameters required for a group box Object. The textwidth and textHeight is not checked with the actual dimension of the object. Clipping is not supported in group box object. It is possible for the text to exceed the dimension of the Object.
Library API > Graphics Object Layer API > GOL Objects > Group Box


Topics

Contents | Index | Home
Topics
Group Box
Topics
Name | Description
Group Box States | List of Group Box bit states.
Library API > Graphics Object Layer API > GOL Objects > Group Box


Group Box States Macros

Contents | Index | Home
Group Box States Macros
Group Box States
Macros
Name | Description
GB_CENTER_ALIGN | Bit to indicate text is center aligned
GB_DISABLED | Bit for disabled state
GB_DRAW | Bit to indicate group box must be redrawn
GB_HIDE | Bit to remove object from screen
GB_RIGHT_ALIGN | Bit to indicate text is right aligned
Library API > Graphics Object Layer API > GOL Objects > Group Box > Group Box States


Topics

Contents | Index | Home
Topics
Hardware Profile
Topics
Name | Description
PMP Interface | Specifies the interface type to the Parallel Master Port (PMP) or Enhanced Parallel Master Port (EPMP).
Development Platform Used | Specifies the Development Platform used for the Microchip Graphics Library demos.
Graphics PICtail Used | Specifies the Graphics PICtail Display Panel used.
Display Controller Used | Specifies the controller used in the Graphics Library supplied demo.
Display Panel Used | Specifies the Graphics Display Panel used.
Device Driver Options | The options Graphics Hardware Platform, DISPLAY_CONTROLLER and DISPLAY_PANEL are specific to the hardware used. The Graphics Hardware Platform selects the Graphics PICtail™ Plus Board version, PIC24FJ256DA210 Development Board or any other Microchip demo boards for the Graphics Library. Currently there are two Graphics PICtail™ Plus Board versions supported as shown in the Getting Started section. The rest of the settings are used to specify the the display parameters when using an RGB type display controller such as SSD1906 and SSD1926 from Solomon Systech. The table below summarizes the generic parameters found in RGB type display controllers and when each type is used.... more
HardwareProfile.h Example | This is an example of the HardwareProfile.h file implementation:
Library API > Graphics Library Configuration > Hardware Profile


Image Compression Option Macros

Contents | Index | Home
Image Compression Option Macros
Image Compression Option
Macros
Name | Description
USE_COMP_IPU | To enable support for DEFLATE compressed images for PutImage(). When this macro is enabled, the PutImage() function will be able to process images generated by the Graphics Resource Converter (GRC) that are compressed using the DEFLATE algorithm. PutImage() will need the IPU module of the Microchip Graphics Module to decompress. Enable this feature only when the driver features the IPU module (example: PIC24FJ2456DA210). Define this in GraphicsConfig.h
USE_COMP_RLE | To enable support for RLE compressed images for PutImage(). When this macro is enabled, the PutImage() function will be able to process images generated by the Graphics Resource Converter (GRC) that are RLE compressed. Define this in GraphicsConfig.h
Library API > Graphics Library Configuration > Graphics Primitive Layer Configuration > Image Compression Option


Image Decoder Configuration Macros

Contents | Index | Home
Image Decoder Configuration Macros
Image Decoder Configuration
Macros
Name | Description
IMG_SUPPORT_BMP | Add this macro in ImageDecoderConfig.h to enable support for bitmap image format decoding.
IMG_SUPPORT_GIF | Add this macro in ImageDecoderConfig.h to enable support for gif image format decoding.
IMG_SUPPORT_JPEG | Add this macro in ImageDecoderConfig.h to enable support for jpeg image format decoding.
IMG_SUPPORT_IMAGE_DECODER_LOOP_CALLBACK | The decoder may takes up significant amount of time decoding an image and user may want to update some information on the display or to send/receive data through some communication channels. It is possible to release processing power in the middle of decoding process by calling a callback function provided by the user. The user should do all the housekeeping activities inside the function. This option can be enabled by adding this macro in ImageDecoderConfig.h.
IMG_USE_ONLY_565_GRAPHICS_DRIVER_FOR_OUTPUT | Add this macro in ImageDecoderConfig.h to optimize code for graphics driver that supports 16-bit 5-6-5 color format and rendering is done directly to the display buffer. If either double buffering has to be done or if user specific rendering has to be done, comment out the above mentioned line and provide a callback function to render the pixel values. The callback function will be explained in the API section. If commented out, then the width and height of the display screen has to be provided using the following defines
IMG_USE_ONLY_MDD_FILE_SYSTEM_FOR_INPUT | Add this macro in ImageDecoderConfig.h to optimize code to use Memory Disk Drive File System(MDDFS) of Microchip MDD File System Interface Library .
Image Decoders API > Image Decoder Configuration


Demo Project

Contents | Index | Home
Demo Project
Image Decoders
Demo Project
Name | Description
Image Decoder Demo | This demo demonstrates the decoding of images with JPEG and BMP file formats.
Image Decoders


Image Decoders API Functions

Contents | Index | Home
Image Decoders API Functions
Image Decoders API
Functions
Name | Description
ImageDecode | This function decodes and displays the image on the screen
ImageDecoderInit | This function initializes the global variables to 0 and then initializes the driver. This must be called once before any other function of the library is called
ImageLoopCallbackRegister | This function registers the loop callback function so that the decoder calls this function in every decoding loop. This can be used by the application program to do maintainance activities such as fetching data, updating the display, etc...
ImageDecodeTask | This function completes one small part of the image decode function
Image Decoders API


Functions

Contents | Index | Home
Legend
Legend
Method
Image Decoders API


Legend

Contents | Index | Home
Legend
Image Decoders API
Legend
Method
Structure
Image Decoders API


Image Decoders API Macros

Contents | Index | Home
Image Decoders API Macros
Image Decoders API
Macros
Name | Description
ImageFullScreenDecode | This function decodes and displays the image on the screen in fullscreen mode with center aligned and downscaled if required
ImageAbort | This function sets the Image Decoder's Abort flag so that decoding aborts in the next decoding loop.
Image Decoders API


Image Decoders API Structures

Contents | Index | Home
Image Decoders API Structures
Image Decoders API
Structures
Name | Description
_BMPDECODER | DATA STRUCTURES
_GIFDECODER | DATA STRUCTURES
_JPEGDECODER | DATA STRUCTURES
Image Decoders API


Structures

Contents | Index | Home
Legend
Legend
Structure
Image Decoders API


Topics

Contents | Index | Home
Topics
Image Decoders API
Topics
Name | Description
Image Decoder Configuration | The Image Decoder Library can be customized by adding or specifying the compile time options located in the application file named ImageDecoderConfig.h.
Image Decoders API


Input Device Selection Macros

Contents | Index | Home
Input Device Selection Macros
Input Device Selection
Macros
Name
Description
USE_KEYBOARD
Input devices macros that defines the messages that Objects will process. The following definitions indicate the usage of the different input devices:
  • USE_TOUCHSCREEN - enables the touch screen support.
  • USE_KEYBOARD - enables the key board support.
Define in GraphicsConfig.h
USE_TOUCHSCREEN
Input devices macros that defines the messages that Objects will process. The following definitions indicate the usage of the different input devices:
  • USE_TOUCHSCREEN - enables the touch screen support.
  • USE_KEYBOARD - enables the key board support.
Define in GraphicsConfig.h
Library API > Graphics Library Configuration > Graphics Object Layer Configuration > Input Device Selection


Key Command Types Macros

Contents | Index | Home
Key Command Types Macros
Key Command Types
Macros
Name | Description
TE_DELETE_COM | This macro is used to assign a "delete" command on a key.
TE_ENTER_COM | This macro is used to assign an "enter" (carriage return) command on a key.
TE_SPACE_COM | This macro is used to assign an insert "space" command on a key.
Library API > Graphics Object Layer API > GOL Objects > Text Entry > Key Command Types


Topics

Contents | Index | Home
Topics
Library API
Topics
Name | Description
Graphics Library Configuration | The Graphics Library can be customized by adding or specifying the compile time options located in the application code named GraphicsConfig.h or the HardwareProfile.h files. The following compile time options are supported by the library.
Graphics Object Layer API | Description of Graphics Object Layer API.
Graphics Primitive Layer API | Description of Graphics Primitive Layer API.
Display Device Driver Layer API | Description of Display Device Driver Layer API.
Library API


Line Functions Functions

Contents | Index | Home
Line Functions Functions
Line Functions
Functions
Name | Description
Line | This function draws a line with the current line type from the start point to the end point.
Library API > Graphics Primitive Layer API > Line Functions


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Primitive Layer API > Line Functions


Legend

Contents | Index | Home
Legend
Line Functions
Legend
Method
Library API > Graphics Primitive Layer API > Line Functions


Line Functions Macros

Contents | Index | Home
Line Functions Macros
Line Functions
Macros
Name | Description
LineRel | This macro draws a line with the current line type from the current graphic cursor position to the position defined by displacement.
LineTo | This macro draws a line with the current line type from the current graphic cursor position to the given x, y position.
SetLineThickness | This macro sets sets line thickness to 1 pixel or 3 pixels.
SetLineType | This macro sets the line type to draw.
Library API > Graphics Primitive Layer API > Line Functions


Topics

Contents | Index | Home
Topics
Line Functions
Topics
Name | Description
Line Types | Line type definitions.
Line Size | Line sizes definition.
Library API > Graphics Primitive Layer API > Line Functions


Line Size Macros

Contents | Index | Home
Line Size Macros
Line Size
Macros
Name | Description
NORMAL_LINE | Normal Line (thickness is 1 pixel)
THICK_LINE | Thick Line (thickness is 3 pixels)
Library API > Graphics Primitive Layer API > Line Functions > Line Size


Line Types Macros

Contents | Index | Home
Line Types Macros
Line Types
Macros
Name | Description
SOLID_LINE | Solid Line Style
DASHED_LINE | Dashed Line Style
DOTTED_LINE | Dotted Line Style
Library API > Graphics Primitive Layer API > Line Functions > Line Types


List Box Functions

Contents | Index | Home
List Box Functions
List Box
Functions
Name | Description
LbCreate | This function creates a LISTBOX object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
LbDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. The text or items drawn in the visible window of the list box is dependent on the alignment set. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
LbAddItem | This function allocates memory for the LISTITEM and adds it to the list box. The newly created LISTITEM will store the location of pText, pBitmap and other parameters describing the added item.
LbDelItem | This function removes an item from the list box and frees the memory used.
LbChangeSel | This function changes the selection status of an item in the list box. If the item is currently selected, it resets the selection. If the item is currently not selected it is set to be selected.
LbGetSel | This function searches for selected items from the list box. A starting position can optionally be given. If starting position is set to NULL, search will begin from the first item list. It returns the pointer to the first selected item found or NULL if there are no items selected.
LbGetFocusedItem | This function returns the index of the focused item in the list box.
LbSetFocusedItem | This function sets the focus for the item with the given index.
LbDelItemsList | This function removes all items from the list box and frees the memory used.
LbMsgDefault | This function performs the actual state change based on the translated message given. The following state changes are supported:
LbTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Library API > Graphics Object Layer API > GOL Objects > List Box


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > List Box


Legend

Contents | Index | Home
Legend
List Box
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > List Box


List Box Macros

Contents | Index | Home
List Box Macros
List Box
Macros
Name | Description
LbGetItemList | This function returns the pointer to the current item list used in the list box.
LbSetSel | This macro sets the selection status of an item to selected.
LbGetCount | This macro returns the number of items in the list box.
LbGetVisibleCount | This macro returns the number of items visible in the list box window.
LbSetBitmap | This macro sets the bitmap used in the item.
LbGetBitmap | This macro returns the location of the currently used bitmap for the item.
Library API > Graphics Object Layer API > GOL Objects > List Box


List Box Structures

Contents | Index | Home
List Box Structures
List Box
Structures
Name | Description
LISTBOX | Defines the parameters required for a list box Object.
LISTITEM | Defines the parameters required for a list item used in list box.
Library API > Graphics Object Layer API > GOL Objects > List Box


Topics

Contents | Index | Home
Topics
List Box
Topics
Name | Description
List Box States | List of List Box bit states.
List Item Status | List of Items status.
Library API > Graphics Object Layer API > GOL Objects > List Box


List Box States Macros

Contents | Index | Home
List Box States Macros
List Box States
Macros
Name | Description
LB_RIGHT_ALIGN | Bit to indicate text is left aligned
LB_SINGLE_SEL | Bit to indicate the only item can be selected
LB_CENTER_ALIGN | Bit to indicate text is center aligned
LB_DISABLED | Bit for disabled state
LB_DRAW | Bit to indicate whole edit box must be redrawn
LB_DRAW_FOCUS | Bit to indicate whole edit box must be redrawn
LB_DRAW_ITEMS | Bit to indicate whole edit box must be redrawn
LB_FOCUSED | Bit for focused state
LB_HIDE | Bit to remove object from screen
Library API > Graphics Object Layer API > GOL Objects > List Box > List Box States


List Item Status Macros

Contents | Index | Home
List Item Status Macros
List Item Status
Macros
Name | Description
LB_STS_SELECTED | Item is selected.
LB_STS_REDRAW | Item is to be redrawn.
Library API > Graphics Object Layer API > GOL Objects > List Box > List Item Status


Meter Functions

Contents | Index | Home
Meter Functions
Meter
Functions
Name | Description
MtrCreate | This function creates a METER object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
MtrDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. Depending on the defined settings, value of the meter will displayed or hidden. Displaying the value will require a little bit more rendering time depending on the size of the meter and font used. When rendering objects of the same type, each object must be rendered completely before the rendering of the... more
MtrSetVal | This function sets the value of the meter to the passed newVal. newVal is checked to be in the minValue-maxValue range inclusive. If newVal is not in the range, minValue maxValue is assigned depending on the given newVal if less than minValue or above maxValue.
MtrMsgDefault | This function performs the actual state change based on the translated message given. Meter value is set based on parameter 2 of the message given. The following state changes are supported:
MtrTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Library API > Graphics Object Layer API > GOL Objects > Meter


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Meter


Legend

Contents | Index | Home
Legend
Meter
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Meter


Meter Macros

Contents | Index | Home
Meter Macros
Meter
Macros
Name
Description
MtrGetVal
This macro returns the current value of the meter. Value is always in the minValue-maxValue range inclusive.
MtrDecVal
This macro is used to directly decrement the value.
MtrIncVal
This macro is used to directly increment the value.
MtrSetScaleColors
Scale colors can be used to highlight values of the meter. User can set these colors to define the arc colors and scale colors. This also sets the color of the meter value when displayed. Limitation is that color settings are set to the following angles: Color Boundaries Type Whole Type Half Type Quarter Arc 6 225 to 180 not used not used Arc 5 179 to 135 179 to 135 not used Arc 4 134 to 90 134 to 90 not used Arc 3 89 to 45 89 to 45 89 to 45 Arc 2 44 to 0 44... more
MtrSetTitleFont
This function sets the font of title.
MtrSetValueFont
This function sets the font of value.
METER_TYPE
This is a compile time setting to select the type if meter shape. There are three types:
  • MTR_WHOLE_TYPE - Meter drawn with 6 octants used.
  • MTR_HALF_TYPE - Meter drawn with semi circle shape.
  • MTR_QUARTER_TYPE - Meter drawn with quarter circle shape.
Set only one value at a time. This is done to save code space. User can define the colors of the arcs for each type. MTR_WHOLE_TYPE will use all the arc colors (arcColor1 - arcColor6) MTR_HALF_TYPE will use arc colors (arcColor5, arcColor4, arcColor3, arcColor2) MTR_QUARTER_TYPE will use arc colors (arcColor3, arcColor2) Set the meter type in Meter.h file and... more
MTR_ACCURACY
Sets the meter accuracy to one decimal places when displaying the values. Application must multiply the minValue, maxValue and values passed to the widget by RESOLUTION.
Library API > Graphics Object Layer API > GOL Objects > Meter


Meter Structures

Contents | Index | Home
Meter Structures
Meter
Structures
Name | Description
METER | Defines the parameters required for a meter Object. Depending on the type selected the meter is drawn with the defined shape parameters and values set on the given fields.
Library API > Graphics Object Layer API > GOL Objects > Meter


Topics

Contents | Index | Home
Topics
Meter
Topics
Name | Description
Meter States | List of Meter bit states.
Library API > Graphics Object Layer API > GOL Objects > Meter


Meter States Macros

Contents | Index | Home
Meter States Macros
Meter States
Macros
Name | Description
MTR_DISABLED | Bit for disabled state.
MTR_DRAW | Bit to indicate object must be redrawn.
MTR_HIDE | Bit to indicate object must be removed from screen.
MTR_RING | Bit for ring type, scales are drawn over the ring default is only scales drawn.
MTR_DRAW_UPDATE | Bit to indicate an update only.
Library API > Graphics Object Layer API > GOL Objects > Meter > Meter States


Miscellaneous Macros

Contents | Index | Home
Miscellaneous Macros
Miscellaneous
Macros
Name | Description
USE_PALETTE_EXTERNAL | Palettes can also be specified to reside in external memory similar to fonts and images. Use this when the palette is located in external memory. Define this in GraphicsConfig.h
USE_PALETTE | Using Palettes, different colors can be used with the same bit depth. Define this in GraphicsConfig.h
COLOR_DEPTH | Specifies the color depth used in the application defined in GraphicsConfig.h.
GFX_free | When using Operating Systems (OS), define the OS specific malloc() and free() functions for compatibility with the OS based systems. Define these in GraphicsConfig.h
GFX_malloc | When using Operating Systems (OS), define the OS specific malloc() and free() functions for compatibility with the OS based systems. Define these in GraphicsConfig.h
Library API > Graphics Library Configuration > Application Configuration > Miscellaneous


Object Management Functions

Contents | Index | Home
Object Management Functions
Object Management
Functions
Name | Description
GOLAddObject | This function adds an object to the tail of the active list pointed to by _pGolObjects. The new list tail is set to point to NULL.
GOLFindObject | This function finds an object in the active list pointed to by _pGolObjects using the given object ID.
GOLRedrawRec | This function marks all objects in the active list intersected by the given rectangular area to be redrawn.
GOLDraw | This function loops through the active list and redraws objects that need to be redrawn. Partial redrawing or full redraw is performed depending on the drawing states of the objects. GOLDrawCallback() function is called by GOLDraw() when drawing of objects in the active list is completed.
GOLDrawCallback | GOLDrawCallback() function MUST BE implemented by the user. This is called inside the GOLDraw() function when the drawing of objects in the active list is completed. User drawing must be done here. Drawing color, line type, clipping region, graphic cursor position and current font will not be changed by GOL if this function returns a zero. To pass drawing control to GOL this function must return a non-zero value. If GOL messaging is not using the active link list, it is safe to modify the list here.
GOLFree | This function frees all the memory used by objects in the active list and initializes _pGolObjects pointer to NULL to start a new empty list. This function must be called only inside the GOLDrawCallback()function when using GOLDraw() and GOLMsg() functions. This requirement assures that primitive rendering settings are not altered by the rendering state machines of the objects.
GOLDeleteObject | deletes an object to the linked list objects for the current screen.
GOLDeleteObjectByID | Deletes an object in the current active linked list of objects using the ID parameter of the object.
GOLSetFocus | This function sets the keyboard input focus to the object. If the object cannot accept keyboard messages focus will not be changed. This function resets FOCUSED state for the object was in focus previously, set FOCUSED state for the required object and marks the objects to be redrawn.
GOLInit | This function initializes the graphics library and creates a default style scheme with default settings referenced by the global scheme pointer. GOLInit() function must be called before GOL functions can be used. It is not necessary to call GraphInit() function if this function is used.
GOLCanBeFocused | This function returns non-zero if the object can be focused. Only button, check box, radio button, slider, edit box, list box, scroll bar can accept focus. If the object is disabled it cannot be set to focused state.
GOLGetFocusNext | This function returns the pointer to the next object in the active linked list which is able to receive keyboard input.
GOLGetFocusPrev | This function returns the pointer to the previous object in the active linked list which is able to receive keyboard input.
GOLPanelDrawTsk | This function draws a panel on the screen with parameters set by GOLPanelDraw() macro. This function must be called repeatedly (depending on the return value) for a successful rendering of the panel.
GOLTwoTonePanelDrawTsk | This function draws a two tone panel on the screen with parameters set by GOLPanelDraw() macro. This function must be called repeatedly (depending on the return value) for a successful rendering of the panel.
Library API > Graphics Object Layer API > Object Management


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Object Layer API > Object Management


Legend

Contents | Index | Home
Legend
Object Management
Legend
Method
Library API > Graphics Object Layer API > Object Management


Object Management Macros

Contents | Index | Home
Object Management Macros
Object Management
Macros
Name
Description
GOLRedraw
This macro sets the object to be redrawn. For the redraw to be effective, the object must be in the current active list. If not, the redraw action will not be performed until the list where the object is currently inserted will be set to be the active list.
GOLDrawComplete
This macro resets the drawing states of the object (6 MSBits of the object’s state).
GetObjType
This macro returns the object type.
GetObjID
This macro returns the object ID.
GetObjNext
This macro returns the next object after the specified object.
GOLNewList
This macro starts a new linked list of objects and resets the keyboard focus to none. This macro assigns the current active list _pGolObjects and current receiving keyboard input _pObjectFocused object pointers to NULL. Any keyboard inputs at this point will be ignored. Previous active list must be saved in another pointer if to be referenced later. If not needed anymore memory used by that list should be freed by GOLFree() function.
GOLGetList
This macro gets the current active list.
GOLSetList
This macro sets the given object list as the active list and resets the keyboard focus to none. This macro assigns the receiving keyboard input object _pObjectFocused pointer to NULL. If the new active list has an object’s state set to focus, the _pObjectFocused pointer must be set to this object or the object’s state must be change to unfocused. This is to avoid two objects displaying a focused state when only one object in the active list must be set to a focused state at anytime.
IsObjUpdated
This macro tests if the object is pending to be redrawn. This is done by testing the 6 MSBits of object’s state to detect if the object must be redrawn.
GOLGetFocus
This macro returns the pointer to the current object receiving keyboard input.
GOLPanelDraw
This macro sets the parameters to draw a panel. Panel is not an object. It will not be added to the active list. Use GOLPanelDrawTsk() to display the panel on the screen. The following relationships of the parameters determines the general shape of the button:
  1. Panel width is determined by right - left.
  2. Panel height is determined by top - bottom.
  3. Panel radius - specifies if the panel will have a rounded edge. If zero then the panel will have sharp (cornered) edge.
  4. If 2*radius = height = width, the panel is circular.
Library API > Graphics Object Layer API > Object Management


Object States Macros

Contents | Index | Home
Object States Macros
Object States
Macros
Name | Description
GetState | This macro retrieves the current value of the state bits of an object. It is possible to get several state bits.
ClrState | This macro clear the state bits of an object. Object must be redrawn to display the changes. It is possible to clear several state bits with this macro.
SetState | This macro sets the state bits of an object. Object must be redrawn to display the changes. It is possible to set several state bits with this macro.
Library API > Graphics Object Layer API > Object States


Topics

Contents | Index | Home
Topics
Object States
Topics
Name | Description
Common Object States | List of common Object bit states.
Library API > Graphics Object Layer API > Object States


Palette.h Functions

Contents | Index | Home
Palette.h Functions
Palette.h
Functions
Name | Description
ClearPaletteChangeError | Clears the Palette change error status
DisablePalette | Disables the Palette mode.
EnablePalette | Enables the Palette mode.
GetPaletteChangeError | Returns the Palette change error status
IsPaletteEnabled | Returns if the Palette mode is enabled or not.
PaletteInit | Initializes the color look up table (CLUT).
RequestPaletteChange | Loads the palettes from the flash during vertical blanking period if possible, otherwise loads immediately.
SetPalette | Programs a block of palette entries starting from startEntry and until startEntry + length from the flash immediately.
SetPaletteBpp | Sets the color look up table (CLUT) number of valid entries.
SetPaletteFlash | Loads the palettes from the flash immediately.
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode > Palette.h


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode > Palette.h


Palette.h Macros

Contents | Index | Home
Palette.h Macros
Palette.h
Macros
Name | Description
RequestEntirePaletteChange | Loads all the palette entries from the flash during vertical blanking period if possible, otherwise loads immediately.
SetEntirePalette | Programs the whole 256 entry palette with new color values from flash.
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode > Palette.h


Palette.h Structures

Contents | Index | Home
Palette.h Structures
Palette.h
Structures
Name | Description
PALETTE_FLASH | Structure for the palette stored in FLASH memory.
PALETTE_HEADER | Structure for the palette header.
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode > Palette.h


Palette.h Types

Contents | Index | Home
Palette.h Types
Palette.h
Types
Name | Description
PALETTE_EXTERNAL | Structure for palette stored in EXTERNAL memory space. (example: External SPI or parallel Flash, EDS_EPMP)
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode > Palette.h


Palette Mode Files

Contents | Index | Home
Palette Mode Files
Palette Mode
Files
Name | Description
Palette.h | This is file Palette.h.
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode


Palette Mode Functions

Contents | Index | Home
Palette Mode Functions
Palette Mode
Functions
Name | Description
ClearPaletteChangeError | Clears the Palette change error status
DisablePalette | Disables the Palette mode.
EnablePalette | Enables the Palette mode.
GetPaletteChangeError | Returns the Palette change error status
IsPaletteEnabled | Returns if the Palette mode is enabled or not.
PaletteInit | Initializes the color look up table (CLUT).
RequestPaletteChange | Loads the palettes from the flash during vertical blanking period if possible, otherwise loads immediately.
SetPalette | Programs a block of palette entries starting from startEntry and until startEntry + length from the flash immediately.
SetPaletteBpp | Sets the color look up table (CLUT) number of valid entries.
SetPaletteFlash | Loads the palettes from the flash immediately.
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode


Legend

Contents | Index | Home
Legend
Palette Mode
Legend
Method
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode


Palette Mode Macros

Contents | Index | Home
Palette Mode Macros
Palette Mode
Macros
Name | Description
RequestEntirePaletteChange | Loads all the palette entries from the flash during vertical blanking period if possible, otherwise loads immediately.
SetEntirePalette | Programs the whole 256 entry palette with new color values from flash.
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode


Palette Mode Structures

Contents | Index | Home
Palette Mode Structures
Palette Mode
Structures
Name | Description
PALETTE_FLASH | Structure for the palette stored in FLASH memory.
PALETTE_HEADER | Structure for the palette header.
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode


Palette Mode Types

Contents | Index | Home
Palette Mode Types
Palette Mode
Types
Name | Description
PALETTE_EXTERNAL | Structure for palette stored in EXTERNAL memory space. (example: External SPI or parallel Flash, EDS_EPMP)
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Palette Mode


Picture Control Functions

Contents | Index | Home
Picture Control Functions
Picture Control
Functions
Name | Description
PictCreate | This function creates a PICTURE object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
PictDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
PictTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event accepted by the PICTURE Object.
Library API > Graphics Object Layer API > GOL Objects > Picture Control


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Picture Control


Legend

Contents | Index | Home
Legend
Picture Control
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Picture Control


Picture Control Macros

Contents | Index | Home
Picture Control Macros
Picture Control
Macros
Name | Description
PictSetBitmap | This macro sets the bitmap used in the object.
PictGetBitmap | This macro returns the pointer to the bitmap used in the object.
PictGetScale | This macro returns the current scale factor used to render the bitmap.
PictSetScale | This macro sets the scale factor used to render the bitmap used in the object.
Library API > Graphics Object Layer API > GOL Objects > Picture Control


Picture Control Structures

Contents | Index | Home
Picture Control Structures
Picture Control
Structures
Name | Description
PICTURE | The structure contains data for picture control
Library API > Graphics Object Layer API > GOL Objects > Picture Control


Topics

Contents | Index | Home
Topics
Picture Control
Topics
Name | Description
Picture States | List of Picture Control bit states.
Library API > Graphics Object Layer API > GOL Objects > Picture Control


Picture States Macros

Contents | Index | Home
Picture States Macros
Picture States
Macros
Name | Description
PICT_DISABLED | Bit to indicate Picture is in a disabled state.
PICT_DRAW | Bit to indicate Picture will be redrawn.
PICT_FRAME | Bit to indicate Picture has a frame.
PICT_HIDE | Bit to indicate Picture must be hidden.
Library API > Graphics Object Layer API > GOL Objects > Picture Control > Picture States


PMP Interface Macros

Contents | Index | Home
PMP Interface Macros
PMP Interface
Macros
Name
Description
USE_8BIT_PMP
Specifies the interface type to the Parallel Master Port (PMP) or Enhanced Parallel Master Port (EPMP).
  • USE_8BIT_PMP - Use 8-bit interface to PMP or EPMP
  • USE_16BIT_PMP - Use 16-bit interface to PMP or EPMP
USE_16BIT_PMP
Specifies the interface type to the Parallel Master Port (PMP) or Enhanced Parallel Master Port (EPMP).
  • USE_8BIT_PMP - Use 8-bit interface to PMP or EPMP
  • USE_16BIT_PMP - Use 16-bit interface to PMP or EPMP
Library API > Graphics Library Configuration > Hardware Profile > PMP Interface


Progress Bar Functions

Contents | Index | Home
Progress Bar Functions
Progress Bar
Functions
Name | Description
PbCreate | This function creates a PROGRESSBAR object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
PbDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
PbSetRange | This function sets the range of the progress bar. Calling this function also resets the position equal to the new range value.
PbSetPos | This function sets the position of the progress bar. Position should be in the given range inclusive.
PbTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen inputs.
Library API > Graphics Object Layer API > GOL Objects > Progress Bar


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Progress Bar


Legend

Contents | Index | Home
Legend
Progress Bar
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Progress Bar


Progress Bar Macros

Contents | Index | Home
Progress Bar Macros
Progress Bar
Macros
Name | Description
PbGetRange | This macro returns the current range of the progress bar.
PbGetPos | This macro returns the current progress bar position.
Library API > Graphics Object Layer API > GOL Objects > Progress Bar


Progress Bar Structures

Contents | Index | Home
Progress Bar Structures
Progress Bar
Structures
Name | Description
PROGRESSBAR | The structure contains data for the progress bar
Library API > Graphics Object Layer API > GOL Objects > Progress Bar


Topics

Contents | Index | Home
Topics
Progress Bar
Topics
Name | Description
Progress Bar States | List of Progress Bar bit states.
Library API > Graphics Object Layer API > GOL Objects > Progress Bar


Progress Bar States Macros

Contents | Index | Home
Progress Bar States Macros
Progress Bar States
Macros
Name | Description
PB_DISABLED | Bit to indicate Progress Bar is in a disabled state.
PB_DRAW | Bit to indicate Progress Bar must be redrawn.
PB_DRAW_BAR | Bit to indicate Progress Bar must be redrawn.
PB_HIDE | Bit to indicate Progress Bar must be hidden.
PB_VERTICAL | Bit for orientation (0 - horizontal, 1 - vertical)
Library API > Graphics Object Layer API > GOL Objects > Progress Bar > Progress Bar States


Radio Button Functions

Contents | Index | Home
Radio Button Functions
Radio Button
Functions
Name | Description
RbCreate | This function creates a RADIOBUTTON object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
RbDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
RbGetCheck | This function returns the ID of the currently checked Radio Button in the group.
RbSetCheck | This function sets the Radio Button with the given ID to its checked state.
RbSetText | This function sets the string used for the object.
RbMsgDefault | This function performs the actual state change based on the translated message given. The following state changes are supported:
RbTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Library API > Graphics Object Layer API > GOL Objects > Radio Button


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Radio Button


Legend

Contents | Index | Home
Legend
Radio Button
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Radio Button


Radio Button Macros

Contents | Index | Home
Radio Button Macros
Radio Button
Macros
Name | Description
RbGetText | This macro returns the address of the current text string used for the object.
Library API > Graphics Object Layer API > GOL Objects > Radio Button


Radio Button Structures

Contents | Index | Home
Radio Button Structures
Radio Button
Structures
Name | Description
RADIOBUTTON | the structure contains data for the Radio Button
Library API > Graphics Object Layer API > GOL Objects > Radio Button


Topics

Contents | Index | Home
Topics
Radio Button
Topics
Name | Description
Radio Button States | List of Radio Button bit states.
Library API > Graphics Object Layer API > GOL Objects > Radio Button


Radio Button States Macros

Contents | Index | Home
Radio Button States Macros
Radio Button States
Macros
Name | Description
RB_CHECKED | Bit to indicate Radio Button is checked.
RB_DISABLED | Bit for disabled state.
RB_DRAW | Bit to indicate whole Radio Button must be redrawn.
RB_DRAW_CHECK | Bit to indicate check mark should be redrawn.
RB_DRAW_FOCUS | Bit to indicate focus must be redrawn.
RB_FOCUSED | Bit for focused state.
RB_GROUP | Bit to indicate the first Radio Button in the group.
RB_HIDE | Bit to indicate that button must be removed from screen.
Library API > Graphics Object Layer API > GOL Objects > Radio Button > Radio Button States


Rectangle Copy Operations Functions

Contents | Index | Home
Rectangle Copy Operations Functions
Rectangle Copy Operations
Functions
Name | Description
ROPBlock | Performs a Raster Operation (ROP) on source and destination. The type of ROP is decided by the rop and the copyOp parameter.
Scroll | Scrolls the rectangular area defined by left, top, right, bottom by delta pixels.
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Rectangle Copy Operations


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Rectangle Copy Operations


Legend

Contents | Index | Home
Legend
Rectangle Copy Operations
Legend
Method
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Rectangle Copy Operations


Rectangle Copy Operations Macros

Contents | Index | Home
Rectangle Copy Operations Macros
Rectangle Copy Operations
Macros
Name
Description
RCC_SRC_ADDR_CONTINUOUS
Source (S) and Destination (D) data type. When performing executing commands on the Rectangle Copy Processing Unit (RCCGPU). The source and destination data can be treated as a continuous block of data in memory or a discontinuous data in memory. This gives flexibility to the operation where an copy operation can be performed to data already present in the display buffer or anywhere else in data memory. Both source and destination data can be set to continuous or discontinuous data. These macros are only used in RCCGPU operations.
  • RCC_SRC_ADDR_CONTINUOUS - source data is continuous
  • RCC_SRC_ADDR_DISCONTINUOUS - source data is discontinuous... more
RCC_SRC_ADDR_DISCONTINUOUS
Source (S) and Destination (D) data type. When performing executing commands on the Rectangle Copy Processing Unit (RCCGPU). The source and destination data can be treated as a continuous block of data in memory or a discontinuous data in memory. This gives flexibility to the operation where an copy operation can be performed to data already present in the display buffer or anywhere else in data memory. Both source and destination data can be set to continuous or discontinuous data. These macros are only used in RCCGPU operations.
  • RCC_SRC_ADDR_CONTINUOUS - source data is continuous
  • RCC_SRC_ADDR_DISCONTINUOUS - source data is discontinuous... more
RCC_DEST_ADDR_CONTINUOUS
Source (S) and Destination (D) data type. When performing executing commands on the Rectangle Copy Processing Unit (RCCGPU). The source and destination data can be treated as a continuous block of data in memory or a discontinuous data in memory. This gives flexibility to the operation where an copy operation can be performed to data already present in the display buffer or anywhere else in data memory. Both source and destination data can be set to continuous or discontinuous data. These macros are only used in RCCGPU operations.
  • RCC_SRC_ADDR_CONTINUOUS - source data is continuous
  • RCC_SRC_ADDR_DISCONTINUOUS - source data is discontinuous... more
RCC_DEST_ADDR_DISCONTINUOUS
Source (S) and Destination (D) data type. When performing executing commands on the Rectangle Copy Processing Unit (RCCGPU). The source and destination data can be treated as a continuous block of data in memory or a discontinuous data in memory. This gives flexibility to the operation where an copy operation can be performed to data already present in the display buffer or anywhere else in data memory. Both source and destination data can be set to continuous or discontinuous data. These macros are only used in RCCGPU operations.
  • RCC_SRC_ADDR_CONTINUOUS - source data is continuous
  • RCC_SRC_ADDR_DISCONTINUOUS - source data is discontinuous... more
RCC_ROP_0
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_1
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_2
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_3
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_4
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_5
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_6
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_7
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_8
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_9
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_A
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_B
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_C
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_D
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_E
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_ROP_F
Raster Operation (ROP) option. Select one of the following 16 raster operation options whenever Rectangle Copy Processing Unit (RCCGPU) is used. The raster operation is performed on the source (S) and destination (D) data. and the result written to the destination (D).
  • RCC_ROP_0 - 0 (BLACK)
  • RCC_ROP_1 - not (S or D)
  • RCC_ROP_2 - (not S) and D
  • RCC_ROP_3 - not (S)
  • RCC_ROP_4 - S and not (D))
  • RCC_ROP_5 - not (D)
  • RCC_ROP_6 - S xor D
  • RCC_ROP_7 - not (S and D)
  • RCC_ROP_8 - S and D
  • RCC_ROP_9 - not (S xor D)
  • RCC_ROP_A - D
  • RCC_ROP_B... more
RCC_COPY
Type of Rectangle Copy Operations. Select one of the following rectangle copy operations and together with the ROP; the source, destination, current color set and transparency are evaluated on each pixel and the result written to the destination.
  • RCC_COPY - Copies the source data to the destination address with the selected ROP.
  • RCC_SOLID_FILL - Fills the specified rectangle with the current color set.
  • RCC_TRANSPARENT_COPY - Operation is the same as the COPY operation except that the source data is compared against the current color set. If the values match, the source data is not written to the destination. The source... more
RCC_SOLID_FILL
Type of Rectangle Copy Operations. Select one of the following rectangle copy operations and together with the ROP; the source, destination, current color set and transparency are evaluated on each pixel and the result written to the destination.
  • RCC_COPY - Copies the source data to the destination address with the selected ROP.
  • RCC_SOLID_FILL - Fills the specified rectangle with the current color set.
  • RCC_TRANSPARENT_COPY - Operation is the same as the COPY operation except that the source data is compared against the current color set. If the values match, the source data is not written to the destination. The source... more
RCC_TRANSPARENT_COPY
Type of Rectangle Copy Operations. Select one of the following rectangle copy operations and together with the ROP; the source, destination, current color set and transparency are evaluated on each pixel and the result written to the destination.
  • RCC_COPY - Copies the source data to the destination address with the selected ROP.
  • RCC_SOLID_FILL - Fills the specified rectangle with the current color set.
  • RCC_TRANSPARENT_COPY - Operation is the same as the COPY operation except that the source data is compared against the current color set. If the values match, the source data is not written to the destination. The source... more
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Rectangle Copy Operations


Rectangle Functions Functions

Contents | Index | Home
Rectangle Functions Functions
Rectangle Functions
Functions
Name | Description
Bar | This function draws a bar given the left, top and right, bottom corners with the current color.
DrawPoly | This function draws a polygon with the current line type using the given number of points. The polygon points (polyPoints) are stored in an array arranged in the following order:
Library API > Graphics Primitive Layer API > Rectangle Functions


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Primitive Layer API > Rectangle Functions


Legend

Contents | Index | Home
Legend
Rectangle Functions
Legend
Method
Library API > Graphics Primitive Layer API > Rectangle Functions


Rectangle Functions Macros

Contents | Index | Home
Rectangle Functions Macros
Rectangle Functions
Macros
Name | Description
Rectangle | This macro draws a rectangle with the given left, top and right, bottom corners. Current line type is used.
Library API > Graphics Primitive Layer API > Rectangle Functions


Display Device Driver Level Primitives Functions

Contents | Index | Home
Display Device Driver Level Primitives Functions
Display Device Driver Level Primitives
Functions
Name | Description
GetPixel | Returns pixel color at the given x,y coordinate position.
PutPixel | Puts pixel with the given x,y coordinate position.
SetClip | Enables/disables clipping.
SetClipRgn | Sets clipping region.
TransparentColorEnable | Sets current transparent color. PutImage() will not render pixels that matches the set transparent color. To enable Transparent Color feature, define the macro USE_TRANSPARENT_COLOR in the GraphicsConfig.h file.
DisplayBrightness | Sets the brightness of the display.
CopyBlock | Copies a block of data from source specified by srcAddr and srcOffset to the destination specified by dstAddr and dstOffset. This is similar to the CopyWindow() and but instead of using left, top position of the source and destination, it uses offsets instead. This is a blocking function.
CopyPageWindow | This is a blocking call. A windows is a rectangular area with the given width and height of a page. The source and destination window can be located in different pages and each page is assumed to have the same dimensions (equal width and height).
CopyWindow | A windows is a rectangular area with the given width and height located in the given base source address. The source and destination window can be located in the same base address. If this is the case, then srcAddr = dstAddr. The operation is similar to CopyPageWindow() but instead of using page numbers, addresses are used for versatility. This is a blocking function.
SetActivePage | Sets active graphic page.
SetVisualPage | Sets graphic page to display.
Library API > Display Device Driver Layer API > Display Device Driver Level Primitives


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Display Device Driver Layer API > Display Device Driver Level Primitives


Legend

Contents | Index | Home
Legend
Display Device Driver Level Primitives
Legend
Method
Library API > Display Device Driver Layer API > Display Device Driver Level Primitives


Display Device Driver Level Primitives Macros

Contents | Index | Home
Display Device Driver Level Primitives Macros
Display Device Driver Level Primitives
Macros
Name | Description
GetColor | Returns current drawing color.
SetColor | Sets current drawing color.
GetMaxX | Returns maximum horizontal coordinate.
GetMaxY | Returns maximum vertical coordinate.
GetClipBottom | Returns bottom clipping border.
GetClipLeft | Returns left clipping border.
GetClipRight | Returns right clipping border.
GetClipTop | Returns top clipping border.
CLIP_DISABLE | Disables clipping.
CLIP_ENABLE | Enables clipping.
TransparentColorDisable | Disables the transparent color function.
GetTransparentColorStatus | Returns the current transparent color function enable status.
GetTransparentColor | Returns the current transparent color value.
TRANSPARENT_COLOR_DISABLE | Check of transparent color is not performed
TRANSPARENT_COLOR_ENABLE | Check pixel if color is equal to transparent color, if equal do not render pixel
GetPageAddress | Returns the address of the given page.
Library API > Display Device Driver Layer API > Display Device Driver Level Primitives


Topics

Contents | Index | Home
Topics
Display Device Driver Level Primitives
Topics
Name | Description
Color Definition | The device driver must also implement the definition of standard color set based on the color format used.
Library API > Display Device Driver Layer API > Display Device Driver Level Primitives


Scan Key Codes Macros

Contents | Index | Home
Scan Key Codes Macros
Scan Key Codes
Macros
Name | Description
SCAN_BS_PRESSED | Back space key pressed.
SCAN_BS_RELEASED | Back space key released.
SCAN_CR_PRESSED | Carriage return pressed.
SCAN_CR_RELEASED | Carriage return released.
SCAN_DEL_PRESSED | Delete key pressed.
SCAN_DEL_RELEASED | Delete key released.
SCAN_DOWN_PRESSED | Down key pressed.
SCAN_DOWN_RELEASED | Down key released.
SCAN_END_PRESSED | End key pressed.
SCAN_END_RELEASED | End key released.
SCAN_HOME_PRESSED | Home key pressed.
SCAN_HOME_RELEASED | Home key released.
SCAN_LEFT_PRESSED | Left key pressed.
SCAN_LEFT_RELEASED | Left key released.
SCAN_PGDOWN_PRESSED | Page down key pressed.
SCAN_PGDOWN_RELEASED | Page down key released.
SCAN_PGUP_PRESSED | Page up key pressed.
SCAN_PGUP_RELEASED | Page up key released.
SCAN_RIGHT_PRESSED | Right key pressed.
SCAN_RIGHT_RELEASED | Right key released.
SCAN_SPACE_PRESSED | Space key pressed.
SCAN_SPACE_RELEASED | Space key released.
SCAN_TAB_PRESSED | Tab key pressed.
SCAN_TAB_RELEASED | Tab key released.
SCAN_UP_PRESSED | Up key pressed.
SCAN_UP_RELEASED | Up key released.
Library API > Graphics Object Layer API > GOL Messages > Scan Key Codes


Set Up Display Interface Macros

Contents | Index | Home
Set Up Display Interface Macros
Set Up Display Interface
Macros
Name
Description
GFX_GCLK_DIVIDER
The following are additional Hardware Profile macros used when using the driver for the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family) (PIC24FJ256DA210_DEV_BOARD).
  • When using internal or external memory
    • GFX_GCLK_DIVIDER - Set the clock divider for the pixel clock.
    • GFX_DISPLAY_BUFFER_START_ADDRESS - Set the Display Buffer location.
    • GFX_DISPLAY_BUFFER_LENGTH - Set the Display Buffer length (size) in bytes. This is calculated by the display's width*height*(color depth/2).
  • When using external memory only. External memory may be placed in chip select 1 (CS1) and/or chip select 2 (CS2) regions. Refer to EPMP Family Reference Manual for details on... more
GFX_EPMP_CS1_BASE_ADDRESS
The following are additional Hardware Profile macros used when using the driver for the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family) (PIC24FJ256DA210_DEV_BOARD).
  • When using internal or external memory
    • GFX_GCLK_DIVIDER - Set the clock divider for the pixel clock.
    • GFX_DISPLAY_BUFFER_START_ADDRESS - Set the Display Buffer location.
    • GFX_DISPLAY_BUFFER_LENGTH - Set the Display Buffer length (size) in bytes. This is calculated by the display's width*height*(color depth/2).
  • When using external memory only. External memory may be placed in chip select 1 (CS1) and/or chip select 2 (CS2) regions. Refer to EPMP Family Reference Manual for details on... more
GFX_EPMP_CS1_MEMORY_SIZE
The following are additional Hardware Profile macros used when using the driver for the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family) (PIC24FJ256DA210_DEV_BOARD).
  • When using internal or external memory
    • GFX_GCLK_DIVIDER - Set the clock divider for the pixel clock.
    • GFX_DISPLAY_BUFFER_START_ADDRESS - Set the Display Buffer location.
    • GFX_DISPLAY_BUFFER_LENGTH - Set the Display Buffer length (size) in bytes. This is calculated by the display's width*height*(color depth/2).
  • When using external memory only. External memory may be placed in chip select 1 (CS1) and/or chip select 2 (CS2) regions. Refer to EPMP Family Reference Manual for details on... more
GFX_EPMP_CS2_BASE_ADDRESS
The following are additional Hardware Profile macros used when using the driver for the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family) (PIC24FJ256DA210_DEV_BOARD).
  • When using internal or external memory
    • GFX_GCLK_DIVIDER - Set the clock divider for the pixel clock.
    • GFX_DISPLAY_BUFFER_START_ADDRESS - Set the Display Buffer location.
    • GFX_DISPLAY_BUFFER_LENGTH - Set the Display Buffer length (size) in bytes. This is calculated by the display's width*height*(color depth/2).
  • When using external memory only. External memory may be placed in chip select 1 (CS1) and/or chip select 2 (CS2) regions. Refer to EPMP Family Reference Manual for details on... more
GFX_EPMP_CS2_MEMORY_SIZE
The following are additional Hardware Profile macros used when using the driver for the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family) (PIC24FJ256DA210_DEV_BOARD).
  • When using internal or external memory
    • GFX_GCLK_DIVIDER - Set the clock divider for the pixel clock.
    • GFX_DISPLAY_BUFFER_START_ADDRESS - Set the Display Buffer location.
    • GFX_DISPLAY_BUFFER_LENGTH - Set the Display Buffer length (size) in bytes. This is calculated by the display's width*height*(color depth/2).
  • When using external memory only. External memory may be placed in chip select 1 (CS1) and/or chip select 2 (CS2) regions. Refer to EPMP Family Reference Manual for details on... more
GFX_DISPLAY_BUFFER_LENGTH
The following are additional Hardware Profile macros used when using the driver for the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family) (PIC24FJ256DA210_DEV_BOARD).
  • When using internal or external memory
    • GFX_GCLK_DIVIDER - Set the clock divider for the pixel clock.
    • GFX_DISPLAY_BUFFER_START_ADDRESS - Set the Display Buffer location.
    • GFX_DISPLAY_BUFFER_LENGTH - Set the Display Buffer length (size) in bytes. This is calculated by the display's width*height*(color depth/2).
  • When using external memory only. External memory may be placed in chip select 1 (CS1) and/or chip select 2 (CS2) regions. Refer to EPMP Family Reference Manual for details on... more
GFX_DISPLAY_BUFFER_START_ADDRESS
The following are additional Hardware Profile macros used when using the driver for the Microchip Graphics Module that comes with the PIC Microcontroller (PIC24FJ256DA210 Device Family) (PIC24FJ256DA210_DEV_BOARD).
  • When using internal or external memory
    • GFX_GCLK_DIVIDER - Set the clock divider for the pixel clock.
    • GFX_DISPLAY_BUFFER_START_ADDRESS - Set the Display Buffer location.
    • GFX_DISPLAY_BUFFER_LENGTH - Set the Display Buffer length (size) in bytes. This is calculated by the display's width*height*(color depth/2).
  • When using external memory only. External memory may be placed in chip select 1 (CS1) and/or chip select 2 (CS2) regions. Refer to EPMP Family Reference Manual for details on... more
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Microchip Graphics Controller > Set Up Display Interface


Set Up Functions Functions

Contents | Index | Home
Set Up Functions Functions
Set Up Functions
Functions
Name | Description
ClearDevice | This function clears the screen with the current color and sets the graphic cursor position to (0, 0). Clipping is NOT supported by ClearDevice().
InitGraph | This function initializes the display controller, sets the line type to SOLID_LINE, sets the screen to all BLACK, sets the current drawing color to WHITE, sets the graphic cursor position to upper left corner of the screen, sets active and visual pages to page #0, clears the active page and disables clipping. This function should be called before using the Graphics Primitive Layer.
Library API > Graphics Primitive Layer API > Set Up Functions


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Primitive Layer API > Set Up Functions


Legend

Contents | Index | Home
Legend
Set Up Functions
Legend
Method
Library API > Graphics Primitive Layer API > Set Up Functions


Slider/Scroll Bar Functions

Contents | Index | Home
Slider/Scroll Bar Functions
Slider/Scroll Bar
Functions
Name | Description
SldCreate | This function creates a SLIDER object with the parameters given. Depending on the SLD_SCROLLBAR state bit slider or scrollbar mode is set. If SLD_SCROLLBAR is set, mode is scrollbar; if not set mode is slider. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
SldDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
SldSetPage | This sets the page size of the object. Page size defines the delta change of the thumb position when incremented via SldIncPos() or decremented via SldDecPos(). Page size minimum value is 1. Maximum value is range/2.
SldSetPos | This function sets the position of the slider thumb. Value should be in the set range inclusive. Object must be redrawn to reflect the change.
SldSetRange | This sets the range of the thumb. If this field is changed Object must be completely redrawn to reflect the change.
SldMsgDefault | This function performs the actual state change based on the translated message given. The following state changes are supported:
SldTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar


Legend

Contents | Index | Home
Legend
Slider/Scroll Bar
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar


Slider/Scroll Bar Macros

Contents | Index | Home
Slider/Scroll Bar Macros
Slider/Scroll Bar
Macros
Name | Description
SldGetPage | Returns the current page size of the object. Page size defines the delta change of the thumb position when incremented via SldIncPos() or decremented via SldDecPos(). Page size minimum value is 1. Maximum value is range/2.
SldGetPos | Returns returns the current position of the slider thumb.
SldGetRange | Returns the current range of the thumb.
SldIncPos | This macro increment the slider position by the delta change (page) value set. Object must be redrawn after this function is called to reflect the changes to the object.
SldDecPos | This macro decrement the slider position by the delta change (page) value set. Object must be redrawn after this function is called to reflect the changes to the object.
Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar


Slider/Scroll Bar Structures

Contents | Index | Home
Slider/Scroll Bar Structures
Slider/Scroll Bar
Structures
Name | Description
SLIDER | Defines the parameters required for a slider/scrollbar Object. Depending on the SLD_SCROLLBAR state bit slider or scrollbar mode is set. If SLD_SCROLLBAR is set, mode is scrollbar; if not set mode is slider. For scrollbar mode, focus rectangle is not drawn.
Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar


Topics

Contents | Index | Home
Topics
Slider/Scroll Bar
Topics
Name | Description
Slider States | List of Slider bit states.
Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar


Slider States Macros

Contents | Index | Home
Slider States Macros
Slider States
Macros
Name | Description
SLD_DISABLED | Bit for disabled state
SLD_DRAW | Bit to indicate whole slider must be redrawn
SLD_DRAW_FOCUS | Bit to indicate that only the focus will be redrawn
SLD_DRAW_THUMB | Bit to indicate that only thumb area must be redrawn
SLD_FOCUSED | Bit for focus state
SLD_HIDE | Bit to remove object from screen
SLD_SCROLLBAR | Bit for type usage (0 - Slider, 1 - ScrollBar)
SLD_VERTICAL | Bit for orientation (0 - horizontal, 1 - vertical)
Library API > Graphics Object Layer API > GOL Objects > Slider/Scroll Bar > Slider States


Static Text Functions

Contents | Index | Home
Static Text Functions
Static Text
Functions
Name | Description
StCreate | This function creates a STATICTEXT object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
StDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
StSetText | This function sets the string that will be used for the object.
StTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen and keyboard inputs.
Library API > Graphics Object Layer API > GOL Objects > Static Text


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Static Text


Legend

Contents | Index | Home
Legend
Static Text
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Static Text


Static Text Macros

Contents | Index | Home
Static Text Macros
Static Text
Macros
Name | Description
StGetText | This macro returns the address of the current text string used for the object.
Library API > Graphics Object Layer API > GOL Objects > Static Text


Static Text Structures

Contents | Index | Home
Static Text Structures
Static Text
Structures
Name | Description
STATICTEXT | Defines the parameters required for a Static Text Object.
Library API > Graphics Object Layer API > GOL Objects > Static Text


Topics

Contents | Index | Home
Topics
Static Text
Topics
Name | Description
Static Text States | List of Static Text bit states.
Library API > Graphics Object Layer API > GOL Objects > Static Text


Static Text States Macros

Contents | Index | Home
Static Text States Macros
Static Text States
Macros
Name | Description
ST_CENTER_ALIGN | Bit to indicate text is center aligned.
ST_DISABLED | Bit for disabled state.
ST_DRAW | Bit to indicate static text must be redrawn.
ST_FRAME | Bit to indicate frame is displayed.
ST_HIDE | Bit to remove object from screen.
ST_RIGHT_ALIGN | Bit to indicate text is left aligned.
ST_UPDATE | Bit to indicate that text area only is redrawn.
Library API > Graphics Object Layer API > GOL Objects > Static Text > Static Text States


STN_DISPLAY_WIDTH Macro Macros

Contents | Index | Home
STN_DISPLAY_WIDTH Macro Macros
STN_DISPLAY_WIDTH Macro
Macros
Name | Description
STN_DISPLAY_WIDTH_16 | display interface is 16 bits wide
STN_DISPLAY_WIDTH_4 | display interface is 4 bits wide
STN_DISPLAY_WIDTH_8 | display interface is 8 bits wide
Library API > Graphics Library Configuration > Display Device Driver Layer Configuration > STN_DISPLAY_WIDTH Macro


Style Scheme Functions

Contents | Index | Home
Style Scheme Functions
Style Scheme
Functions
Name | Description
GOLCreateScheme | This function creates a new style scheme object and initializes the parameters to default values. Default values are based on the GOLSchemeDefault defined in GOLSchemeDefault.c file. Application code can override this initialization, See GOLSchemeDefault.
Library API > Graphics Object Layer API > Style Scheme


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Object Layer API > Style Scheme


Legend

Contents | Index | Home
Legend
Style Scheme
Legend
Method
Library API > Graphics Object Layer API > Style Scheme


Style Scheme Macros

Contents | Index | Home
Style Scheme Macros
Style Scheme
Macros
Name | Description
GOLSetScheme | This macro sets the GOL scheme to be used for the object.
GOLGetScheme | This macro gets the GOL scheme used by the given object.
GOLGetSchemeDefault | This macro returns the default GOL scheme pointer.
GOL_EMBOSS_SIZE | This option defines the 3-D effect emboss size for objects. The default value of this is 3 set in GOL.h. If it is not defined in GraphicsConfig.h file then the default value is used.
RGBConvert | This macro converts the color data to the selected COLOR_DEPTH. This macro is only valid when COLOR_DEPTH is 8, 16, or 24.
Library API > Graphics Object Layer API > Style Scheme


Style Scheme Structures

Contents | Index | Home
Style Scheme Structures
Style Scheme
Structures
Name | Description
GOL_SCHEME | GOL scheme defines the style scheme to be used by an object.
Library API > Graphics Object Layer API > Style Scheme


Topics

Contents | Index | Home
Topics
Style Scheme
Topics
Name | Description
Default Style Scheme Settings | Lists the default settings for the style scheme.
Library API > Graphics Object Layer API > Style Scheme


Style Scheme Variables

Contents | Index | Home
Style Scheme Variables
Style Scheme
Variables
Name | Description
GOLFontDefault | This is variable GOLFontDefault.
GOLSchemeDefault | This defines a default GOL scheme that gets populated when an application calls the GOLCreateScheme(). The application can override this definition by defining the macro GFX_SCHEMEDEFAULT in the GraphicsConfig.h header file and defining GOLSchemeDefault structure in the application code. It is important to use the same structure name since the library assumes that this object exists and assigns the default style scheme pointer to this object.
Library API > Graphics Object Layer API > Style Scheme


Text Entry Functions

Contents | Index | Home
Text Entry Functions
Text Entry
Functions
Name | Description
TeCreate | This function creates a TEXTENTRY object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
TeDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. This widget will draw the keys using the function GOLPanelDraw(). The number of keys will depend on the horizontal and vertical parameters given (horizontalKeys*verticakKeys).
TeSetBuffer | This function sets the buffer used to display text. If the buffer is initialized with a string, the string must be a null terminated string. If the string length is greater than MaxSize, string will be truncated to MaxSize. pText must point to a valid memory location with size equal to MaxSize+1. The +1 is used for the string terminator.
TeClearBuffer | This function will clear the data in the display. You must set the drawing state bit TE_UPDATE_TEXT to update the TEXTENTRY on the screen.
TeGetKeyCommand | This function will return the currently used command by a key with the given index.
TeSetKeyCommand | This function will assign a command (TE_DELETE_COM, TE_SPACE_COM or TE_ENTER_COM) to a key with the given index.
TeCreateKeyMembers | This function will create the list of KEYMEMBERS that holds the information on each key. The number of keys is determined by the equation (verticalKeys*horizontalKeys). The object creates the information holder for each key automatically and assigns each entry in the *pText[] array with the first entry automatically assigned to the key with an index of 1. The number of entries to *pText[] must be equal or greater than (verticalKeys*horizontalKeys). The last key is assigned with an index of (verticalKeys*horizontalKeys)-1. No checking is performed on the length of *pText[] entries to match (verticalKeys*horizontalKeys).
TeAddChar | This function will insert a character to the end of the buffer. The character inserted is dependent on the currently pressed key. Drawing states TE_UPDATE_TEXT or TE_DRAW must be set to see the effect of this insertion.
TeIsKeyPressed | This function will test if a key given by its index in the TextEntry object has been pressed.
TeSpaceChar | This function will insert a space character to the end of the buffer. Drawing states TE_UPDATE_TEXT or TE_DRAW must be set to see the effect of this insertion.
TeDelKeyMembers | This function will delete the KEYMEMBER list assigned to the object from memory. Pointer to the KEYMEMBER list is then initialized to NULL.
TeSetKeyText | This function will set the test assigned to a key with the given index.
TeMsgDefault | This function performs the actual state change based on the translated message given. The following state changes are supported:
TeTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. If the message is valid, the keys in the Text Entry object will be scanned to detect which key was pressed. If True, the corresponding text will be displayed, the ‘text’ will also be stored in the TeOutput parameter of the object.
Library API > Graphics Object Layer API > GOL Objects > Text Entry


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Text Entry


Legend

Contents | Index | Home
Legend
Text Entry
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Text Entry


Text Entry Macros

Contents | Index | Home
Text Entry Macros
Text Entry
Macros
Name | Description
TeGetBuffer | This macro will return the currently used buffer in the TextEntry object.
Library API > Graphics Object Layer API > GOL Objects > Text Entry


Text Entry Structures

Contents | Index | Home
Text Entry Structures
Text Entry
Structures
Name | Description
TEXTENTRY | Defines the parameters required for a TextEntry Object.
KEYMEMBER | Defines the parameters and the strings assigned for each key.
Library API > Graphics Object Layer API > GOL Objects > Text Entry


Topics

Contents | Index | Home
Topics
Text Entry
Topics
Name | Description
TextEntry States | List of Text Entry bit states.
Key Command Types | List of available Key command types.
Library API > Graphics Object Layer API > GOL Objects > Text Entry


Text Functions Functions

Contents | Index | Home
Text Functions Functions
Text Functions
Functions
Name | Description
SetFont | This function sets the current font used in OutTextXY(), OutText() and OutChar() functions.
OutChar | This function outputs a character from the current graphic cursor position. OutChar() uses the current active font set with SetFont().
OutText | This function outputs a string of characters starting at the current graphic cursor position. The string must be terminated by a line feed or zero. For Non-Blocking configuration, OutText() may return control to the program due to display device busy status. When this happens zero is returned and OutText() must be called again to continue the outputting of the string. For Blocking configuration, this function always returns a 1. OutText() uses the current active font set with SetFont().
OutTextXY | This function outputs a string of characters starting at the given x, y position. The string must be terminated by a line feed or zero. For Non-Blocking configuration, OutTextXY() may return control to the program due to display device busy status. When this happens zero is returned and OutTextXY() must be called again to continue the outputting of the string. For Blocking configuration, this function always returns a 1. OutTextXY() uses the current active font set with SetFont().
GetTextHeight | This macro returns the height of the specified font. All characters in a given font table have a constant height.
GetTextWidth | This function returns the width of the specified string for the specified font. The string must be terminated by a line feed or zero.
Library API > Graphics Primitive Layer API > Text Functions


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Primitive Layer API > Text Functions


Legend

Contents | Index | Home
Legend
Text Functions
Legend
Method
Library API > Graphics Primitive Layer API > Text Functions


Text Functions Macros

Contents | Index | Home
Text Functions Macros
Text Functions
Macros
Name | Description
GetFontOrientation | Returns font orientation.
SetFontOrientation | Sets font orientation vertical or horizontal.
GFX_Font_GetAntiAliasType | Returns the font anti-alias type.
GFX_Font_SetAntiAliasType | Sets font anti-alias type to either Translucent or opaque.
XCHAR | This macro sets the data type for the strings and characters. There are three types used for XCHAR and the type is selected by adding one of the macros in GraphicsConfig.h.
Library API > Graphics Primitive Layer API > Text Functions


Text Functions Structures

Contents | Index | Home
Text Functions Structures
Text Functions
Structures
Name | Description
FONT_HEADER | Structure describing the font header.
FONT_FLASH | Structure for font stored in FLASH memory.
Library API > Graphics Primitive Layer API > Text Functions


Topics

Contents | Index | Home
Topics
Text Functions
Topics
Name | Description
Anti-Alias Type | Anti-alias type definitions.
Library API > Graphics Primitive Layer API > Text Functions


Text Functions Types

Contents | Index | Home
Text Functions Types
Text Functions
Types
Name | Description
FONT_EXTERNAL | Structure for font stored in EXTERNAL memory space. (example: External SPI or parallel Flash, EDS_EPMP)
Library API > Graphics Primitive Layer API > Text Functions


TextEntry States Macros

Contents | Index | Home
TextEntry States Macros
TextEntry States
Macros
Name | Description
TE_KEY_PRESSED | Bit for press state of one of the keys.
TE_DISABLED | Bit for disabled state.
TE_ECHO_HIDE | Bit to hide the entered characters and instead echo "*" characters to the display.
TE_DRAW | Bit to indicate object must be redrawn.
TE_HIDE | Bit to indicate object must be removed from screen.
TE_UPDATE_KEY | Bit to indicate redraw of a key is needed.
TE_UPDATE_TEXT | Bit to indicate redraw of the text displayed is needed.
Library API > Graphics Object Layer API > GOL Objects > Text Entry > TextEntry States


Transitions Enumerations

Contents | Index | Home
Transitions Enumerations
Transitions
Enumerations
Name | Description
GFX_TRANSITION_DIRECTION | Direction enumeration to determine the direction of the selected GFX_TRANSITION_TYPE.
GFX_TRANSITION_TYPE | Transition type enumeration to determine the type of the transition. Each type will require specific parameters when setting up the transition operation (GFXSetupTransition() or GFXTransition()).
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Transitions


Transitions Functions

Contents | Index | Home
Transitions Functions
Transitions
Functions
Name | Description
GFXTransition | This immediately executes the transition effect using the GFX_TRANSITION_TYPE and the given parameters.
GFXSetupTransition | This sets up the transition effect using the GFX_TRANSITION_TYPE and the given parameters. The actual transition execution will occur when GFXExecutePendingTransition() is called. When DOUBLE_BUFFERING is enabled, GFXExecutePendingTransition() is executed after the current screen is fully rendered.
GFXExecutePendingTransition | This function executes the transition that was set up by GFXSetupTransition(). Status of the transition is returned to indicate if the transition was executed or not. This function is used by the double buffering feature (USE_DOUBLE_BUFFERING) to perform transition operation after the current screen is fully rendered. This function assumes that the source page and destination page are already set up.
GFXIsTransitionPending | This function returns the status of a pending transition, set up by GFXSetupTransition(), waiting to be executed.
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Transitions


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Transitions


Legend

Contents | Index | Home
Legend
Transitions
Legend
Method
Library API > Display Device Driver Layer API > Advanced Display Driver Features > Transitions


Transparent Color Feature in PutImage() Macros

Contents | Index | Home
Transparent Color Feature in PutImage() Macros
Transparent Color Feature in PutImage()
Macros
Name | Description
USE_TRANSPARENT_COLOR | To enable support for transparent color in PutImage(). Enabling this macro enables the use of a transparent color (set by TransparentColorEnable()) in rendering images by PutImage(). When a pixel in the image matches the transparent color set, the pixel is not rendered to the screen. This is useful in rendering rounded icons or images to the screen with a complex background. Define this in GraphicsConfig.h
Library API > Graphics Library Configuration > Graphics Primitive Layer Configuration > Transparent Color Feature in PutImage()


Font Type Selection Macros

Contents | Index | Home
Font Type Selection Macros
Font Type Selection
Macros
Name | Description
USE_MULTIBYTECHAR | To enable support for unicode fonts, USE_MULTIBYTECHAR must be defined. This sets the XCHAR definition (0-2^16 range). See XCHAR for details. Define this in GraphicsConfig.h
USE_UNSIGNED_XCHAR | To enable support for unsigned characters data type for fonts, USE_UNSIGNED_XCHAR must be defined. This sets the XCHAR definition (0-255 range). See XCHAR for details. Define this in GraphicsConfig.h
Library API > Graphics Library Configuration > Graphics Primitive Layer Configuration > Font Type Selection


Window Functions

Contents | Index | Home
Window Functions
Window
Functions
Name | Description
WndCreate | This function creates a WINDOW object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.
WndDraw | This function renders the object on the screen using the current parameter settings. Location of the object is determined by the left, top, right and bottom parameters. The colors used are dependent on the state of the object. The font used is determined by the style scheme set. When rendering objects of the same type, each object must be rendered completely before the rendering of the next object is started. This is to avoid incomplete object rendering.
WndSetText | This function sets the string used for the title bar.
WndTranslateMsg | This function evaluates the message from a user if the message will affect the object or not. The table below enumerates the translated messages for each event of the touch screen inputs.
Library API > Graphics Object Layer API > GOL Objects > Window


Functions

Contents | Index | Home
Legend
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Window


Legend

Contents | Index | Home
Legend
Window
Legend
Method
Library API > Graphics Object Layer API > GOL Objects > Window


Window Macros

Contents | Index | Home
Window Macros
Window
Macros
Name | Description
WndGetText | This macro returns the address of the current text string used for the title bar.
Library API > Graphics Object Layer API > GOL Objects > Window


Window Structures

Contents | Index | Home
Window Structures
Window
Structures
Name | Description
WINDOW | The structure contains data for the window
Library API > Graphics Object Layer API > GOL Objects > Window


Topics

Contents | Index | Home
Topics
Window
Topics
Name | Description
Window States | List of Window bit states.
Library API > Graphics Object Layer API > GOL Objects > Window


Window States Macros

Contents | Index | Home
Window States Macros
Window States
Macros
Name | Description
WND_DISABLED | Bit for disabled state
WND_DRAW | Bits to indicate whole window must be redrawn
WND_DRAW_CLIENT | Bit to indicate client area must be redrawn
WND_DRAW_TITLE | Bit to indicate title area must be redrawn
WND_FOCUSED | Bit for focus state
WND_HIDE | Bit to indicate window must be removed from screen
WND_TITLECENTER | Bit to center the text on the Title Area
Library API > Graphics Object Layer API > GOL Objects > Window > Window States


Contents

Contents | Index | Home
Contents
This is the table of contents of this documentation.
Introduction
Software License Agreement.txt
Release Notes
Getting Started
Demo Projects
Demo Summary
Microchip Application Library Abbreviations
Demo Compatibility Matrix
Library Architecture
Graphics Object Layer
Object Rendering
Graphics Primitive Layer
Display Device Driver Layer
Library API
Graphics Library Configuration
Graphics Object Layer Configuration
Input Device Selection
USE_KEYBOARD Macro
USE_TOUCHSCREEN Macro
Focus Support Selection
USE_FOCUS Macro
Graphics Object Selection
USE_ANALOGCLOCK Macro
USE_BUTTON Macro
USE_BUTTON_MULTI_LINE Macro
USE_CHECKBOX Macro
USE_DIGITALMETER Macro
USE_EDITBOX Macro
USE_GROUPBOX Macro
USE_LISTBOX Macro
USE_METER Macro
USE_PICTURE Macro
USE_PROGRESSBAR Macro
USE_RADIOBUTTON Macro
USE_ROUNDDIAL Macro
USE_SLIDER Macro
USE_STATICTEXT Macro
USE_WINDOW Macro
USE_CUSTOM Macro
USE_GOL Macro
USE_TEXTENTRY Macro
Graphics Primitive Layer Configuration
Image Compression Option
USE_COMP_IPU Macro
USE_COMP_RLE Macro
Font Type Selection
USE_MULTIBYTECHAR Macro
USE_UNSIGNED_XCHAR Macro
Advanced Font Features Selection
USE_ANTIALIASED_FONTS Macro
Gradient Bar Rendering
USE_GRADIENT Macro
Transparent Color Feature in PutImage()
USE_TRANSPARENT_COLOR Macro
External Memory Buffer
Display Device Driver Layer Configuration
USE_ALPHABLEND Macro
USE_DOUBLE_BUFFERING Macro
GFX_LCD_TYPE Macro
GFX_LCD_CSTN Macro
GFX_LCD_MSTN Macro
GFX_LCD_OFF Macro
GFX_LCD_TFT Macro
STN_DISPLAY_WIDTH Macro
STN_DISPLAY_WIDTH_16 Macro
STN_DISPLAY_WIDTH_4 Macro
STN_DISPLAY_WIDTH_8 Macro
Application Configuration
Configuration Setting
USE_NONBLOCKING_CONFIG Macro
Font Source Selection
USE_FONT_FLASH Macro
USE_FONT_EXTERNAL Macro
Image Source Selection
USE_BITMAP_FLASH Macro
USE_BITMAP_EXTERNAL Macro
Miscellaneous
USE_PALETTE_EXTERNAL Macro
USE_PALETTE Macro
COLOR_DEPTH Macro
GFX_free Macro
GFX_malloc Macro
GraphicsConfig.h Example
Hardware Profile
PMP Interface
USE_8BIT_PMP Macro
USE_16BIT_PMP Macro
Development Platform Used
EXPLORER_16 Macro
PIC24FJ256DA210_DEV_BOARD Macro
MEB_BOARD Macro
PIC_SK Macro
Graphics PICtail Used
GFX_PICTAIL_LCC Macro
GFX_PICTAIL_V3 Macro
GFX_PICTAIL_V3E Macro
Display Controller Used
GFX_USE_DISPLAY_CONTROLLER_DMA Macro
GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210 Macro
GFX_USE_DISPLAY_CONTROLLER_S1D13517 Macro
GFX_USE_DISPLAY_CONTROLLER_SSD1926 Macro
Display Panel Used
GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q Macro
GFX_USE_DISPLAY_PANEL_TFT_640480_8_E Macro
GFX_USE_DISPLAY_PANEL_TFT_800480_33_E Macro
GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E Macro
Device Driver Options
DISP_DATA_WIDTH Macro
DISP_ORIENTATION Macro
DISP_HOR_RESOLUTION Macro
DISP_VER_RESOLUTION Macro
DISP_HOR_FRONT_PORCH Macro
DISP_HOR_BACK_PORCH Macro
DISP_VER_FRONT_PORCH Macro
DISP_VER_BACK_PORCH Macro
DISP_HOR_PULSE_WIDTH Macro
DISP_VER_PULSE_WIDTH Macro
DISP_INV_LSHIFT Macro
HardwareProfile.h Example
Graphics Object Layer API
GOL Objects
GOL_OBJ_TYPE Enumeration
OBJ_HEADER Structure
DRAW_FUNC Type
FREE_FUNC Type
MSG_DEFAULT_FUNC Type
MSG_FUNC Type
Analog Clock
Analog Clock States
AC_DRAW Macro
AC_DISABLED Macro
AC_HIDE Macro
AC_PRESSED Macro
AC_TICK Macro
UPDATE_HOUR Macro
UPDATE_MINUTE Macro
UPDATE_SECOND Macro
AcCreate Function
AcDraw Function
AcSetHour Function
AcSetMinute Function
AcSetSecond Function
ANALOGCLOCK Structure
Button
Button States
BTN_DISABLED Macro
BTN_DRAW Macro
BTN_DRAW_FOCUS Macro
BTN_FOCUSED Macro
BTN_HIDE Macro
BTN_PRESSED Macro
BTN_TEXTBOTTOM Macro
BTN_TEXTLEFT Macro
BTN_TEXTRIGHT Macro
BTN_TEXTTOP Macro
BTN_TOGGLE Macro
BTN_TWOTONE Macro
BTN_NOPANEL Macro
BtnCreate Function
BtnDraw Function
BtnGetText Macro
BtnSetText Function
BtnGetBitmap Macro
BtnSetBitmap Macro
BtnMsgDefault Function
BtnTranslateMsg Function
BUTTON Structure
Chart
Chart States
CH_DISABLED Macro
CH_DRAW Macro
CH_DRAW_DATA Macro
CH_3D_ENABLE Macro
CH_BAR Macro
CH_BAR_HOR Macro
CH_DONUT Macro
CH_LEGEND Macro
CH_NUMERIC Macro
CH_PERCENT Macro
CH_PIE Macro
CH_VALUE Macro
CH_HIDE Macro
Data Series Status Settings
HIDE_DATA Macro
SHOW_DATA Macro
Chart Examples
ChCreate Function
ChDraw Function
ChAddDataSeries Function
ChRemoveDataSeries Function
ChShowSeries Macro
ChHideSeries Macro
ChGetShowSeriesCount Macro
ChGetShowSeriesStatus Macro
ChSetValueLabel Macro
ChGetValueLabel Macro
ChGetValueMax Macro
ChGetValueMin Macro
ChSetValueRange Function
ChGetValueRange Macro
ChSetSampleLabel Macro
ChGetSampleLabel Macro
ChGetSampleStart Macro
ChGetSampleEnd Macro
ChSetPercentRange Function
ChGetPercentRange Macro
ChSetSampleRange Function
ChGetSampleRange Macro
ChGetPercentMax Macro
ChGetPercentMin Macro
ChSetColorTable Macro
ChGetColorTable Macro
ChSetTitle Macro
ChGetTitle Macro
ChSetTitleFont Macro
ChGetTitleFont Macro
ChGetAxisLabelFont Macro
ChSetAxisLabelFont Macro
ChGetGridLabelFont Macro
ChSetGridLabelFont Macro
ChFreeDataSeries Function
ChTranslateMsg Function
CHART Structure
DATASERIES Structure
CHARTPARAM Structure
Color Table
CH_CLR0 Macro
CH_CLR1 Macro
CH_CLR2 Macro
CH_CLR3 Macro
CH_CLR4 Macro
CH_CLR5 Macro
CH_CLR6 Macro
CH_CLR7 Macro
CH_CLR8 Macro
CH_CLR9 Macro
CH_CLR10 Macro
CH_CLR11 Macro
CH_CLR12 Macro
CH_CLR13 Macro
CH_CLR14 Macro
CH_CLR15 Macro
Checkbox
Check Box States
CB_CHECKED Macro
CB_DISABLED Macro
CB_DRAW Macro
CB_DRAW_CHECK Macro
CB_DRAW_FOCUS Macro
CB_FOCUSED Macro
CB_HIDE Macro
CbCreate Function
CbDraw Function
CbGetText Macro
CbSetText Function
CbMsgDefault Function
CbTranslateMsg Function
CHECKBOX Structure
Round Dial
Dial States
RDIA_DISABLED Macro
RDIA_DRAW Macro
RDIA_HIDE Macro
RDIA_ROT_CCW Macro
RDIA_ROT_CW Macro
RdiaCreate Function
RdiaDraw Function
RdiaIncVal Macro
RdiaDecVal Macro
RdiaGetVal Macro
RdiaSetVal Macro
RdiaMsgDefault Function
RdiaTranslateMsg Function
ROUNDDIAL Structure
Digital Meter
Digital Meter States
DM_DISABLED Macro
DM_DRAW Macro
DM_HIDE Macro
DM_CENTER_ALIGN Macro
DM_RIGHT_ALIGN Macro
DM_FRAME Macro
DM_UPDATE Macro
DmCreate Function
DmDraw Function
DmGetValue Macro
DmSetValue Function
DmDecVal Macro
DmIncVal Macro
DmTranslateMsg Function
DIGITALMETER Structure
Edit Box
Edit Box States
EB_CENTER_ALIGN Macro
EB_DISABLED Macro
EB_DRAW Macro
EB_HIDE Macro
EB_FOCUSED Macro
EB_RIGHT_ALIGN Macro
EB_DRAW_CARET Macro
EB_CARET Macro
EbCreate Function
EbDraw Function
EbGetText Macro
EbSetText Function
EbAddChar Function
EbDeleteChar Function
EbMsgDefault Function
EbTranslateMsg Function
EDITBOX Structure
Grid
Grid States
GRID_FOCUSED Macro
GRID_DISABLED Macro
GRID_SHOW_LINES Macro
GRID_SHOW_FOCUS Macro
GRID_SHOW_BORDER_ONLY Macro
GRID_SHOW_SEPARATORS_ONLY Macro
GRID_DRAW_ITEMS Macro
GRID_DRAW_ALL Macro
GRID_HIDE Macro
Grid Item States
GRIDITEM_SELECTED Macro
GRIDITEM_IS_TEXT Macro
GRIDITEM_IS_BITMAP Macro
GRIDITEM_TEXTBOTTOM Macro
GRIDITEM_TEXTLEFT Macro
GRIDITEM_TEXTRIGHT Macro
GRIDITEM_TEXTTOP Macro
GRIDITEM_DRAW Macro
GridCreate Function
GridDraw Function
GridClearCellState Function
GridGetFocusX Macro
GridGetFocusY Macro
GRID_OUT_OF_BOUNDS Macro
GRID_SUCCESS Macro
GridFreeItems Function
GridGetCell Function
GridSetCell Function
GridSetCellState Function
GridSetFocus Function
GridMsgDefault Function
GridTranslateMsg Function
GRID Structure
GRIDITEM Structure
Group Box
Group Box States
GB_CENTER_ALIGN Macro
GB_DISABLED Macro
GB_DRAW Macro
GB_HIDE Macro
GB_RIGHT_ALIGN Macro
GbCreate Function
GbDraw Function
GbGetText Macro
GbSetText Function
GbTranslateMsg Function
GROUPBOX Structure
List Box
List Box States
LB_RIGHT_ALIGN Macro
LB_SINGLE_SEL Macro
LB_CENTER_ALIGN Macro
LB_DISABLED Macro
LB_DRAW Macro
LB_DRAW_FOCUS Macro
LB_DRAW_ITEMS Macro
LB_FOCUSED Macro
LB_HIDE Macro
List Item Status
LB_STS_SELECTED Macro
LB_STS_REDRAW Macro
LbCreate Function
LbDraw Function
LbGetItemList Macro
LbAddItem Function
LbDelItem Function
LbChangeSel Function
LbSetSel Macro
LbGetSel Function
LbGetFocusedItem Function
LbSetFocusedItem Function
LbGetCount Macro
LbGetVisibleCount Macro
LbSetBitmap Macro
LbGetBitmap Macro
LbDelItemsList Function
LbMsgDefault Function
LbTranslateMsg Function
LISTBOX Structure
LISTITEM Structure
Meter
Meter States
MTR_DISABLED Macro
MTR_DRAW Macro
MTR_HIDE Macro
MTR_RING Macro
MTR_DRAW_UPDATE Macro
MtrCreate Function
MtrDraw Function
MtrSetVal Function
MtrGetVal Macro
MtrDecVal Macro
MtrIncVal Macro
MtrSetScaleColors Macro
MtrSetTitleFont Macro
MtrSetValueFont Macro
METER_TYPE Macro
MTR_ACCURACY Macro
MtrMsgDefault Function
MtrTranslateMsg Function
METER Structure
Picture Control
Picture States
PICT_DISABLED Macro
PICT_DRAW Macro
PICT_FRAME Macro
PICT_HIDE Macro
PictCreate Function
PictDraw Function
PictSetBitmap Macro
PictGetBitmap Macro
PictGetScale Macro
PictSetScale Macro
PictTranslateMsg Function
PICTURE Structure
Progress Bar
Progress Bar States
PB_DISABLED Macro
PB_DRAW Macro
PB_DRAW_BAR Macro
PB_HIDE Macro
PB_VERTICAL Macro
PbCreate Function
PbDraw Function
PbSetRange Function
PbGetRange Macro
PbSetPos Function
PbGetPos Macro
PbTranslateMsg Function
PROGRESSBAR Structure
Radio Button
Radio Button States
RB_CHECKED Macro
RB_DISABLED Macro
RB_DRAW Macro
RB_DRAW_CHECK Macro
RB_DRAW_FOCUS Macro
RB_FOCUSED Macro
RB_GROUP Macro
RB_HIDE Macro
RbCreate Function
RbDraw Function
RbGetCheck Function
RbSetCheck Function
RbGetText Macro
RbSetText Function
RbMsgDefault Function
RbTranslateMsg Function
RADIOBUTTON Structure
Slider/Scroll Bar
Slider States
SLD_DISABLED Macro
SLD_DRAW Macro
SLD_DRAW_FOCUS Macro
SLD_DRAW_THUMB Macro
SLD_FOCUSED Macro
SLD_HIDE Macro
SLD_SCROLLBAR Macro
SLD_VERTICAL Macro
SldCreate Function
SldDraw Function
SldSetPage Function
SldGetPage Macro
SldSetPos Function
SldGetPos Macro
SldSetRange Function
SldGetRange Macro
SldIncPos Macro
SldDecPos Macro
SldMsgDefault Function
SldTranslateMsg Function
SLIDER Structure
Static Text
Static Text States
ST_CENTER_ALIGN Macro
ST_DISABLED Macro
ST_DRAW Macro
ST_FRAME Macro
ST_HIDE Macro
ST_RIGHT_ALIGN Macro
ST_UPDATE Macro
StCreate Function
StDraw Function
StGetText Macro
StSetText Function
StTranslateMsg Function
STATICTEXT Structure
Text Entry
TextEntry States
TE_KEY_PRESSED Macro
TE_DISABLED Macro
TE_ECHO_HIDE Macro
TE_DRAW Macro
TE_HIDE Macro
TE_UPDATE_KEY Macro
TE_UPDATE_TEXT Macro
Key Command Types
TE_DELETE_COM Macro
TE_ENTER_COM Macro
TE_SPACE_COM Macro
TeCreate Function
TeDraw Function
TeGetBuffer Macro
TeSetBuffer Function
TeClearBuffer Function
TeGetKeyCommand Function
TeSetKeyCommand Function
TeCreateKeyMembers Function
TeAddChar Function
TeIsKeyPressed Function
TeSpaceChar Function
TeDelKeyMembers Function
TeSetKeyText Function
TeMsgDefault Function
TeTranslateMsg Function
TEXTENTRY Structure
KEYMEMBER Structure
Window
Window States
WND_DISABLED Macro
WND_DRAW Macro
WND_DRAW_CLIENT Macro
WND_DRAW_TITLE Macro
WND_FOCUSED Macro
WND_HIDE Macro
WND_TITLECENTER Macro
WndCreate Function
WndDraw Function
WndGetText Macro
WndSetText Function
WndTranslateMsg Function
WINDOW Structure
Object States
Common Object States
FOCUSED Macro
DISABLED Macro
HIDE Macro
DRAW Macro
DRAW_FOCUS Macro
DRAW_UPDATE Macro
GetState Macro
ClrState Macro
SetState Macro
Object Management
GOLAddObject Function
GOLFindObject Function
GOLRedraw Macro
GOLRedrawRec Function
GOLDraw Function
GOLDrawComplete Macro
GOLDrawCallback Function
GOLFree Function
GetObjType Macro
GetObjID Macro
GetObjNext Macro
GOLDeleteObject Function
GOLDeleteObjectByID Function
GOLNewList Macro
GOLGetList Macro
GOLSetList Macro
GOLSetFocus Function
IsObjUpdated Macro
GOLInit Function
GOLGetFocus Macro
GOLCanBeFocused Function
GOLGetFocusNext Function
GOLGetFocusPrev Function
GOLPanelDraw Macro
GOLPanelDrawTsk Function
GOLTwoTonePanelDrawTsk Function
GOL Messages
GOLMsg Function
GOLMsgCallback Function
GOL_MSG Structure
TRANS_MSG Enumeration
INPUT_DEVICE_EVENT Enumeration
INPUT_DEVICE_TYPE Enumeration
Scan Key Codes
SCAN_BS_PRESSED Macro
SCAN_BS_RELEASED Macro
SCAN_CR_PRESSED Macro
SCAN_CR_RELEASED Macro
SCAN_DEL_PRESSED Macro
SCAN_DEL_RELEASED Macro
SCAN_DOWN_PRESSED Macro
SCAN_DOWN_RELEASED Macro
SCAN_END_PRESSED Macro
SCAN_END_RELEASED Macro
SCAN_HOME_PRESSED Macro
SCAN_HOME_RELEASED Macro
SCAN_LEFT_PRESSED Macro
SCAN_LEFT_RELEASED Macro
SCAN_PGDOWN_PRESSED Macro
SCAN_PGDOWN_RELEASED Macro
SCAN_PGUP_PRESSED Macro
SCAN_PGUP_RELEASED Macro
SCAN_RIGHT_PRESSED Macro
SCAN_RIGHT_RELEASED Macro
SCAN_SPACE_PRESSED Macro
SCAN_SPACE_RELEASED Macro
SCAN_TAB_PRESSED Macro
SCAN_TAB_RELEASED Macro
SCAN_UP_PRESSED Macro
SCAN_UP_RELEASED Macro
Style Scheme
GOLCreateScheme Function
GOLSetScheme Macro
GOLGetScheme Macro
GOLGetSchemeDefault Macro
GOL_SCHEME Structure
Default Style Scheme Settings
FONTDEFAULT Variable
GOLFontDefault Variable
GOL_EMBOSS_SIZE Macro
GOLSchemeDefault Variable
RGBConvert Macro
GOL Global Variables
_pDefaultGolScheme Variable
_pGolObjects Variable
_pObjectFocused Variable
Graphics Primitive Layer API
Text Functions
FONT_HEADER Structure
FONT_FLASH Structure
FONT_EXTERNAL Type
SetFont Function
GetFontOrientation Macro
SetFontOrientation Macro
GFX_Font_GetAntiAliasType Macro
GFX_Font_SetAntiAliasType Macro
OutChar Function
OutText Function
OutTextXY Function
GetTextHeight Function
GetTextWidth Function
XCHAR Macro
Anti-Alias Type
ANTIALIAS_OPAQUE Macro
ANTIALIAS_TRANSLUCENT Macro
Gradient
BarGradient Function
BevelGradient Function
GFX_GRADIENT_TYPE Enumeration
GFX_GRADIENT_STYLE Structure
Line Functions
Line Function
LineRel Macro
LineTo Macro
SetLineThickness Macro
SetLineType Macro
Line Types
SOLID_LINE Macro
DASHED_LINE Macro
DOTTED_LINE Macro
Line Size
NORMAL_LINE Macro
THICK_LINE Macro
Rectangle Functions
Bar Function
Rectangle Macro
DrawPoly Function
Circle Functions
Circle Macro
FillCircle Macro
Arc Function
DrawArc Function
Bevel Function
FillBevel Function
SetBevelDrawType Macro
Graphic Cursor
GetX Macro
GetY Macro
MoveRel Macro
MoveTo Macro
Bitmap Functions
PutImage Function
GetImageHeight Function
GetImageWidth Function
BITMAP_HEADER Structure
Bitmap Settings
IMAGE_NORMAL Macro
IMAGE_X2 Macro
Bitmap Source
External Memory
ExternalMemoryCallback Function
EXTERNAL_FONT_BUFFER_SIZE Macro
Memory Type
Set Up Functions
ClearDevice Function
InitGraph Function
GFX_RESOURCE Enumeration
GFX_IMAGE_HEADER Structure
IMAGE_FLASH Structure
IMAGE_RAM Structure
GFX_EXTDATA Structure
Display Device Driver Layer API
Display Device Driver Level Primitives
GetPixel Function
PutPixel Function
GetColor Macro
SetColor Macro
GetMaxX Macro
GetMaxY Macro
SetClip Function
SetClipRgn Function
GetClipBottom Macro
GetClipLeft Macro
GetClipRight Macro
GetClipTop Macro
CLIP_DISABLE Macro
CLIP_ENABLE Macro
TransparentColorEnable Function
TransparentColorDisable Macro
GetTransparentColorStatus Macro
GetTransparentColor Macro
TRANSPARENT_COLOR_DISABLE Macro
TRANSPARENT_COLOR_ENABLE Macro
DisplayBrightness Function
GetPageAddress Macro
CopyBlock Function
CopyPageWindow Function
CopyWindow Function
SetActivePage Function
SetVisualPage Function
Color Definition
BLACK Macro
BLUE Macro
BRIGHTBLUE Macro
BRIGHTCYAN Macro
BRIGHTGREEN Macro
BRIGHTMAGENTA Macro
BRIGHTRED Macro
BRIGHTYELLOW Macro
BROWN Macro
CYAN Macro
DARKGRAY Macro
GRAY0 Macro
GRAY1 Macro
GRAY2 Macro
GRAY3 Macro
GRAY4 Macro
GRAY5 Macro
GRAY6 Macro
GREEN Macro
LIGHTBLUE Macro
LIGHTCYAN Macro
LIGHTGRAY Macro
LIGHTGREEN Macro
LIGHTMAGENTA Macro
LIGHTRED Macro
MAGENTA Macro
RED Macro
WHITE Macro
YELLOW Macro
Display Device Driver Control
IsDeviceBusy Function
ResetDevice Function
Advanced Display Driver Features
Alpha Blending
AlphaBlendWindow Function
GFXGetPageOriginAddress Function
GFXGetPageXYAddress Function
Transitions
GFXTransition Function
GFXSetupTransition Function
GFXExecutePendingTransition Function
GFXIsTransitionPending Function
GFX_TRANSITION_DIRECTION Enumeration
GFX_TRANSITION_TYPE Enumeration
Microchip Graphics Controller
Rectangle Copy Operations
ROPBlock Function
Scroll Function
RCC_SRC_ADDR_CONTINUOUS Macro
RCC_ROP_0 Macro
RCC_COPY Macro
Double Buffering
SwitchOffDoubleBuffering Function
SwitchOnDoubleBuffering Function
InvalidateRectangle Function
RequestDisplayUpdate Function
UpdateDisplayNow Function
Decompressing DEFLATEd data
Decompress Function
Palette Mode
ClearPaletteChangeError Function
DisablePalette Function
EnablePalette Function
GetPaletteChangeError Function
IsPaletteEnabled Function
PaletteInit Function
RequestPaletteChange Function
SetPalette Function
SetPaletteBpp Function
SetPaletteFlash Function
PALETTE_FLASH Structure
PALETTE_HEADER Structure
PALETTE_EXTERNAL Type
RequestEntirePaletteChange Macro
SetEntirePalette Macro
Palette.h
Set Up Display Interface
GFX_GCLK_DIVIDER Macro
GFX_EPMP_CS1_BASE_ADDRESS Macro
GFX_EPMP_CS1_MEMORY_SIZE Macro
GFX_EPMP_CS2_BASE_ADDRESS Macro
GFX_EPMP_CS2_MEMORY_SIZE Macro
GFX_DISPLAY_BUFFER_LENGTH Macro
GFX_DISPLAY_BUFFER_START_ADDRESS Macro
External or Internal Memory and Palettes
Image Decoders
Image Decoders API
Image Decoder Configuration
IMG_SUPPORT_BMP Macro
IMG_SUPPORT_GIF Macro
IMG_SUPPORT_JPEG Macro
IMG_SUPPORT_IMAGE_DECODER_LOOP_CALLBACK Macro
IMG_USE_ONLY_565_GRAPHICS_DRIVER_FOR_OUTPUT Macro
IMG_USE_ONLY_MDD_FILE_SYSTEM_FOR_INPUT Macro
ImageDecode Function
ImageDecoderInit Function
ImageLoopCallbackRegister Function
ImageDecodeTask Function
ImageFullScreenDecode Macro
ImageAbort Macro
_BMPDECODER Structure
_GIFDECODER Structure
_JPEGDECODER Structure
Miscellaneous Topics
Starting a New Project
Changing the default Font
Advanced Font Features
Using Primitive Rendering Functions in Blocking and Non-Blocking Modes
Using Microchip Graphics Module Color Look Up Table in Applications
Converting Images to Use a Common Palette in GIMP
How to Define Colors in your Applications
Connecting RGB data bus
Adding New Device Driver
References


Index

Contents | Index | Home
Index
These are all topics and symbols available in this documentation.
_ | A | B | C | D | E | F | G | H | I | K | L | M | N | O | P | R | S | T | U | W | X | Y
_
_BMPDECODER structure
_GIFDECODER structure
_JPEGDECODER structure
_pDefaultGolScheme variable
_pGolObjects variable
_pObjectFocused variable
A
AC_DISABLED macro
AC_DRAW macro
AC_HIDE macro
AC_PRESSED macro
AC_TICK macro
AcCreate function
AcDraw function
AcSetHour function
AcSetMinute function
AcSetSecond function
Adding New Device Driver
Advanced Display Driver Features
Advanced Font Features
Advanced Font Features Selection
Alpha Blending
AlphaBlendWindow function
Analog Clock
Analog Clock States
ANALOGCLOCK structure
Anti-Alias Type
ANTIALIAS_OPAQUE macro
ANTIALIAS_TRANSLUCENT macro
Application Configuration
Arc function
B
Bar function
BarGradient function
Bevel function
BevelGradient function
Bitmap Functions
Bitmap Settings
Bitmap Source
BITMAP_HEADER structure
BLACK macro
BLUE macro
BRIGHTBLUE macro
BRIGHTCYAN macro
BRIGHTGREEN macro
BRIGHTMAGENTA macro
BRIGHTRED macro
BRIGHTYELLOW macro
BROWN macro
BTN_DISABLED macro
BTN_DRAW macro
BTN_DRAW_FOCUS macro
BTN_FOCUSED macro
BTN_HIDE macro
BTN_NOPANEL macro
BTN_PRESSED macro
BTN_TEXTBOTTOM macro
BTN_TEXTLEFT macro
BTN_TEXTRIGHT macro
BTN_TEXTTOP macro
BTN_TOGGLE macro
BTN_TWOTONE macro
BtnCreate function
BtnDraw function
BtnGetBitmap macro
BtnGetText macro
BtnMsgDefault function
BtnSetBitmap macro
BtnSetText function
BtnTranslateMsg function
Button
Button States
BUTTON structure
C
CB_CHECKED macro
CB_DISABLED macro
CB_DRAW macro
CB_DRAW_CHECK macro
CB_DRAW_FOCUS macro
CB_FOCUSED macro
CB_HIDE macro
CbCreate function
CbDraw function
CbGetText macro
CbMsgDefault function
CbSetText function
CbTranslateMsg function
CH_3D_ENABLE macro
CH_BAR macro
CH_BAR_HOR macro
CH_CLR0 macro
CH_CLR1 macro
CH_CLR10 macro
CH_CLR11 macro
CH_CLR12 macro
CH_CLR13 macro
CH_CLR14 macro
CH_CLR15 macro
CH_CLR2 macro
CH_CLR3 macro
CH_CLR4 macro
CH_CLR5 macro
CH_CLR6 macro
CH_CLR7 macro
CH_CLR8 macro
CH_CLR9 macro
CH_DISABLED macro
CH_DONUT macro
CH_DRAW macro
CH_DRAW_DATA macro
CH_HIDE macro
CH_LEGEND macro
CH_NUMERIC macro
CH_PERCENT macro
CH_PIE macro
CH_VALUE macro
ChAddDataSeries function
Changing the default Font
Chart
Chart Examples
Chart States
CHART structure
CHARTPARAM structure
ChCreate function
ChDraw function
Check Box States
Checkbox
CHECKBOX structure
ChFreeDataSeries function
ChGetAxisLabelFont macro
ChGetColorTable macro
ChGetGridLabelFont macro
ChGetPercentMax macro
ChGetPercentMin macro
ChGetPercentRange macro
ChGetSampleEnd macro
ChGetSampleLabel macro
ChGetSampleRange macro
ChGetSampleStart macro
ChGetShowSeriesCount macro
ChGetShowSeriesStatus macro
ChGetTitle macro
ChGetTitleFont macro
ChGetValueLabel macro
ChGetValueMax macro
ChGetValueMin macro
ChGetValueRange macro
ChHideSeries macro
ChRemoveDataSeries function
ChSetAxisLabelFont macro
ChSetColorTable macro
ChSetGridLabelFont macro
ChSetPercentRange function
ChSetSampleLabel macro
ChSetSampleRange function
ChSetTitle macro
ChSetTitleFont macro
ChSetValueLabel macro
ChSetValueRange function
ChShowSeries macro
ChTranslateMsg function
Circle Functions
Circle macro
ClearDevice function
ClearPaletteChangeError function
CLIP_DISABLE macro
CLIP_ENABLE macro
ClrState macro
Color Definition
Color Table
COLOR_DEPTH macro
Common Object States
Configuration Setting
Connecting RGB data bus
Converting Images to Use a Common Palette in GIMP
CopyBlock function
CopyPageWindow function
CopyWindow function
CYAN macro
D
DARKGRAY macro
DASHED_LINE macro
Data Series Status Settings
DATASERIES structure
Decompress function
Decompressing DEFLATEd data
Default Style Scheme Settings
Demo Compatibility Matrix
Demo Projects
Demo Summary
Development Platform Used
Device Driver Options
Dial States
Digital Meter
Digital Meter States
DIGITALMETER structure
DISABLED macro
DisablePalette function
DISP_DATA_WIDTH macro
DISP_HOR_BACK_PORCH macro
DISP_HOR_FRONT_PORCH macro
DISP_HOR_PULSE_WIDTH macro
DISP_HOR_RESOLUTION macro
DISP_INV_LSHIFT macro
DISP_ORIENTATION macro
DISP_VER_BACK_PORCH macro
DISP_VER_FRONT_PORCH macro
DISP_VER_PULSE_WIDTH macro
DISP_VER_RESOLUTION macro
Display Controller Used
Display Device Driver Control
Display Device Driver Layer
Display Device Driver Layer API
Display Device Driver Layer Configuration
Display Device Driver Level Primitives
Display Panel Used
DisplayBrightness function
DM_CENTER_ALIGN macro
DM_DISABLED macro
DM_DRAW macro
DM_FRAME macro
DM_HIDE macro
DM_RIGHT_ALIGN macro
DM_UPDATE macro
DmCreate function
DmDecVal macro
DmDraw function
DmGetValue macro
DmIncVal macro
DmSetValue function
DmTranslateMsg function
DOTTED_LINE macro
Double Buffering
DRAW macro
DRAW_FOCUS macro
DRAW_FUNC type
DRAW_UPDATE macro
DrawArc function
DrawPoly function
E
EB_CARET macro
EB_CENTER_ALIGN macro
EB_DISABLED macro
EB_DRAW macro
EB_DRAW_CARET macro
EB_FOCUSED macro
EB_HIDE macro
EB_RIGHT_ALIGN macro
EbAddChar function
EbCreate function
EbDeleteChar function
EbDraw function
EbGetText macro
EbMsgDefault function
EbSetText function
EbTranslateMsg function
Edit Box
Edit Box States
EDITBOX structure
EnablePalette function
EXPLORER_16 macro
External Memory
External Memory Buffer
External or Internal Memory and Palettes
EXTERNAL_FONT_BUFFER_SIZE macro
ExternalMemoryCallback function
F
FillBevel function
FillCircle macro
Focus Support Selection
FOCUSED macro
Font Source Selection
Font Type Selection
FONT_EXTERNAL type
FONT_FLASH structure
FONT_HEADER structure
FONTDEFAULT variable
FREE_FUNC type
G
GB_CENTER_ALIGN macro
GB_DISABLED macro
GB_DRAW macro
GB_HIDE macro
GB_RIGHT_ALIGN macro
GbCreate function
GbDraw function
GbGetText macro
GbSetText function
GbTranslateMsg function
GetClipBottom macro
GetClipLeft macro
GetClipRight macro
GetClipTop macro
GetColor macro
GetFontOrientation macro
GetImageHeight function
GetImageWidth function
GetMaxX macro
GetMaxY macro
GetObjID macro
GetObjNext macro
GetObjType macro
GetPageAddress macro
GetPaletteChangeError function
GetPixel function
GetState macro
GetTextHeight function
GetTextWidth function
Getting Started
GetTransparentColor macro
GetTransparentColorStatus macro
GetX macro
GetY macro
GFX_DISPLAY_BUFFER_LENGTH macro
GFX_DISPLAY_BUFFER_START_ADDRESS macro
GFX_EPMP_CS1_BASE_ADDRESS macro
GFX_EPMP_CS1_MEMORY_SIZE macro
GFX_EPMP_CS2_BASE_ADDRESS macro
GFX_EPMP_CS2_MEMORY_SIZE macro
GFX_EXTDATA structure
GFX_Font_GetAntiAliasType macro
GFX_Font_SetAntiAliasType macro
GFX_free macro
GFX_GCLK_DIVIDER macro
GFX_GRADIENT_STYLE structure
GFX_GRADIENT_TYPE enumeration
GFX_IMAGE_HEADER structure
GFX_LCD_CSTN macro
GFX_LCD_MSTN macro
GFX_LCD_OFF macro
GFX_LCD_TFT macro
GFX_LCD_TYPE macro
GFX_malloc macro
GFX_PICTAIL_LCC macro
GFX_PICTAIL_V3 macro
GFX_PICTAIL_V3E macro
GFX_RESOURCE enumeration
GFX_TRANSITION_DIRECTION enumeration
GFX_TRANSITION_TYPE enumeration
GFX_USE_DISPLAY_CONTROLLER_DMA macro
GFX_USE_DISPLAY_CONTROLLER_MCHP_DA210 macro
GFX_USE_DISPLAY_CONTROLLER_S1D13517 macro
GFX_USE_DISPLAY_CONTROLLER_SSD1926 macro
GFX_USE_DISPLAY_PANEL_PH480272T_005_I11Q macro
GFX_USE_DISPLAY_PANEL_TFT_640480_8_E macro
GFX_USE_DISPLAY_PANEL_TFT_800480_33_E macro
GFX_USE_DISPLAY_PANEL_TFT_G240320LTSW_118W_E macro
GFXExecutePendingTransition function
GFXGetPageOriginAddress function
GFXGetPageXYAddress function
GFXIsTransitionPending function
GFXSetupTransition function
GFXTransition function
GOL Global Variables
GOL Messages
GOL Objects
GOL_EMBOSS_SIZE macro
GOL_MSG structure
GOL_OBJ_TYPE enumeration
GOL_SCHEME structure
GOLAddObject function
GOLCanBeFocused function
GOLCreateScheme function
GOLDeleteObject function
GOLDeleteObjectByID function
GOLDraw function
GOLDrawCallback function
GOLDrawComplete macro
GOLFindObject function
GOLFontDefault variable
GOLFree function
GOLGetFocus macro
GOLGetFocusNext function
GOLGetFocusPrev function
GOLGetList macro
GOLGetScheme macro
GOLGetSchemeDefault macro
GOLInit function
GOLMsg function
GOLMsgCallback function
GOLNewList macro
GOLPanelDraw macro
GOLPanelDrawTsk function
GOLRedraw macro
GOLRedrawRec function
GOLSchemeDefault variable
GOLSetFocus function
GOLSetList macro
GOLSetScheme macro
GOLTwoTonePanelDrawTsk function
Gradient
Gradient Bar Rendering
Graphic Cursor
Graphics Library Configuration
Graphics Object Layer
Graphics Object Layer API
Graphics Object Layer Configuration
Graphics Object Selection
Graphics PICtail Used
Graphics Primitive Layer
Graphics Primitive Layer API
Graphics Primitive Layer Configuration
GraphicsConfig.h Example
GRAY0 macro
GRAY1 macro
GRAY2 macro
GRAY3 macro
GRAY4 macro
GRAY5 macro
GRAY6 macro
GREEN macro
Grid
Grid Item States
Grid States
GRID structure
GRID_DISABLED macro
GRID_DRAW_ALL macro
GRID_DRAW_ITEMS macro
GRID_FOCUSED macro
GRID_HIDE macro
GRID_OUT_OF_BOUNDS macro
GRID_SHOW_BORDER_ONLY macro
GRID_SHOW_FOCUS macro
GRID_SHOW_LINES macro
GRID_SHOW_SEPARATORS_ONLY macro
GRID_SUCCESS macro
GridClearCellState function
GridCreate function
GridDraw function
GridFreeItems function
GridGetCell function
GridGetFocusX macro
GridGetFocusY macro
GRIDITEM structure
GRIDITEM_DRAW macro
GRIDITEM_IS_BITMAP macro
GRIDITEM_IS_TEXT macro
GRIDITEM_SELECTED macro
GRIDITEM_TEXTBOTTOM macro
GRIDITEM_TEXTLEFT macro
GRIDITEM_TEXTRIGHT macro
GRIDITEM_TEXTTOP macro
GridMsgDefault function
GridSetCell function
GridSetCellState function
GridSetFocus function
GridTranslateMsg function
Group Box
Group Box States
GROUPBOX structure
H
Hardware Profile
HardwareProfile.h Example
HIDE macro
HIDE_DATA macro
How to Define Colors in your Applications
I
Image Compression Option
Image Decoder Configuration
Image Decoder Demo
Image Decoders
Image Decoders API
Image Source Selection
IMAGE_FLASH structure
IMAGE_NORMAL macro
IMAGE_RAM structure
IMAGE_X2 macro
ImageAbort macro
ImageDecode function
ImageDecoderInit function
ImageDecodeTask function
ImageFullScreenDecode macro
ImageLoopCallbackRegister function
IMG_SUPPORT_BMP macro
IMG_SUPPORT_GIF macro
IMG_SUPPORT_IMAGE_DECODER_LOOP_CALLBACK macro
IMG_SUPPORT_JPEG macro
IMG_USE_ONLY_565_GRAPHICS_DRIVER_FOR_OUTPUT macro
IMG_USE_ONLY_MDD_FILE_SYSTEM_FOR_INPUT macro
InitGraph function
Input Device Selection
INPUT_DEVICE_EVENT enumeration
INPUT_DEVICE_TYPE enumeration
Introduction
InvalidateRectangle function
IsDeviceBusy function
IsObjUpdated macro
IsPaletteEnabled function
K
Key Command Types
KEYMEMBER structure
L
LB_CENTER_ALIGN macro
LB_DISABLED macro
LB_DRAW macro
LB_DRAW_FOCUS macro
LB_DRAW_ITEMS macro
LB_FOCUSED macro
LB_HIDE macro
LB_RIGHT_ALIGN macro
LB_SINGLE_SEL macro
LB_STS_REDRAW macro
LB_STS_SELECTED macro
LbAddItem function
LbChangeSel function
LbCreate function
LbDelItem function
LbDelItemsList function
LbDraw function
LbGetBitmap macro
LbGetCount macro
LbGetFocusedItem function
LbGetItemList macro
LbGetSel function
LbGetVisibleCount macro
LbMsgDefault function
LbSetBitmap macro
LbSetFocusedItem function
LbSetSel macro
LbTranslateMsg function
Library API
Library Architecture
LIGHTBLUE macro
LIGHTCYAN macro
LIGHTGRAY macro
LIGHTGREEN macro
LIGHTMAGENTA macro
LIGHTRED macro
Line function
Line Functions
Line Size
Line Types
LineRel macro
LineTo macro
List Box
List Box States
List Item Status
LISTBOX structure
LISTITEM structure
M
MAGENTA macro
MEB_BOARD macro
Memory Type
Meter
Meter States
METER structure
METER_TYPE macro
Microchip Application Library Abbreviations
Microchip Graphics Controller
Miscellaneous
Miscellaneous Topics
MoveRel macro
MoveTo macro
MSG_DEFAULT_FUNC type
MSG_FUNC type
MTR_ACCURACY macro
MTR_DISABLED macro
MTR_DRAW macro
MTR_DRAW_UPDATE macro
MTR_HIDE macro
MTR_RING macro
MtrCreate function
MtrDecVal macro
MtrDraw function
MtrGetVal macro
MtrIncVal macro
MtrMsgDefault function
MtrSetScaleColors macro
MtrSetTitleFont macro
MtrSetVal function
MtrSetValueFont macro
MtrTranslateMsg function
N
NORMAL_LINE macro
O
OBJ_HEADER structure
Object Management
Object Rendering
Object States
OutChar function
OutText function
OutTextXY function
P
Palette Mode
Palette.h
PALETTE_EXTERNAL type
PALETTE_FLASH structure
PALETTE_HEADER structure
PaletteInit function
PB_DISABLED macro
PB_DRAW macro
PB_DRAW_BAR macro
PB_HIDE macro
PB_VERTICAL macro
PbCreate function
PbDraw function
PbGetPos macro
PbGetRange macro
PbSetPos function
PbSetRange function
PbTranslateMsg function
PIC_SK macro
PIC24FJ256DA210_DEV_BOARD macro
PICT_DISABLED macro
PICT_DRAW macro
PICT_FRAME macro
PICT_HIDE macro
PictCreate function
PictDraw function
PictGetBitmap macro
PictGetScale macro
PictSetBitmap macro
PictSetScale macro
PictTranslateMsg function
Picture Control
Picture States
PICTURE structure
PMP Interface
Progress Bar
Progress Bar States
PROGRESSBAR structure
PutImage function
PutPixel function
R
Radio Button
Radio Button States
RADIOBUTTON structure
RB_CHECKED macro
RB_DISABLED macro
RB_DRAW macro
RB_DRAW_CHECK macro
RB_DRAW_FOCUS macro
RB_FOCUSED macro
RB_GROUP macro
RB_HIDE macro
RbCreate function
RbDraw function
RbGetCheck function
RbGetText macro
RbMsgDefault function
RbSetCheck function
RbSetText function
RbTranslateMsg function
RCC_COPY macro
RCC_DEST_ADDR_CONTINUOUS macro
RCC_DEST_ADDR_DISCONTINUOUS macro
RCC_ROP_0 macro
RCC_ROP_1 macro
RCC_ROP_2 macro
RCC_ROP_3 macro
RCC_ROP_4 macro
RCC_ROP_5 macro
RCC_ROP_6 macro
RCC_ROP_7 macro
RCC_ROP_8 macro
RCC_ROP_9 macro
RCC_ROP_A macro
RCC_ROP_B macro
RCC_ROP_C macro
RCC_ROP_D macro
RCC_ROP_E macro
RCC_ROP_F macro
RCC_SOLID_FILL macro
RCC_SRC_ADDR_CONTINUOUS macro
RCC_SRC_ADDR_DISCONTINUOUS macro
RCC_TRANSPARENT_COPY macro
RDIA_DISABLED macro
RDIA_DRAW macro
RDIA_HIDE macro
RDIA_ROT_CCW macro
RDIA_ROT_CW macro
RdiaCreate function
RdiaDecVal macro
RdiaDraw function
RdiaGetVal macro
RdiaIncVal macro
RdiaMsgDefault function
RdiaSetVal macro
RdiaTranslateMsg function
Rectangle Copy Operations
Rectangle Functions
Rectangle macro
RED macro
References
Release Notes
RequestDisplayUpdate function
RequestEntirePaletteChange macro
RequestPaletteChange function
ResetDevice function
RGBConvert macro
ROPBlock function
Round Dial
ROUNDDIAL structure
S
Scan Key Codes
SCAN_BS_PRESSED macro
SCAN_BS_RELEASED macro
SCAN_CR_PRESSED macro
SCAN_CR_RELEASED macro
SCAN_DEL_PRESSED macro
SCAN_DEL_RELEASED macro
SCAN_DOWN_PRESSED macro
SCAN_DOWN_RELEASED macro
SCAN_END_PRESSED macro
SCAN_END_RELEASED macro
SCAN_HOME_PRESSED macro
SCAN_HOME_RELEASED macro
SCAN_LEFT_PRESSED macro
SCAN_LEFT_RELEASED macro
SCAN_PGDOWN_PRESSED macro
SCAN_PGDOWN_RELEASED macro
SCAN_PGUP_PRESSED macro
SCAN_PGUP_RELEASED macro
SCAN_RIGHT_PRESSED macro
SCAN_RIGHT_RELEASED macro
SCAN_SPACE_PRESSED macro
SCAN_SPACE_RELEASED macro
SCAN_TAB_PRESSED macro
SCAN_TAB_RELEASED macro
SCAN_UP_PRESSED macro
SCAN_UP_RELEASED macro
Scroll function
Set Up Display Interface
Set Up Functions
SetActivePage function
SetBevelDrawType macro
SetClip function
SetClipRgn function
SetColor macro
SetEntirePalette macro
SetFont function
SetFontOrientation macro
SetLineThickness macro
SetLineType macro
SetPalette function
SetPaletteBpp function
SetPaletteFlash function
SetState macro
SetVisualPage function
SHOW_DATA macro
SLD_DISABLED macro
SLD_DRAW macro
SLD_DRAW_FOCUS macro
SLD_DRAW_THUMB macro
SLD_FOCUSED macro
SLD_HIDE macro
SLD_SCROLLBAR macro
SLD_VERTICAL macro
SldCreate function
SldDecPos macro
SldDraw function
SldGetPage macro
SldGetPos macro
SldGetRange macro
SldIncPos macro
SldMsgDefault function
SldSetPage function
SldSetPos function
SldSetRange function
SldTranslateMsg function
Slider States
SLIDER structure
Slider/Scroll Bar
Software License Agreement.txt
SOLID_LINE macro
ST_CENTER_ALIGN macro
ST_DISABLED macro
ST_DRAW macro
ST_FRAME macro
ST_HIDE macro
ST_RIGHT_ALIGN macro
ST_UPDATE macro
Starting a New Project
Static Text
Static Text States
STATICTEXT structure
StCreate function
StDraw function
StGetText macro
STN_DISPLAY_WIDTH macro
STN_DISPLAY_WIDTH_16 macro
STN_DISPLAY_WIDTH_4 macro
STN_DISPLAY_WIDTH_8 macro
StSetText function
StTranslateMsg function
Style Scheme
SwitchOffDoubleBuffering function
SwitchOnDoubleBuffering function
T
TE_DELETE_COM macro
TE_DISABLED macro
TE_DRAW macro
TE_ECHO_HIDE macro
TE_ENTER_COM macro
TE_HIDE macro
TE_KEY_PRESSED macro
TE_SPACE_COM macro
TE_UPDATE_KEY macro
TE_UPDATE_TEXT macro
TeAddChar function
TeClearBuffer function
TeCreate function
TeCreateKeyMembers function
TeDelKeyMembers function
TeDraw function
TeGetBuffer macro
TeGetKeyCommand function
TeIsKeyPressed function
TeMsgDefault function
TeSetBuffer function
TeSetKeyCommand function
TeSetKeyText function
TeSpaceChar function
TeTranslateMsg function
Text Entry
Text Functions
TextEntry States
TEXTENTRY structure
THICK_LINE macro
TRANS_MSG enumeration
Transitions
Transparent Color Feature in PutImage()
TRANSPARENT_COLOR_DISABLE macro
TRANSPARENT_COLOR_ENABLE macro
TransparentColorDisable macro
TransparentColorEnable function
U
UPDATE_HOUR macro
UPDATE_MINUTE macro
UPDATE_SECOND macro
UpdateDisplayNow function
USE_16BIT_PMP macro
USE_8BIT_PMP macro
USE_ALPHABLEND macro
USE_ANALOGCLOCK macro
USE_ANTIALIASED_FONTS macro
USE_BITMAP_EXTERNAL macro
USE_BITMAP_FLASH macro
USE_BUTTON macro
USE_BUTTON_MULTI_LINE macro
USE_CHECKBOX macro
USE_COMP_IPU macro
USE_COMP_RLE macro
USE_CUSTOM macro
USE_DIGITALMETER macro
USE_DOUBLE_BUFFERING macro
USE_EDITBOX macro
USE_FOCUS macro
USE_FONT_EXTERNAL macro
USE_FONT_FLASH macro
USE_GOL macro
USE_GRADIENT macro
USE_GROUPBOX macro
USE_KEYBOARD macro
USE_LISTBOX macro
USE_METER macro
USE_MULTIBYTECHAR macro
USE_NONBLOCKING_CONFIG macro
USE_PALETTE macro
USE_PALETTE_EXTERNAL macro
USE_PICTURE macro
USE_PROGRESSBAR macro
USE_RADIOBUTTON macro
USE_ROUNDDIAL macro
USE_SLIDER macro
USE_STATICTEXT macro
USE_TEXTENTRY macro
USE_TOUCHSCREEN macro
USE_TRANSPARENT_COLOR macro
USE_UNSIGNED_XCHAR macro
USE_WINDOW macro
Using Microchip Graphics Module Color Look Up Table in Applications
Using Primitive Rendering Functions in Blocking and Non-Blocking Modes
W
WHITE macro
Window
Window States
WINDOW structure
WND_DISABLED macro
WND_DRAW macro
WND_DRAW_CLIENT macro
WND_DRAW_TITLE macro
WND_FOCUSED macro
WND_HIDE macro
WND_TITLECENTER macro
WndCreate function
WndDraw function
WndGetText macro
WndSetText function
WndTranslateMsg function
X
XCHAR macro
Y
YELLOW macro


Image Decoder Demo

Contents | Index | Home
Previous | Up | Next
Image Decoder Demo
Image Decoders

Please refer to the getting started htm document located at <Install Directory>/Microchip/Graphics/Documents/Getting Started/Getting Started - Running the Image Decoders Demo.htm, where <Install Directory> is the root directory of the Microchip Applications Library.

Module

Image Decoders

Links
Image Decoders
Image Decoders > Demo Project > Image Decoder Demo


Microchip Graphics Library