View Source Circuits.GPIO.Backend behaviour (circuits_gpio v2.0.0-pre.2)
Backends provide the connection to the real or virtual GPIO controllers
Summary
Callbacks
@callback enumerate() :: [Circuits.GPIO.Line.t()]
Return a list of GPIOs
See the Line struct for the information that is returned.
@callback info() :: map()
Return information about this backend
@callback open( gpio_spec :: Circuits.GPIO.gpio_spec(), direction :: Circuits.GPIO.direction(), options :: Circuits.GPIO.open_options() ) :: {:ok, Circuits.GPIO.Handle.t()} | {:error, atom()}
Open one or more GPIOs
gpio_spec should be a valid GPIO pin specification on the system and direction
should be :input or :output. If opening as an output, then be sure to set
the :initial_value option if you need the set to be glitch free.
Options:
- :initial_value - Set to
0or1if this is an output.0is the default. - :pull_mode - Set to
:not_set,:pullup,:pulldown, or:nonefor an input pin.:not_setis the default.