wafer v0.1.0 Wafer.Driver.Circuits.I2C

A connection to a chip via Circuits' I2C driver.

Implements the Wafer.Conn behaviour as well as the Wafer.Chip and Wafer.I2C protocols.

Link to this section Summary

Functions

Acquire a connection to a peripheral using the Circuits' I2C driver on the specified bus and address.

Link to this section Types

Link to this type

option()

option() ::
  {:bus_name, binary()} | {:address, Wafer.I2C.address()} | {:force, boolean()}
Link to this type

options()

options() :: [option()]
Link to this type

t()

t() :: %Wafer.Driver.Circuits.I2C{
  address: Wafer.I2C.address(),
  bus: binary(),
  ref: reference()
}

Link to this section Functions

Link to this function

acquire(opts)

acquire(options()) :: {:ok, t()} | {:error, reason :: any()}

Acquire a connection to a peripheral using the Circuits' I2C driver on the specified bus and address.