20UHAL_REGISTER_DERIVED_NODE(FIBV2IONode)
24 IONode(aNode, "i2c", "i2c", "SI5345", {
"PLL",
"BKP DATA"}, {
"i2c_sfp0",
"i2c_sfp1",
"i2c_sfp2",
"i2c_sfp3",
"i2c_sfp4",
"i2c_sfp5",
"i2c_sfp6",
"i2c_sfp7"}) {
46 TLOG() <<
"No text config for CDCLVD110";
54 std::stringstream status;
61 TLOG() << status.str();
76 getNode(
"csr.ctrl.rst").write(0x1);
77 getNode(
"csr.ctrl.rst").write(0x0);
79 getClient().dispatch();
81 getNode(
"csr.ctrl.clk_enable").write(0x0);
83 if (clock_source == kInput0)
85 getNode(
"csr.ctrl.clk_select").write(0x0);
87 else if (clock_source == kInput1)
89 getNode(
"csr.ctrl.clk_select").write(0x1);
96 getClient().dispatch();
98 TLOG() <<
"Reset done";
112 std::stringstream status;
116 std::string sfp_i2c_bus =
"i2c_sfp" + std::to_string(sfp_id);
118 status <<
"FIB V2 SFP " << sfp_id <<
":" << std::endl;
119 status << sfp->get_status();
122 TLOG() << status.str();
134 std::string sfp_i2c_bus =
"i2c_sfp" + std::to_string(sfp_id);
136 sfp->switch_soft_tx_control_bit(turn_on);
146 auto sfp_tx_control_flags = getNode(
"csr.ctrl.sfp_tx_disable").read();
147 getClient().dispatch();
149 uint8_t current_sfp_tx_control_flags=sfp_tx_control_flags.value();
150 uint8_t new_sfp_tx_control_flags;
154 new_sfp_tx_control_flags = current_sfp_tx_control_flags & ~(1UL << sfp_id);
158 new_sfp_tx_control_flags = current_sfp_tx_control_flags | (1UL << sfp_id);
161 getNode(
"csr.ctrl.sfp_tx_disable").write(new_sfp_tx_control_flags);
162 getClient().dispatch();
170 mon_data.
lol =
false;
171 mon_data.
los =
false;
179 std::stringstream status;
180 status <<
"No status yet for CDCLVD110 on FIBv2";
183 TLOG() << status.str();
194 return temp_mon->read_temperature();
std::string get_pll_status(bool print_out=false) const override
Print status of on-board PLL.
void validate_sfp_id(uint32_t sfp_id) const
Get the PLL chip.
void switch_sfp_soft_tx_control_bit(uint32_t sfp_id, bool turn_on) const override
control tx laser of on-board SFP softly (I2C command)
std::string get_status(bool print_out=false) const override
Get status string, optionally print.
void switch_sfp_tx(uint32_t sfp_id, bool turn_on) const override
Switch on or off the SFP tx laser via the I2C IO expander controlling the sfp tx disable pin....
void configure_pll(const std::string &clock_config_file="") const override
Configure clock chip.
std::string get_sfp_status(uint32_t sfp_id, bool print_out=false) const override
Print status of on-board SFP.
void reset_pll() const override
Reset PLL.
void reset(const ClockSource &clock_source) const override
Reset IO, with clock file look up.
float read_board_temperature() const
Read data from on-board temperature monitor.
std::string get_uid_address_parameter_name() const override
Get the UID address parameter name.
void get_info(timinghardwareinfo::TimingPLLMonitorData &mon_data) const override
Base class for timing IO nodes.
virtual void write_soft_reset_register() const
Write soft reset register.
const std::string m_pll_i2c_bus
std::unique_ptr< const T > get_i2c_device(const std::string &i2c_bus_name, const std::string &i2c_device_name) const
Get the an I2C chip.
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.
std::string format_reg_value(T reg_value, uint32_t base)
void millisleep(const double &time_in_milliseconds)