# `EtherCAT.Register`
[🔗](https://github.com/tallakt/yaethercat/blob/v0.1.0/lib/ethercat/register.ex#L1)

The registers of an EtherCAT SubDevice controller (ESC) that this library uses, by the names
ETG.1000.4 clause 6 gives them, and the layout of the sync manager and FMMU entities.

| Register | Address |
|---|---|
| DL information: type, revision, build, FMMUs, sync managers, RAM, ports, features | 0x0000 to 0x0009 |
| Configured station address | 0x0010 |
| Configured station alias | 0x0012 |
| DL control | 0x0100 |
| Loop control, DL control's second byte | 0x0101 |
| DL status | 0x0110 |
| AL control | 0x0120 |
| AL status | 0x0130 |
| AL status code | 0x0134 |
| RX error counters | 0x0300 |
| Lost link counters | 0x0310 |
| Watchdog divider | 0x0400 |
| DLS-user watchdog | 0x0410 |
| Sync manager watchdog | 0x0420 |
| Sync manager watchdog status | 0x0440 |
| SII access, control and status, address, data | 0x0500, 0x0502, 0x0504, 0x0508 |
| FMMU entities, 16 bytes each | 0x0600 |
| Sync manager channels, 8 bytes each | 0x0800 |

The AL registers are the "DLS-user R1" to "R6" of ETG.1000.4, which ETG.1000.6 names.

# `al_control`

AL control, R1: the state requested.

# `al_status`

AL status, R3: the state, and whether the last change failed.

# `al_status_code`

AL status code, R6: why it failed.

# `dl_control`

DL control: forwarding and loop control of each port.

# `dl_information`

DL information: the ESC's type, revision, build, FMMUs, sync managers, RAM and features.

# `dl_status`

DL status: link, loop and signal of each port.

# `dls_user_watchdog`

DLS-user watchdog, in units of the divider.

# `fmmu`

FMMU entity `n`.

# `fmmu_entity`

```elixir
@spec fmmu_entity(keyword()) :: &lt;&lt;_::128&gt;&gt;
```

An FMMU entity: `length` bytes of logical memory at `logical`, from bit `start_bit` of its first
byte to bit `end_bit` of its last, mapped to the physical memory at `physical` from bit
`physical_bit`, for reading, writing or both.

# `loop_control`

Loop control, the second byte of DL control: two bits for each port, from port 0 up. 0 is Auto, a
port closed while it has no link and open while it has; 1 Auto close, closed when its link goes
and opened again by a frame that comes in at it; 2 always open; 3 always closed.

# `lost_link_counter`

Lost link counters of the four ports.

# `rx_error_counter`

RX error counters of the four ports.

# `sii_access`

SII access: who owns the SII.

# `sii_address`

SII address, in words.

# `sii_control`

SII control/status.

# `sii_data`

SII data.

# `station_address`

Configured station address.

# `station_alias`

Configured station alias, loaded from SII word 4.

# `sync_manager`

Sync manager channel `n`.

# `sync_manager_channel`

```elixir
@spec sync_manager_channel(0..65535, 0..65535, byte(), boolean()) :: &lt;&lt;_::64&gt;&gt;
```

A sync manager channel: its area of physical memory, its control byte and whether it's enabled.
The status byte is not written, as it's the SubDevice's.

# `sync_manager_control`

```elixir
@spec sync_manager_control(:buffered | :mailbox, :write | :read, keyword()) :: byte()
```

The control byte of a sync manager channel: buffered (three buffers) or mailbox, written or read by
the MainDevice, and whether the sync manager watchdog watches it.

# `sync_manager_watchdog`

Sync manager watchdog, in units of the divider; 0 turns it off.

# `sync_manager_watchdog_status`

Sync manager watchdog status.

# `watchdog_divider`

Watchdog divider, in 40 ns steps: the unit of the watchdogs, 100 µs by default.

---

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