# `NanoKVMGo.EDID`
[🔗](https://github.com/cocoa-xu/nano_kvm_go/blob/v0.4.0/lib/nano_kvm_go/edid.ex#L1)

Decodes an EDID, such as the one `NanoKVMGo.Video.edid/1` returns: who made
the display it describes, its name and the modes it lists.

    {:ok, edid} = NanoKVMGo.Video.edid()
    {:ok, %{name: "NanoKVM-Go", modes: [%{width: 3840, height: 2160} | _]}} =
      NanoKVMGo.EDID.decode(edid)

The modes are the detailed timings of the base block and of CTA-861
extension blocks, the preferred mode first.

# `mode`

```elixir
@type mode() :: %{
  width: pos_integer(),
  height: pos_integer(),
  refresh: float(),
  pixel_clock_khz: pos_integer(),
  interlaced: boolean()
}
```

A detailed timing.

# `t`

```elixir
@type t() :: %{
  manufacturer: String.t(),
  product: non_neg_integer(),
  serial: non_neg_integer(),
  week: non_neg_integer(),
  year: pos_integer(),
  version: String.t(),
  name: String.t() | nil,
  modes: [mode()],
  extensions: non_neg_integer()
}
```

# `decode`

```elixir
@spec decode(binary()) :: {:ok, t()} | {:error, :invalid_edid}
```

Decodes an EDID of one to four blocks with valid checksums.

# `valid?`

```elixir
@spec valid?(term()) :: boolean()
```

Whether `edid` is an EDID: one to four blocks of 128 bytes, the first
with the EDID header, each with a valid checksum. `NanoKVMGo.Video.set_edid/2`
takes such an EDID.

---

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