mokomoking2501/MoonECAT/mailbox does not have a README file

    CoeService

    pub(all) enum CoeService {
    SdoRequest
    SdoResponse
    SdoInfo
    PdoRemoteRequest
    TxPdo
    RxPdo
    Emergency
    } derive(Eq,
    Debug
    )

    CoE service types (CAN application protocol over EtherCAT).

    EmergencyMessage

    pub(all) struct EmergencyMessage {
    error_code : UInt
    error_register : Byte
    data : Bytes
    } derive(Eq,
    Debug
    )

    Decoded CoE Emergency message.

    EoeFrameType

    pub(all) enum EoeFrameType {
    FragData
    InitRespTimestamp
    SetIpReq
    SetIpResp
    SetAddrFilterReq
    SetAddrFilterResp
    GetIpReq
    GetIpResp
    GetAddrFilterReq
    GetAddrFilterResp
    } derive(Eq,
    Debug
    )

    EoE frame type values per ETG.1000.6.

    EoeFrameType::from_uint

    EoeFrameType::to_uint

    fn EoeFrameType::to_uint(self : EoeFrameType) -> UInt

    EoeResponse

    pub(all) enum EoeResponse {
    EoeFragment(frame_type~ : EoeFrameType, last_fragment~ : Bool, frag_number~ : UInt, frame_offset~ : UInt, frame_number~ : UInt, data~ : Bytes)
    EoeIpResponse(result~ : EoeResult, data~ : Bytes)
    } derive(Eq,
    Debug
    )

    Decoded EoE response.

    EoeResult

    pub(all) enum EoeResult {
    Success
    UnspecifiedError
    UnsupportedFrameType
    NoIpSupport
    NoDhcpSupport
    NoFilterSupport
    Unknown(UInt)
    } derive(Eq,
    Debug
    )

    EoE result codes for Set IP / Get IP responses.

    EoeResult::from_uint

    fn EoeResult::from_uint(v : UInt) -> EoeResult

    EoeResult::to_uint

    fn EoeResult::to_uint(self : EoeResult) -> UInt

    FmmuConfig

    pub(all) struct FmmuConfig {
    logical_start : UInt
    length : UInt
    logical_start_bit : Byte
    logical_end_bit : Byte
    physical_start : UInt
    physical_start_bit : Byte
    direction : FmmuDirection
    activate : Bool
    } derive(Eq,
    Debug
    )

    FMMU (Fieldbus Memory Management Unit) configuration entry.

    FmmuConfig::to_bytes

    fn FmmuConfig::to_bytes(self : FmmuConfig) -> Bytes

    Encode an FmmuConfig into 16 bytes suitable for writing to FMMU registers.

    FmmuDirection

    pub(all) enum FmmuDirection {
    Outputs
    Inputs
    MailboxState
    DynamicOutputs
    DynamicInputs
    } derive(Eq,
    Debug
    )

    FoeErrorCode

    pub(all) enum FoeErrorCode {
    NotDefined
    NotFound
    AccessDenied
    DiskFull
    Illegal
    PacketNumberWrong
    AlreadyExists
    NoUser
    BootstrapOnly
    NotInBootstrap
    NoRights
    ProgramError
    InvalidChecksum
    InvalidFirmware
    FlashError
    Unknown(UInt)
    } derive(Eq,
    Debug
    )

    FoE error codes per ETG.1000.6.

    FoeErrorCode::from_uint

    fn FoeErrorCode::from_uint(code : UInt) -> FoeErrorCode

    FoeErrorCode::to_uint

    fn FoeErrorCode::to_uint(self : FoeErrorCode) -> UInt

    FoeOpCode

    pub(all) enum FoeOpCode {
    Read
    Write
    Data
    Ack
    Error
    Busy
    } derive(Eq,
    Debug
    )

    FoE OpCode values.

    FoeOpCode::from_byte

    FoeOpCode::to_byte

    fn FoeOpCode::to_byte(self : FoeOpCode) -> Byte

    FoeResponse

    pub(all) enum FoeResponse {
    FoeData(packet_number~ : UInt, data~ : Bytes)
    FoeAck(packet_number~ : UInt)
    FoeError(code~ : FoeErrorCode, text~ : String)
    FoeBusy
    } derive(Eq,
    Debug
    )

    Decoded FoE response frame.

    MailboxConfig

    pub(all) struct MailboxConfig {
    out_address : UInt
    out_size : UInt
    out_sm_index : Int
    in_address : UInt
    in_size : UInt
    in_sm_index : Int
    } derive(Eq,
    Debug
    )

    MailboxConfig holds the SM addresses used for mailbox transport. SM Out = Master → Slave (slave's "receive" mailbox, typically SM0). SM In = Slave → Master (slave's "transmit" mailbox, typically SM1).

    MailboxConfig::from_sii

    fn MailboxConfig::from_sii(sii : SiiData) -> MailboxConfig

    Build a MailboxConfig from SII EEPROM header data. Uses standard SM0/SM1 mailbox convention.

    MailboxConfig::is_valid

    fn MailboxConfig::is_valid(self : MailboxConfig) -> Bool

    Check if the slave supports mailbox communication (both SM Out and SM In must have non-zero size).

    MailboxCounter

    pub(all) struct MailboxCounter {
    value : Byte
    } derive(
    Debug
    )

    MailboxCounter manages the mailbox session counter cycling (1-7, wrapping).

    MailboxCounter::new

    MailboxCounter::next

    fn MailboxCounter::next(self : MailboxCounter) -> Byte

    Get the current counter value and advance.

    MailboxHeader

    pub(all) struct MailboxHeader {
    length : UInt
    address : UInt
    channel : Byte
    priority : Byte
    mb_type : MailboxType
    counter : Byte
    } derive(Eq,
    Debug
    )

    Mailbox header structure (6 bytes in protocol).

    MailboxHeader::from_bytes

    Decode a mailbox header from bytes (needs at least 6 bytes).

    MailboxHeader::to_bytes

    fn MailboxHeader::to_bytes(self : MailboxHeader) -> Bytes

    Encode a mailbox header into 6 bytes.

    MailboxRepeatState

    pub(all) struct MailboxRepeatState {
    request : Bool
    acknowledge : Bool
    } derive(Eq,
    Debug
    )

    Repeat request / acknowledge state for resilient mailbox read recovery.

    Repeat Request is toggled by the MainDevice in the SyncManager activate byte (offset 0x0006 bit 1). Repeat Acknowledge is toggled by the SubDevice in the PDI-owned status byte (offset 0x0007 bit 1) after restoring the last readable mailbox payload.

    MailboxRepeatState::apply_to_activate_byte

    fn MailboxRepeatState::apply_to_activate_byte(self : MailboxRepeatState, activate : Byte) -> Byte

    Apply the current repeat request value to a SyncManager activate byte.

    MailboxRepeatState::apply_to_pdi_control_byte

    fn MailboxRepeatState::apply_to_pdi_control_byte(self : MailboxRepeatState, pdi_control : Byte) -> Byte

    Apply the current repeat acknowledge value to the SyncManager PDI byte.

    MailboxRepeatState::from_sync_manager_bytes

    fn MailboxRepeatState::from_sync_manager_bytes(activate : Byte, pdi_control : Byte) -> MailboxRepeatState

    Decode resilient mailbox repeat state from the two SyncManager bytes.

    MailboxRepeatState::is_acknowledged

    fn MailboxRepeatState::is_acknowledged(self : MailboxRepeatState) -> Bool

    Return true once the SubDevice has observed and acknowledged the current repeat request toggle.

    MailboxRepeatState::toggle_request

    fn MailboxRepeatState::toggle_request(self : MailboxRepeatState) -> Bool

    Toggle the MainDevice repeat request state for a mailbox-read replay.

    MailboxType

    pub(all) enum MailboxType {
    Err
    AoE
    EoE
    CoE
    FoE
    SoE
    VoE
    } derive(Eq,
    Debug
    )

    Mailbox protocol types as defined in ETG.1000.6.

    MailboxType::to_byte

    fn MailboxType::to_byte(self : MailboxType) -> Byte

    Rmsm

    pub(all) struct Rmsm {
    counter : MailboxCounter
    state : RmsmState
    max_retries : Int
    retries : Int
    last_recv_counter : Byte
    repeat_request : Bool
    awaiting_repeat_ack : Bool
    } derive(
    Debug
    )

    Per-slave Resilient Mailbox State Machine. Manages counter correlation and repeat detection.

    Rmsm::awaits_repeat_ack

    fn Rmsm::awaits_repeat_ack(self : Rmsm) -> Bool

    Report whether a mailbox-read repeat is currently waiting for RepeatAck.

    Rmsm::begin_read_repeat

    fn Rmsm::begin_read_repeat(self : Rmsm, activate : Byte) -> Byte raise
    EcError

    Toggle Repeat Request in the SyncManager activate byte to recover a lost mailbox read frame. The returned byte is ready to write back to SMx+0x06.

    Rmsm::begin_retry_transaction

    fn Rmsm::begin_retry_transaction(self : Rmsm) -> Byte raise
    EcError

    Begin a timeout retry transaction without clearing the accumulated retry budget for the surrounding operation.

    Rmsm::begin_transaction

    fn Rmsm::begin_transaction(self : Rmsm) -> Byte raise
    EcError

    Begin a new mailbox transaction. Returns the counter value to embed. Transitions from Idle → WaitingForResponse.

    Rmsm::current_counter

    fn Rmsm::current_counter(self : Rmsm) -> Byte

    Get the current counter value that would be used for the next send (without actually beginning a transaction). For repeat sends.

    Rmsm::is_idle

    fn Rmsm::is_idle(self : Rmsm) -> Bool

    Check if the RMSM is ready for a new transaction.

    Rmsm::new

    fn Rmsm::new(max_retries? : Int) -> Rmsm

    Rmsm::observe_repeat_ack

    fn Rmsm::observe_repeat_ack(self : Rmsm, pdi_control : Byte) -> Bool

    Check whether the SubDevice has mirrored the RepeatAck bit for the current read-repeat sequence. Returns true exactly when the expected toggle is seen.

    Rmsm::record_timeout

    fn Rmsm::record_timeout(self : Rmsm) -> Bool

    Record a timeout and check if we should retry. Returns true if a retry is allowed, false if retries exhausted.

    Rmsm::reset

    fn Rmsm::reset(self : Rmsm) -> Unit

    Reset the RMSM to Idle state, discarding any pending transaction.

    Rmsm::reset_for_retry

    fn Rmsm::reset_for_retry(self : Rmsm) -> Unit

    Reset the RMSM to Idle between retry attempts while preserving the retry budget already spent by the caller.

    Rmsm::validate_response

    fn Rmsm::validate_response(self : Rmsm, recv_counter : Byte) -> Bool raise
    EcError

    Validate a received mailbox response counter. Returns true if this is a valid (new) response; false if it's a stale or repeat frame that the caller should discard and continue polling.

    RmsmState

    pub(all) enum RmsmState {
    Idle
    WaitingForResponse(Byte)
    Error(String)
    } derive(Eq,
    Debug
    )

    RMSM state for a single slave's mailbox channel.

    SdoCommand

    pub(all) enum SdoCommand {
    DownloadRequest
    DownloadResponse
    UploadRequest
    UploadResponse
    AbortTransfer
    } derive(Eq,
    Debug
    )

    SDO command specifier for expedited/normal transfer.

    SdoInfoEntryDescription

    pub(all) struct SdoInfoEntryDescription {
    index : UInt
    subindex : Byte
    value_info : Byte
    data_type : UInt
    bit_length : UInt
    access : UInt
    name : String
    } derive(Eq,
    Debug
    )

    SDO Info entry description (Get OE response body).

    SdoInfoObjectDescription

    pub(all) struct SdoInfoObjectDescription {
    index : UInt
    data_type : UInt
    object_code : Byte
    max_subindex : Byte
    name : String
    } derive(Eq,
    Debug
    )

    SDO Info object description (Get OD response body).

    SdoInfoResponse

    pub(all) struct SdoInfoResponse {
    opcode : Byte
    incomplete : Bool
    fragments_left : UInt
    payload : Bytes
    } derive(Eq,
    Debug
    )

    Decoded SDO Info response header and payload body.

    SdoRequest

    pub(all) struct SdoRequest {
    index : UInt
    subindex : Byte
    command : SdoCommand
    data : Bytes
    complete_access : Bool
    } derive(Eq,
    Debug
    )

    SDO request descriptor.

    SdoResponse

    pub(all) struct SdoResponse {
    index : UInt
    subindex : Byte
    command : SdoCommand
    data : Bytes
    segmented : Bool
    toggle : Bool
    last_segment : Bool
    complete_size : UInt?
    } derive(Eq,
    Debug
    )

    SdoResponse holds a decoded SDO response.

    SdoTransaction

    pub(all) struct SdoTransaction {
    counter : Byte
    station : UInt
    request : SdoRequest
    } derive(Eq,
    Debug
    )

    SdoTransaction tracks one SDO request-response exchange.

    SdoTransaction::encode

    fn SdoTransaction::encode(self : SdoTransaction) -> Bytes

    Build a complete mailbox frame for an SDO request (expedited).

    SiiCategory

    pub(all) enum SiiCategory {
    Strings
    DataTypes
    General
    Fmmu
    SyncManager
    FmmuEx
    SyncUnit
    TxPdo
    RxPdo
    Dc
    Timeouts
    Dictionary
    Hardware
    VendorInformation
    Images
    Raw
    } derive(Eq,
    Debug
    )

    SII category types (Slave Information Interface).

    SiiCategoryClass

    pub(all) enum SiiCategoryClass {
    StandardKnown
    StandardUnknown
    DeviceSpecific
    VendorSpecific
    ApplicationSpecific
    } derive(Eq,
    Debug
    )

    Stable export classification for SII categories.

    SiiCategoryClass::label

    fn SiiCategoryClass::label(self : SiiCategoryClass) -> String

    SiiCategoryEntry

    pub(all) struct SiiCategoryEntry {
    category : SiiCategory
    type_code : UInt
    data : BytesView
    } derive(Eq,
    Debug
    )

    A parsed SII category with its type tag and raw data.

    SiiCategoryEntry::category_class

    fn SiiCategoryEntry::category_class(self : SiiCategoryEntry) -> SiiCategoryClass

    SiiCategoryEntry::overlay_candidate

    fn SiiCategoryEntry::overlay_candidate(self : SiiCategoryEntry) -> SiiOverlayCandidate?

    SiiData

    pub(all) struct SiiData {
    vendor_id : UInt
    product_code : UInt
    revision : UInt
    serial : UInt
    bootstrap_rx_offset : UInt
    bootstrap_rx_size : UInt
    bootstrap_tx_offset : UInt
    bootstrap_tx_size : UInt
    mailbox_rx_offset : UInt
    mailbox_rx_size : UInt
    mailbox_tx_offset : UInt
    mailbox_tx_size : UInt
    mailbox_protocols : UInt
    firmware_version : UInt
    hardware_version : UInt
    production_date_raw : UInt
    pdi_control_1 : Byte
    esc_config_b0 : Byte
    pdi_config_1 : UInt
    pdi_config_1_ext : UInt
    esc_config_b4 : UInt
    esc_config_b5 : UInt
    esc_config_b6 : UInt
    checksum_b : UInt
    esc_config_b_present : Bool
    } derive(Eq,
    Debug
    )

    Basic SII data read from slave EEPROM.

    SiiData::production_week

    fn SiiData::production_week(self : SiiData) -> Int

    SiiData::production_weekday

    fn SiiData::production_weekday(self : SiiData) -> Int

    SiiData::production_year

    fn SiiData::production_year(self : SiiData) -> Int

    SiiData::supports_aoe

    fn SiiData::supports_aoe(self : SiiData) -> Bool

    Supported mailbox protocol bit helpers from the SII header mailbox protocol mask.

    SiiData::supports_coe

    fn SiiData::supports_coe(self : SiiData) -> Bool

    SiiData::supports_eoe

    fn SiiData::supports_eoe(self : SiiData) -> Bool

    SiiData::supports_foe

    fn SiiData::supports_foe(self : SiiData) -> Bool

    SiiData::supports_soe

    fn SiiData::supports_soe(self : SiiData) -> Bool

    SiiData::supports_voe

    fn SiiData::supports_voe(self : SiiData) -> Bool

    SiiDcClock

    pub(all) struct SiiDcClock {
    cycle_time_0 : UInt
    shift_time_0 : UInt
    shift_time_1 : UInt
    sync1_cycle_factor : Int
    assign_activate : UInt
    sync0_cycle_factor : Int
    name_idx : Byte
    description_idx : Byte
    } derive(Eq,
    Debug
    )

    Parsed DC clock category entry. This follows the field layout siitool uses for category 0x3c.

    SiiFmmuEx

    pub(all) struct SiiFmmuEx {
    op_only : Bool
    sm_defined : Bool
    su_defined : Bool
    sync_manager : Byte
    sync_unit : Byte
    } derive(Eq,
    Debug
    )

    Parsed SII FMMU_EX category element (ETG.2010 Table 10).

    SiiFullInfo

    pub(all) struct SiiFullInfo {
    eeprom : BytesView
    preamble : SiiPreamble
    standard : SiiStandardMetadata
    header : SiiData
    categories : Array[SiiCategoryEntry]
    strings : Array[String]
    general : SiiGeneral?
    timeouts : SiiTimeouts?
    fmmu : Array[FmmuDirection]
    fmmu_ex : Array[SiiFmmuEx]
    sync_managers : Array[SiiSmEntry]
    sync_units : Array[SiiSyncUnit]
    tx_pdo : Array[SiiPdo]
    rx_pdo : Array[SiiPdo]
    dc_clocks : Array[SiiDcClock]
    } derive(
    Debug
    )

    Aggregated SII view shared by CLI, runtime, and offline projection paths.

    SiiGeneral

    pub(all) struct SiiGeneral {
    group_idx : Byte
    image_idx : Byte
    order_idx : Byte
    name_idx : Byte
    coe_details : Byte
    foe_supported : Bool
    eoe_supported : Bool
    soe_supported : Bool
    soe_channels : Byte
    ds402_channels : Byte
    sysman_class : Byte
    flags : Byte
    current_on_ebus : Int
    group_idx_dup : Byte
    physical_port_0 : Byte
    physical_port_1 : Byte
    physical_port_2 : Byte
    physical_port_3 : Byte
    physical_memory_address : UInt
    } derive(Eq,
    Debug
    )

    General category data extracted from SII.

    SiiGeneral::identification_method

    fn SiiGeneral::identification_method(self : SiiGeneral) -> Int

    Extract the identification method from the SII General flags (bits 3-4). Returns 0 = none, 1 = IdentALSts, 2 = IdentPhyM, 3 = both.

    SiiGeneral::is_op_only

    fn SiiGeneral::is_op_only(self : SiiGeneral) -> Bool

    Check if the slave's OpOnly flag is set. When true, output data is only valid in Operational state; the master should disable output SM in non-Op states.

    SiiGeneral::prefers_not_lrw

    fn SiiGeneral::prefers_not_lrw(self : SiiGeneral) -> Bool

    Check if the slave prefers separate LRD/LWR instead of LRW. When true, the master should use LRD + LWR instead of LRW for PDO exchange.

    SiiGeneral::supports_coe_complete_access

    fn SiiGeneral::supports_coe_complete_access(self : SiiGeneral) -> Bool

    Check if CoE Complete Access is supported.

    SiiGeneral::supports_coe_pdo_assign

    fn SiiGeneral::supports_coe_pdo_assign(self : SiiGeneral) -> Bool

    Check if CoE PDO assignment objects are writable/configurable.

    SiiGeneral::supports_coe_pdo_configuration

    fn SiiGeneral::supports_coe_pdo_configuration(self : SiiGeneral) -> Bool

    Check if CoE PDO mapping objects are writable/configurable.

    SiiGeneral::supports_coe_sdo

    fn SiiGeneral::supports_coe_sdo(self : SiiGeneral) -> Bool

    Check if CoE SDO upload/download services are supported.

    SiiGeneral::supports_coe_sdo_info

    fn SiiGeneral::supports_coe_sdo_info(self : SiiGeneral) -> Bool

    Check if CoE SDO Information services are supported.

    SiiGeneral::supports_coe_upload_at_startup

    fn SiiGeneral::supports_coe_upload_at_startup(self : SiiGeneral) -> Bool

    Check if CoE upload at startup is supported.

    SiiGeneral::supports_identification_ado

    fn SiiGeneral::supports_identification_ado(self : SiiGeneral) -> Bool

    Check if the slave supports Explicit Device Identification (IdentificationAdo). Used for Hot Connect verification.

    SiiGeneral::supports_identification_physical_memory

    fn SiiGeneral::supports_identification_physical_memory(self : SiiGeneral) -> Bool

    Check if the slave supports Explicit Device Identification via Physical Memory.
    fn SiiGeneral::supports_mailbox_data_link_layer(self : SiiGeneral) -> Bool

    Check if resilient mailbox handling via Data Link Layer is supported.

    SiiOverlayCandidate

    pub(all) struct SiiOverlayCandidate {
    scope : SiiOverlayScope
    type_code : UInt
    data : BytesView
    } derive(Eq,
    Debug
    )

    SiiOverlayCandidate::decoder_name

    fn SiiOverlayCandidate::decoder_name(self : SiiOverlayCandidate) -> String?

    SiiOverlayCandidate::dispatch_key

    fn SiiOverlayCandidate::dispatch_key(self : SiiOverlayCandidate) -> String

    SiiOverlayCandidate::status_label

    fn SiiOverlayCandidate::status_label(self : SiiOverlayCandidate) -> String

    SiiOverlayScope

    pub(all) enum SiiOverlayScope {
    DeviceSpecific
    VendorSpecific
    ApplicationSpecific
    } derive(Eq,
    Debug
    )

    Dispatch scope for future typed overlays on raw SII categories.

    SiiOverlayScope::label

    fn SiiOverlayScope::label(self : SiiOverlayScope) -> String

    SiiPdo

    pub(all) struct SiiPdo {
    pdo_index : UInt
    entry_count : Byte
    sync_manager : Byte
    synchronization : Byte
    name_idx : Byte
    flags : UInt
    entries : Array[SiiPdoEntry]
    } derive(Eq,
    Debug
    )

    Parsed SII PDO descriptor (TxPdo/RxPdo category).

    SiiPdo::is_default

    fn SiiPdo::is_default(self : SiiPdo) -> Bool

    PDO flags bit 1: PDO is mapped by default.

    SiiPdo::is_depend_on_slot

    fn SiiPdo::is_depend_on_slot(self : SiiPdo) -> Bool

    PDO flags bit 9: PDO index depends on slot.

    SiiPdo::is_depend_on_slot_group

    fn SiiPdo::is_depend_on_slot_group(self : SiiPdo) -> Bool

    PDO flags bit 10: PDO index depends on slot group.

    SiiPdo::is_fixed_content

    fn SiiPdo::is_fixed_content(self : SiiPdo) -> Bool

    PDO flags bit 4: PDO has fixed content (entries cannot be changed).

    SiiPdo::is_mandatory

    fn SiiPdo::is_mandatory(self : SiiPdo) -> Bool

    PDO flags bit 0: PDO is mandatory.

    SiiPdo::is_module_align

    fn SiiPdo::is_module_align(self : SiiPdo) -> Bool

    PDO flags bit 8: Module alignment for PDO.

    SiiPdo::is_overwritten_by_module

    fn SiiPdo::is_overwritten_by_module(self : SiiPdo) -> Bool

    PDO flags bit 11: PDO is overwritten by module.

    SiiPdo::is_virtual_content

    fn SiiPdo::is_virtual_content(self : SiiPdo) -> Bool

    PDO flags bit 5: PDO has virtual content.

    SiiPdoEntry

    pub(all) struct SiiPdoEntry {
    entry_index : UInt
    subindex : Byte
    name_idx : Byte
    data_type : Byte
    bit_length : Byte
    flags : UInt
    } derive(Eq,
    Debug
    )

    Single entry within a PDO descriptor.

    SiiPreamble

    pub(all) struct SiiPreamble {
    pdi_control : UInt
    pdi_config : UInt
    sync_impulse_length_raw : UInt
    pdi_config2 : UInt
    configured_station_alias : UInt
    checksum : UInt
    checksum_ok : Bool
    } derive(Eq,
    Debug
    )

    Fixed SII preamble loaded by the ESC during startup.

    SiiPreamble::sync_impulse_length_ns

    fn SiiPreamble::sync_impulse_length_ns(self : SiiPreamble) -> UInt

    SiiSmEntry

    pub(all) struct SiiSmEntry {
    physical_start : UInt
    length : UInt
    control : Byte
    status : Byte
    activate : Byte
    sm_type : SmType
    } derive(Eq,
    Debug
    )

    SM info from SII SM category. Each SM entry is 8 bytes.

    SiiStandardMetadata

    pub(all) struct SiiStandardMetadata {
    eeprom_size_raw : UInt
    version : UInt
    } derive(Eq,
    Debug
    )

    Additional fixed metadata stored after the standard SII config block.

    SiiStandardMetadata::eeprom_size_bytes

    fn SiiStandardMetadata::eeprom_size_bytes(self : SiiStandardMetadata) -> UInt

    SiiSyncUnit

    pub(all) struct SiiSyncUnit {
    separate_su : Bool
    separate_frame : Bool
    depend_on_input_state : Bool
    frame_repeat_support : Bool
    raw_flags : Byte
    } derive(Eq,
    Debug
    )

    Parsed SII SyncUnit category element (ETG.2010 Table 14).

    SiiTimeouts

    pub(all) struct SiiTimeouts {
    preop_timeout_ms : UInt
    safeop_op_timeout_ms : UInt
    back_to_init_timeout_ms : UInt
    back_to_safeop_timeout_ms : UInt
    mailbox_request_timeout_ms : UInt
    mailbox_response_timeout_ms : UInt
    } derive(Eq,
    Debug
    )

    Parsed SII timeout category (ETG.2010 Table 13), values in milliseconds.

    SlaveMapping

    pub(all) struct SlaveMapping {
    sm_configs : Array[SmConfig]
    fmmu_configs : Array[FmmuConfig]
    output_bytes : Int
    input_bytes : Int
    } derive(Eq,
    Debug
    )

    Result of FMMU / SM mapping calculation for one slave.

    SmConfig

    pub(all) struct SmConfig {
    physical_start : UInt
    length : UInt
    control : Byte
    status : Byte
    activate : Byte
    sm_type : SmType
    } derive(Eq,
    Debug
    )

    SyncManager (SM) configuration entry.

    SmConfig::to_bytes

    fn SmConfig::to_bytes(self : SmConfig) -> Bytes

    Encode an SmConfig into 8 bytes suitable for writing to SM registers.

    SmType

    pub(all) enum SmType {
    MailboxOut
    MailboxIn
    ProcessDataOut
    ProcessDataIn
    DynamicProcessDataOut
    DynamicProcessDataIn
    Unused
    } derive(Eq,
    Debug
    )

    SoeElementFlag

    pub(all) enum SoeElementFlag {
    DataState
    Name
    Attribute
    Unit
    Min
    Max
    Value
    Default
    } derive(Eq,
    Debug
    )

    SoE element flags — select which IDN properties to transfer.

    SoeElementFlag::to_byte

    fn SoeElementFlag::to_byte(self : SoeElementFlag) -> Byte

    SoeOpCode

    pub(all) enum SoeOpCode {
    ReadReq
    ReadRes
    WriteReq
    WriteRes
    Notification
    Emergency
    } derive(Eq,
    Debug
    )

    SoE OpCode values per ETG.1000.6.

    SoeOpCode::from_uint

    SoeOpCode::to_uint

    fn SoeOpCode::to_uint(self : SoeOpCode) -> UInt

    SoeResponse

    pub(all) enum SoeResponse {
    SoeReadData(drive_no~ : UInt, element_flags~ : Byte, idn~ : UInt, incomplete~ : Bool, data~ : Bytes)
    SoeWriteAck(drive_no~ : UInt, element_flags~ : Byte, idn~ : UInt)
    SoeError(drive_no~ : UInt, idn~ : UInt, error_code~ : UInt)
    SoeNotification(drive_no~ : UInt, idn~ : UInt, data~ : Bytes)
    } derive(Eq,
    Debug
    )

    Decoded SoE response.

    apply_pdo_lengths_to_sm_configs

    fn apply_pdo_lengths_to_sm_configs(sm_configs : Array[SmConfig], tx_pdos : Array[SiiPdo], rx_pdos : Array[SiiPdo]) -> Array[SmConfig]

    build_sdo_download

    fn build_sdo_download(counter : Byte, station : UInt, index : UInt, subindex : Byte, data : Bytes) -> SdoTransaction

    Build an SDO Download (write) transaction.

    build_sdo_download_ca

    fn build_sdo_download_ca(counter : Byte, station : UInt, index : UInt, subindex : Byte, data : Bytes) -> SdoTransaction

    Build an SDO Download transaction with Complete Access flag set.

    build_sdo_download_segment_request

    fn build_sdo_download_segment_request(counter : Byte, station : UInt, toggle : Bool, last_segment : Bool, segment : Bytes) -> Bytes raise
    EcError

    Build an SDO Download Segment request frame. segment may contain at most 7 bytes.

    build_sdo_info_get_od_list_request

    fn build_sdo_info_get_od_list_request(counter : Byte, station : UInt, list_type : UInt) -> Bytes

    Build an SDO Info "Get OD List" request frame. list_type: 0 = number of objects for all list classes.

    build_sdo_info_get_od_request

    fn build_sdo_info_get_od_request(counter : Byte, station : UInt, index : UInt) -> Bytes

    Build an SDO Info "Get OD" (object description) request frame.

    build_sdo_info_get_oe_request

    fn build_sdo_info_get_oe_request(counter : Byte, station : UInt, index : UInt, subindex : Byte, value_info : Byte) -> Bytes

    Build an SDO Info "Get OE" (entry description) request frame. value_info is a bitmask selecting additional fields in the response.

    build_sdo_upload

    fn build_sdo_upload(counter : Byte, station : UInt, index : UInt, subindex : Byte) -> SdoTransaction

    Build an SDO Upload (read) transaction.

    build_sdo_upload_ca

    fn build_sdo_upload_ca(counter : Byte, station : UInt, index : UInt, subindex : Byte) -> SdoTransaction

    Build an SDO Upload transaction with Complete Access flag set.

    build_sdo_upload_segment_request

    fn build_sdo_upload_segment_request(counter : Byte, station : UInt, toggle : Bool) -> Bytes

    Build an SDO Upload Segment request frame. Toggle bit alternates on each segment round-trip.

    calculate_fmmu_configs

    fn calculate_fmmu_configs(fmmu_directions : Array[FmmuDirection], sm_configs : Array[SmConfig], logical_base : UInt) -> (Array[FmmuConfig], Int, Int)

    Compute FmmuConfig array from SII FMMU directions and the calculated SM configs. Each FMMU entry maps a contiguous block of logical address space to the physical address of the corresponding process-data SM.

    logical_base — starting logical address for this slave's mapped I/O.

    Returns (fmmu_configs, output_bytes, input_bytes).

    calculate_slave_mapping

    fn calculate_slave_mapping(eeprom : Bytes, logical_base : UInt) -> SlaveMapping raise
    EcError

    High-level helper: compute the full mapping for a slave from its raw SII EEPROM data and a logical base address.

    calculate_slave_mapping_from_sii

    fn calculate_slave_mapping_from_sii(sii : SiiFullInfo, logical_base : UInt) -> SlaveMapping

    calculate_sm_configs

    fn calculate_sm_configs(sii_header : SiiData, sii_sm_entries : Array[SiiSmEntry]) -> Array[SmConfig]

    Compute SmConfig array from SII SM entries and mailbox header info. Mailbox SM entries use the SII header offsets/sizes; process-data SM entries keep the physical addresses from the SII SM category.

    decode_emergency

    fn decode_emergency(payload : Bytes) -> EmergencyMessage raise
    EcError

    Decode a CoE Emergency message from the CoE payload (after mailbox header + CoE header, i.e., the SDO/Emergency data area).

    decode_emergency_frame

    fn decode_emergency_frame(frame : Bytes) -> (MailboxHeader, EmergencyMessage) raise
    EcError

    Decode a full mailbox frame as a CoE Emergency message. Parses mailbox header, verifies CoE type and Emergency service, then decodes the emergency payload.

    decode_eoe_response

    fn decode_eoe_response(frame : Bytes) -> EoeResponse raise
    EcError

    Decode an EoE response from a mailbox frame (after mailbox header).

    decode_foe_response

    fn decode_foe_response(data : Bytes) -> (MailboxHeader, FoeResponse) raise
    EcError

    Decode a FoE response from a raw mailbox frame.

    decode_sdo_info_od_description_payload

    fn decode_sdo_info_od_description_payload(payload : Bytes) -> SdoInfoObjectDescription raise
    EcError

    Decode Get OD response payload.

    decode_sdo_info_od_list_payload

    fn decode_sdo_info_od_list_payload(payload : Bytes) -> Array[UInt]

    Decode OD list payload (sequence of little-endian WORD indices).

    decode_sdo_info_oe_description_payload

    fn decode_sdo_info_oe_description_payload(payload : Bytes) -> SdoInfoEntryDescription raise
    EcError

    Decode Get OE response payload.

    decode_sdo_info_response

    fn decode_sdo_info_response(data : Bytes) -> (MailboxHeader, SdoInfoResponse) raise
    EcError

    Decode SDO Info response frame (service=0x08).

    decode_sdo_response

    fn decode_sdo_response(data : Bytes) -> (MailboxHeader, SdoResponse) raise
    EcError

    Decode an SDO response from a raw mailbox frame.

    decode_soe_response

    fn decode_soe_response(frame : Bytes) -> SoeResponse raise
    EcError

    Decode a SoE response from a mailbox frame (after mailbox header).

    encode_eoe_fragment

    fn encode_eoe_fragment(counter : Byte, port : UInt, last_fragment : Bool, frag_number : UInt, frame_offset : UInt, frame_number : UInt, data : Bytes) -> Bytes

    Encode an EoE Ethernet frame fragment for sending to a slave.

    encode_eoe_get_ip_req

    fn encode_eoe_get_ip_req(counter : Byte, port : UInt) -> Bytes

    Encode an EoE Get IP parameter request.

    encode_eoe_set_ip_req

    fn encode_eoe_set_ip_req(counter : Byte, port : UInt, ip : Bytes, subnet : Bytes, gateway : Bytes) -> Bytes

    Encode an EoE Set IP parameter request.

    encode_foe_ack

    fn encode_foe_ack(counter : Byte, packet_number : UInt) -> Bytes

    Encode a FoE Ack frame.

    encode_foe_data

    fn encode_foe_data(counter : Byte, packet_number : UInt, data : Bytes) -> Bytes

    Encode a FoE Data segment (used in both upload and download transfers).

    encode_foe_read

    fn encode_foe_read(counter : Byte, password : UInt, filename : String) -> Bytes

    Encode a FoE Read request (upload: host wants to read file from slave).

    encode_foe_write

    fn encode_foe_write(counter : Byte, password : UInt, filename : String) -> Bytes

    Encode a FoE Write request (download: host wants to write file to slave).

    encode_soe_read_req

    fn encode_soe_read_req(counter : Byte, drive_no : UInt, element_flags : Byte, idn : UInt) -> Bytes

    Encode a SoE Read Request.

    encode_soe_write_req

    fn encode_soe_write_req(counter : Byte, drive_no : UInt, element_flags : Byte, idn : UInt, data : Bytes) -> Bytes

    Encode a SoE Write Request.

    parse_sii_categories

    fn parse_sii_categories(data : BytesView) -> Array[SiiCategoryEntry]

    Parse all SII categories from the category area of EEPROM data.

    parse_sii_dc

    fn parse_sii_dc(data : BytesView) -> SiiDcClock raise
    EcError

    Parse a DC clock category entry.

    parse_sii_fmmu

    fn parse_sii_fmmu(data : BytesView) -> Array[FmmuDirection]

    Parse the FMMU category data. Each entry is 1 byte indicating FMMU usage. Per ETG1000.6 Table 22: 0x01 = Outputs, 0x02 = Inputs, 0x03 = mailbox state.

    parse_sii_fmmu_ex

    fn parse_sii_fmmu_ex(data : BytesView) -> Array[SiiFmmuEx]

    Parse the FMMU_EX category data (ETG.2010 Table 10).

    parse_sii_full_info

    fn parse_sii_full_info(data : Bytes) -> SiiFullInfo raise
    EcError

    Parse the complete SII model once and expose all commonly used projections. Single-pass dispatch over categories to avoid 10 separate linear scans.

    parse_sii_general

    fn parse_sii_general(data : BytesView) -> SiiGeneral raise
    EcError

    Parse the General category data.

    parse_sii_header

    fn parse_sii_header(data : BytesView) -> SiiData raise
    EcError

    Parse the fixed SII header fields from raw EEPROM data.

    parse_sii_pdo

    fn parse_sii_pdo(data : BytesView) -> Array[SiiPdo]

    Parse TxPdo or RxPdo category data (ETG1000.6 Tables 24+25). Each PDO has a fixed 8-byte header followed by nEntry × 8-byte entries.

    parse_sii_preamble

    fn parse_sii_preamble(data : BytesView) -> SiiPreamble raise
    EcError

    Parse the fixed SII preamble.

    parse_sii_sm

    fn parse_sii_sm(data : BytesView) -> Array[SiiSmEntry]

    Parse the SyncManager category data.

    parse_sii_standard_metadata

    fn parse_sii_standard_metadata(data : BytesView) -> SiiStandardMetadata raise
    EcError

    Parse standard SII metadata fields after the mailbox configuration block.

    parse_sii_strings

    fn parse_sii_strings(data : BytesView) -> Array[String]

    Parse the Strings category data (ETG1000.6 Table 20). Returns an array of strings indexed from 1 (index 0 is unused by convention).

    parse_sii_sync_units

    fn parse_sii_sync_units(data : BytesView) -> Array[SiiSyncUnit]

    Parse the SyncUnit category data (ETG.2010 Table 14).

    parse_sii_timeouts

    fn parse_sii_timeouts(data : BytesView) -> SiiTimeouts raise
    EcError

    Parse the Timeouts category data (ETG.2010 Table 13).

    sdo_abort_code_description

    fn sdo_abort_code_description(code : UInt) -> String

    Human-readable description of an SDO Abort Code per ETG.1000.6 Table 40.

    sii_category_start

    let sii_category_start : Int

    First category header starts at word 64.

    soe_element_flags

    fn soe_element_flags(flags : Array[SoeElementFlag]) -> Byte

    Combine multiple element flags into a single byte via bitwise OR.