# `EtherCAT.Slave.Config`
[🔗](https://github.com/sid2baker/ethercat/blob/main/lib/ethercat/slave/config.ex#L1)

Declarative configuration struct for a Slave.

Fields:
  - `:name` (required) — atom identifying this slave
  - `:driver` — module implementing `EtherCAT.Slave.Driver`,
    defaults to `EtherCAT.Slave.Driver.Default`
  - `:config` — driver-specific configuration map, default `%{}`
  - `:process_data` — one of:
    - `:none` — do not auto-register process data
    - `{:all, domain_id}` — register all signal names from the driver's
      `signal_model/1` against one domain
    - `[{signal_name, domain_id}]` — explicit signal-to-domain assignments
  - `:target_state` — desired startup target for this slave:
    - `:op` — master will advance it to cyclic operation
    - `:preop` — master will leave it in PREOP for manual configuration
  - `:sync` — optional `%EtherCAT.Slave.Sync.Config{}` describing slave-local
    SYNC0/SYNC1 and latch intent
  - `:health_poll_ms` — interval in milliseconds to poll AL Status after reaching `:op`.
    When set, the slave periodically reads register `0x0130` and emits a
    `[:ethercat, :slave, :health, :fault]` telemetry event if the slave has faulted
    or dropped out of Op. Defaults to `250`; set it to `nil` to disable polling.

# `process_data_request`

```elixir
@type process_data_request() :: :none | {:all, atom()} | [{atom(), atom()}]
```

# `t`

```elixir
@type t() :: %EtherCAT.Slave.Config{
  config: map(),
  driver: module(),
  health_poll_ms: pos_integer() | nil,
  name: atom(),
  process_data: process_data_request(),
  sync: EtherCAT.Slave.Sync.Config.t() | nil,
  target_state: target_state()
}
```

# `target_state`

```elixir
@type target_state() :: :preop | :op
```

# `default_health_poll_ms`

```elixir
@spec default_health_poll_ms() :: pos_integer()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
