#include <uhd/rfnoc/mb_controller.hpp>
Public Types | |
using | sptr = std::shared_ptr< timekeeper > |
using | write_period_fn_t = std::function< void(uint64_t)> |
Public Member Functions | |
timekeeper () | |
virtual | ~timekeeper () |
uhd::time_spec_t | get_time_now (void) |
virtual uint64_t | get_ticks_now ()=0 |
uhd::time_spec_t | get_time_last_pps (void) |
virtual uint64_t | get_ticks_last_pps ()=0 |
void | set_time_now (const uhd::time_spec_t &time) |
virtual void | set_ticks_now (const uint64_t ticks)=0 |
void | set_time_next_pps (const uhd::time_spec_t &time) |
virtual void | set_ticks_next_pps (const uint64_t ticks)=0 |
double | get_tick_rate () |
Protected Member Functions | |
void | set_tick_rate (const double rate) |
virtual void | set_period (const uint64_t period_ns)=0 |
Interface to interact with timekeepers
Timekeepers are objects separate from RFNoC blocks. This class is meant to be subclassed by motherboards implementing it.
using uhd::rfnoc::mb_controller::timekeeper::sptr = std::shared_ptr<timekeeper> |
using uhd::rfnoc::mb_controller::timekeeper::write_period_fn_t = std::function<void(uint64_t)> |
uhd::rfnoc::mb_controller::timekeeper::timekeeper | ( | ) |
|
inlinevirtual |
|
inline |
Return the current tick rate
|
pure virtual |
Return the time from the last PPS as a tick count
See also get_time_last_pps()
|
pure virtual |
uhd::time_spec_t uhd::rfnoc::mb_controller::timekeeper::get_time_last_pps | ( | void | ) |
Return the time from the last PPS as a time spec
Note that there is no control over when this command gets executed, it will read the time "as soon as possible", and then return that value. Calling this on two synchronized clocks sequentially will definitely return two different values.
uhd::time_spec_t uhd::rfnoc::mb_controller::timekeeper::get_time_now | ( | void | ) |
Return the current time as a time spec
Note that there is no control over when this command gets executed, it will read the time "as soon as possible", and then return that value. Calling this on two synchronized clocks sequentially will definitely return two different values.
|
protectedpure virtual |
Set the time period as a 64-bit Q32 value
period_ns | The period as nanoseconds per tick, in Q32 format |
|
protected |
Set the tick rate
This doesn't change the input clock to the timekeeper, but does two things:
|
pure virtual |
Set the ticks at next PPS
|
pure virtual |
Set the ticks "now"
void uhd::rfnoc::mb_controller::timekeeper::set_time_next_pps | ( | const uhd::time_spec_t & | time | ) |
Set the time at next PPS from a time spec
void uhd::rfnoc::mb_controller::timekeeper::set_time_now | ( | const uhd::time_spec_t & | time | ) |
Set the time "now" from a time spec