labgrid icon indicating copy to clipboard operation
labgrid copied to clipboard

protocol/driver: add `DigitalInputProtocol`, `GpioDigitalInputDriver`

Open flxzt opened this issue 1 year ago • 1 comments

Description

this adds a new protocol DigitalInputProtocol and a GPIO driver that implements it.

The DigitalOutputProtocol ABC now also inherits it, ensuring it can be used in all existing driver implementations.

Additionally the client now automatically uses DigitalInputProtocol when the command is io get.

By seperating the input from output protocol it is possible to make sure the GPIO line is configured in direction input in sysfs, which avoids shorts when reading out digital states from DUT's. Otherwise, one would have to rely on the circuitry of the GPIO line.

Tested on two Raspberry Pi's as exporter and DUT.

Note:

the sysfsgpioin.py part duplicates most of the sysfsgpio.py code but because of the way this code is executed by agentwrapper I thought it was cleaner to separate it into a new file.

Checklist

  • [x] Documentation for the feature
  • [x] Tests for the feature
  • [x] The arguments and description in doc/configuration.rst have been updated
  • [x] PR has been tested

closes #1457

flxzt avatar Jul 31 '24 14:07 flxzt