module ti.sysbios.family.arm.a8.TimestampProvider

A8 TimestampProvider

The source of the timestamps for the A8 TimestampProvider is the A8's internal PMC counter which counts CPU cycles. [ more ... ]
C synopsis target-domain sourced in ti/sysbios/family/arm/a8/TimestampProvider.xdc
DETAILS
The source of the timestamps for the A8 TimestampProvider is the A8's internal PMC counter which counts CPU cycles.
As this counter is only 32 bits in length, provision is made in the get64() API to test if an overflow has occurred since the last invocation of get64() and compensate the return value accordingly.
As it is possible for the 32 bit counter to roll over more than once between successive get64() calls, it is up to the user to call the get64() API often enough to guarantee coherency in successive timestamps. A simple mechanism to do this would be to add a Clock function that simply invokes get64():
  var Clock = xdc.useModule('ti.sysbios.knl.Clock');
  var TimestampProvider = xdc.useModule('ti.sysbios.family.arm.a8.TimestampProvider');
  var clockParams = new Clock.Params();
  clockParams.period = 1;     // call every Clock tick
  Clock.create($externModFxn(TimestampProvider.get64), 1, clockParams);

Calling Context

Function Hwi Swi Task Main Startup
get32 Y Y Y Y N
get64 Y Y Y Y N
getFreq Y Y Y Y N
Definitions:
  • Hwi: API is callable from a Hwi thread.
  • Swi: API is callable from a Swi thread.
  • Task: API is callable from a Task thread.
  • Main: API is callable during any of these phases:
    • In your module startup after this module is started (e.g. TimestampProvider_Module_startupDone() returns TRUE).
    • During xdc.runtime.Startup.lastFxns.
    • During main().
    • During BIOS.startupFxns.
  • Startup: API is callable during any of these phases:
    • During xdc.runtime.Startup.firstFxns.
    • In your module startup before this module is started (e.g. TimestampProvider_Module_startupDone() returns FALSE).
 
TimestampProvider_get32()  // module-wide

Return a 32-bit timestamp

C synopsis target-domain
Bits32 TimestampProvider_get32();
 
RETURNS
Returns a 32-bit timestamp value. Use getFreq to convert this value into units of real time.
Returns a 32-bit timestamp value. Use getFreq to convert this value into units of real time.
SEE
 
TimestampProvider_get64()  // module-wide

Return a 64-bit timestamp

C synopsis target-domain
Void TimestampProvider_get64(Types_Timestamp64 *result);
 
ARGUMENTS
result — pointer to 64-bit result
This parameter is a pointer to a structure representing a 64-bit wide timestamp value where the current timestamp is written.
If the underlying hardware does not support 64-bit resolution, the hi field of result is always set to 0; see xdc.runtime.Types.Timestamp64. So, it is possible for the lo field to wrap around without any change to the hi field. Use getFreq to convert this value into units of real time.
pointer to 64-bit result
This parameter is a pointer to a structure representing a 64-bit wide timestamp value where the current timestamp is written.
If the underlying hardware does not support 64-bit resolution, the hi field of result is always set to 0; see xdc.runtime.Types.Timestamp64. So, it is possible for the lo field to wrap around without any change to the hi field. Use getFreq to convert this value into units of real time.
SEE
 
TimestampProvider_getFreq()  // module-wide

Get the timestamp timer's frequency (in Hz)

C synopsis target-domain
Void TimestampProvider_getFreq(Types_FreqHz *freq);
 
ARGUMENTS
freq — pointer to a 64-bit result
This parameter is a pointer to a structure representing a 64-bit wide frequency value where the timer's frequency (in Hz) is written; see xdc.runtime.Types.FreqHz. This function provides a way of converting timestamp values into units of real time.
pointer to a 64-bit result
This parameter is a pointer to a structure representing a 64-bit wide frequency value where the timer's frequency (in Hz) is written; see xdc.runtime.Types.FreqHz. This function provides a way of converting timestamp values into units of real time.
SEE
Module-Wide Built-Ins

C synopsis target-domain
Types_ModuleId TimestampProvider_Module_id();
// Get this module's unique id
 
Bool TimestampProvider_Module_startupDone();
// Test if this module has completed startup
 
IHeap_Handle TimestampProvider_Module_heap();
// The heap from which this module allocates memory
 
Bool TimestampProvider_Module_hasMask();
// Test whether this module has a diagnostics mask
 
Bits16 TimestampProvider_Module_getMask();
// Returns the diagnostics mask for this module
 
Void TimestampProvider_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
 
XDCscript usage meta-domain sourced in ti/sysbios/family/arm/a8/TimestampProvider.xdc
var TimestampProvider = xdc.useModule('ti.sysbios.family.arm.a8.TimestampProvider');
module-wide config parameters
 
 
metaonly config TimestampProvider.common$  // module-wide

Common module configuration parameters

XDCscript usage meta-domain
TimestampProvider.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.
generated on Thu, 01 Mar 2012 16:57:30 GMT