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 ... ]
XDCspec summary sourced in ti/sdo/io/IConverter.xdc
interface IConverter {  ...
// inherits xdc.runtime.IModule
instance:  ...
XDCspec declarations sourced in ti/sdo/io/IConverter.xdc
package ti.sdo.io;
 
interface IConverter {
module-wide constants & types
    const Int Q_TERMINATING// Terminating quality = 1;
 
    typedef Void (*DoneFxn// Typedef for callback function)(UArg);
module-wide config parameters
 
 
instance:
per-instance functions
    Void control// Send a control command(DriverTypes.ControlCmd cmd, UArg cmdArg, Error.Block *eb);
    Void open// Opens the IConverter Instance(String name, UInt mode, UArg chanParams, IConverter.DoneFxn cbFxn, UArg cbArg, Error.Block *eb);
    Bool query// Query for qualities supported(Int qual);
}
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

XDCspec declarations sourced in ti/sdo/io/IConverter.xdc
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

XDCspec declarations sourced in ti/sdo/io/IConverter.xdc
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

XDCspec declarations sourced in ti/sdo/io/IConverter.xdc
metaonly config Types.Common$ common$;
 
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

XDCspec declarations sourced in ti/sdo/io/IConverter.xdc
Void close(Error.Block *eb);
 
ARGUMENTS
eb — error block
 
IConverter.control()  // instance

Send a control command

XDCspec declarations sourced in ti/sdo/io/IConverter.xdc
Void control(DriverTypes.ControlCmd cmd, UArg cmdArg, Error.Block *eb);
 
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

XDCspec declarations sourced in ti/sdo/io/IConverter.xdc
Void issue(DriverTypes.Packet *packet, Error.Block *eb);
 
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

XDCspec declarations sourced in ti/sdo/io/IConverter.xdc
Void open(String name, UInt mode, UArg chanParams, IConverter.DoneFxn cbFxn, UArg cbArg, Error.Block *eb);
 
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

XDCspec declarations sourced in ti/sdo/io/IConverter.xdc
Bool query(Int qual);
 
ARGUMENTS
qual — quality to be tested
 
IConverter.reclaim()  // instance

Reclaim a previously issued packet

XDCspec declarations sourced in ti/sdo/io/IConverter.xdc
Void reclaim(DriverTypes.Packet **packetp, Error.Block *eb);
 
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 Sat, 11 Feb 2012 00:37:45 GMT