Packages
circuits_gpio
2.0.0-pre.0
2.3.0
2.2.0
2.1.3
2.1.2
retired
2.1.1
retired
2.1.0
retired
2.0.2
retired
2.0.1
retired
2.0.0
retired
2.0.0-pre.6
retired
2.0.0-pre.5
retired
2.0.0-pre.4
retired
2.0.0-pre.3
retired
2.0.0-pre.2
retired
2.0.0-pre.1
retired
2.0.0-pre.0
retired
1.2.2
1.2.1
1.2.0
1.1.0
1.0.1
1.0.0
0.4.8
0.4.7
0.4.6
0.4.5
0.4.4
0.4.3
0.4.2
0.4.1
0.4.0
0.3.1
0.3.0
0.2.0
0.1.0
Use GPIOs in Elixir
Retired package: Release invalid - Use v2.0.0 or later
Current section
Files
Jump to
Current section
Files
lib/gpio/backend.ex
# SPDX-FileCopyrightText: 2023 Frank Hunleth
#
# SPDX-License-Identifier: Apache-2.0
defmodule Circuits.GPIO.Backend do
@moduledoc """
Backends provide the connection to the real or virtual GPIO controllers
"""
alias Circuits.GPIO
alias Circuits.GPIO.Handle
@doc """
Open one or more GPIOs
`pin_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 `:not_set`, `0` or `1` if this is an output.
`:not_set` is the default.
* :pull_mode - Set to `:not_set`, `:pullup`, `:pulldown`, or `:none` for an
input pin. `:not_set` is the default.
"""
@callback open(
pin_spec :: GPIO.pin_spec(),
direction :: GPIO.pin_direction(),
options :: GPIO.open_options()
) ::
{:ok, Handle.t()} | {:error, atom()}
@doc """
Return information about this backend
"""
@callback info() :: map()
end