16 #include <unordered_map>
21 namespace uhd {
namespace rfnoc {
29 using sptr = std::shared_ptr<mb_controller>;
52 using sptr = std::shared_ptr<timekeeper>;
76 virtual uint64_t get_ticks_now() = 0;
91 virtual uint64_t get_ticks_last_pps() = 0;
99 virtual void set_ticks_now(
const uint64_t ticks) = 0;
107 virtual void set_ticks_next_pps(
const uint64_t ticks) = 0;
111 double get_tick_rate()
125 void set_tick_rate(
const double rate);
131 virtual void set_period(
const uint64_t period_ns) = 0;
135 double _tick_rate = 1.0;
140 size_t get_num_timekeepers()
const;
145 timekeeper::sptr get_timekeeper(
const size_t tk_idx)
const;
158 virtual std::string get_mboard_name()
const = 0;
201 virtual void set_time_source(
const std::string&
source) = 0;
207 virtual std::string get_time_source()
const = 0;
213 virtual std::vector<std::string> get_time_sources()
const = 0;
256 virtual void set_clock_source(
const std::string&
source) = 0;
262 virtual std::string get_clock_source()
const = 0;
268 virtual std::vector<std::string> get_clock_sources()
const = 0;
279 virtual void set_sync_source(
280 const std::string& clock_source,
const std::string& time_source) = 0;
315 virtual std::vector<uhd::device_addr_t> get_sync_sources() = 0;
324 virtual void set_clock_source_out(
const bool enb) = 0;
333 virtual void set_time_source_out(
const bool enb) = 0;
346 virtual std::vector<std::string> get_sensor_names() = 0;
366 virtual bool synchronize(std::vector<mb_controller::sptr>& mb_controllers,
368 const bool quiet =
false);
375 virtual std::vector<std::string> get_gpio_banks()
const;
382 virtual std::vector<std::string> get_gpio_srcs(
const std::string& bank)
const;
386 virtual std::vector<std::string> get_gpio_src(
const std::string& bank);
395 virtual void set_gpio_src(
396 const std::string& bank,
const std::vector<std::string>& src);
406 virtual void register_sync_source_updater(sync_source_updater_t callback_f);
412 void register_timekeeper(
const size_t idx, timekeeper::sptr tk);
418 std::unordered_map<size_t, timekeeper::sptr> _timekeepers;