USRP Hardware Driver and USRP Manual Version: 4.1.0.3
UHD and USRP Manual
uhd::rfnoc::mb_controller::timekeeper Class Referenceabstract

#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
 

Detailed Description

Interface to interact with timekeepers

Timekeepers are objects separate from RFNoC blocks. This class is meant to be subclassed by motherboards implementing it.

Member Typedef Documentation

◆ sptr

◆ write_period_fn_t

using uhd::rfnoc::mb_controller::timekeeper::write_period_fn_t = std::function<void(uint64_t)>

Constructor & Destructor Documentation

◆ timekeeper()

uhd::rfnoc::mb_controller::timekeeper::timekeeper ( )

◆ ~timekeeper()

virtual uhd::rfnoc::mb_controller::timekeeper::~timekeeper ( )
inlinevirtual

Member Function Documentation

◆ get_tick_rate()

double uhd::rfnoc::mb_controller::timekeeper::get_tick_rate ( )
inline

Return the current tick rate

◆ get_ticks_last_pps()

virtual uint64_t uhd::rfnoc::mb_controller::timekeeper::get_ticks_last_pps ( )
pure virtual

Return the time from the last PPS as a tick count

See also get_time_last_pps()

◆ get_ticks_now()

virtual uint64_t uhd::rfnoc::mb_controller::timekeeper::get_ticks_now ( )
pure virtual

Return the current time as a tick count

See also get_time_now().

Returns
the current time

◆ get_time_last_pps()

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.

◆ get_time_now()

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.

Returns
the current time

◆ set_period()

virtual void uhd::rfnoc::mb_controller::timekeeper::set_period ( const uint64_t  period_ns)
protectedpure virtual

Set the time period as a 64-bit Q32 value

Parameters
period_nsThe period as nanoseconds per tick, in Q32 format

◆ set_tick_rate()

void uhd::rfnoc::mb_controller::timekeeper::set_tick_rate ( const double  rate)
protected

Set the tick rate

This doesn't change the input clock to the timekeeper, but does two things:

  • Update the local value of the tick rate, so the time-spec based API calls work
  • Convert the tick rate to a period and call set_period()

◆ set_ticks_next_pps()

virtual void uhd::rfnoc::mb_controller::timekeeper::set_ticks_next_pps ( const uint64_t  ticks)
pure virtual

Set the ticks at next PPS

◆ set_ticks_now()

virtual void uhd::rfnoc::mb_controller::timekeeper::set_ticks_now ( const uint64_t  ticks)
pure virtual

Set the ticks "now"

◆ set_time_next_pps()

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

◆ set_time_now()

void uhd::rfnoc::mb_controller::timekeeper::set_time_now ( const uhd::time_spec_t time)

Set the time "now" from a time spec


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