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)
172 template <EtherCATDataTypeEnum E>
176 return {name, E, EtherCATDataType::bitLength<typename TypeMap<E>::type>};
182 const std::unordered_map<RegisterEnum, RegisterInfo>
registerMap = {
192 makeInfo<EtherCATDataTypeEnum::BIT1>(
"FMMU bit operation not supported")},
194 makeInfo<EtherCATDataTypeEnum::BIT1>(
"No support for reserved register")},
199 makeInfo<EtherCATDataTypeEnum::BIT1>(
"Enhanced link detection EBUS")},
201 makeInfo<EtherCATDataTypeEnum::BIT1>(
"Enhanced link detection MII")},
203 makeInfo<EtherCATDataTypeEnum::BIT1>(
"Separate fcs error handling")},
205 makeInfo<EtherCATDataTypeEnum::UNSIGNED16>(
"Configured station address")},
207 makeInfo<EtherCATDataTypeEnum::UNSIGNED16>(
"Configured station alias")},
209 makeInfo<EtherCATDataTypeEnum::BIT1>(
"DLS user operational")},
211 makeInfo<EtherCATDataTypeEnum::BIT1>(
"Link status port 0")},
213 makeInfo<EtherCATDataTypeEnum::BIT1>(
"Link status port 1")},
215 makeInfo<EtherCATDataTypeEnum::BIT1>(
"Link status port 2")},
217 makeInfo<EtherCATDataTypeEnum::BIT1>(
"Link status port 3")},
219 makeInfo<EtherCATDataTypeEnum::BIT1>(
"Loop status port 0")},
221 makeInfo<EtherCATDataTypeEnum::BIT1>(
"Signal detection port 0")},
223 makeInfo<EtherCATDataTypeEnum::BIT1>(
"Loop status port 1")},
225 makeInfo<EtherCATDataTypeEnum::BIT1>(
"Signal detection port 1")},
227 makeInfo<EtherCATDataTypeEnum::BIT1>(
"Loop status port 2")},
229 makeInfo<EtherCATDataTypeEnum::BIT1>(
"Signal detection port 2")},
231 makeInfo<EtherCATDataTypeEnum::BIT1>(
"Loop status port 3")},
233 makeInfo<EtherCATDataTypeEnum::BIT1>(
"Signal detection port 3")},
244 makeInfo<EtherCATDataTypeEnum::UNSIGNED8>(
"Frame error counter port 0")},
246 makeInfo<EtherCATDataTypeEnum::UNSIGNED8>(
"Physical error counter port 0")},
248 makeInfo<EtherCATDataTypeEnum::UNSIGNED8>(
"Frame error counter port 1")},
250 makeInfo<EtherCATDataTypeEnum::UNSIGNED8>(
"Physical error counter port 1")},
252 makeInfo<EtherCATDataTypeEnum::UNSIGNED8>(
"Frame error counter port 2")},
254 makeInfo<EtherCATDataTypeEnum::UNSIGNED8>(
"Physical error counter port 2")},
256 makeInfo<EtherCATDataTypeEnum::UNSIGNED8>(
"Frame error counter port 3")},
258 makeInfo<EtherCATDataTypeEnum::UNSIGNED8>(
"Physical error counter port 3")},
260 makeInfo<EtherCATDataTypeEnum::UNSIGNED8>(
"Previous error counter port 0")},
262 makeInfo<EtherCATDataTypeEnum::UNSIGNED8>(
"Previous error counter port 1")},
264 makeInfo<EtherCATDataTypeEnum::UNSIGNED8>(
"Previous error counter port 2")},
266 makeInfo<EtherCATDataTypeEnum::UNSIGNED8>(
"Previous error counter port 3")},
268 makeInfo<EtherCATDataTypeEnum::UNSIGNED8>(
"Malformat frame counter")},
270 makeInfo<EtherCATDataTypeEnum::UNSIGNED8>(
"Local problem counter")},
272 makeInfo<EtherCATDataTypeEnum::UNSIGNED8>(
"Lost link counter port 0")},
274 makeInfo<EtherCATDataTypeEnum::UNSIGNED8>(
"Lost link counter port 1")},
276 makeInfo<EtherCATDataTypeEnum::UNSIGNED8>(
"Lost link counter port 2")},
278 makeInfo<EtherCATDataTypeEnum::UNSIGNED8>(
"Lost link counter port 3")},
280 makeInfo<EtherCATDataTypeEnum::BIT1>(
"SII read operation")},
282 makeInfo<EtherCATDataTypeEnum::BIT1>(
"SII write operation")},
284 makeInfo<EtherCATDataTypeEnum::BIT1>(
"SII reload operation")},
286 makeInfo<EtherCATDataTypeEnum::BIT1>(
"SII checksum error")},
288 makeInfo<EtherCATDataTypeEnum::BIT1>(
"SII device info error")},
290 makeInfo<EtherCATDataTypeEnum::BIT1>(
"SII command error")},
319 std::map<datatypes::RegisterEnum, datatypes::RegisterEnumTypeContainer>
registerData;