Wafer.Driver.Circuits.GPIO (wafer v0.1.3)

A connection to a native GPIO pin via Circuits' GPIO driver.

Implements the Wafer.Conn behaviour as well as the Wafer.GPIO protocol.

Link to this section Summary

Functions

Acquire a connection to a native GPIO pin via Circuit's GPIO driver.

Link to this section Types

Specs

option() :: {:pin, non_neg_integer()} | {:direction, Wafer.GPIO.pin_direction()}

Specs

options() :: [option()]

Specs

t() :: %Wafer.Driver.Circuits.GPIO{
  direction: Wafer.GPIO.pin_direction(),
  pin: non_neg_integer(),
  ref: reference()
}

Link to this section Functions

Specs

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

Acquire a connection to a native GPIO pin via Circuit's GPIO driver.

Options

  • :pin (required) the integer number of the pin to connect to. Hardware dependent.
  • :direction (optional) either :in or :out. Defaults to :out.