|
SatCat5
|
PTP reference counter with rate-control only.
Definition at line 27 of file cfgbus_ptpref.h.
#include <cfgbus_ptpref.h>
Public Member Functions | |
| constexpr | PtpReference (const satcat5::cfg::Register ®, double ref_clk_hz, unsigned scale=40) |
| PtpReference is a thin-wrapper for a single control register. 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. | |
| s64 | get_rate () const |
| Read the current clock-tuning parameter. More... | |
Protected Attributes | |
| satcat5::cfg::Register | m_reg |
| const satcat5::ptp::RateConversion | m_rate |
| s64 | m_offset |
Private Attributes | |
| satcat5::ptp::TrackingClock * | m_next |
|
inlineconstexpr |
PtpReference is a thin-wrapper for a single control register.
Clock rate is required to renormalize frequency adjustments. Default scale parameter matches "ptp_counter_free.vhd".
Definition at line 32 of file cfgbus_ptpref.h.
|
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 35 of file cfgbus_ptpref.cc.
|
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 41 of file cfgbus_ptpref.cc.
|
inlineinherited |
Read the current clock-tuning parameter.
Definition at line 70 of file ptp_tracking.h.