SatCat5
satcat5::ptp::TrackingClock Class Referenceabstract

Detailed Description

Generic interface to a numerically-controlled reference clock.

  • Clock implementations MUST override each of the methods below.
  • The "clock_rate" implementation MUST store the input to m_offset.
  • Implementations SHOULD provide a constant or constexpr function to calculate "ref_scale" for loop filters (see "ptp_filters.h").
    See also
    ptp_tracking.h

Definition at line 52 of file ptp_tracking.h.

#include <ptp_tracking.h>

Inheritance diagram for satcat5::ptp::TrackingClock:
[legend]
Collaboration diagram for satcat5::ptp::TrackingClock:
[legend]

Public Member Functions

virtual satcat5::ptp::Time clock_now ()=0
 Return the current time if available, TIME_ZERO otherwise.
 
virtual satcat5::ptp::Time clock_adjust (const satcat5::ptp::Time &amount)=0
 Make a one-time adjustment of the specified magnitude. More...
 
virtual void clock_rate (s64 offset)=0
 Adjust rate by a normalized frequency offset. More...
 
s64 get_rate () const
 Read the current clock-tuning parameter. More...
 

Protected Member Functions

constexpr TrackingClock ()
 Protected constructor should only be called by the child.
 

Protected Attributes

s64 m_offset
 

Private Attributes

satcat5::ptp::TrackingClockm_next
 

Member Function Documentation

◆ clock_adjust()

virtual satcat5::ptp::Time satcat5::ptp::TrackingClock::clock_adjust ( const satcat5::ptp::Time amount)
pure virtual

Make a one-time adjustment of the specified magnitude.

Positive quantities indicate the clock should move forward. Return value is the estimated remainder or residual error.

Implemented in satcat5::cfg::PtpRealtime, satcat5::cfg::PtpReference, satcat5::ublaze::TemacAvb, and satcat5::ptp::SimulatedClock.

◆ clock_rate()

virtual void satcat5::ptp::TrackingClock::clock_rate ( s64  offset)
pure virtual

Adjust rate by a normalized frequency offset.

Positive offsets command the clock to run faster. (See discussion above, near definition of RATE_ONE_PPB.)

Implemented in satcat5::cfg::PtpRealtime, satcat5::cfg::PtpReference, satcat5::ublaze::TemacAvb, and satcat5::ptp::SimulatedClock.

◆ get_rate()

s64 satcat5::ptp::TrackingClock::get_rate ( ) const
inline

Read the current clock-tuning parameter.

Returns
The most recent value passed to "clock_rate", above.

Definition at line 70 of file ptp_tracking.h.


The documentation for this class was generated from the following file: