Wafer.Driver.Circuits.GPIO.Dispatcher (wafer v1.1.1)

View Source

This module implements a simple dispatcher for GPIO interrupts when using Circuits.GPIO.

Because the Circuit's interrupt doesn't provide an indication of whether the pin is rising or falling we store the last known pin state and use it to compare.

Summary

Functions

Returns a specification to start this module under a supervisor.

Disable interrupts for this connection using the specified pin_condition.

Enable interrupts for this connection using the specified pin_condition.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

disable(conn, pin_condition)

@spec disable(Wafer.Conn.t(), Wafer.GPIO.pin_condition()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Disable interrupts for this connection using the specified pin_condition.

enable(conn, pin_condition, metadata \\ nil)

@spec enable(Wafer.Conn.t(), Wafer.GPIO.pin_condition(), any()) ::
  {:ok, Wafer.Conn.t()} | {:error, reason :: any()}

Enable interrupts for this connection using the specified pin_condition.