Microchip Technology Starter Kit for PIC24F DM240011 DM240011 Manual De Usuario

Los códigos de productos
DM240011
Descargar
Página de 16
Graphics Quick Reference Guide 
7
 
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.
Predefined Types
GFX_COLOR 
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;
XCHAR
Data type for characters. Set by macros in GraphicsConfig.h 
        macro                                                  XCHAR Data Type 
#define USE_MULTIBYTECHAR        signed int 
#define USE_UNSIGNED_XCHAR     unsigned char 
non-of the above                                  signed char
Device Driver Layer
Device Driver Layer
Description
void ResetDevice()
Initialize the display interface and resets the display.
void PutPixel(SHORT x, SHORT y)
Renders the pixel located on the given x,y position with the 
current set color.
GFX_COLOR GetPixel( 
                    SHORT x,  
                    SHORT y)
Returns the pixel color located on the given x,y position.
void DisplayBrightness(WORD level)
Sets the brightness of the display (level: 0-100).
WORD IsDeviceBusy()
Returns a non-zero if display controller is busy with the 
previous rendering operation. Zero if idle.
WORD GetMaxX()
Returns the maximum horizontal coordinate.
WORD GetMaxY()
Returns the maximum vertical coordinate.
void SetClip(BYTE control)
Enables/disables clipping.  
      control              definition 
CLIP_DISABLE      Disable clipping 
CLIP_ENABLE       Enable clipping
void SetClipRgn( 
                    SHORT left,  
                    SHORT top,  
                    SHORT right,  
                    SHORT bottom) 
Sets the clipping region with the given coordinates.
WORD GetClipLeft()
Returns left clipping border.
WORD GetClipRight()
Returns right clipping border.
WORD GetClipTop()
Returns top clipping border.
WORD GetClipBottom()
Returns bottom clipping border.
void SetColor(GFX_COLOR color)
Sets the current drawing color.
GFX_COLOR GetColor()
Returns the current drawing color.
void TransparentColorEnable( 
                    GFX_COLOR color)
Set the transparent color and enable the transparent color 
feature for PutImage(). 
Graphics Config: USE_TRANSPARENT_COLOR
void TransparentColorDisable()
Disable the transparent color feature for PutImage(). 
Graphics Config: USE_TRANSPARENT_COLOR
WORD GetTransparentColorStatus()
Returns the current status of the transparent color feature of 
PutImage(). 
             return value                                     definition 
TRANSPARENT_COLOR_DISABLE      feature is disabled 
TRANSPARENT_COLOR_ENABLE       feature is enabled 
Graphics Config: USE_TRANSPARENT_COLOR
GFX_COLOR GetTransparentColor()
Returns the current transparent color set by 
TransparentColorEnable().
void SetActivePage(WORD page)
Set the active page. Active page is the buffer used for 
rendering.
(1)
 
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.
Device Driver Layer
Description
void SetVisualPage(WORD page)
Set the visible page. Visual page (display buffer ) is the page 
shown on the display.
(1)
WORD CopyWindow( 
                    DWORD srcAddr,  
                    DWORD dstAddr,      
                    WORD srcX, WORD srcY,                  
                    WORD dstX, WORD dstY,                 
                    WORD width,  
                    WORD height) 
Copies the contents of a window located in the address 
defined by srcAddr and the pixel offset set by srcX and srcY 
to an address location defined by dstAddr and the pixel offset 
set by dstX and dstY. Size of the copied window is set by the 
given width and height.
(2)
WORD CopyPageWindow(  
                     BYTE srcPage,  
                     BYTE dstPage, 
                     WORD srcX, WORD srcY, 
                     WORD dstX, WORD dstY, 
                     WORD width,  
                     WORD height);     
Copies the contents of a window located in the page defined 
by srcPage and the pixel offset set by srcX and srcY to 
another page defined by dstPage and the pixel offset set by 
dstX and dstY. Size of the copied window is set by the given 
width and height.
(1, 2)
WORD CopyBlock( 
                      DWORD srcAddr,  
                      DWORD dstAddr,  
                      DWORD srcOffset,  
                      DWORD dstOffset,  
                      WORD width,  
                      WORD 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.
(2)
void SwitchOnDoubleBuffering()
Turn on the automatic management of double buffering. All 
rendering will be performed on the currently set draw buffer. 
Graphics Config: USE_DOUBLE_BUFFERING
void SwitchOffDoubleBuffering()
Turn off the automatic management of double buffering. All 
rendering will be performed on the currently set display buffer. 
Graphics Config: USE_DOUBLE_BUFFERING
BYTE IsDisplayUpdatePending()
Returns the status of the display update set by 
RequestDisplayUpdate(). 
Graphics Config: USE_DOUBLE_BUFFERING
void RequestDisplayUpdate(void)
Schedule synchronization of the contents of the draw buffer 
and the display buffer at the next vertical blanking. 
Graphics Config: USE_DOUBLE_BUFFERING
void InvalidateAll()
Marks the whole screen area as invalidated. 
Graphics Config: USE_DOUBLE_BUFFERING
void InvalidateRectangle( 
                      WORD left,  
                      WORD top,  
                      WORD right,  
                      WORD bottom);
Invalidates the defined 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 Config: USE_DOUBLE_BUFFERING
void UpdateDisplayNow()
Synchronizes the draw and display buffer immediately.  
Graphics Config: USE_DOUBLE_BUFFERING
Microchip Graphics Library Quick Reference Guide