@@ -102,14 +102,20 @@ defmodule Circuits.GPIO do
102102 @ type pull_mode ( ) :: :not_set | :none | :pullup | :pulldown
103103
104104 @ typedoc """
105- Static GPIO information
105+ Ways of referring to a GPIO
106106
107- Location and other static information about a GPIO that is returned by
108- `enumerate/1`. Backends must provide `:location` which is an unambiguous
109- `t:gpio_spec/0` for use with `open/3`. As described in `open/3`, there are
110- many ways to refer to GPIOs and those may be exposed here as well. Since GPIO
111- information can be cached, this map does not contain mode settings or current
112- values. See other functions for getting that information.
107+ It's possible to refer to a GPIOs in many ways and this map contains
108+ information for doing that. See `enumerate/1` and `identifiers/1` for
109+ querying `Circuits.GPIO` for these maps.
110+
111+ The information in this map is backend specific. At a minimum, all backends
112+ provide the `:location` field which is an unambiguous `t:gpio_spec/0` for use
113+ with `open/3`.
114+
115+ When provided, the `:label` field is a string name for the GPIO that should
116+ be unique to the system but this isn't guaranteed. A common convention is to
117+ label GPIOs by their pin names in documentation or net names in schematics.
118+ The Linux cdev backend uses labels from the device tree file.
113119
114120 Fields:
115121
@@ -181,7 +187,7 @@ defmodule Circuits.GPIO do
181187 def gpio_spec? ( x ) , do: is_gpio_spec ( x )
182188
183189 @ doc """
184- Return static information about a GPIO
190+ Return indentifying information about a GPIO
185191
186192 See `t:gpio_spec/0` for the ways of referring to GPIOs. If the GPIO is found,
187193 this function returns information about the GPIO.
@@ -190,7 +196,7 @@ defmodule Circuits.GPIO do
190196 def identifiers ( gpio_spec ) do
191197 { backend , backend_defaults } = default_backend ( )
192198
193- backend . gpio_identifiers ( gpio_spec , backend_defaults )
199+ backend . identifiers ( gpio_spec , backend_defaults )
194200 end
195201
196202 @ doc """
@@ -203,7 +209,7 @@ defmodule Circuits.GPIO do
203209 def status ( gpio_spec ) do
204210 { backend , backend_defaults } = default_backend ( )
205211
206- backend . gpio_status ( gpio_spec , backend_defaults )
212+ backend . status ( gpio_spec , backend_defaults )
207213 end
208214
209215 @ doc """
@@ -391,12 +397,12 @@ defmodule Circuits.GPIO do
391397 def backend_info ( backend \\ nil )
392398
393399 def backend_info ( nil ) , do: backend_info ( default_backend ( ) )
394- def backend_info ( { backend , _options } ) , do: backend . info ( )
400+ def backend_info ( { backend , _options } ) , do: backend . backend_info ( )
395401
396402 @ doc """
397403 Return a list of accessible GPIOs
398404
399- Each GPIO is described in a `t:gpio_info /0` map. Some fields in the map like
405+ Each GPIO is described in a `t:identifiers /0` map. Some fields in the map like
400406 `:location` and `:label` may be passed to `open/3` to use the GPIO. The map
401407 itself can also be passed to `open/3` and the function will figure out how to
402408 access the GPIO.
0 commit comments