Page 121 - DCAP210_INTRODUCTION__TO_MICROPROCESSORS
P. 121
Unit 8: Interfacing I/O Devices
• Simple event queues just record a code for event (Iris GL). Notes
• Better event queues record extra information such as time stamps (X windows).
8.2.8 Toolkits and Callbacks
Event-loop processing can be generalized:
• Instead of switch, use table lookup.
• Each table entry associates an event with a callback function.
• When event occurs, corresponding callback is invoked.
• Provide an API to make and delete table entries.
• Divide screen into parcels, and assign different callbacks to different parcels (X Windows
does this).
• Event manager does most or all of the administration.
Modular UI functionality is provided through a set of widgets:
• Widgets are parcels of the screen that can respond to events.
• A widget has a graphical representation that suggests its function.
• Widgets may respond to events with a change in appearance, as well as issuing callbacks.
• Widgets are arranged in a parent/child hierarchy.
– Event-process definition for parent may apply to child, and child may add additional
event-process definitions
– Event-process definition for parent may be redefined within child
• Widgets may have multiple parts, and in fact may be composed of other widgets in a hierarchy.
Some UI toolkits: Xm, Xt, SUIT, FORMS, Tk
Distinguish between Physical and virtual devices.
8.3 I/O Devices in Microprocessor
Using I/O devices data can be transferred between the microprocessor and the outside world.
This can be done in groups of 8 bits using the entire data bus. This is called parallel I/O. The
other method is serial I/O where one bit is transferred at a time using the SI and SO pins on the
Microprocessor.
8.3.1 Dealing with I/O Devices
There are two ways to deal with I/O devices.
1. Consider them like any other memory location.
• They are assigned a 16-bit address within the address range of the 8085.
• The exchange of data with these devices follows the transfer of data with memory. The
user uses the same instructions used for memory.
• This is called memory-mapped I/O.
LOVELY PROFESSIONAL UNIVERSITY 115