Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

otTimeTrap Class Reference
[TimeTrap - A process manager over time, TimeTrap - A process manager over time]

A process manager over time.

#include <otTimeTrap.h>


Public Types

typedef otTimeTrap::TimeBase TimeBase
 Time base units.
enum  TimeBase { TB_US, TB_MS, TB_S }

Public Member Functions

 otTimeTrap ()
bool init (U16 events, U16 tid)
void close ()
U16 addTrap (timeTrapCallback proc, U64 time, TimeBase tb)
void sync ()
void sync (U16 npar,...)
U16 process (U32 minDelay=100)
U64 elapsedTime (U16 id)
U64 period (U16 id)
S64 jitter (U16 id)
void setDelay (U64 dly)
bool delayDone ()
void delayUs (U64 dly)
void delayMs (U64 dly)
U64 counts ()
U64 time (U16 &h, U16 &m, U16 &s)


Member Typedef Documentation

typedef otTimeTrap::TimeBase otTimeTrap.TimeBase
 


Member Enumeration Documentation

enum otTimeTrap::TimeBase
 

Enumeration values:
TB_US  Micro seconds.
TB_MS  Milli seconds.
TB_S  Seconds.


Constructor & Destructor Documentation

otTimeTrap.otTimeTrap (   ) 
 

Create the class


Member Function Documentation

U16 otTimeTrap.addTrap (  timeTrapCallback  proc,
U64  time,
TimeBase  tb
) 
 

Add a time trap to execute a specific process

Parameters:
proc Pointer to user function
time Time period
tb Time base used to specify the period see TimeBase
Returns:
Process id

void otTimeTrap.close (   ) 
 

Free all allocated resources

U64 otTimeTrap.counts (   ) 
 

Reads the internal 64-bit counter

Returns:
Timer counts as us

bool otTimeTrap.delayDone (   ) 
 

Check that a set delay has been performed.

Returns:
True on complete

void otTimeTrap.delayMs (  U64  dly  ) 
 

Performs a non-blocking delay until completion. If the delay value is long enough, more processes are performed.

Parameters:
dly Delay as ms

void otTimeTrap.delayUs (  U64  dly  ) 
 

Performs a non-blocking delay until completion. If the delay value is long enough, more processes are performed.

Parameters:
dly Delay as us

U64 otTimeTrap.elapsedTime (  U16  id  ) 
 

Return elapsed time for a specific process id.

Parameters:
id Process id
Returns:
Elapsed time as us

bool otTimeTrap.init (  U16  events,
U16  tid
) 
 

Init the class

Parameters:
events Number of events to allocate
tid Timer identifier, see TimerId

S64 otTimeTrap.jitter (  U16  id  ) 
 

Return jitter from a specific process.

Parameters:
id Process id
Returns:
Jitter time as us

U64 otTimeTrap.period (  U16  id  ) 
 

Return the actual period achieved by a specific process.

Parameters:
id Process id
Returns:
Period time as us

U16 otTimeTrap.process (  U32  minDelay = 100  ) 
 

Call this method continuously.

Parameters:
minDelay Minimum requested delay, set to 0 if this method is followed by other code with a minimum overhead of 100us.
Returns:
Processed function id

void otTimeTrap.setDelay (  U64  dly  ) 
 

Set a non-blocking delay

Parameters:
dly Delay as us

void otTimeTrap.sync (  U16  npar,
  ...
) 
 

Synchronize all processes to run with different time offset as us

Parameters:
npar Number of specified offset starting from the first. Use a 0 for no offset.
... Offset list

void otTimeTrap.sync (   ) 
 

Synchronize all processes to run.

U64 otTimeTrap.time (  U16 &  h,
U16 &  m,
U16 &  s
) 
 

Return the internal 64-bit counter and show it as hour, minute, second

Parameters:
h Output of elapsed hour
m Output of elapsed minute
s Output of elapsed second
Returns:
Timer counts


The documentation for this class was generated from the following file: footer
otStudio - Library Reference - (C) 2020-25 Officina Turini, All Rights Reserved
Document built with Doxygen 1.4.0