33 EthercatDevice::construct(sh, start_address);
37 ROS_INFO(
"Shadow Bridge configure - %d @ %d", sh_->get_product_code(), sh_->get_ring_position());
46 EthercatDirectCom com(sh_->m_router_instance->m_al_instance->m_dll_instance);
47 uint16_t
data, new_data;
50 rv = readData(&com, (uint16_t) EC_Slave_RD[PDI_Conf_reg].ado, &data, 2, FIXED_ADDR);
51 ROS_INFO(
"bridge port type: %s", data & 1 ?
"MII" :
"EBUS");
53 rv = readData(&com, 0x100, &data, 2, FIXED_ADDR);
57 new_data = data & ~0xc000;
59 rv = writeData(&com, 0x100, &new_data, 2, FIXED_ADDR);
63 rv = readData(&com, 0x100, &data, 2, FIXED_ADDR);
72 std::ostringstream str;
73 str <<
"SRBridge : " << std::setw(2) << std::setfill(
'0') << sh_->get_ring_position();
76 str << sh_->get_product_code() <<
'-' << sh_->get_serial();
77 d.hardware_id = str.str();
83 d.
addf(
"Position",
"%02d", sh_->get_ring_position());
84 d.
addf(
"Product code",
"%08x", sh_->get_product_code());
85 d.
addf(
"Serial",
"%08x", sh_->get_serial());
86 d.
addf(
"Revision",
"%08x", sh_->get_revision());
88 this->ethercatDiagnostics(d, 2);
virtual int initialize(hardware_interface::HardwareInterface *hw, bool allow_unprogrammed=true)
virtual void diagnostics(diagnostic_updater::DiagnosticStatusWrapper &d, unsigned char *buffer)
void addf(const std::string &key, const char *format,...)
virtual int initialize(hardware_interface::HardwareInterface *hw, bool allow_unprogrammed)
This is a ROS driver for the etherCAT bridge.
virtual void construct(EtherCAT_SlaveHandler *sh, int &start_address)
PLUGINLIB_EXPORT_CLASS(SRBridge, EthercatDevice)