User guide

13
The new serial manager maintains a database of installed hardware and currently open
connections. Applications, libraries, or other serial communication tasks open different
pieces of serial hardware by specifying a logical port number or a four-character code
identifying the exact piece of serial hardware that a task wishes to open a connection
with. The new serial manager then performs the proper actions on the hardware via small
hardware drivers that are opened dynamically when the port is needed.
Once a port is opened, the new serial manager allocates a structure for maintaining the
current information and settings of the particular port. The task or application that opens
the port is returned a port ID and must supply the port ID to refer to this port when other
new serial manager functions are called.
Upon closing the port, the new serial manager deallocates the open port structure and
unlocks the driver code resource to prevent memory fragmentation.
From hardware point of view, the UART unit in MC68EZ328 controls the infrared
LED/sensor. The UART unit also drives the 5-wire serial interface (used for hotsyncing
and for connecting to external devices – modems).
IR Receiver
Receiving the infrared stream of data is relatively simple with the help of New Serial
Manager, since it is very similar to standard serial communication. There are functions
provided for opening a serial connection, checking availability of bytes in the receive
buffer, waiting for a specified number of bytes to come, reading the buffer and closing
the connection.