# `CircuitsSim.Device.TM1620`
[🔗](https://github.com/elixir-circuits/circuits_sim/blob/v0.1.2/lib/circuits_sim/device/tm1620.ex#L1)

TM1620 LED Driver

See the [datasheet](https://github.com/fhunleth/binary_clock/blob/main/datasheets/TM1620-English.pdf) for details.
Many features aren't implemented.

# `render_mode`

```elixir
@type render_mode() :: :grid | :seven_segment | :binary_clock
```

Render mode is how to pretty print the expected LED output

Modes:

* `:grid` - a grid of LEDs. Grid dimensions depend on the TM1620 mode
* `:seven_segment` - render LEDs like they're hooked up to a 7 segment display
* `:binary_clock` - render LEDs like the Nerves binary clock

# `t`

```elixir
@type t() :: %CircuitsSim.Device.TM1620{
  data: &lt;&lt;_::88&gt;&gt;,
  digits: pos_integer(),
  mode: :auto,
  pulse16: pos_integer(),
  render: render_mode()
}
```

# `binary_clock`

```elixir
@spec binary_clock(binary()) :: IO.ANSI.ansidata()
```

# `child_spec`

```elixir
@spec child_spec(keyword()) :: Supervisor.child_spec()
```

# `command`

```elixir
@spec command(binary(), t()) :: t()
```

Process a TM1620 command

# `grid`

```elixir
@spec grid(4..6, binary()) :: IO.ANSI.ansidata()
```

Display registers as a grid

# `new`

```elixir
@spec new(keyword()) :: t()
```

# `seven_segment`

```elixir
@spec seven_segment(binary()) :: IO.ANSI.ansidata()
```

Draw out 7-segment display digits using TM1620 data

---

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