module ti.sdo.io.converters.Transformer

Transformer module

This module allows the user to create instances which modify a data stream by applying a function to each point produced or consumed by an underlying driver. The number of transformer instances in the system is limited only by the availability of memory; [ more ... ]
C synopsis target-domain sourced in ti/sdo/io/converters/Transformer.xdc
#include <ti/sdo/io/converters/Transformer.h>
Functions
Void 
Void 
Void 
Void
Functions common to all IConverter modules
Void 
Void 
Void 
Void 
Transformer_open// Opens the IConverter Instance(Transformer_Handle handle, String name, UInt mode, UArg chanParams, IConverter_DoneFxn cbFxn, UArg cbArg, Error_Block *eb);
Bool 
Void 
Functions common to all target instances
Functions common to all target modules
Defines
#define
Typedefs
typedef Void 
typedef struct
typedef struct
typedef struct
typedef Void 
 
DETAILS
This module allows the user to create instances which modify a data stream by applying a function to each point produced or consumed by an underlying driver. The number of transformer instances in the system is limited only by the availability of memory;
This module implements ti.sdo.io.IConverter interface and as such is only usable with ti.sdo.io.Stream. IConverter instances are added to a table within Stream and they can be linked together to form an IO stack/chain.
For example, is "/scale" is a Transformer instance in the stream table and "/adc" is a driver in ti.sdo.io.DriverTable then the name "/scale/adc" can be used to create a Stream instance.
For every Transformer instance the user can supply a tranfer function. Transformer provides three of these functions - multiply, fix2flt and flt2fix.
 
const Transformer_Q_TERMINATING

Terminating quality

C synopsis target-domain
#define Transformer_Q_TERMINATING (Int)1
 
DETAILS
Implementations with this "quality" can be at the bottom of the IO stack
 
typedef Transformer_DoneFxn

Typedef for callback function

C synopsis target-domain
typedef Void (*Transformer_DoneFxn)(UArg);
 
DETAILS
The IConverter instance lower in the stack will invoke this callback whenever an I/O operation completes.
 
typedef Transformer_TransFunc

typedefs for transformer function

C synopsis target-domain
typedef Void (*Transformer_TransFunc)(Ptr,SizeT,UArg);
 
DETAILS
Functions of this type get passed the buffer, buffer size and a function specific argument. The function should NOT act on the buffer if buffer is NULL or buffer size is zero.
 
Transformer_fix2flt()  // module-wide

fix2flt converts each data point from fixed point to floating point

C synopsis target-domain
Void Transformer_fix2flt(Ptr addr, SizeT size, UArg scaleFactor);
 
DETAILS
This function ignores the scaleFactor.
 
Transformer_flt2fix()  // module-wide

flt2fix converts each data point from floating point to fixed point

C synopsis target-domain
Void Transformer_flt2fix(Ptr addr, SizeT size, UArg scalePtr);
 
DETAILS
This function ignores the scaleFactor.
 
Transformer_multiply()  // module-wide

multiply function mutiples each data point with a scale value

C synopsis target-domain
Void Transformer_multiply(Ptr addr, SizeT size, UArg scaleFactor);
 
DETAILS
This function casts the scaleFactor to a UInt before using it. If arg is NULL a scaleFactor of 1 is used.
Module-Wide Built-Ins

C synopsis target-domain
Types_ModuleId Transformer_Module_id();
// Get this module's unique id
 
Bool Transformer_Module_startupDone();
// Test if this module has completed startup
 
IHeap_Handle Transformer_Module_heap();
// The heap from which this module allocates memory
 
Bool Transformer_Module_hasMask();
// Test whether this module has a diagnostics mask
 
Bits16 Transformer_Module_getMask();
// Returns the diagnostics mask for this module
 
Void Transformer_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
Instance Object Types

C synopsis target-domain
typedef struct Transformer_Object Transformer_Object;
// Opaque internal representation of an instance object
 
typedef Transformer_Object *Transformer_Handle;
// Client reference to an instance object
 
typedef struct Transformer_Struct Transformer_Struct;
// Opaque client structure large enough to hold an instance object
 
Transformer_Handle Transformer_handle(Transformer_Struct *structP);
// Convert this instance structure pointer into an instance handle
 
Transformer_Struct *Transformer_struct(Transformer_Handle handle);
// Convert this instance handle into an instance structure pointer
Instance Config Parameters

C synopsis target-domain
typedef struct Transformer_Params {
// Instance config-params structure
    IInstance_Params *instance;
    // Common per-instance configs
    UArg arg;
    // Arg to be used with transform functions
    Transformer_TransFunc fxn;
    // Function can be multiply, fix2flt or flt2fix or a user specific function
} Transformer_Params;
 
Void Transformer_Params_init(Transformer_Params *params);
// Initialize this config-params structure with supplier-specified defaults before instance creation
 
config Transformer_arg  // instance

Arg to be used with transform functions

C synopsis target-domain
      ...
    UArg arg;
 
 
config Transformer_fxn  // instance

Function can be multiply, fix2flt or flt2fix or a user specific function

C synopsis target-domain
      ...
    Transformer_TransFunc fxn;
 
 
Transformer_close()  // instance

Close an IConverter Instance

C synopsis target-domain
Void Transformer_close(Transformer_Handle handle, Error_Block *eb);
 
ARGUMENTS
handle — handle of a previously-created Transformer instance object
eb — error block
 
