User`s guide
3 Porting a BSP to Custom Hardware
3.3 Finalizing Your BSP
105
3
SIO_OPEN
Opens a channel.
SIO_HUP
Closes a channel.
txStartup( )
This routine provides a pointer to the routine that the system calls when new
data is available for transmission. Typically, this routine is called only from the
ttyDrv.o module. This module provides a higher level of functionality that
makes a raw serial channel behave with line control and canonical character
processing.
callbackInstall( )
This routine provides the driver with pointers to callback functions that the
driver can call asynchronously to handle character puts and gets. The driver is
responsible for saving the callback routines and arguments that it receives
from the callbackInstall( ) routine.The available callbacks are
SIO_CALLBACK_GET_TX_CHAR and SIO_CALLBACK_PUT_RCV_CHAR.
You must define
SIO_CALLBACK_GET_TX_CHAR to point to a routine that
fetches a new character for output. The driver calls this callback routine with
the supplied argument and an additional argument that is the address to
receive the new output character, if a character is available. The called routine
returns
OK to indicate that a character was delivered, or ERROR to indicate
that no more characters are available.
You must define
SIO_CALLBACK_PUT_RCV_CHAR to point to a routine the
driver can use to send characters upward. For each incoming character, the
callback routine is called with the supplied argument, and the new character
as a second argument. Drivers do not normally care about the return value
from this call. Typically, the only option available to the driver is to drop a
character if the higher level is not able to receive it.
pollInput( ) and pollOutput( )
These routines provide an interface to the polled mode operations of the
driver. Do not call these routines unless the device has already been placed into
polled mode operation by an
SIO_MODE_SET operation.
See target/src/drv/sio/templateSio.c for more information on the internal
workings of a typical SIO device driver.