Microchip Technology AC164127-9 Data Sheet

Page of 34
AN1368
DS01368A-page 26
 2011 Microchip Technology Inc.
CONFIGURATION
The configuration of the Microchip Graphics Library is
done through two files:
• GraphicsConfig.h
• HardwareProfile.h
GraphicsConfig.h
The software library related configurations are done in
GraphicsConfig.h
. The available options are:
1.
USE_NONBLOCKING_CONFIG:
 If this option is
defined, then the Non-Blocking mode of the API
calls is used; that is, the APIs with return status
values can return without completing their task.
The task may complete some time after
returning. This is especially useful if 2D-
Acceleration is supported by the display driver.
In that case, the application can regain control
while rendering is being processed in parallel.
This reduces Idle time for the microcontroller
waiting for the rendering of a primitive command
(such as line(),  bar()). If this define is
disabled (commented out), then all API calls
return only after the completion of their task. For
non-blocking configuration, the user must check
the return value of the API to know if its
execution got completed or not.
2.
USE_DOUBLE_BUFFERING:
 If this option is
defined, two buffers will be used. One buffer will
be used as a draw buffer, where the next screen
is rendered, and the other as a frame buffer,
which holds the visible pixels of the screen. This
mode is used to avoid visible slow drawing on
the screen, like rendering of a large area or
decoding and displaying of an image. This mode
uses twice the amount of the frame buffer and
the library currently supports this feature only for
certain graphics controllers (refer to the
documentation of the Microchip Graphics
Library). If this option is commented out, then
only one buffer is used as the frame buffer and
the changes to the screen are visible at the
same time.
3.
USE_PALETTE:
 If this option is defined, Palette
mode is enabled and the colors are taken from
the palette table. This option is available only to
controllers that have a built-in, programmable,
color look-up table (example: PIC24FJ256DA210
has a graphics module with a color look-up table).
The table is required to initialize the palette
engine and set a valid palette table before
displaying anything on the screen. The library
supports this feature only for PIC microcontrollers
with a built-in display controller. The
COLOR_DEPTH
 setting can be 1, 2, 4 or 8 with the
palettes enabled. If disabled, Normal Color mode
will be used.
4.
USE_FOCUS:
 If this option is defined, a dashed
outline (focus line) is displayed on the selected
widget. This focus line is especially useful for
navigation and selection of widgets if push
buttons are used as user input.
5.
USE_TOUCHSCREEN:
 This option
 
enables the
touch screen support for the application by
enabling the touch message processing part of
the GOL.
6.
USE_KEYBOARD:
 This option
 
enables the
physical keys support for the application by
enabling the hard key message processing part
of the GOL.
7.
USE_GOL:
 This option enables the Graphic Object
Layer (GOL). Initially, GOLInit() must be called.
GOLDraw()
 and GOLMsg() must be called
repeatedly in a loop and GOLDrawCallback()
and  GOLMsgCallback() functions must be
implemented by the application.
8.
USE_BUTTON
,  USE_CHECKBOX,  USE_WINDOW,
… , USE_CUSTOM:
 These options are valid only
if USE_GOL is defined. They enable the support
of each widget in the application and each
enabled widget will use its share of RAM, ROM
and heap.
9.
USE_MULTIBYTECHAR:
 This will make the
XCHAR, 2 bytes long so that Unicode (UTF16)
is supported. Languages other than English
characters can be supported by the usage of
Unicode. Enable this option if multiple language
support is needed in the application and disable
(comment out) this option if only ASCII is used.
If this option is disabled, XCHAR takes one byte
per character.
10. USE_FONT_FLASH:  Supports fonts stored in
the internal Flash of the microcontroller to be
used in the application.
11. USE_FONT_RAM: Supports fonts stored in the
RAM of the microcontroller to be used in the
application. This is used as font accelerations in
PIC microcontrollers with a built-in display
controller. 
12. USE_FONT_EXTERNAL: Supports fonts
stored in the external memory (serial or paral-
lel Flash) to be used in the application. The
application needs to implement a function,
WORD ExternalMemoryCallback(EXTDATA
*memory, LONG offset, WORD nCount,
void *buffer)
, to get data from the external
memory.
13. COLOR_DEPTH: Specifies the color depth used
in the demo in bits-per-pixel and it can take
values, such as 1, 2, 4, 8, 16 or 24 (limited by the
hardware capabilities).