Transformer_control()  // instance

Send a control command

C synopsis target-domain
Void Transformer_control(Transformer_Handle handle, DriverTypes_ControlCmd cmd, UArg cmdArg, Error_Block *eb);
 
ARGUMENTS
handle — handle of a previously-created Transformer instance object
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.
 
Transformer_issue()  // instance

Issue a packet for IO

C synopsis target-domain
Void Transformer_issue(Transformer_Handle handle, DriverTypes_Packet *packet, Error_Block *eb);
 
ARGUMENTS
handle — handle of a previously-created Transformer instance object
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.
 
Transformer_open()  // instance

Opens the IConverter Instance

C synopsis target-domain
Void Transformer_open(Transformer_Handle handle, String name, UInt mode, UArg chanParams, IConverter_DoneFxn cbFxn, UArg cbArg, Error_Block *eb);
 
ARGUMENTS
handle — handle of a previously-created Transformer instance object
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.
 
Transformer_query()  // instance

Query for qualities supported

C synopsis target-domain
Bool Transformer_query(Transformer_Handle handle, Int qual);
 
ARGUMENTS
handle — handle of a previously-created Transformer instance object
qual — quality to be tested
 
Transformer_reclaim()  // instance

Reclaim a previously issued packet

C synopsis target-domain
Void Transformer_reclaim(Transformer_Handle handle, DriverTypes_Packet **packetp, Error_Block *eb);
 
ARGUMENTS
handle — handle of a previously-created Transformer instance object
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.
Instance Convertors

C synopsis target-domain
IConverter_Handle Transformer_Handle_upCast(Transformer_Handle handle);
// unconditionally move one level up the inheritance hierarchy
 
Transformer_Handle Transformer_Handle_downCast(IConverter_Handle handle);
// conditionally move one level down the inheritance hierarchy; NULL upon failure
Instance Built-Ins

C synopsis target-domain
Int Transformer_Object_count();
// The number of statically-created instance objects
 
Transformer_Handle Transformer_Object_get(Transformer_Object *array, Int i);
// The handle of the i-th statically-created instance object (array == NULL)
 
Transformer_Handle Transformer_Object_first();
// The handle of the first dynamically-created instance object, or NULL
 
Transformer_Handle Transformer_Object_next(Transformer_Handle handle);
// The handle of the next dynamically-created instance object, or NULL
 
IHeap_Handle Transformer_Object_heap();
// The heap used to allocate dynamically-created instance objects
 
Types_Label *Transformer_Handle_label(Transformer_Handle handle, Types_Label *buf);
// The label associated with this instance object
 
String Transformer_Handle_name(Transformer_Handle handle);
// The name of this instance object
 
XDCscript usage meta-domain sourced in ti/sdo/io/converters/Transformer.xdc
var Transformer = xdc.useModule('ti.sdo.io.converters.Transformer');
module-wide constants & types
 
    var obj = new Transformer.BasicView// ;
        obj.label = String  ...
        obj.lowerConverter = Ptr  ...
        obj.mode = String  ...
        obj.callbackFxn = String[]  ...
        obj.callbackArg = UArg  ...
        obj.transformFxn = String[]  ...
        obj.transformArg = UArg  ...
module-wide config parameters
per-instance config parameters
    var params = new Transformer.Params// Instance config-params object;
        params.arg// Arg to be used with transform functions = UArg null;
        params.fxn// Function can be multiply, fix2flt or flt2fix or a user specific function = Void(*)(Ptr,SizeT,UArg) null;
 
 
const Transformer.Q_TERMINATING

Terminating quality

XDCscript usage meta-domain
const Transformer.Q_TERMINATING = 1;
 
DETAILS
Implementations with this "quality" can be at the bottom of the IO stack
C SYNOPSIS
 
metaonly struct Transformer.BasicView
XDCscript usage meta-domain
var obj = new Transformer.BasicView;
 
    obj.label = String  ...
    obj.lowerConverter = Ptr  ...
    obj.mode = String  ...
    obj.callbackFxn = String[]  ...
    obj.callbackArg = UArg  ...
    obj.transformFxn = String[]  ...
    obj.transformArg = UArg  ...
 
 
metaonly config Transformer.common$  // module-wide

Common module configuration parameters

XDCscript usage meta-domain
Transformer.common$ = Types.Common$ undefined;
 
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.
 
metaonly config Transformer.rovViewInfo  // module-wide
XDCscript usage meta-domain
Transformer.rovViewInfo = ViewInfo.Instance ViewInfo.create;
 
Instance Config Parameters

XDCscript usage meta-domain
var params = new Transformer.Params;
// Instance config-params object
    params.arg = UArg null;
    // Arg to be used with transform functions
    params.fxn = Void(*)(Ptr,SizeT,UArg) null;
    // Function can be multiply, fix2flt or flt2fix or a user specific function
 
config Transformer.arg  // instance

Arg to be used with transform functions

XDCscript usage meta-domain
var params = new Transformer.Params;
  ...
params.arg = UArg null;
 
C SYNOPSIS
 
config Transformer.fxn  // instance

Function can be multiply, fix2flt or flt2fix or a user specific function

XDCscript usage meta-domain
var params = new Transformer.Params;
  ...
params.fxn = Void(*)(Ptr,SizeT,UArg) null;
 
C SYNOPSIS
generated on Tue, 22 May 2012 23:44:30 GMT