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_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().
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().
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().
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().
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().
UtcSyncParams uavcan_kinetis::clock::getUtcSyncParams | ( | ) |
UTC sync params get/set.
Both functions are thread safe.
Referenced by uavcan_kinetis::clock::UtcSyncParams::UtcSyncParams().
uavcan::uint64_t uavcan_kinetis::clock::getUtcUSecFromCanInterrupt | ( | ) |
void uavcan_kinetis::clock::init | ( | ) |
Starts the clock.
Can be called multiple times, only the first call will be effective.
bool uavcan_kinetis::clock::isUtcLocked | ( | ) |
Whether UTC is synchronized and locked.
This function is thread safe.
Referenced by uavcan_kinetis::clock::UtcSyncParams::UtcSyncParams().
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.
void uavcan_kinetis::clock::setUtcSyncParams | ( | const UtcSyncParams & | params | ) |
Referenced by uavcan_kinetis::clock::UtcSyncParams::UtcSyncParams().