Base class for generic ethercat slaves using soem. More...
#include <EthercatSlaveBase.hpp>
Classes | |
struct | PdoInfo |
Struct defining the Pdo characteristic. More... | |
Public Member Functions | |
EthercatSlaveBase (EthercatBusBase *bus, const uint32_t address) | |
uint32_t | getAddress () const |
Returns the bus address of the slave. More... | |
virtual PdoInfo | getCurrentPdoInfo () const =0 |
Gets the current pdo information. More... | |
virtual std::string | getName () const =0 |
Returns the name of the slave. More... | |
template<typename Value > | |
bool | sendSdoRead (const uint16_t index, const uint8_t subindex, const bool completeAccess, Value &value) |
virtual bool | sendSdoReadDouble (const uint16_t index, const uint8_t subindex, const bool completeAccess, double &value) |
virtual bool | sendSdoReadFloat (const uint16_t index, const uint8_t subindex, const bool completeAccess, float &value) |
virtual bool | sendSdoReadGeneric (const std::string &indexString, const std::string &subindexString, const std::string &valueTypeString, std::string &valueString) |
virtual bool | sendSdoReadInt16 (const uint16_t index, const uint8_t subindex, const bool completeAccess, int16_t &value) |
virtual bool | sendSdoReadInt32 (const uint16_t index, const uint8_t subindex, const bool completeAccess, int32_t &value) |
virtual bool | sendSdoReadInt64 (const uint16_t index, const uint8_t subindex, const bool completeAccess, int64_t &value) |
virtual bool | sendSdoReadInt8 (const uint16_t index, const uint8_t subindex, const bool completeAccess, int8_t &value) |
virtual bool | sendSdoReadUInt16 (const uint16_t index, const uint8_t subindex, const bool completeAccess, uint16_t &value) |
virtual bool | sendSdoReadUInt32 (const uint16_t index, const uint8_t subindex, const bool completeAccess, uint32_t &value) |
virtual bool | sendSdoReadUInt64 (const uint16_t index, const uint8_t subindex, const bool completeAccess, uint64_t &value) |
virtual bool | sendSdoReadUInt8 (const uint16_t index, const uint8_t subindex, const bool completeAccess, uint8_t &value) |
template<typename Value > | |
bool | sendSdoWrite (const uint16_t index, const uint8_t subindex, const bool completeAccess, const Value value) |
virtual bool | sendSdoWriteDouble (const uint16_t index, const uint8_t subindex, const bool completeAccess, const double value) |
virtual bool | sendSdoWriteFloat (const uint16_t index, const uint8_t subindex, const bool completeAccess, const float value) |
virtual bool | sendSdoWriteGeneric (const std::string &indexString, const std::string &subindexString, const std::string &valueTypeString, const std::string &valueString) |
virtual bool | sendSdoWriteInt16 (const uint16_t index, const uint8_t subindex, const bool completeAccess, const int16_t value) |
virtual bool | sendSdoWriteInt32 (const uint16_t index, const uint8_t subindex, const bool completeAccess, const int32_t value) |
virtual bool | sendSdoWriteInt64 (const uint16_t index, const uint8_t subindex, const bool completeAccess, const int64_t value) |
virtual bool | sendSdoWriteInt8 (const uint16_t index, const uint8_t subindex, const bool completeAccess, const int8_t value) |
virtual bool | sendSdoWriteUInt16 (const uint16_t index, const uint8_t subindex, const bool completeAccess, const uint16_t value) |
virtual bool | sendSdoWriteUInt32 (const uint16_t index, const uint8_t subindex, const bool completeAccess, const uint32_t value) |
virtual bool | sendSdoWriteUInt64 (const uint16_t index, const uint8_t subindex, const bool completeAccess, const uint64_t value) |
virtual bool | sendSdoWriteUInt8 (const uint16_t index, const uint8_t subindex, const bool completeAccess, const uint8_t value) |
virtual void | shutdown ()=0 |
Used to shutdown slave specific objects. More... | |
virtual bool | startup ()=0 |
Startup non-ethercat specific objects for the slave. More... | |
virtual void | updateRead ()=0 |
Called during reading the ethercat bus. Use this method to extract readings from the ethercat bus buffer. More... | |
virtual void | updateWrite ()=0 |
Called during writing to the ethercat bus. Use this method to stage a command for the slave. More... | |
virtual | ~EthercatSlaveBase ()=default |
Protected Member Functions | |
void | printWarnNotImplemented () |
Prints a warning. Use this method to suppress compiler warnings. More... | |
Protected Attributes | |
const uint32_t | address_ { 0 } |
EthercatBusBase * | bus_ |
std::recursive_mutex | mutex_ |
Base class for generic ethercat slaves using soem.
Definition at line 19 of file EthercatSlaveBase.hpp.
rokubimini::soem_interface::EthercatSlaveBase::EthercatSlaveBase | ( | EthercatBusBase * | bus, |
const uint32_t | address | ||
) |
Definition at line 9 of file EthercatSlaveBase.cpp.
|
virtualdefault |
|
inline |
Returns the bus address of the slave.
Definition at line 85 of file EthercatSlaveBase.hpp.
|
pure virtual |
Gets the current pdo information.
Implemented in rokubimini::ethercat::RokubiminiEthercatSlave, and soem_interface_examples::ExampleSlave.
|
pure virtual |
Returns the name of the slave.
Implemented in rokubimini::ethercat::RokubiminiEthercatSlave, and soem_interface_examples::ExampleSlave.
|
inlineprotected |
Prints a warning. Use this method to suppress compiler warnings.
Definition at line 235 of file EthercatSlaveBase.hpp.
template bool rokubimini::soem_interface::EthercatSlaveBase::sendSdoRead< double > | ( | const uint16_t | index, |
const uint8_t | subindex, | ||
const bool | completeAccess, | ||
Value & | value | ||
) |
Send a reading SDO.
index | Index of the SDO. |
subindex | Sub-index of the SDO. |
completeAccess | Access all sub-inidices at once. |
value | Return argument, will contain the value which was read. |
Definition at line 24 of file EthercatSlaveBase.cpp.
|
inlinevirtual |
Definition at line 161 of file EthercatSlaveBase.hpp.
|
inlinevirtual |
Definition at line 156 of file EthercatSlaveBase.hpp.
|
virtual |
Definition at line 74 of file EthercatSlaveBase.cpp.
|
inlinevirtual |
Definition at line 118 of file EthercatSlaveBase.hpp.
|
inlinevirtual |
Definition at line 123 of file EthercatSlaveBase.hpp.
|
inlinevirtual |
Definition at line 128 of file EthercatSlaveBase.hpp.
|
inlinevirtual |
Definition at line 113 of file EthercatSlaveBase.hpp.
|
inlinevirtual |
Definition at line 138 of file EthercatSlaveBase.hpp.
|
inlinevirtual |
Definition at line 144 of file EthercatSlaveBase.hpp.
|
inlinevirtual |
Definition at line 150 of file EthercatSlaveBase.hpp.
|
inlinevirtual |
Definition at line 133 of file EthercatSlaveBase.hpp.
template bool rokubimini::soem_interface::EthercatSlaveBase::sendSdoWrite< double > | ( | const uint16_t | index, |
const uint8_t | subindex, | ||
const bool | completeAccess, | ||
const Value | value | ||
) |
Send a writing SDO.
index | Index of the SDO. |
subindex | Sub-index of the SDO. |
completeAccess | Access all sub-inidices at once. |
value | Value to write. |
Definition at line 15 of file EthercatSlaveBase.cpp.
|
inlinevirtual |
Definition at line 220 of file EthercatSlaveBase.hpp.
|
inlinevirtual |
Definition at line 214 of file EthercatSlaveBase.hpp.
|
virtual |
Definition at line 81 of file EthercatSlaveBase.cpp.
|
inlinevirtual |
Definition at line 172 of file EthercatSlaveBase.hpp.
|
inlinevirtual |
Definition at line 178 of file EthercatSlaveBase.hpp.
|
inlinevirtual |
Definition at line 184 of file EthercatSlaveBase.hpp.
|
inlinevirtual |
Definition at line 166 of file EthercatSlaveBase.hpp.
|
inlinevirtual |
Definition at line 196 of file EthercatSlaveBase.hpp.
|
inlinevirtual |
Definition at line 202 of file EthercatSlaveBase.hpp.
|
inlinevirtual |
Definition at line 208 of file EthercatSlaveBase.hpp.
|
inlinevirtual |
Definition at line 190 of file EthercatSlaveBase.hpp.
|
pure virtual |
Used to shutdown slave specific objects.
Implemented in rokubimini::ethercat::RokubiminiEthercatSlave, and soem_interface_examples::ExampleSlave.
|
pure virtual |
Startup non-ethercat specific objects for the slave.
Implemented in rokubimini::ethercat::RokubiminiEthercatSlave, and soem_interface_examples::ExampleSlave.
|
pure virtual |
Called during reading the ethercat bus. Use this method to extract readings from the ethercat bus buffer.
Implemented in rokubimini::ethercat::RokubiminiEthercatSlave, and soem_interface_examples::ExampleSlave.
|
pure virtual |
Called during writing to the ethercat bus. Use this method to stage a command for the slave.
Implemented in rokubimini::ethercat::RokubiminiEthercatSlave, and soem_interface_examples::ExampleSlave.
|
protected |
Definition at line 245 of file EthercatSlaveBase.hpp.
|
protected |
Definition at line 243 of file EthercatSlaveBase.hpp.
|
mutableprotected |
Definition at line 241 of file EthercatSlaveBase.hpp.