Skip to content

driver: usbsdmuxdriver: add GPIO get and set support#1891

Open
hamztouiz wants to merge 1 commit into
labgrid-project:masterfrom
hamztouiz:topic/usbsdmux-gpio-support
Open

driver: usbsdmuxdriver: add GPIO get and set support#1891
hamztouiz wants to merge 1 commit into
labgrid-project:masterfrom
hamztouiz:topic/usbsdmux-gpio-support

Conversation

@hamztouiz

Copy link
Copy Markdown

Add two new methods to USBSDMuxDriver:

  • get_gpio(gpio): reads the state of a GPIO pin (0 or 1), returns 'high' or 'low'
  • set_gpio(gpio, value): sets a GPIO pin to 'high'/'1' or 'low'/'0'

Both methods use the gpio subcommand of the usbsdmux CLI tool,
which is available on hardware revisions that support open-drain GPIO
outputs (e.g. USB-SD-Mux Fast).

Signed-off-by: Hamza TOUIZRAT hamzatouizrat@yahoo.com

Add two new methods to USBSDMuxDriver:
- get_gpio(gpio): reads the state of a GPIO pin (0 or 1), returns 'high' or 'low'
- set_gpio(gpio, value): sets a GPIO pin to 'high'/'1' or 'low'/'0'

Both methods use the 'gpio' subcommand of the usbsdmux CLI tool,
which is available on hardware revisions that support open-drain GPIO
outputs (e.g. USB-SD-Mux Fast).

Signed-off-by: Hamza TOUIZRAT <hamzatouizrat@yahoo.com>

@Driver.check_active
@step(title="sdmux_gpio_get", args=["gpio"])
def get_gpio(self, gpio):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not using the DigitalOutputProtocol here means that we can't make use of the IOs in the client and discoverability is difficult (since the function is named differently)

But the DigitalOutputProtocol requires that the index of the GPIO is set beforehand.

@Bastian-Krause @jluebbe do you have a better idea here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants