© 2000 Ubicom, Inc. All rights reserved.
- 7 -
www.ubicom.com
SX IrDA Virtual Peripheral Implementation
AN16
3.2.5 Transmit API
The pl2flTxStart call starts the transmission of a frame
header immediately and resets the receive state to idle.
When the framing layer can transmit a payload byte it
calls fl2plTxData to obtain the data to transmit. The pay-
load byte is returned in w and the z flag is set if this is the
last byte to be sent. This process will be repeated until a
last indication is detected.
Finally fl2plTxComplete is called once the frame has
been completely sent (i.e. the stop bit of the EOF byte
has been sent).
3.2.6 Transmit State Machine
Table 3-2 shows the Framing Layer Transmit State Machine
Control
RxAvail = BOF
Indicate data error to payload layer (fl2plRxError).
Begin
RxAvail = EOF
XOR RxData with $20.
Add to FCS.
Pass to payload layer via FIFO buffer.
Idle
RxAvail = Other
Payload
All States
pl2flRxIgnore
Idle
RxAvail = EOF & FCS = valid
Indicate data error to payload layer (fl2plRxError).
Idle
RxAvail = EOF & FCS = invalid
Idle
RxAvail = CE
Add data to FCS
Pass RxData to payload layer via FIFO buffer.
Control
RxAvail = Other
Indicate data error to payload layer (fl2plRxError).
Payload
Table
3-1. Framing Layer Receive State Machine
pl2flTxStarT ()
The payload layer wants to transmit a frame.
fl2plTxData (ret w=Data, z=Last)
Request the next payload byte.
fl2plTxComplete ()
The frame has been completely sent.
Figure
3-3. Framing Layer Transmit API
Table
3-2. Framing Layer Transmit State Machine
Current State
Event
Action
Next State
Idle
pl2flTxStart ()
Initialize FF counter.
Send FF byte.
Begin
Begin
TxEmpty & Counter-- <> 0
Send FF byte.
Begin
TxEmpty & Counter-- = 0
Initialize FCS.
Send BOF byte.
Payload