13#include <unordered_map>
111 static constexpr std::uint32_t addressMask = 0xFFFF;
112 return static_cast<std::uint32_t
>(e) & addressMask;
118 static constexpr std::uint32_t subaddressMask = 0x70000;
119 return static_cast<std::uint8_t
>((
static_cast<std::uint32_t
>(e) & subaddressMask) >> 16);
131 if (a_address < b_address)
135 else if (a_address > b_address)
141 if (a_subaddress < b_subaddress)
171 template <EtherCATDataTypeEnum E>
181 const std::unordered_map<RegisterEnum, RegisterInfo>
registerMap = {
316 std::map<datatypes::RegisterEnum, datatypes::RegisterEnumTypeContainer>
registerData;
EtherCATDataTypeEnum
Holds all the types we support via EtherCAT in a type-agnostic enum.
RegisterEnum
The RegisterEnum enum encodes the slave registers that every slave offers.
@ LOST_LINK_COUNTER_PORT_0
@ NO_SUPPORT_RESERVED_REGISTER
@ PHYSICAL_ERROR_COUNTER_PORT_0
@ CONFIGURED_STATION_ADDRESS
@ SEPARATE_FCS_ERROR_HANDLING
@ PHYSICAL_ERROR_COUNTER_PORT_3
@ SIGNAL_DETECTION_PORT_1
@ FRAME_ERROR_COUNTER_PORT_3
@ SIGNAL_DETECTION_PORT_3
@ MALFORMAT_FRAME_COUNTER
@ PHYSICAL_ERROR_COUNTER_PORT_1
@ PREVIOUS_ERROR_COUNTER_PORT_1
@ LOST_LINK_COUNTER_PORT_2
@ SIGNAL_DETECTION_PORT_0
@ PREVIOUS_ERROR_COUNTER_PORT_0
@ SIGNAL_DETECTION_PORT_2
@ PREVIOUS_ERROR_COUNTER_PORT_2
@ FRAME_ERROR_COUNTER_PORT_0
@ CONFIGURED_STATION_ALIAS
@ ENHANCED_LINK_DETECTION_EBUS
@ PREVIOUS_ERROR_COUNTER_PORT_3
@ LOST_LINK_COUNTER_PORT_1
@ ENHANCED_LINK_DETECTION_MII
@ LOST_LINK_COUNTER_PORT_3
@ PHYSICAL_ERROR_COUNTER_PORT_2
@ FRAME_ERROR_COUNTER_PORT_1
@ FRAME_ERROR_COUNTER_PORT_2
constexpr int bitLength
Defines the length of the various EtherCATDataTypes in bits.
std::uint32_t getRegisterAddress(RegisterEnum e)
std::variant< EtherCATDataType::INTEGER8, EtherCATDataType::INTEGER16, EtherCATDataType::INTEGER32, EtherCATDataType::INTEGER64, EtherCATDataType::UNSIGNED8, EtherCATDataType::UNSIGNED16, EtherCATDataType::UNSIGNED32, EtherCATDataType::UNSIGNED64 > RegisterEnumTypeContainer
RegisterInfo makeInfo(const std::string &name)
std::uint8_t getRegisterSubAddress(RegisterEnum e)
const std::unordered_map< RegisterEnum, RegisterInfo > registerMap
Holds additional information on all defined registers.
bool operator<(RegisterEnum a, RegisterEnum b)
std::size_t getRegisterByteLength(datatypes::RegisterEnum reg)
Get the length of a register in bytes, rounded up.
Brief description of struct RegisterDataList.
std::map< datatypes::RegisterEnum, datatypes::RegisterEnumTypeContainer > registerData
The RegisterInfo struct holds additional information on one register.
EtherCATDataTypeEnum enumType