19UHAL_REGISTER_DERIVED_NODE(FIBV2IONode)
23 IONode(aNode, "i2c", "i2c", "SI5345", {
"PLL",
"BKP DATA"}, {
"i2c_sfp0",
"i2c_sfp1",
"i2c_sfp2",
"i2c_sfp3",
"i2c_sfp4",
"i2c_sfp5",
"i2c_sfp6",
"i2c_sfp7"}) {
45 TLOG() <<
"No text config for CDCLVD110";
53 std::stringstream status;
58 TLOG() << status.str();
74 getNode(
"csr.ctrl.rst").write(0x1);
75 getNode(
"csr.ctrl.rst").write(0x0);
77 getClient().dispatch();
79 getNode(
"csr.ctrl.clk_enable").write(0x0);
81 if (clock_source == kInput0)
83 getNode(
"csr.ctrl.clk_select").write(0x0);
85 else if (clock_source == kInput1)
87 getNode(
"csr.ctrl.clk_select").write(0x1);
94 TLOG() <<
"Reset done";
101 std::stringstream status;
105 std::string sfp_i2c_bus =
"i2c_sfp" + std::to_string(sfp_id);
107 status <<
"FIB V2 SFP " << sfp_id <<
":" << std::endl;
108 status << sfp->get_status();
111 TLOG() << status.str();
123 std::string sfp_i2c_bus =
"i2c_sfp" + std::to_string(sfp_id);
125 sfp->switch_soft_tx_control_bit(turn_on);
135 auto sfp_tx_control_flags = getNode(
"csr.ctrl.sfp_tx_disable").read();
136 getClient().dispatch();
138 uint8_t current_sfp_tx_control_flags=sfp_tx_control_flags.value();
139 uint8_t new_sfp_tx_control_flags;
143 new_sfp_tx_control_flags = current_sfp_tx_control_flags & ~(1UL << sfp_id);
147 new_sfp_tx_control_flags = current_sfp_tx_control_flags | (1UL << sfp_id);
150 getNode(
"csr.ctrl.sfp_tx_disable").write(new_sfp_tx_control_flags);
151 getClient().dispatch();
159 mon_data.
lol =
false;
160 mon_data.
los =
false;
168 std::stringstream status;
169 status <<
"No status yet for CDCLVD110 on FIBv2";
172 TLOG() << status.str();
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(const ClockSource &clock_source) const override
Reset IO, with clock file look up.
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.
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)