AN1368
USER MESSAGE INTERFACE
The user message interface is a sublayer of the GOL
which is enabled if the GOL is used. This sublayer is
used to facilitate the message passing between
widgets and user input. For example, if the user
presses a button, then a message is sent to a call back
function, called GOLMsgCallback() , where the
message indicating that the button is pressed is
checked and an action is taken. This callback function
must be present in the application code if the GOL is
being used, no matter if message passing is being
used or not. If the message passing is not used, the
function body must return a ‘ 1 ’.
Similar to GOLDraw() , GOLMsg() must be called
continuously in a loop inside the application code to
facilitate message collection and passing.
The usage of GOLDraw() , GOLDrawCallback() ,
GOLMsg() and GOLMsgCallback() are explained in
Example 4 , Example 5 and Example 6 .
APPLICATION LAYER
In this layer, the user has full control of the application.
Initially, the user must initialize the Microchip Graphics
Library. The initialization is done by calling GOLInit() if
all the layers are being used, InitGraph() if the GOL
is not being used but the Primitive and Display Driver
layers are being used, or by calling ResetDevice() if
only the Display Driver layer is being used. After the
initialization routine, the Primitive and Driver layers’ APIs
can be called to achieve the required draw functionality.
To use GOL objects (like buttons), the widgets must be
created by calling the widget’s create function (e.g.,
BtnCreate() ), one by one, until all of the widgets are
created. This step will not display the widgets. The
created widgets are drawn on the screen when the
GOLDraw() function is called repeatedly in a while loop.
The messages are processed by calling the GOLMsg()
inside the same loop, as shown in Example 5 .
DS01368A-page 24
After GOLDraw() is done, messages are received
from the touch screen driver and hard buttons driver.
The obtained message is passed to GOLMsg() to
process and to output a widget-specific message. For
example, it converts a “USER TOUCHED POSITION
100, 100” message to BUTTON1_PRESSED .
Additionally, the application must possess the
GOLDrawCallback() and GOLMsgCallback()
functions .
If custom drawing is not done, then the draw callback is
used, as shown in Example 4 .
EXAMPLE 4:
WORD GOLDrawCallback(void)
{
return (1);
}
The message callback handles the processed
message sent out by the widgets, as shown in
If the application already uses a main loop,
GOLDraw() and GOLMsg() can be called within the
loop (see Example 5 ).
Note 1: Refer to the application note, AN1136, “ How
to Use Widgets in Microchip Graphics
Library ” for creating a simple application.
2: Refer to the Microchip Graphics Library
Help file for the list of related application
notes.
? 2011 Microchip Technology Inc.
相关PDF资料
AC164130 BOARD DAUGHT PICTL PLUS ECAN/LIN
AC164131 BOARD DAUGHTER USB PICTAIL PLUS
AC164132 BOARD DAUGHTER PICTAIL ETHERNET
AC164141 BOARD SMART CARD / SIM CARD
AC164142 BOARD DAUGHTER PWR LINE MODEM
AC164144 LLC PICTAIL PLUS DAUGHTR BRD
AC164145 BOARD DAUGHTER PWR LINE MODEM
AC243005-1 KIT MEMORY SERIAL SUPERFLASH 1
相关代理商/技术参数
AC164128 功能描述:子卡和OEM板 dsPICDEM Motor Cntrl PICtail Plus RoHS:否 制造商:BeagleBoard by CircuitCo 产品:BeagleBone LCD4 Boards 用于:BeagleBone - BB-Bone - Open Source Development Kit
AC164129 功能描述:子卡和OEM板 Audio PICtail Plus Daughter Board RoHS:否 制造商:BeagleBoard by CircuitCo 产品:BeagleBone LCD4 Boards 用于:BeagleBone - BB-Bone - Open Source Development Kit
AC164130 功能描述:网络开发工具 ECAN/LIN PICtail Plus Daughter Board RoHS:否 制造商:Rabbit Semiconductor 产品:Development Kits 类型:Ethernet to Wi-Fi Bridges 工具用于评估:RCM6600W 数据速率:20 Mbps, 40 Mbps 接口类型:802.11 b/g, Ethernet 工作电源电压:3.3 V
AC164130-2 功能描述:子卡和OEM板 CAN/LIN PICtail Plus Daughter Board RoHS:否 制造商:BeagleBoard by CircuitCo 产品:BeagleBone LCD4 Boards 用于:BeagleBone - BB-Bone - Open Source Development Kit
AC164131 功能描述:子卡和OEM板 USB PICtail Plus Daughter Board RoHS:否 制造商:BeagleBoard by CircuitCo 产品:BeagleBone LCD4 Boards 用于:BeagleBone - BB-Bone - Open Source Development Kit
AC164132 功能描述:以太网开发工具 100Mbps Ethernet PICtail Plus DB RoHS:否 制造商:Micrel 产品:Evaluation Boards 类型:Ethernet Transceivers 工具用于评估:KSZ8873RLL 接口类型:RMII 工作电源电压:
AC164133 功能描述:电源管理IC开发工具 dsPIC BuckBoost PICtail Daughtr Brd RoHS:否 制造商:Maxim Integrated 产品:Evaluation Kits 类型:Battery Management 工具用于评估:MAX17710GB 输入电压: 输出电压:1.8 V
AC164133 制造商:Microchip Technology Inc 功能描述:Buck/Boost Converter PICtail P