17UHAL_REGISTER_DERIVED_NODE(MIBIONode)
21 :
IONode(node, "i2c", "i2c", {
"PLL" }, {
"PLL",
"CDR 0",
"CDR 1" }, {
"i2c" })
42 std::stringstream status;
48 TLOG() << std::endl << status.str();
59 i2c_switch->set_channels_states(8);
70 i2c_switch->set_channels_states(8);
87 getNode(
"csr.ctrl.rst").write(0x1);
88 getNode(
"csr.ctrl.rst").write(0x0);
90 getNode(
"io_select.csr.ctrl.amc_out").write(0xfff);
91 getNode(
"io_select.csr.ctrl.amc_in").write(0x0);
92 getNode(
"io_select.csr.ctrl.usfp_src").write(0x0);
94 getClient().dispatch();
96 TLOG() <<
"Reset done";
104 TLOG() <<
"clock check needs to be implemented";
157 std::stringstream status;
163 i2c_switch->set_channels_states(1UL << sfp_id);
167 status <<
"SFP " << sfp_id <<
":" << std::endl;
171 status << sfp->get_status();
175 i2c_switch->set_channels_states(8);
179 i2c_switch->set_channels_states(8);
182 TLOG() << status.str();
194 i2c_switch->set_channels_states(1UL << sfp_id);
196 sfp->switch_soft_tx_control_bit(turn_on);
197 i2c_switch->set_channels_states(8);
284 if (amc_slot < 1 || amc_slot > 12) {
Base class for timing IO nodes.
virtual void write_soft_reset_register() const
Write soft reset register.
const std::vector< std::string > m_sfp_i2c_buses
virtual void configure_pll(const std::string &clock_config_file="") const
Configure clock chip.
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.
virtual std::string get_pll_status(bool print_out=false) const
Print status of on-board PLL.
Class for the timing FMC board.
void validate_sfp_id(uint32_t sfp_id) const
Fill hardware monitoring structure.
std::string get_uid_address_parameter_name() const override
Get the UID address parameter name.
void validate_amc_slot(uint32_t amc_slot) const
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_sfp_status(uint32_t sfp_id, bool print_out=false) const override
Switch the SFP mux channel.
void reset(const std::string &clock_config_file) const override
Reset MIB IO.
std::string get_status(bool print_out=false) const override
Get status string, optionally print.
bool clocks_ok() const override
Clocks ready?
void configure_pll(const std::string &clock_config_file="") const override
Configure clock chip.
std::string get_pll_status(bool print_out=false) const override
Print status of on-board PLL.
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)