wafer v0.1.0 Wafer.Driver.ElixirALE.GPIO

A connection to a native GPIO pin via ElixirALE's GPIO driver.

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

Link to this section Summary

Functions

Acquire a connection to the specified GPIO pin using the ElixirALE GPIO driver.

Link to this section Types

Link to this type

option()

option() ::
  {:pin, non_neg_integer()}
  | {:direction, Wafer.GPIO.pin_direction()}
  | {:force, boolean()}
Link to this type

options()

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

t()

t() :: %Wafer.Driver.ElixirALE.GPIO{direction: term(), pid: pid(), pin: term()}

Link to this section Functions

Link to this function

acquire(opts)

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

Acquire a connection to the specified GPIO pin using the ElixirALE GPIO driver.

Options

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