Руслан Урядинский / libuavcan

Dependents:   UAVCAN UAVCAN_Subscriber

Embed: (wiki syntax)

« Back to documentation index

SystemClock Class Reference

Adapter for uavcan::ISystemClock. More...

#include <clock.hpp>

Inherits uavcan::ISystemClock, and uavcan::Noncopyable.

Public Member Functions

virtual uavcan::MonotonicTime getMonotonic () const
 Monototic system clock.
virtual uavcan::UtcTime getUtc () const
 Global network clock.

Static Public Member Functions

static SystemClockinstance ()
 Calls clock::init() as needed.

Detailed Description

Adapter for uavcan::ISystemClock.

Definition at line 104 of file drivers/stm32/driver/include/uavcan_stm32/clock.hpp.


Member Function Documentation

virtual uavcan::MonotonicTime getMonotonic (  ) const [virtual]

Monototic system clock.

This clock shall never jump or change rate; the base time is irrelevant. This clock is mandatory and must remain functional at all times.

On POSIX systems use clock_gettime() with CLOCK_MONOTONIC.

Implements ISystemClock.

Definition at line 111 of file drivers/stm32/driver/include/uavcan_stm32/clock.hpp.

virtual uavcan::UtcTime getUtc (  ) const [virtual]

Global network clock.

It doesn't have to be UTC, the name is a bit misleading - actual time base doesn't matter.

This clock can be synchronized with other nodes on the bus, hence it can jump and/or change rate occasionally. This clock is optional; if it is not supported, return zero. Also return zero if the UTC time is not available yet (e.g. the device has just started up with no battery clock).

For POSIX refer to clock_gettime(), gettimeofday().

Implements ISystemClock.

Definition at line 112 of file drivers/stm32/driver/include/uavcan_stm32/clock.hpp.

static SystemClock& instance (  ) [static]

Calls clock::init() as needed.

This function is thread safe.