const TimerNull.ANY |
|
Const used to specify any timer
XDCscript usage |
meta-domain |
const TimerNull.ANY = ~0;
#define TimerNull_ANY (UInt)~0
enum TimerNull.PeriodType |
|
PeriodType
XDCscript usage |
meta-domain |
values of type TimerNull.PeriodType
const TimerNull.PeriodType_MICROSECS;
// period in microsecs
const TimerNull.PeriodType_COUNTS;
// period in counts
typedef enum TimerNull_PeriodType {
TimerNull_PeriodType_MICROSECS,
// period in microsecs
TimerNull_PeriodType_COUNTS
// period in counts
} TimerNull_PeriodType;
VALUES
PeriodType_MICROSECS
Period value is in microseconds.
PeriodType_COUNTS
Period value is in counts.
enum TimerNull.RunMode |
|
Timer Run Modes
XDCscript usage |
meta-domain |
values of type TimerNull.RunMode
const TimerNull.RunMode_CONTINUOUS;
// periodic and continuous
const TimerNull.RunMode_ONESHOT;
// one-shot
typedef enum TimerNull_RunMode {
TimerNull_RunMode_CONTINUOUS,
// periodic and continuous
TimerNull_RunMode_ONESHOT
// one-shot
} TimerNull_RunMode;
VALUES
RunMode_CONTINUOUS
Timer is periodic and runs continuously.
RunMode_ONESHOT
Timer runs for a single period value and stops
enum TimerNull.StartMode |
|
Timer Start Modes
XDCscript usage |
meta-domain |
values of type TimerNull.StartMode
const TimerNull.StartMode_AUTO;
// timer starts automatically
const TimerNull.StartMode_USER;
// timer will be started by user
typedef enum TimerNull_StartMode {
TimerNull_StartMode_AUTO,
// timer starts automatically
TimerNull_StartMode_USER
// timer will be started by user
} TimerNull_StartMode;
VALUES
StartMode_AUTO
Statically created/consructed Timers will be started in BIOS_start().
Dynamically created Timers will start at create() time. This includes
timers created before BIOS_start().
StartMode_USER
Timer will be started by the user using start().
enum TimerNull.Status |
|
Timer Status
XDCscript usage |
meta-domain |
values of type TimerNull.Status
const TimerNull.Status_INUSE;
// timer in use
const TimerNull.Status_FREE;
// timer is free
typedef enum TimerNull_Status {
TimerNull_Status_INUSE,
// timer in use
TimerNull_Status_FREE
// timer is free
} TimerNull_Status;
VALUES
Status_INUSE
Timer is in use. A timer is marked in use from the time it gets
created to the time it gets deleted.
Status_FREE
Timer is free and can be acquired using create.
typedef TimerNull.FuncPtr |
|
Timer tick function prototype
typedef Void (*TimerNull_FuncPtr)(UArg);
metaonly config TimerNull.common$ // module-wide |
|
Common module configuration parameters
XDCscript usage |
meta-domain |
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.
TimerNull.getNumTimers( ) // module-wide |
|
Returns number of timer peripherals on the platform
UInt TimerNull_getNumTimers( );
RETURNS
Number of timer peripherals.
TimerNull.getStatus( ) // module-wide |
|
Returns timer status (free or in use)
RETURNS
timer status
module-wide built-ins |
|
// Get this module's unique id
Bool TimerNull_Module_startupDone( );
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool TimerNull_Module_hasMask( );
// Test whether this module has a diagnostics mask
Bits16 TimerNull_Module_getMask( );
// Returns the diagnostics mask for this module
Void TimerNull_Module_setMask( Bits16 mask );
// Set the diagnostics mask for this module
per-instance object types |
|
typedef struct TimerNull_Object TimerNull_Object;
// Opaque internal representation of an instance object
// Client reference to an instance object
typedef struct TimerNull_Struct TimerNull_Struct;
// Opaque client structure large enough to hold an instance object
// Convert this instance structure pointer into an instance handle
// Convert this instance handle into an instance structure pointer
per-instance config parameters |
|
XDCscript usage |
meta-domain |
var params = new TimerNull.Params;
// Instance config-params object
params.arg = UArg null;
// Argument for tick function. Default is null
// Timer frequency
lo: 0,
hi: 0
};
params.period = UInt32 0;
// Period of tick. Can be specified in timer counts or microseconds.
Default is 0
// Period Type. Default is PeriodType_MICROSECS
// Timer run mode. Default is {@link #RunMode_CONTINUOUS}
// Start mode. Default is {@link #StartMode_AUTO}
typedef struct TimerNull_Params {
// Instance config-params structure
// Common per-instance configs
UArg arg;
// Argument for tick function. Default is null
// Timer frequency
UInt32 period;
// Period of tick. Can be specified in timer counts or microseconds.
Default is 0
// Period Type. Default is PeriodType_MICROSECS
// Timer run mode. Default is {@link #RunMode_CONTINUOUS}
// Start mode. Default is {@link #StartMode_AUTO}
} TimerNull_Params;
// Initialize this config-params structure with supplier-specified defaults before instance creation
config TimerNull.arg // per-instance |
|
Argument for tick function. Default is null
XDCscript usage |
meta-domain |
var params = new TimerNull.Params;
...
params.arg = UArg null;
config TimerNull.extFreq // per-instance |
|
Timer frequency
XDCscript usage |
meta-domain |
var params = new TimerNull.Params;
...
lo: 0,
hi: 0
};
DETAILS
This parameter is meaningfull only on platforms where the timer clock
can be changed. If value is left at zero, then default hookup of timer
clock is assumed.
config TimerNull.period // per-instance |
|
Period of tick. Can be specified in timer counts or microseconds.
Default is 0
XDCscript usage |
meta-domain |
var params = new TimerNull.Params;
...
params.period = UInt32 0;
DETAILS
The implementation of ITimer will support a period of UInt32
timer counts and use pre-scalars if necessary.
config TimerNull.periodType // per-instance |
|
Period Type. Default is PeriodType_MICROSECS
XDCscript usage |
meta-domain |
var params = new TimerNull.Params;
...
config TimerNull.runMode // per-instance |
|
Timer run mode. Default is RunMode_CONTINUOUS
XDCscript usage |
meta-domain |
var params = new TimerNull.Params;
...
config TimerNull.startMode // per-instance |
|
Start mode. Default is StartMode_AUTO
XDCscript usage |
meta-domain |
var params = new TimerNull.Params;
...
per-instance creation |
|
XDCscript usage |
meta-domain |
var params =
new TimerNull.
Params;
// Allocate instance config-params
params.config = ...
// Assign individual configs
var inst = TimerNull.create( Int id, Void(*)(UArg) tickFxn, params );
// Create an instance-object
// Allocate and initialize a new instance object and return its handle
// Initialize a new instance object inside the provided structure
ARGUMENTS
id
Timer id ranging from 0 to a platform specific value
tickFxn
function that runs upon timer expiry.
params
per-instance config params, or NULL to select default values (target-domain only)
eb
active error-handling block, or NULL to select default policy (target-domain only)
DETAILS
Create could fail if timer peripheral is unavailable. To
request any available timer use
ANY as the id.
TimerId's are logical ids. The family specific implementations
map the ids to physical peripherals.
per-instance deletion |
|
// Finalize and free this previously allocated instance object, setting the referenced handle to NULL
// Finalize the instance object inside the provided structure
TimerNull.getFreq( ) // per-instance |
|
Returns timer frequency in Hz
ARGUMENTS
handle
handle of a previously-created TimerNull instance object
freq
frequency in Hz
DETAILS
This is the effective frequency of the clock incrementing the timer
counter register after all scaling factors are taken into account.
(including pre-scalars).
TimerNull.getFunc( ) // per-instance |
|
Get Timer function and arg
ARGUMENTS
handle
handle of a previously-created TimerNull instance object
arg
pointer for returning Timer's function argument
RETURNS
Timer's function
TimerNull.getPeriod( ) // per-instance |
|
Gets timer period in timer counts
ARGUMENTS
handle
handle of a previously-created TimerNull instance object
RETURNS
period in timer counts
TimerNull.setFunc( ) // per-instance |
|
Overwrite Timer function and arg
ARGUMENTS
handle
handle of a previously-created TimerNull instance object
fxn
pointer to function
arg
argument to function
DETAILS
Replaces a Timer object's tickFxn function originally
provided in
create.
TimerNull.setPeriod( ) // per-instance |
|
Sets timer period specified in timer counts
ARGUMENTS
handle
handle of a previously-created TimerNull instance object
period
period in timer counts
DETAILS
Timer_setPeriod() invokes Timer_stop() prior to setting the period
and leaves the timer in the stopped state.
To dynamically change the period of a timer you must
protect against re-entrancy by disabling interrupts.
Use the following call sequence to guarantee proper results:
// disable interrupts if an interrupt could lead to
// another call to Timer_start().
key = Hwi_disable();
Timer_setPeriod(period);
Timer_start();
Hwi_restore(key);
ITimer implementation must support UInt32 and use pre-scalars whenever
necessary
SIDE EFFECTS
Calls Timer_stop(), and disables the timer's interrupt.
TimerNull.setPeriodMicroSecs( ) // per-instance |
|
Sets timer period specified in microseconds
ARGUMENTS
handle
handle of a previously-created TimerNull instance object
period
period in microseconds
DETAILS
A best-effort method will be used to set the period register.
There might be a slight rounding error based on resolution of timer
period register. If the timer frequency cannot support the requested
period, ie the timer period register cannot support the requested
period, then this function returns false.
Timer_setPeriodMicroSecs() invokes Timer_stop() prior to setting
the period and leaves the timer in the stopped state.
To dynamically change the period of a timer you must
protect against re-entrancy by disabling interrupts.
Use the following call sequence to guarantee proper results:
// disable interrupts if an interrupt could lead to
// another call to Timer_start().
key = Hwi_disable();
Timer_setPeriodMicroSecs(period);
Timer_start();
Hwi_restore(key);
TimerNull.start( ) // per-instance |
|
Reloads and starts the timer
ARGUMENTS
handle
handle of a previously-created TimerNull instance object
DETAILS
Thread safety must be observed when using the
start
and
stop APIs to avoid possible miss-
configuration of the timers and unintended behaviors.
To protect against re-entrancy, surround the start/stop invocations
with
Hwi_disable() and
Hwi_restore() calls:
// disable interrupts if an interrupt could lead to
// another call to Timer_start().
key = Hwi_disable();
Timer_stop();
...
Timer_start();
Hwi_restore(key);
SIDE EFFECTS
Enables the timer's interrupt.
TimerNull.stop( ) // per-instance |
|
Stop the timer
ARGUMENTS
handle
handle of a previously-created TimerNull instance object
DETAILS
Thread safety must be observed when using the
start
and
stop APIs to avoid possible miss-
configuration of the timers and unintended behaviors.
To protect against re-entrancy, surround the start/stop invocations
with
Hwi_disable() and
Hwi_restore() calls:
// disable interrupts if an interrupt could lead to
// another call to Timer_start().
key = Hwi_disable();
Timer_stop();
...
Timer_start();
Hwi_restore(key);
SIDE EFFECTS
Disables the timer's interrupt.
per-instance convertors |
|
// unconditionally move one level up the inheritance hierarchy
// conditionally move one level down the inheritance hierarchy; NULL upon failure
per-instance built-ins |
|
Int TimerNull_Object_count( );
// The number of statically-created instance objects
// The handle of the i-th statically-created instance object (array == NULL)
// The handle of the first dynamically-created instance object, or NULL
// The handle of the next dynamically-created instance object, or NULL
// The heap used to allocate dynamically-created instance objects
// The label associated with this instance object
// The name of this instance object