17UHAL_REGISTER_DERIVED_NODE(GIBV2IONode)
21 :
GIBIONode(node, "i2c", "i2c", {
"PLL" }, {
"PLL",
"SFP CDR 0",
"SFP CDR 1",
"SFP CDR 2",
"SFP CDR 3",
"SFP CDR 4",
"SFP CDR 5",
"10 MHz" }, {
"i2c",
"i2c",
"i2c",
"i2c",
"i2c",
"i2c",
"i2c" })
36 uint8_t los_bits =
static_cast<uint8_t
>(expander_bits & 0b01);
38 for (uint8_t sfp = 0; sfp<6; sfp++) {
41 los_bits = (los_bits << 1) + ((expander_bits >> (2 + 20 - 4*sfp)) & 1);
54 uint8_t fault_bits =
static_cast<uint8_t
>(expander_bits & 0b10);
56 for (uint8_t sfp = 0; sfp<6; sfp++) {
59 fault_bits = (fault_bits << 1) + ((expander_bits >> (3 + 20 - 4*sfp)) & 1);
70 std::stringstream status;
73 bool pll_lol = states.find(
"clk_gen_lol")->second.value();
75 bool mmcm_ok = states.find(
"mmcm_ok")->second.value();
77 TLOG_DEBUG(5) <<
"pll lol: " << pll_lol <<
", mmcm ok: " << mmcm_ok;
79 return !pll_lol && mmcm_ok;
90 sfp_id = sfp_id + (sfp_id/6);
93 uint8_t current_sfp_tx_control_flags = sfp_expander_1->read_outputs_config(1);
95 uint8_t new_sfp_tx_control_flags;
98 new_sfp_tx_control_flags = current_sfp_tx_control_flags & ~(1UL << sfp_id);
102 new_sfp_tx_control_flags = current_sfp_tx_control_flags | (1UL << sfp_id);
105 sfp_expander_1->set_outputs(1, new_sfp_tx_control_flags);
Class for the timing FMC board.
virtual uint32_t read_io_expanders() const
Read the contents of the IO expanders.
void validate_sfp_id(uint32_t sfp_id) const
Class for the timing FMC board.
uint8_t get_num_sfps() const override
uint8_t read_sfps_fault() const override
Retrive SFP fault status for all SFPs.
uint8_t read_sfps_los() const override
Retrive SFP LOS status for all SFPs.
bool clocks_ok() const override
Clocks ready?
uint8_t get_sfp_tx_disable_bitmap() const override
void switch_sfp_tx(uint32_t sfp_id, bool turn_on) const override
control tx laser of on-board SFP softly (I2C command)
const std::string m_uid_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.
#define TLOG_DEBUG(lvl,...)