YARP CiA-402 EtherCAT Device 0.6.0
YARP device plugin for EtherCAT CiA-402 drives
Loading...
Searching...
No Matches
EthercatManager.cpp File Reference
#include <CiA402/EthercatManager.h>
#include <CiA402/LogComponent.h>
#include <algorithm>
#include <chrono>
#include <limits>
#include <thread>
#include <yarp/os/LogStream.h>
Include dependency graph for EthercatManager.cpp:

Go to the source code of this file.

Functions

constexpr uint32_t mapEntry (uint16_t idx, uint8_t sub, uint8_t bits)
 Helper function to create a PDO mapping entry.
 

Function Documentation

◆ mapEntry()

uint32_t mapEntry ( uint16_t idx,
uint8_t sub,
uint8_t bits )
constexpr

Helper function to create a PDO mapping entry.

EtherCAT PDO mappings use a 32-bit value that encodes:

  • Bits 31-16: Object index (e.g., 0x6041 for statusword)
  • Bits 15-8: Object subindex (usually 0x00)
  • Bits 7-0: Size in bits (8, 16, 32, etc.)
Parameters
idxObject index (16 bits)
subObject subindex (8 bits)
bitsSize of the object in bits (8 bits)
Returns
32-bit mapping entry for use in PDO configuration

Definition at line 30 of file EthercatManager.cpp.