Microchip offers varying levels of solutions to drive everything
from simple monochrome LCDs to full color WVGA user
interfaces.
Graphics support includes the following approaches:
■
PIC24F DA integrated graphics controller
■
PIC32 controllerless graphics
■
Support for PIC MCU with external graphics controllers
The silicon offering is complemented with powerful, free
and easy to use graphics library, display designer GUI and
hardware development kits with flexible interface to various
glass sizes.
Supported Screen Sizes and Colors
Microchip graphics solutions support various screen sizes
and colors ranging from small monochrome OLED displays up
to WVGA displays with vivid color. The table below shows the
bits per pixel required to represent color.
Display
Representation
MonoBlack and White1
Grayscale
Color
Color Examples
4 shades
16 shades
256 colors
65K colors
16 million colors
As the color depth and display resolution increase, the frame
buffer grows. Depending on the size, the frame buffer can
be stored in the microcontroller RAM, in external SRAM or
integrated into an external graphics controller.
Color Depth
(bits per pixel)
2
4
8
16
24
The table below shows examples of the frame buffer sizes
required for some popular resolution and color depths.
■
PIC24 DA family supports up to 96 KB on chip
■
PIC32 MCUs support up to 128 KB on chip
■
External SRAM can be used for larger frame buffers
■
For advanced graphics, external graphics controllers have
additional frame buffer storage
Display Resolution
Typical Sizes
WVGA800x4807˝48,00096,000384,000768,000
VGA640x4805.7˝38,400 76,800 307,200 614,400
WQVGA 480x272 4.3˝16,32032,640 130,560 261,120
QVGA 320x240 3.2˝9,600 19,200 76,800 153,600
Common
for
OLED
Internal SRAM on PIC24DA or PIC32 MCU External SRAM
128x64 1˝-2.7˝ 1,024 2,048 8,192 16,384
Memory Requirement in (bytes)
1 bpp
(Mono)
Color Depth/
2 bpp
(4 shades)
8 bpp
(256 colors)
16 bpp
(65K colors)
Target Applications
Applications that benefit from attractive and easy to use
graphical displays include:
Consumer: Thermostats, Cordless Phones, Remote Controls
Home Appliance: Coffee Makers, Washing Machines, Ovens
Industrial: Digital Instrument Gauges, Storage Controls,
PIC24F with Integrated Graphics Controller:
Low Cost, Easy to Use
The PIC24F DA family makes it easy and cost-effective to
add advanced graphics to your application by eliminating the
need for external frame buffers or display controllers.
■
Dedicated graphics clock for a continuous, clean display
■
On-chip display controller provides direct interface to TFT,
STN and OLED displays
■
Easy to use Graphics Processing Units for hardware
acceleration
– Move and copy rectangles with smooth, fast memory
transfers
– Decompress images without CPU intervention
– Render text without CPU intervention
■
Color look-up table and 96 KB frame buffer to support
multiple colors
– Supports QVGA 8 bpp with internal frame buffer
– Supports WQVGA 16 bpp with external frame buffer
using PMP (Parallel Master Port)
With the hardware acceleration, this family is able to process
and render graphics without using any MCU MIPS. The
dedicated graphics engine is able to continuously drive a
display without being shared with any other function.
Microchip’s PIC32 line of 32-bit microcontrollers offers
80MIPS and high performance DMA to render graphics
directly to displays. This enables PIC32 devices to drive a
display without an external graphics controller.
Works with any PIC32 80 MIPS 32-bit microcontroller
With devices offering up to 512 KB Flash and 128 KBRAM,
developers have plenty of space for application code,
communications stacks and data buffering. In addition to
the graphics capabilities, PIC32 MCUs also have integrated
peripherals for USB, CAN, Ethernet and capacitive touch
sensing.
DMA
External Graphics Controller: PIC24 or PIC32
with Parallel Master Port (PMP)
PIC24 and PIC32 MCUs can also work with an external
graphics controller to support larger screen sizes or more
advanced graphical features.
The Solomon Systech SSD1926 Graphics Controller has
hardware graphics acceleration to free up the MIPS of the
PIC MCU. This controller includes a SD Card interface and
JPEG decode engine as well as 256 KB RAM. The Graphics
PICtail™ Plus SSD1926 Board (AC164127-5) includes serial
Flash for data storage and interfaces to either Explorer 16 or
PIC32 Starter Kits.
The Epson S1D13517 Graphics Controller includes alpha
blending, picture-in-picture and supports up to WVGA
(800x480) at 24 bpp. This controller has an SDRAM interface
for connection to low cost external memory. The Graphics
Controller PICtail Plus Epson S1D13517 Board (AC164127-7)
includes 128 Mb SDRAM frame buffer and 16Mb serial Flash
and interfaces to either Explorer 16 or PIC32 Starter Kits.
Graphics Quick Reference Guide 3
Graphics Librar y, Designer and App Notes
FREE Microchip Graphics Library
The Microchip Graphics Library is highly modular and is
optimized for Microchip’s 16- and 32-bit microcontrollers. It
is easy to use and has an open documented interface for
driver or controller support. The library supports the following
features:
■
Pre-made graphics objects
■
Multiple fonts and languages
■
User interface for mTouch™ sensing
■
Includes buttons, charts, check boxes, scroll bars, list
boxes, images and basic animation
FREE Microchip Graphics Display Designer
The Microchip
Graphics Display
Designer (GDD)
is a visual design
tool that provides
customers with a
quick and easy way
of creating Graphical
User Interface (GUI)
screens for graphical
interface applications
on Microchip MCUs.
It provides the following advantages to the developers:
■
Simplifies coding for the GUI screens with an ability to
draw, resize and delete screen objects
■
Eliminates the need to manually calculate the X/Y
coordinates for on-screen object placements
■
Generates output source files
■
Ability to import various graphical resources, including
custom fonts and bitmap images
Application Notes for Graphical Displays
■
How to Use Widgets in Microchip Graphics Library, AN1136
■
Fonts in the Microchip Graphics Library, AN1182
■
How to Create Widgets in Microchip Graphics Library, AN1246
■
Using a Keyboard with the Microchip Graphics Library,
AN1227
■
Developing Graphics Applications using MCU with
Integrated Controller, AN1368
■
Using PIC32 MCUs to Develop Low-Cost Controllers (LCC)
Graphics Solutions, AN1387
Development Tools for Graphical Display Controllers
Display Boards Supported
Family
PIC24 DA Family PIC24FJ256DA210 Board (DM240312) + Display Board 8 bpp or 30 HzYes
PIC32 Starter Kit (DM320001 or DM320003-2 or DM320004) + Epson GFX Board (AC164127-7) +
Display Board
WQVGA 4.3″ Graphics
Display Powertip 480x272
Board (AC164127-6)
VGA 5.7″ Graphics
Display Truly 640x480
Board (AC164127-8)
8 bpp or 30 HzYes
WVGA 7″ Graphics
Display Truly 800x480
Board (AC164127-9)
Prototype Boards
Connect Your Glass
(AC164139)
Yes
No
Yes
Yes
4 Graphics Quick Reference Guide
Tools for Designing Graphical Displays
Microchip Graphics Solutions
This table shows the out-of-the-box support for the following development boards and kits. With proper software and hardware
configuration compatibility of certain hardware combinations and other PIC devices can be achieved.
PIC32
Ethernet
Starter Kit
(DM320004)
–
PIC32 Starter Kit Based
Graphics LCD Controller PICtail™ Plus
SSD1926 Board (AC164127-5)
Graphics Controller PICtail™ Plus Epson
S1D13517 Board (AC164127-7)
Low-Cost Controllerless (LCC) Graphics
PICtail™ Plus Daughter Board
(AC164144)
Multi Media Expansion Board
(DM320005)
Development Boards
PIC24FJ256DA210 Development Board
(DM240312)
Graphics LCD Controller PICtail™ Plus
SSD1926 Board (AC164127-5)
Graphics Controller PICtail™ Plus Epson
S1D13517 Board (AC164127-7)
Low-Cost Controllerless (LCC) Graphics
PICtail™ Plus Daughter Board
(AC164144)
Stand Alone Development Boards
MPLAB® Star ter Kit for PIC24H MCUs
(DM240021)
MPLAB® Star ter Kit for PIC24F MCUs
(DM240011)
PIC24F PIMs
PIC32MX PIMs
PIC24EP & dsPIC33EP PIMs
PIC24H & dsPIC33F PIMs
PIC32
Starter Kit
(DM320001)
PIC32 USB
Starter Kit II
(DM320003-2)
++
++
Explorer 16 Development
Board (DM240001) +
Plug-In Modules (PIMs)
PIC24F PIMs
PIC32MX PIMs
PIC24EP & dsPIC33EP PIMs
PIC24H & dsPIC33F PIMs
PIC24F PIMs
PIC32MX PIMs
PIC24EP & dsPIC33EP PIMs
PIC24H & dsPIC33F PIMs
PIC24F PIMs
PIC32MX PIMs
PIC24EP & dsPIC33EP PIMs
PIC24H & dsPIC33F PIMs
Stand Alone Development Board with a built-in display.
Stand Alone Development Board with a built-in display.
=Compatible (out of the box)
+ =Compatible (will need firmware modification)
– =Incompatible
Notes:
1. SSD1926 suppor ts up to WQVGA (480x272) displays.
2. Manually assemble chosen display panel to the protoyping board.
3. Run at 8 bpp with external memory.
4. 8 bpp or less using internal memory, 8 bpp or 16 bpp using external memory.
5. 8 bpp or 16 bpp with external memory.
PIC24E USB
Starter Kit
(DM240012)
dsPIC33E
USB
Starter Kit
(DM330012)
Graphics
Display Truly
″ 240x320
3.2
Board
(AC164127-4)
++
–––––
Graphics
Display Truly
3.2″ 240x320
Board
(AC164127-4)
(4)
+
+
+++++
–––––
––
+++
–––
Graphics
Display
Powertip 4.3
480x272
Board
(AC164127-6)
Graphics
Display
Powertip 4.3
480x272
Board
(AC164127-6)
(5)
Graphics
Display Truly
″
″ 640x480
5.7
Board
(AC164127-8)
–
Graphics
Display Truly
″
″ 640x480
5.7
Board
(AC164127-8)
––
––
––
––
+
–
(1)
(3)
(3)
(3)
(3)
Graphics
Display Truly
″ 800x480
7
Board
(AC164127-9)
(1)
–
–
Graphics
Display Truly
″ 800x480
7
Board
(AC164127-9)
–
–
–
–
–
Graphics
Display
Prototype
Board
(AC164139)
(2)
(2)
(2)
Graphics
Display
Prototype
Board
(AC164139)
(2)
(2)
(2)
(2)
(2)
(2)
(2)
(2)
(2)
–
(2)
(2)
+
–
Graphics Quick Reference Guide 5
Tools for Designing Graphical Displays
Development Tool
PIC24FJ256DA210
Development Board
Explorer 16
Development Board
Multi Media
Expansion Board
Graphics LCD Controller
PICtail™ Plus
SSD1926 Board
Graphics Controller
PICtail™ Plus Epson
S1D13517 Board
Part
Number
DM240312
DM240001
DM320005
AC164127-5
AC164127-7
Tool Image
Development Tool
PIC32 Starter KitDM320001
PIC32 USB
Starter Kit II
PIC32 Ethernet
Starter Kit
PIC24E USB
Starter Kit
dsPIC33E USB
Starter Kit
Part
Number
DM320003-2
DM320004
DM240012
DM330012
Tool Image
Low-Cost Controllerless
(LCC) Graphics PICtail™
Plus Daughter Board
Graphics Display
Truly 3.2″ 240x320
Board
Graphics Display
Powertip 4.3″ 480x272
Board
Graphics Display
Truly 5.7″ 640x480
Board
Graphics Display
Truly 7″ 800x480
Board
AC164144
AC164127-4
AC164127-6
AC164127-8
AC164127-9
Graphics Display
Prototype Board
Prototype PICtail™ Plus
Daughter Board
MPLAB® Starter Kit
for PIC24H MCUs
MPLAB® Starter Kit
for PIC24F
AC164139
AC164126
DM240021
DM240011
6 Graphics Quick Reference Guide
Microchip Graphics Library Quick Reference Guide
Microchip Graphics Library Quick Reference Guide
August 22, 2011 – based on Graphics Library Version 3.01
This card contains brief API description. For complete API description, see Graphics Library Help File.
Predened Types
GFX_COLOR
XCHAR
Device Driver Layer
Device Driver LayerDescription
void ResetDevice()
void PutPixel(SHORT x, SHORT y)
GFX_COLOR GetPixel(
SHORT x,
SHORT y)
void DisplayBrightness(WORD level)
WORD IsDeviceBusy()
WORD GetMaxX()
WORD GetMaxY()
void SetClip(BYTE control)
void SetClipRgn(
SHORT left,
SHORT top,
SHORT right,
SHORT bottom)
WORD GetClipLeft()
WORD GetClipRight()
WORD GetClipTop()
WORD GetClipBottom()
void SetColor(GFX_COLOR color)
GFX_COLOR GetColor()
void TransparentColorEnable(
GFX_COLOR color)
void TransparentColorDisable()
WORD GetTransparentColorStatus()
GFX_COLOR GetTransparentColor()
void SetActivePage(WORD page)
Notes:
1. The API is enabled only if the display controller supports multiple display buffers (or pages).
2. This is an optional feature and is implemented only if the display controller supports addressing of a block of pixel data.
Data type for color data. Dependent on the COLOR_DEPTH setting.
COLOR_DEPTH Data Type
8 typedef BYTE GFX_COLOR;
16 typedef WORD GFX_COLOR;
24 typedef DWORD GFX_COLOR;
Data type for characters. Set by macros in GraphicsCong.h
macro XCHAR Data Type
#dene USE_MULTIBYTECHAR signed int
#dene USE_UNSIGNED_XCHAR unsigned char
non-of the above signed char
Initialize the display interface and resets the display.
Renders the pixel located on the given x,y position with the
current set color.
Returns the pixel color located on the given x,y position.
Sets the brightness of the display (level: 0-100).
Returns a non-zero if display controller is busy with the
previous rendering operation. Zero if idle.
Returns the maximum horizontal coordinate.
Returns the maximum vertical coordinate.
Enables/disables clipping.
control denition
CLIP_DISABLE Disable clipping
CLIP_ENABLE Enable clipping
Sets the clipping region with the given coordinates.
Returns left clipping border.
Returns right clipping border.
Returns top clipping border.
Returns bottom clipping border.
Sets the current drawing color.
Returns the current drawing color.
Set the transparent color and enable the transparent color
feature for PutImage().
Graphics Cong: USE_TRANSPARENT_COLOR
Disable the transparent color feature for PutImage().
Graphics Cong: USE_TRANSPARENT_COLOR
Returns the current status of the transparent color feature of
PutImage().
return value denition
TRANSPARENT_COLOR_DISABLE feature is disabled
TRANSPARENT_COLOR_ENABLE feature is enabled
Graphics Cong: USE_TRANSPARENT_COLOR
Returns the current transparent color set by
TransparentColorEnable().
Set the active page. Active page is the buffer used for
(1)
rendering.
Device Driver LayerDescription
void SetVisualPage(WORD page)
WORD CopyWindow(
DWORD srcAddr,
DWORD dstAddr,
WORD srcX, WORD srcY,
WORD dstX, WORD dstY,
WORD width,
WORD height)
WORD CopyPageWindow(
BYTE srcPage,
BYTE dstPage,
WORD srcX, WORD srcY,
WORD dstX, WORD dstY,
WORD width,
WORD height);
WORD CopyBlock(
DWORD srcAddr,
DWORD dstAddr,
DWORD srcOffset,
DWORD dstOffset,
WORD width,
WORD height);
void SwitchOnDoubleBuffering()
void SwitchOffDoubleBuffering()
BYTE IsDisplayUpdatePending()
void RequestDisplayUpdate(void)
void InvalidateAll()
void InvalidateRectangle(
WORD left,
WORD top,
WORD right,
WORD bottom);
void UpdateDisplayNow()
Set the visible page. Visual page (display buffer ) is the page
shown on the display.
Copies the contents of a window located in the address
dened by srcAddr and the pixel offset set by srcX and srcY
to an address location dened by dstAddr and the pixel offset
set by dstX and dstY. Size of the copied window is set by the
given width and height.
Copies the contents of a window located in the page dened
by srcPage and the pixel offset set by srcX and srcY to
another page dened by dstPage and the pixel offset set by
dstX and dstY. Size of the copied window is set by the given
width and height.
Copies a block of pixels from the given source address
srcAddr with an offset srcOffset to a destination address given
by dstAddr with a given offset dstOffset. Size of the copied
block is set by the given width and height.
Turn on the automatic management of double buffering. All
rendering will be performed on the currently set draw buffer.
Graphics Cong: USE_DOUBLE_BUFFERING
Turn off the automatic management of double buffering. All
rendering will be performed on the currently set display buffer.
Graphics Cong: USE_DOUBLE_BUFFERING
Returns the status of the display update set by
RequestDisplayUpdate().
Graphics Cong: USE_DOUBLE_BUFFERING
Schedule synchronization of the contents of the draw buffer
and the display buffer at the next vertical blanking.
Graphics Cong: USE_DOUBLE_BUFFERING
Marks the whole screen area as invalidated.
Graphics Cong: USE_DOUBLE_BUFFERING
Invalidates the dened rectangular area in the display buffer.
On the next synchronization of the draw and display buffer,
the invalidated rectangle will be refreshed with the data in
the draw buffer.
Graphics Cong: USE_DOUBLE_BUFFERING
Synchronizes the draw and display buffer immediately.
Graphics Cong: USE_DOUBLE_BUFFERING
(1)
(2)
(1, 2)
(2)
Graphics Quick Reference Guide 7
Microchip Graphics Library Quick Reference Guide
Primitive Layer
Primitive LayerDescription
void InitGraph()
void ClearDevice()
SHORT GetX()
SHORT GetY()
void Mo veTo(
SHORT x,
SHORT y)
void MovetoRel(SHORT x, SHORT y)
void SetFont(void *pFont)
void SetFontOrientation(WORD orient)
BYTE GetFontOrientation()
WORD OutChar(XCHAR ch)
WORD OutText(XCHAR *pString)
WORD OutTextXY(
SHORT x,
SHORT y,
XCHAR *pString)
SHORT GetTextHeight(void *pFont)
SHORT GetTextWidth(
XCHAR pString,
void *pFont)
void SetLineType(WORD lnType)
void SetLineThickness(WORD lnThickness)
WORD Line(
SHORT x1,
SHORT y1,
SHORT x2,
SHORT y2)
WORD LineRel(
SHORT x,
SHORT y)
WORD LineTo(
SHORT x,
SHORT y)
Note:
1. This is an optional feature and is implemented only if the display controller supports alpha blending.
Initialize the display controller, sets the screen to BLACK,
sets current color to WHITE, sets the cursor at (0,0), sets
the line type to SOLID_LINE and sets the active page
and visual page to 0.
Clears the screen with the current color and sets the
cursor at (0,0).
Returns the graphic cursor x coordinates.
Returns the graphic cursor y coordinates.
Moves the graphic cursor to the new x,y location.
Moves the graphic cursor relative to the current location.
Sets the current font to be used when rendering
characters.
Sets the font orientation to vertical or horizontal
orientation.
orient denition
ORIENT_HOR horizontal
ORIENT_VER vertical
Returns the current font orientation (vertical or horizontal).
See SetFontOrientation().
Renders the character represented by the character ID ch
on the current graphic cursor position using the current
set font and color.
Renders a string of characters pointed to by pString on
the current graphic cursor location using the current set
font and color.
Renders the specied string pointed to by pString on
the location specied by x,y using the current set font
and color.
Returns the height of the specied font.
Returns the width of the specied string for the specied
font.
Sets the line type to render.
lnType denition
SOLID_LINE Solid line
DASHED_LINE Dashed line
Sets the line thickness to render.
lnThickness denition
NORMAL_LINE 1 pixel thick
THICK_LINE 3 pixel thick
Renders a line using the current set line type, line
thickness and color from x1,y1 to x2,y2.
Renders a line using the current set line type, line
thickness and color from the current graphic cursor
position to the relative position specied by the given x
and y displacement.
Renders a line using the current set line type, line
thickness and color from the current graphic cursor
position to the given x,y position.
Primitive LayerDescription
WORD Circle(
SHORT x,
SHORT y,
SHORT r)
WORD FillCircle(
SHORT x,
SHORT y,
SHORT r)
WORD DrawPoly(
SHORT numPoints,
SHORT *polyPoints)
WORD Arc(
SHORT xL,
SHORT yR,
SHORT xR,
SHORT yB,
SHORT r1,
SHORT r2,
BYTE octant)
WORD PutImage(
SHORT left,
SHORT top,
void *pBitmap,
BYTE stretch)
SHORT GetImageHeight(
void *pBitmap)
SHORT GetImageWidth(
void *pBitmap)
SHORT GetSineCosine(
SHORT v,
WORD type)
SHORT Sine(
SHORT v)
SHORT Cosine(
SHORT v)
WORD AlphaBlendWindow(
DWORD foregroundWindowAddr,
DWORD backgroundWindowAddr,
DWORD destinationWindowAddr,
WORD width,
WORD height,
BYTE alphaPercentage)
DWORD GFXGetPageXYAddress(
SHORT pageNumber,
WORD x,
WORD y)
DWORD GFXGetPageOriginAddress(
SHORT pageNumber)
WORD ExternalMemoryCallback(
GFX_EXTDATA *memory,
LONG offset,
WORD nCount,
void *buffer)
Renders a circle using the current set line type, line
size and color located at center on x,y with a radius r.
Renders a lled circle using the current set color
located at center on x,y with a radius r.
Renders a polygon with the current line type, line
size and color where the number of points is given
by numPoints and the polygon points is given by the
array pointed to by polyPoints.
PolyPoints[n] = x0,y0,x1,y1,…xn,yn;
n = numPoints
Draws the octant arc of the beveled gure with the
given centers, radii and octant mask.
Renders the image pointed to by pBitmap starting
from left, top position.
Returns the image height.
Returns the image width.
Returns the sine or cosine (type = GETSINE or
GETCOSINE) values of the given angle v. Return
values are normalized to 256.
Returns the sine value of the given angle v. Return
values are normalized to 256.
Returns the sine value of the given angle v. Return
values are normalized to 256.
Alpha blends the foreground and the background
images with the dimension specied by width and
height and writes the result to the destination.
Graphics Cong: USE_ALPHA_BLEND
Calculates the address of the pixel located in x,y
position inside the buffer specied by pageNumber.
Graphics Cong: USE_ALPHA_BLEND
Calculates the address of the buffer specied by
pageNumber.
Graphics Cong: USE_ALPHA_BLEND
When using external memory, this function must be
implemented in the application code and will contain
code to access external memory with the appropriate
external memory drivers.
Graphics Cong: USE_FONT_EXTERNAL or
USE_BITMAP_EXTERNAL
(1)
(1)
(1)
8 Graphics Quick Reference Guide
Microchip Graphics Library Quick Reference Guide
GOL Layer
GOL LayerDescription
void GOLInit()
WORD GOLDraw()
WORD GOLDrawCallback()
void GOLRedraw(OBJ_HEADER pObj)
void GOLRedrawRec(
SHORT left,
SHORT top,
SHORT right,
SHORT bottom)
WORD IsObjUpdated(OBJ_HEADER pObj)
void GOLDrawComplete(OBJ_HEADER pObj)
void GOLAddObject(OBJ_HEADER pObj)
void GOLFree()
OBJ_HEADER *GOLFindObject(WORD ID)
BOOL GOLDeleteObject(OBJ_HEADER pObj)
BOOL GOLDeleteObjectByID(WORD ID)
GOL_OBJ_TYPE GetObjType(OBJ_HEADER pObj)
WORD GetObjID(OBJ_HEADER pObj)
OBJ_HEADER *GetObjNext(OBJ_HEADER pObj)
void GOLNewList()
OBJ_HEADER *GOLGetList()
void GOLSetList(OBJ_HEADER pObjList)
void GOLSetFocus(OBJ_HEADER pObj)
OBJ_HEADER *GOLGetFocus()
WORD GOLCanBeFocused(OBJ_HEADER pObj)
OBJ_HEADER *GOLGetFocusNext()
OBJ_HEADER *GOLGetFocusPrev()
This function initializes the object layer, primitive
layer and display driver layer. Creates a default
style scheme with default settings.
Renders all widgets that needs to be rendered on
the active list.
Function implemented in the application. Function
called by GOLDraw() to allow application dened
rendering.
Sets the drawing states of the widget to be
redrawn on the next GOLDraw().
Marks all widgets in the active list intersected by
the given rectangular area.
Tests if the widget is pending to be redrawn.
Returns a non zero if pending and zero if not.
Resets the drawing states of the widget.
Adds the widget to the end of the active list.
Frees up the memory used by the current active
list. Active list becomes empty.
Returns the pointer to the widget in the active list
with the given ID.
Deletes a widget from the current active list.
Deletes a widget from the current active list.
Returns the widget type of the specied widget.
Returns the object ID of the specied widget.
Returns the pointer to the next widget right after
the specied widget in the active list.
Starts a new but empty list of widgets. Use
GOLAddObjects() to populate the list.
Returns the pointer to the current active list.
Sets the active list to the pointer specied by
pObjList.
Sets the widget pObj to be focused.
Returns the pointer to the currently focused widget
in the active list.
Returns a non-zero if the widget can be focused.
Returns the pointer of the next widget that can be
focused in the active list.
Returns the pointer of the previous widget that can
be focused in the active list.
GOL LayerDescription
GOLPanelDraw(
SHORT left,
SHORT top,
SHORT right,
SHORT bottom,
SHORT radius,
GFX_COLOR faceClr,
GFX_COLOR embossLtClr,
GFX_COLOR embossDkClr,
void *pBitmap,
WORD embossSize)
WORD GOLPanelDrawTsk()
WORD GOLTwoTonePanelDrawTsk()
WORD GetState(
OBJ_HEADER *pObj,
WORD stateBits)
void SetState(
OBJ_HEADER *pObj,
WORD stateBits)
void ClrState(
OBJ_HEADER *pObj,
WORD stateBits)
void GOLMsg(GOL_MSG *pMsg)
WORD GOLMsgCallback(
WORD objMsg,
OBJ_HEADER * pObj,
GOL_MSG * pMsg)
GFX_COLOR RGBConvert(
WORD red,
WORD green,
WORD blue)
Sets up the parameters to draw a panel. Use this API to set
up GOLPanelDrawTsk() and GOLTwoTonePanelDrawTask().
Renders a panel with the parameters set by
GOLPanelDraw().
Renders a two tone panel with the parameters set by
GOLPanelDraw().
Returns the current value of the state bits of the widget.
Sets the state bit(s) of the widget.
Clears the state bit(s) of the widget.
Process the GOL_MSG and checks which widget is
affected by the message. For each affected widget,
GOLMsgCallback() is called for the application to have an
opportunity to customize the reaction to the message and
cancel or call the default reaction to the message.
Function implemented in the application. Function called
by GOLMsg() to allow application to implement its own
interpretation of messages and customize widget behavior.
Creates a style scheme object with application dened styles
or using graphics library assigned default styles.
Sets the GOL_SCHEME to be used for the widget.
Gets the GOL_SCHEME used by the widget.
Returns the pointer to the default scheme created when
GOLInit() is called.
Converts 8-8-8 RGB color data to color format set by
COLOR_DEPTH.
Graphics Quick Reference Guide 9
Microchip Graphics Library Quick Reference Guide
Widget API
AnalogClockButton ChartChart2Chart3
Graphics Cong: USE_ANALOGCLOCKGraphics Cong:
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)
WORD AcHandsDraw(
ANALOGCLOCK * pObj,
SHORT hand,
SHORT thickness,
WORD color,
void * pBitmap)
void AcSetHour(
ANALOGCLOCK * pObj,
SHORT hour)
void AcSetMinute(
ANALOGCLOCK * pObj,
SHORT minute)
void AcSetSecond(
ANALOGCLOCK * pObj,
SHORT second)
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;
USE_BUTTON
USE_BUTTON_MULTI_LINE
BUTTON * BtnCreate(
WORD ID,
SHORT left,
SHORT top,
SHORT right,
SHORT bottom,
SHORT radius,
WORD state,
void * pBitmap,
XCHAR * pText,
GOL_SCHEME * pScheme)
void BtnMsgDefault(
WORD translatedMsg,
void * pObj,
GOL_MSG * pMsg)
WORD BtnTranslateMsg(
void * pObj,
GOL_MSG * pMsg)
typedef struct {
OBJ_HEADER hdr;
SHORT radius;
SHORT textWidth;
SHORT textHeight;
XCHAR * pText;
void * pBitmap;
} BUTTON;
Graphics Cong: USE_CHARTvoid ChHideSeries(
CHART * ChCreate(
WORD ID,
SHORT left,
SHORT top,
SHORT right,
SHORT bottom,
WORD state,
DATASERIES * pData,
CHARTPARAM * pParam,
GOL_SCHEME * pScheme)
typedef struct {
XCHAR * pSData;
WORD samples;
BYTE show;
WORD * pData;
void * pNextData;
} DATASERIES;
typedef struct {
XCHAR * pTitle;
XCHAR * pSmplLabel;
XCHAR * pValLabel;
SHORT seriesCount;
WORD smplStart;
WORD smplEnd;
WORD valMax;
WORD valMin;
WORD perMax;
WORD perMin;
WORD * pColor;
void * pTitleFont;
void * pAxisLabelsFont;
void * pGridLabelsFont;
} CHARTPARAM;
WORD RdiaGetVal(ROUNDDIAL *pObj)void CbMsgDefault(
void RdiaSetVal(ROUNDDIAL *pObj, WORD value)WORD CbTranslateMsg(
void RdiaMsgDefault(
WORD translatedMsg,
void * pObj,
GOL_MSG * pMsg)
WORD RdiaTranslateMsg(
void * pObj,
GOL_MSG * pMsg)
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;
CHECKBOX * CbCreate(
WORD ID,
SHORT left,
SHORT top,
SHORT right,
SHORT bottom,
WORD state,
XCHAR * pText,
GOL_SCHEME * pScheme)
DIGITALMETER * DmCreate(
WORD ID,
SHORT left,
SHORT top,
SHORT right,
SHORT bottom,
WORD state,
DWORD Value,
BYTE NoOfDigits,
BYTE DotPos,
GOL_SCHEME * pScheme)
void DmSetValue(
DIGITALMETER *pObj,
WORD value)
void DmIncVal(
DIGITALMETER *pObj,
WORD deltaValue)
void DmDecVal(
DIGITALMETER *pObj,
WORD deltaValue)
WORD EbTranslateMsg(
void * pObj,
GOL_MSG * pMsg
)
typedef struct {
OBJ_HEADER hdr;
SHORT textHeight;
XCHAR * pBuffer;
WORD charMax;
WORD length;
} EDITBOX;
Graphics Quick Reference Guide 11
Microchip Graphics Library Quick Reference Guide
Widget API (Continued)
Graphics Cong: USE_GRIDvoid GridSetFocus(
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)
WORD GridDraw(void * pObj)WORD GridTranslateMsg(
void GridClearCellState(
GRID * pObj,
SHORT column,
SHORT row,
WORD state)
WORD GridGetFocusX(GRID *pObj)typedef struct {
WORD GridGetFocusY(GRID *pObj)WORD GbTranslateMsg(
void GridFreeItems(void * pObj)typedef struct {
void * GridGetCell(
GRID * pObj,
SHORT column,
SHORT row,
WORD * cellType)
WORD GridSetCell(
GRID * pObj,
SHORT column,
SHORT row,
WORD state,
void * data)
void GridSetCellState(
GRID * pObj,
SHORT column,
SHORT row,
WORD state)
GridGrid2Group BoxList BoxList Box2
GRID * pObj,
SHORT column,
SHORT row)
void GridMsgDefault(
WORD translatedMsg,
void * pObj,
GOL_MSG * pMsg)
void * pObj,
GOL_MSG * pMsg)
typedef struct {
OBJ_HEADER hdr;
SHORT numColumns;
SHORT numRows;
SHORT cellHeight;
SHORT cellWidth;
SHORT focusX;
SHORT focusY;
GRIDITEM * gridObjects;
} GRID;
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)
WORD MtrGetVal(METER *pObj)void *PictSetBitmap(PICTURE *pObj)WORD PbGetRange(
void MtrDecVal(
METER *pObj,
WORD deltaValue)
void MtrIncVal(
METER *pObj,
WORD deltaValue)
void MtrSetScaleColors(
METER *pObj,
WORD arc1,
WORD arc2,
WORD arc3,
WORD arc4,
WORD arc5,
WORD arc6)
void MtrSetTitleFont(
METER *pMtr,
void *pFont)
void MtrSetValueFont(
METER *pMtr,
void *pFont)
void MtrMsgDefault(
WORD translatedMsg,
void * pObj,
GOL_MSG * pMsg)
WORD MtrTranslateMsg(
void * pObj,
GOL_MSG * pMsg)
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;
PICTURE * PictCreate(
WORD ID,
SHORT left,
SHORT top,
SHORT right,
SHORT bottom,
WORD state,
char scale,
void * pBitmap,
GOL_SCHEME * pScheme)
void PictSetBitmap(
PICTURE *pObj,
void *pBtmap)
WORD PictGetScale(PICTURE *pObj)void PbSetPos(
void PictSetScale(
PICTURE *pObj,
WORD scale)
WORD PictTranslateMsg(
void * pObj,
GOL_MSG * pMsg)
OBJ_HEADER hdr;
SHORT textHeight;
XCHAR * pText;
} STATICTEXT;
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)
WORD TeGetKeyCommand(
TEXTENTRY * pObj,
WORD index)
BOOL TeSetKeyCommand(
TEXTENTRY * pObj,
WORD index
WORD command)
TEXTENTRY * pObj,
XCHAR * pText[])
TEXTENTRY * pObj,
WORD index)
void TeSpaceChar(TEXTENTRY * pObj)
void TeSpaceChar(TEXTENTRY * pObj)
BOOL TeSetKeyText(
TEXTENTRY * pObj,
WORD index,
XCHAR * pText)
WORD translatedMsg,
void * pObj,
GOL_MSG * pMsg)
void * pObj,
GOL_MSG * pMsg)
typedef struct {
OBJ_HEADER hdr;
SHORT horizontalKeys;
SHORT verticalKeys;
XCHAR * pTeOutput;
WORD CurrentLength;
WORD outputLenMax;
KEYMEMBER * pActiveKey;
KEYMEMBER * pHeadOfList;
void * pDisplayFont;
} TEXTENTRY;
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;
WINDOW * WndCreate(
WORD ID,
SHORT left,
SHORT top,
SHORT right,
SHORT bottom,
WORD state,
void * pBitmap,
XCHAR * pText,
GOL_SCHEME * pScheme)
WORD WndDraw(void * pObj)
XCHAR *WndGetText(WINDOW* pObj)
void *WndSetText(
WINDOW* pObj
XCHAR * pText)
WORD WndTranslateMsg(
void * pObj,
GOL_MSG * pMsg)
Microchip is committed to supporting its customers
in developing products faster and more efficiently. We
maintain a worldwide network of field applications
engineers and technical support ready to provide product
and system assistance. In addition, the following service
areas are available at www.microchip.com:
■
Support link provides a way to get questions
answered fast:http://support.microchip.com
■
Sample link offers evaluation samples of any
Microchip device: http://sample.microchip.com
■
Forum link provides access to knowledge base and
peer help: http://forum.microchip.com
■
Buy link provides locations of Microchip Sales Channel
Partners: www.microchip.com/sales
Sales Office Listing
AMERICAS
Atlanta
Tel: 678-957-9614
Boston
Tel: 774-760-0087
Chicago
Tel: 630-285-0071
Cleveland
Tel: 216-447-0464
Dallas
Tel: 972-818-7423
Detroit
Tel: 248-538-2250
Indianapolis
Tel: 317-773-8323
Los Angeles
Tel: 949-462-9523
Santa Clara
Tel: 408-961-6444
Toronto
Mississauga, Ontario
Tel: 905-673-0699
EUROPE
Austria - Wels
Tel: 43-7242-2244-39
Denmark - Copenhagen
Tel: 45-4450-2828
France - Paris
Tel: 33-1-69-53-63-20
Germany - Munich
Tel: 49-89-627-144-0
Italy - Milan
Tel: 39-0331-742611
Netherlands - Drunen
Tel: 31-416-690399
Spain - Madrid
Tel: 34-91-708-08-90
UK - Wokingham
Tel: 44-118-921-5869
Training
If additional training interests you, then Microchip can
help. We continue to expand our technical training options,
offering a growing list of courses and in-depth curriculum
locally, as well as significant online resources – whenever
you want to use them.
■
Technical Training Centers: www.microchip.com/training
■
MASTERs Conferences: www.microchip.com/masters
■
Worldwide Seminars: www.microchip.com/seminars
■
eLearning: www.microchip.com/webseminars
■
Resources from our Distribution and Third Party Partners