View Source CircuitsSim.Device.TM1620 (circuits_sim v0.1.0)

TM1620 LED Driver

See the datasheet for details. Many features aren't implemented.

Summary

Types

Render mode is how to pretty print the expected LED output

t()

Functions

Process a TM1620 command

Display registers as a grid

Draw out 7-segment display digits using TM1620 data

Types

@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
@type t() :: %CircuitsSim.Device.TM1620{
  data: <<_::88>>,
  digits: pos_integer(),
  mode: :auto,
  pulse16: pos_integer(),
  render: render_mode()
}

Functions

@spec binary_clock(binary()) :: IO.ANSI.ansidata()
@spec child_spec(keyword()) :: Supervisor.child_spec()
@spec command(binary(), t()) :: t()

Process a TM1620 command

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

Display registers as a grid

@spec new(keyword()) :: t()
@spec seven_segment(binary()) :: IO.ANSI.ansidata()

Draw out 7-segment display digits using TM1620 data