CircuitsSim.Device.MCP23008 (circuits_sim v0.1.2)

View Source

MCP23008 8-bit I/O Expander

This is a simple I2C GPIO Expander that's normally found at I2C addresses between 0x20 and 0x27.

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

Summary

Types

t()

@type t() :: %CircuitsSim.Device.MCP23008{
  defval: byte(),
  gpinten: byte(),
  gpio: byte(),
  gppu: byte(),
  intcap: byte(),
  intcon: byte(),
  intf: byte(),
  iocon: byte(),
  iodir: byte(),
  ipol: byte(),
  olat: byte()
}

Functions

child_spec(args)

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

new()

@spec new() :: %CircuitsSim.Device.MCP23008{
  defval: 0,
  gpinten: 0,
  gpio: 0,
  gppu: 0,
  intcap: 0,
  intcon: 0,
  intf: 0,
  iocon: 0,
  iodir: 255,
  ipol: 0,
  olat: 0
}