CircuitsSim.Device.TM1620 (circuits_sim v0.1.2)

View Source

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

render_mode()

@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()

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

Functions

binary_clock(data)

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

child_spec(args)

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

command(data, state)

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

Process a TM1620 command

grid(digits, data)

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

Display registers as a grid

new(args)

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

seven_segment(data)

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

Draw out 7-segment display digits using TM1620 data