Low-Level Serial Port Driver (llSerial)
D-14
Get a Serial Buffer from the System
llSerialGetBuffer
Syntax
UINT8 *llSerialGetBuffer();
Return Value
nothing
Description
Called to get a serial buffer from the system, which will eventually be sent via
llSerialSend(), or returned to the driver via llSerialReturnBuffer(). Buffering is
done in this fashion so drivers that use their own buffer pools can support pass-
ing buffer ownership without copying data.
All buffers are of a fixed size. They have a usable size in bytes indicated by the
#define: HAL_SERIAL_BUFFERSIZE (currently 3052 bytes).
Send a Serial Buffer
llSerialSend
Syntax
void llSerialSend( uint dev, UINT8 *pb, uint offset, uint size );
Description
Called to send a serial buffer out the physical serial device indicated by dev.
The size of the valid data is in size. The byte offset to the valid data in the sup-
plied buffer is in offset. Once the buffer has been sent, the memory is returned
internally to the serial port’s free queue. Only buffers allocated via llSerialGet-
Buffer() can be used in this call.
Return a Serial Buffer to the System
llSerialReturnBuffer
Syntax
void llSerialReturnBuffer( UINT8 *bAddr );
Description
Called to return a serial buffer to the system, which was previously obtained
from a call to llSerialGetBuffer(). This is done so drivers that use their own buff-
er pools can support passing buffer ownership without copying buffer data.