PX4 Firmware
PX4 Autopilot Software http://px4.io
uavcan_stm32::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_stm32::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_stm32::SystemClock::adjustUtc().

Here is the caller graph for this function:

◆ getMonotonic()

uavcan::MonotonicTime uavcan_stm32::clock::getMonotonic ( )

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

This function is thread safe.

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

Here is the caller graph for this function:

◆ getUtc()

uavcan::UtcTime uavcan_stm32::clock::getUtc ( )

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

This function is thread safe.

Referenced by uavcan_stm32::SystemClock::getUtc(), and UavcanNode::run().

Here is the caller graph for this function:

◆ getUtcJumpCount()

uavcan::uint32_t uavcan_stm32::clock::getUtcJumpCount ( )

Number of non-gradual adjustments performed so far.

Ideally should be zero. This function is thread safe.

Referenced by UavcanNode::run(), and uavcan_stm32::clock::UtcSyncParams::UtcSyncParams().

Here is the caller graph for this function:

◆ getUtcRateCorrectionPPM()

float uavcan_stm32::clock::getUtcRateCorrectionPPM ( )

Clock rate error.

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

Referenced by UavcanNode::run(), and uavcan_stm32::clock::UtcSyncParams::UtcSyncParams().

Here is the caller graph for this function:

◆ getUtcSyncParams()

UtcSyncParams uavcan_stm32::clock::getUtcSyncParams ( )

UTC sync params get/set.

Both functions are thread safe.

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

Here is the caller graph for this function:

◆ getUtcUSecFromCanInterrupt()

uavcan::uint64_t uavcan_stm32::clock::getUtcUSecFromCanInterrupt ( )

◆ init()

void uavcan_stm32::clock::init ( )

Starts the clock.

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

◆ isUtcLocked()

bool uavcan_stm32::clock::isUtcLocked ( )

Whether UTC is synchronized and locked.

This function is thread safe.

Referenced by UavcanNode::run(), and uavcan_stm32::clock::UtcSyncParams::UtcSyncParams().

Here is the caller graph for this function:

◆ setUtc()

void uavcan_stm32::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_stm32::clock::setUtcSyncParams ( const UtcSyncParams params)

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

Here is the caller graph for this function: