Clock library
[Contiki system]

The clock library is the interface between Contiki and the platform specific clock functionality. More...

Defines

#define CLOCK_SECOND
 A second, measured in system clock time.

Functions

void clock_init (void)
 Initialize the clock library.
CCIF clock_time_t clock_time (void)
 Get the current clock time.
void clock_delay (unsigned int)
 Delay the CPU for a multiple of TODO.

Detailed Description

The clock library is the interface between Contiki and the platform specific clock functionality.

The clock library performs a single function: measuring time. Additionally, the clock library provides a macro, CLOCK_SECOND, which corresponds to one second of system time.

Note:
The clock library need in many cases not be used directly. Rather, the timer library or the event timers should be used.
See also:
Timer library
Event timers

Function Documentation

void clock_init ( void   ) 

Initialize the clock library.

This function initializes the clock library and should be called from the main() function of the system.

set Timer/Counter0 to be asynchronous from the CPU clock with a second external clock(32,768kHz) driving it.

Wait for TCN0UB, OCR0UB, and TCR0UB.

Definition at line 37 of file clock.c.

References CLOCK_SECOND, INTERRUPTS_OFF, INTERRUPTS_ON, and TICK_VAL.

Referenced by main().

CCIF clock_time_t clock_time ( void   ) 

Get the current clock time.

This function returns the current system clock time.

Returns:
The current clock time, measured in system ticks.
Examples:
example-rucb.c, and example-rudolph2.c.

Definition at line 42 of file clock.c.

Referenced by clock_wait().


Generated on Mon Apr 11 14:23:52 2011 for Contiki 2.5 by  doxygen 1.6.1