PX4 Firmware
PX4 Autopilot Software http://px4.io
|
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 ¶ms) |
uavcan::uint64_t | getUtcUSecFromCanInterrupt () |
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().
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().
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().
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().
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().
UtcSyncParams uavcan_stm32::clock::getUtcSyncParams | ( | ) |
UTC sync params get/set.
Both functions are thread safe.
Referenced by uavcan_stm32::clock::UtcSyncParams::UtcSyncParams().
uavcan::uint64_t uavcan_stm32::clock::getUtcUSecFromCanInterrupt | ( | ) |
void uavcan_stm32::clock::init | ( | ) |
Starts the clock.
Can be called multiple times, only the first call will be effective.
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().
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.
void uavcan_stm32::clock::setUtcSyncParams | ( | const UtcSyncParams & | params | ) |
Referenced by uavcan_stm32::clock::UtcSyncParams::UtcSyncParams().