Master API structure
The core interface of the EtherCAT master: it manages initialization, state management, slave control and PDO communication for the whole EtherCAT network.
API structure
Every function identifies the master instance with a uint16_t master_index (returned by Initialize()).
Public functions are included through ethercat.h and called directly with the master index (no DLL handle, no function-pointer table):
C SDK (ethercat.h) // direct calls, no DLL handle
│
├── Lifecycle: Initialize, Dispose, Start, Stop
├── Network: SetNetwork, GetNetworkInfo, QuickSlaveCount
├── State machine: SetState, SetStateSequence, SetStateWithTimeout
├── IO: CopySlaveInputPdo, WriteSlaveOutputPdo
│
├── Slave properties: GetSlaveVendorId, GetSlaveName, GetSlaveState...
│ ├── PDO read/write: CopySlaveInputPdo, WriteSlaveOutputPdo
│ ├── CoE/SDO: sdo_read_typed_ex, sdo_write_typed_ex, sdo_read_u16
│ │ ├── CiA 402: CiA402_Enable, CiA402_SetMode, CiA402_ParseState
│ │ └── EMCY: EmcyGetHistory, EmcyClearHistory
│ ├── SoE: soe_read_u16, soe_write_u16, soe_read_string
│ ├── FoE: foe_upload, foe_download
│ ├── EoE: eoe_ping, eoe_set_receive_hook
│ ├── AoE: aoe_sub_create, aoe_sub_add
│ ├── VoE: voe_register_notification
│ ├── FSoE: fsoe_manager_create, fsoe_manager_get_info
│ ├── DC: SetSyncBySlaveIndex, GetSlaveHasDC
│ └── Startup parameters: AddStartupParameter, ClearStartupParameters, ApplyStartupParameters
│
├── Configuration: LoadConfigJson, AutoConfigureSM, EcInit, EcClose
├── DC: ConfigureDCAll, EnableDriftCompensation
├── Group management: SetSlaveGroup, SetGroupCycleDivider
├── Redundancy: GetRedundancyStatus
├── Diagnostics: GetDiagnosticsSnapshot, GetBreakPoints
├── Registers/watchdog: WriteSlaveRegister, ReadSlaveRegister, SetSlaveWatchdog
├── Mailbox gateway: gateway_create / gateway_start / gateway_stop / gateway_get_statistics (master/gateway.h)
│
├── Event callbacks:
│ ├── SetLogCallback
│ ├── RegisterProcessDataCyclicCallbackSync
│ ├── RegisterSlaveStateChangeCallbackSync / RegisterSlaveStateChangeCallbackAsync
│ ├── RegisterEmergencyEventCallback
│ ├── RegisterSlaveDiscoveryCallbackSync / RegisterSlaveDiscoveryCallbackAsync
│ ├── RegisterPDOFrameLossCallback
│ ├── RegisterRedundancyModeChangedCallback
│ ├── RegisterSlavePreOpReconfigCallback
│ └── SetDCSyncLostCallback