COSA
An Object-Oriented Platform for Arduino Programming
RTT Class Reference

#include <RTT.hh>

Collaboration diagram for RTT:
Collaboration graph

Classes

class  Clock
 
class  Scheduler
 

Static Public Member Functions

static bool begin ()
 
static bool end ()
 
static uint16_t us_per_tick ()
 
static uint16_t us_per_timer_cycle ()
 
static uint32_t micros ()
 
static void micros (uint32_t usec)
 
static uint32_t millis ()
 
static void millis (uint32_t ms)
 
static uint32_t since (uint32_t start)
 
static void delay (uint32_t ms)
 
static void await ()
 
static void job (RTT::Scheduler *scheduler)
 
static RTT::Schedulerscheduler ()
 
static void wall (Clock *clock)
 
static Clockclock ()
 

Friends

class RTT::Scheduler
 

Detailed Description

Real-Time Timer (RTT) with micro/milli/seconds timing based on hardware timer. Uses Timer2 when possible to allow low power mode with timer. Alternatively Timer0 is used.

Limitations

Cannot be used together with other classes that use AVR/Timer2/ Timer0.

Definition at line 37 of file RTT.hh.

Member Function Documentation

static void RTT::await ( )
inlinestatic

Wait for the next real-time timer milli-seconds update.

Definition at line 124 of file RTT.hh.

bool RTT::begin ( )
static

Start the real-time timer.

Returns
bool true(1) if successful otherwise false(0).

Definition at line 43 of file RTT.cpp.

static Clock* RTT::clock ( )
inlinestatic

Get the wall-clock.

Returns
clock.

Definition at line 210 of file RTT.hh.

void RTT::delay ( uint32_t  ms)
static

Delay using the real-time timer. Installed as the global delay() function when the real-time timer is started with begin().

Parameters
[in]mssleep period in milli-seconds.

Definition at line 136 of file RTT.cpp.

bool RTT::end ( )
static

Stop the real-time timer.

Returns
bool true(1) if successful otherwise false(0).

Definition at line 72 of file RTT.cpp.

static void RTT::job ( RTT::Scheduler scheduler)
inlinestatic

Set the real-time timer job scheduler.

Parameters
[in]scheduler.

Definition at line 169 of file RTT.hh.

uint32_t RTT::micros ( )
static

Return the current clock in micro-seconds.

Returns
micro-seconds.

Definition at line 103 of file RTT.cpp.

static void RTT::micros ( uint32_t  usec)
inlinestatic

Set the current clock in micro-seconds.

Parameters
[in]usec.
Note
atomic

Definition at line 74 of file RTT.hh.

uint32_t RTT::millis ( )
static

Return the current clock in milli-seconds.

Returns
milli-seconds.

Definition at line 121 of file RTT.cpp.

static void RTT::millis ( uint32_t  ms)
inlinestatic

Set the current clock in milli-seconds.

Parameters
[in]usec.
Note
atomic

Definition at line 93 of file RTT.hh.

static RTT::Scheduler* RTT::scheduler ( )
inlinestatic

Get the real-time timer job scheduler.

Returns
scheduler.

Definition at line 178 of file RTT.hh.

static uint32_t RTT::since ( uint32_t  start)
inlinestatic

Returns number of milli-seconds from given start time in milli-seconds.

Parameters
[in]start
Returns
number of milli-seconds.

Definition at line 107 of file RTT.hh.

uint16_t RTT::us_per_tick ( )
static

Get number of micro-seconds per real-time timer tick.

Returns
micro-seconds.

Definition at line 91 of file RTT.cpp.

uint16_t RTT::us_per_timer_cycle ( )
static

Get number of micro-seconds per timer cycle.

Returns
micro-seconds.

Definition at line 97 of file RTT.cpp.

static void RTT::wall ( Clock clock)
inlinestatic

Set the wall-clock.

Parameters
[in]clock.

Definition at line 201 of file RTT.hh.

Friends And Related Function Documentation

friend class RTT::Scheduler
friend

Interrupt Service Routine. Scheduler access.

Definition at line 238 of file RTT.hh.


The documentation for this class was generated from the following files: