111 { m_clocks.
remove(clock); }
124 { m_filters.
remove(filter); }
128 void reset(
bool linear=
false);
134 if (m_lock_state == LockState::TRACK) {
135 m_lock_state = LockState::ACQUIRE;
147 {
return m_lock_state == LockState::TRACK ||
148 m_lock_state == LockState::LINEAR; }
155 void filter(u32 elapsed_usec, s64 delta_subns);
160 void clock_rate(s64 offset);
163 inline void pps_event(
168 enum class LockState {RESET, ACQUIRE, TRACK, LINEAR};
177 satcat5::ptp::TrackingController::LockState m_lock_state;
Pulse-per-second (PPS) input and output.
Callback interface for cfg::PpsInput events.
Amplitude-based outlier rejection.
PTP callback accepts each complete measurement from the Source.
Loop-filter for a proportional-double-integral (PII) controller.
Define the basic chain-of-filters API.
A source for ptp::Measurement events, usually a ptp::Client.
High-precision timestamp for use with PTP / IEEE1588.
Generic interface to a numerically-controlled reference clock.
virtual satcat5::ptp::Time clock_now()=0
Return the current time if available, TIME_ZERO otherwise.
constexpr TrackingClock()
Protected constructor should only be called by the child.
s64 get_rate() const
Read the current clock-tuning parameter.
virtual void clock_rate(s64 offset)=0
Adjust rate by a normalized frequency offset.
virtual satcat5::ptp::Time clock_adjust(const satcat5::ptp::Time &amount)=0
Make a one-time adjustment of the specified magnitude.
Bang-bang alternative to TrackingController.
void ptp_ready(const satcat5::ptp::Measurement &data) override
Event handler for ptp::Callback.
TrackingCoarse(satcat5::ptp::TrackingClock *clk, satcat5::ptp::Source *source)
Constructor links to a specific TrackingClock target.
Clock controller handling coarse and fine discipline.
TrackingController(satcat5::ptp::TrackingClock *clk, satcat5::ptp::Source *source=0)
Constructor links to a specific TrackingClock target.
void update(const satcat5::ptp::Time &delta)
Update filter state with a new measurement from the PTP client.
void add_clock(satcat5::ptp::TrackingClock *clock)
Add to the list of attached clocks.
bool is_locked() const
Check if the controller is currently locked.
void ptp_ready(const satcat5::ptp::Measurement &data) override
Event handler for ptp::Callback.
void reacquire()
Indicate to the controller than an external event has happened that should trigger a re-acquisition w...
void remove_clock(satcat5::ptp::TrackingClock *clock)
Remove an item from the list of attached clocks.
void add_filter(satcat5::ptp::Filter *filter)
Add to the chain of processing filters.
void reset(bool linear=false)
Reset tracking filter(s) and begin free-wheeling.
void remove_filter(satcat5::ptp::Filter *filter)
Remove a filter from the chain, leaving others as-is.
Simple all-in-one implementation of TrackingController.
TrackingSimple(satcat5::ptp::TrackingClock *clk, satcat5::ptp::Source *source)
Constructor links to a specific TrackingClock target.
Helper functions for manipulating singly-linked lists.
void push_back(T *item)
Add a new item at the tail of the list.
void remove(T *item)
Remove the designated item from the list.
void push_front(T *item)
Add a new item at the head of the list.
Templated functions for manipulating singly-linked lists.
Core event-processing loop for SatCat5 software.
Chainable filters for use with ptp::TrackingController.
Define the data structure for a two-way time transfer handshake.
Define the API for generating ptp::Measurement events.
High-precision "Time" object for use with PTP / IEEE1588.
constexpr s64 SUBNS_PER_NSEC
Define commonly used scaling factors.
constexpr s64 RATE_ONE_PPK
Define rate offsets for the TrackingClock::clock_rate() method.
constexpr s64 RATE_ONE_PPM
Define rate offsets for the TrackingClock::clock_rate() method.
constexpr s64 RATE_ONE_PPB
Define rate offsets for the TrackingClock::clock_rate() method.
Timestamps and metadata for a two-way time-transfer handshake.
Timestamp for measuring elapsed time.
TimeRef and TimeVal define the API for monotonic timers.
Miscellaneous mathematical utility functions.