Skip to content

Commit d6f9dd9

Browse files
committed
doc/configuration.rst: Add new Button drivers
Add documentations for ManualButtonDriver, ExternalButtonDriver, DigitalOutputButtonDriver. Update the SysfsGPIO, MatchedSysfsGPIO, and GpioDigitalOutputDriver to add the new active_low attribute and the new protocols supported by the GpioDigitalOutputDriver. Signed-off-by: Perry Melange <[email protected]>
1 parent 33e2c15 commit d6f9dd9

File tree

1 file changed

+76
-2
lines changed

1 file changed

+76
-2
lines changed

doc/configuration.rst

Lines changed: 76 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,9 +556,11 @@ A :any:`SysfsGPIO` resource describes a GPIO line.
556556
557557
SysfsGPIO:
558558
index: 12
559+
active_low: False
559560
560561
Arguments:
561562
- index (int): index of the GPIO line
563+
- active_low (bool, default=False): optional, invert the logical line value when True
562564

563565
Used by:
564566
- `GpioDigitalOutputDriver`_
@@ -577,6 +579,7 @@ USB based gpiochips.
577579
'@SUBSYSTEM': 'usb'
578580
'@ID_SERIAL_SHORT': 'D38EJ8LF'
579581
pin: 0
582+
active_low: False
580583
581584
The example would search for a USB gpiochip with the key `ID_SERIAL_SHORT`
582585
and the value `D38EJ8LF` and use the pin 0 of this device.
@@ -585,6 +588,7 @@ The `ID_SERIAL_SHORT` property is set by the usb_id builtin helper program.
585588
Arguments:
586589
- match (dict): key and value pairs for a udev match, see `udev Matching`_
587590
- pin (int): gpio pin number within the matched gpiochip.
591+
- active_low (bool, default=False): optional, invert the logical line value when True
588592

589593
Used by:
590594
- `GpioDigitalOutputDriver`_
@@ -2213,6 +2217,72 @@ Implements:
22132217
Arguments:
22142218
- delay (float, default=2.0): delay in seconds between off and on
22152219

2220+
ManualButtonDriver
2221+
~~~~~~~~~~~~~~~~~~
2222+
A :any:`ManualButtonDriver` requires the user to control the taget button.
2223+
This is required if a strategy is used with the target, but no automatic
2224+
button control is available.
2225+
2226+
The driver's name will be displayed during interaction.
2227+
2228+
Binds to:
2229+
- None
2230+
2231+
Implements:
2232+
- :any:`ButtonProtocol`
2233+
2234+
.. code-block:: yaml
2235+
2236+
ManualButtonDriver:
2237+
name: 'example-board'
2238+
2239+
Arguments:
2240+
- None
2241+
2242+
ExternalButtonDriver
2243+
~~~~~~~~~~~~~~~~~~~~
2244+
An :any:`ExternalButtonDriver` is used to control a target button via an
2245+
external command.
2246+
2247+
Binds to:
2248+
- None
2249+
2250+
Implements:
2251+
- :any:`ButtonProtocol`
2252+
2253+
.. code-block:: yaml
2254+
2255+
ExternalButtonDriver:
2256+
cmd_press: 'example_command press and hold'
2257+
cmd_release: 'example_command release'
2258+
cmd_press_for: 'example_command press_for'
2259+
delay: 2.0
2260+
2261+
Arguments:
2262+
- cmd_press (str): command to press and hold the button on the board
2263+
- cmd_release (str): command to release the button on the board
2264+
- cmd_press_for (str): command to press, pause, and release the button on the board
2265+
- delay (float, default=1.0): delay in seconds when calling press_for
2266+
2267+
DigitalOutputButtonDriver
2268+
~~~~~~~~~~~~~~~~~~~~~~~~~
2269+
A :any:`DigitalOutputButtonDriver` is used to control a target button via a
2270+
DigitalOutputDriver
2271+
2272+
Binds to:
2273+
- :any:`DigitalOutputProtocol`
2274+
2275+
Implements:
2276+
- :any:`ButtonProtocol`
2277+
2278+
.. code-block:: yaml
2279+
2280+
DigitalOutputButtonDriver:
2281+
delay: 2.0
2282+
2283+
Arguments:
2284+
- delay (float, default=1.0): delay in seconds when calling press_for
2285+
22162286
GpioDigitalOutputDriver
22172287
~~~~~~~~~~~~~~~~~~~~~~~
22182288
The :any:`GpioDigitalOutputDriver` writes a digital signal to a GPIO line.
@@ -2228,13 +2298,17 @@ Binds to:
22282298

22292299
Implements:
22302300
- :any:`DigitalOutputProtocol`
2301+
- :any:`ResetProtocol`
2302+
- :any:`PowerProtocol`
2303+
- :any:`ButtonProtocol`
22312304

22322305
.. code-block:: yaml
22332306
2234-
GpioDigitalOutputDriver: {}
2307+
GpioDigitalOutputDriver:
2308+
delay: 2.0
22352309
22362310
Arguments:
2237-
- None
2311+
- delay (float, default=1.0): delay in seconds between off and on for a power cycle or between states for button press_for
22382312

22392313
SerialPortDigitalOutputDriver
22402314
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)