SatCat5
satcat5::cfg::PtpRealtime Class Reference

Detailed Description

PTP reference with rate-control and coarse-adjust command.

See also
cfgbus_ptpref.h, cfg::PtpReference.

Definition at line 53 of file cfgbus_ptpref.h.

#include <cfgbus_ptpref.h>

Inheritance diagram for satcat5::cfg::PtpRealtime:
[legend]
Collaboration diagram for satcat5::cfg::PtpRealtime:
[legend]

Public Member Functions

constexpr PtpRealtime (const satcat5::cfg::Register &reg, double ref_clk_hz, unsigned scale=40)
 PtpRealtime uses a block of six control registers. More...
 
satcat5::ptp::Time clock_adjust (const satcat5::ptp::Time &amount) override
 Make a one-time adjustment of the specified magnitude. More...
 
void clock_rate (s64 offset) override
 Adjust rate by a normalized frequency offset. More...
 
satcat5::ptp::Time clock_now () override
 Return the current time if available, TIME_ZERO otherwise.
 
void clock_rate_raw (s64 rate)
 Legacy API for rate-control without additional scaling.
 
satcat5::ptp::Time clock_ext ()
 Read timestamp of external rising-edge signal.
 
void clock_set (const satcat5::ptp::Time &new_time)
 Coarse adjustment of the current time.
 
s64 get_rate () const
 Read the current clock-tuning parameter. More...
 

Protected Member Functions

void load (const satcat5::ptp::Time &time)
 

Protected Attributes

satcat5::cfg::Register m_reg
 
const satcat5::ptp::RateConversion m_rate
 
s64 m_offset
 

Private Attributes

satcat5::ptp::TrackingClockm_next
 

Constructor & Destructor Documentation

◆ PtpRealtime()

constexpr satcat5::cfg::PtpRealtime::PtpRealtime ( const satcat5::cfg::Register reg,
double  ref_clk_hz,
unsigned  scale = 40 
)
inlineconstexpr

PtpRealtime uses a block of six control registers.

Clock rate is required to renormalize frequency adjustments. Default scale parameter matches "ptp_realtime.vhd".

Definition at line 58 of file cfgbus_ptpref.h.

Member Function Documentation

◆ clock_adjust()

Time PtpRealtime::clock_adjust ( const satcat5::ptp::Time amount)
overridevirtual

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.

Implements satcat5::ptp::TrackingClock.

Definition at line 57 of file cfgbus_ptpref.cc.

◆ clock_rate()

void PtpRealtime::clock_rate ( s64  offset)
overridevirtual

Adjust rate by a normalized frequency offset.

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

Implements satcat5::ptp::TrackingClock.

Definition at line 64 of file cfgbus_ptpref.cc.

◆ get_rate()

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

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 files: