interface ti.sdo.io.IConverter |
|
|
Interface defining an IConverter
This interfaces allows applications to "stack" functionality on top
of a driver. Modules that implement this interface can manipulate data
coming to and from a driver. Simple scaling, fixed to float or float to
fixed transformations can be done using IConverters without major changes
in the application.
[
more ... ]
interface IConverter { ...
instance: ...
interface IConverter {
module-wide constants & types
module-wide config parameters
instance:
per-instance functions
}
DETAILS
This interfaces allows applications to "stack" functionality on top
of a driver. Modules that implement this interface can manipulate data
coming to and from a driver. Simple scaling, fixed to float or float to
fixed transformations can be done using IConverters without major changes
in the application.
IConverters can only be used along with the
Stream module.
Stream maintains a name table of
IConverter handles.
This table is used by Stream to create an IO stack. The name passed to
Stream.create is usually of the form "/scale/uart". This name may
correspond to the following IO stack.
Stream Instance
|
V
IConverter Instance (/scale)
|
V
IDriver Instance (/uart)
In this case the Stream requires "/scale" to be in its IConverter table
and "/uart" to be in
DriverTable. The IConverter table associates
a name with an IConverter Handle. Note that these names have to be of the
form "/name1".
There may be several other IConverters such as a
ti.sdo.io.converters.Transformer instance in the stack.
IConverter implementation follows a simple asynchronous issue/reclaim
model. Once an instance of an IConverter is created it accepts IO
packets through the
issue function. Issue ALWAYS results in a
callback when IO completes or an error occurs.
The IConverter device above it in the stack or the
Stream
module will call
reclaim to get the packet back.
ti.sdo.io.DriverTypes.ControlCmd are sent to the IConverters or the
underlying drivers using
control function.
Only packets with
ti.sdo.io.DriverTypes.READ and
ti.sdo.io.DriverTypes.WRITE are operated on by IConverter. Other
commands are passed down.
const IConverter.Q_TERMINATING |
|
Terminating quality
const Int Q_TERMINATING = 1;
DETAILS
Implementations with this "quality" can be at the bottom of the IO
stack
typedef IConverter.DoneFxn |
|
Typedef for callback function
typedef Void (*DoneFxn)(UArg);
DETAILS
The IConverter instance lower in the stack will invoke this callback
whenever an I/O operation completes.
metaonly config IConverter.common$ // module-wide |
|
Common module configuration parameters
DETAILS
All modules have this configuration parameter. Its name
contains the '$' character to ensure it does not conflict with
configuration parameters declared by the module. This allows
new configuration parameters to be added in the future without
any chance of breaking existing modules.
IConverter.close() // instance |
|
Close an IConverter Instance
ARGUMENTS
eb
error block
IConverter.control() // instance |
|
Send a control command
ARGUMENTS
cmd
control cmd
cmdArg
control cmd arg
eb
error block
DETAILS
The IConverter will respond to command meant for it and pass down all
others.
IConverter.issue() // instance |
|
Issue a packet for IO
ARGUMENTS
packet
IO packet
eb
Error Block
DETAILS
The IConverter might work on the buffer of data if the mode is
ti.sdo.io.DriverTypes.OUTPUT and call the issue function for the
IConverter lower in the stack. Some IConverters may be the last in
the IO stack. issue() always results in a callback.
IConverter.open() // instance |
|
Opens the IConverter Instance
ARGUMENTS
name
remaining name
mode
DriverTypes_INPUT/OUTPUT
chanParams
channel params for driver at the bottom of stack
cbFxn
callback function
cbArg
callback function arg
eb
error block
DETAILS
This is called at runtime after the IConverter instance has been
created. This function opens the IConverter instance lower in the
stack and gives its callback function and arg.
IConverter.query() // instance |
|
Query for qualities supported
ARGUMENTS
qual
quality to be tested
IConverter.reclaim() // instance |
|
Reclaim a previously issued packet
ARGUMENTS
packetp
pointer to returned packet
eb
Error Block
DETAILS
The IConverter will call the reclaim function for the
IConverter lower in the stack. It may work on the buffer of data
returned if the mode is
ti.sdo.io.DriverTypes.INPUT.
generated on Wed, 23 Mar 2011 16:23:26 GMT