PX4 Firmware
PX4 Autopilot Software http://px4.io
uavcan_kinetis::clock Namespace Reference

Classes

struct  UtcSyncParams
 UTC clock synchronization parameters. More...
 

Functions

void init ()
 Starts the clock. More...
 
uavcan::MonotonicTime getMonotonic ()
 Returns current monotonic time since the moment when clock::init() was called. More...
 
void setUtc (uavcan::UtcTime time)
 Sets the driver's notion of the system UTC. More...
 
uavcan::UtcTime getUtc ()
 Returns UTC time if it has been set, otherwise returns zero time. More...
 
void adjustUtc (uavcan::UtcDuration adjustment)
 Performs UTC phase and frequency adjustment. More...
 
float getUtcRateCorrectionPPM ()
 Clock rate error. More...
 
uavcan::uint32_t getUtcJumpCount ()
 Number of non-gradual adjustments performed so far. More...
 
bool isUtcLocked ()
 Whether UTC is synchronized and locked. More...
 
UtcSyncParams getUtcSyncParams ()
 UTC sync params get/set. More...
 
void setUtcSyncParams (const UtcSyncParams &params)
 
uavcan::uint64_t getUtcUSecFromCanInterrupt ()
 

Function Documentation

◆ adjustUtc()

void uavcan_kinetis::clock::adjustUtc ( uavcan::UtcDuration  adjustment)

Performs UTC phase and frequency adjustment.

The UTC time will be zero until first adjustment has been performed. This function is thread safe.

Referenced by uavcan_kinetis::SystemClock::adjustUtc(), and UavcanNode::Run().

Here is the caller graph for this function:

◆ getMonotonic()

uavcan::MonotonicTime uavcan_kinetis::clock::getMonotonic ( )

Returns current monotonic time since the moment when clock::init() was called.

This function is thread safe.

Referenced by uavcan_kinetis::SystemClock::getMonotonic(), uavcan_kinetis::CanIface::receive(), and uavcan_kinetis::CanDriver::select().

Here is the caller graph for this function:

◆ getUtc()

uavcan::UtcTime uavcan_kinetis::clock::getUtc ( )

Returns UTC time if it has been set, otherwise returns zero time.

This function is thread safe.

Referenced by uavcan_kinetis::SystemClock::getUtc().

Here is the caller graph for this function:

◆ getUtcJumpCount()

uavcan::uint32_t uavcan_kinetis::clock::getUtcJumpCount ( )

Number of non-gradual adjustments performed so far.

Ideally should be zero. This function is thread safe.

Referenced by uavcan_kinetis::clock::UtcSyncParams::UtcSyncParams().

Here is the caller graph for this function:

◆ getUtcRateCorrectionPPM()

float uavcan_kinetis::clock::getUtcRateCorrectionPPM ( )

Clock rate error.

Positive if the hardware timer is slower than reference time. This function is thread safe.

Referenced by uavcan_kinetis::clock::UtcSyncParams::UtcSyncParams().

Here is the caller graph for this function:

◆ getUtcSyncParams()

UtcSyncParams uavcan_kinetis::clock::getUtcSyncParams ( )

UTC sync params get/set.

Both functions are thread safe.

Referenced by uavcan_kinetis::clock::UtcSyncParams::UtcSyncParams().

Here is the caller graph for this function:

◆ getUtcUSecFromCanInterrupt()

uavcan::uint64_t uavcan_kinetis::clock::getUtcUSecFromCanInterrupt ( )

◆ init()

void uavcan_kinetis::clock::init ( )

Starts the clock.

Can be called multiple times, only the first call will be effective.

◆ isUtcLocked()

bool uavcan_kinetis::clock::isUtcLocked ( )

Whether UTC is synchronized and locked.

This function is thread safe.

Referenced by uavcan_kinetis::clock::UtcSyncParams::UtcSyncParams().

Here is the caller graph for this function:

◆ setUtc()

void uavcan_kinetis::clock::setUtc ( uavcan::UtcTime  time)

Sets the driver's notion of the system UTC.

It should be called at startup and any time the system clock is updated from an external source that is not the UAVCAN Timesync master. This function is thread safe.

◆ setUtcSyncParams()

void uavcan_kinetis::clock::setUtcSyncParams ( const UtcSyncParams params)

Referenced by uavcan_kinetis::clock::UtcSyncParams::UtcSyncParams().

Here is the caller graph for this function: