19UHAL_REGISTER_DERIVED_NODE(IRIGTimestampNode)
35 std::stringstream status;
36 status <<
"Timestamp: 0x" << std::hex <<
read_timestamp() << std::endl;
55 TLOG() << status.str();
61uhal::ValVector<uint32_t>
64 auto timestamp = getNode(
"tstamp").readBlock(2);
66 getClient().dispatch();
83 getNode(
"csr.ctrl.rst").write(0x1);
84 getNode(
"csr.ctrl.irig_epoch").write(irig_epoch);
85 getNode(
"csr.ctrl.rst").write(0x0);
86 getClient().dispatch();
94 auto counter = getNode(
"pps_ctr").read();
95 getClient().dispatch();
96 return counter.value();
104 auto seconds_since_epoch = getNode(
"seconds_since_epoch").readBlock(2);
105 getClient().dispatch();
Class for timestamp generator node.
std::string get_status(bool print_out=false) const override
Print the status of the timing node.
uint64_t read_timestamp() const
Read the current timestamp words.
virtual ~IRIGTimestampNode()
uint64_t read_seconds_since_epoch() const
Read the current seconds since epoch words.
void set_irig_epoch(IRIGEpoch irig_epoch) const
Set IRIG epoch: TAI/UNIX.
uhal::ValVector< uint32_t > read_raw_timestamp(bool dispatch=true) const
Read the current timestamp words.
uint32_t read_pps_counter() const
Read the current pps ctr word.
Base class for timing nodes.
std::map< std::string, uhal::ValWord< uint32_t > > read_sub_nodes(const uhal::Node &node, bool dispatch=true) const
Read subnodes.
std::string format_reg_table(T data, std::string title, std::vector< std::string > headers)
Format reg-value table.
uint64_t tstamp2int(uhal::ValVector< uint32_t > raw_timestamp)