-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gpio acitve low and button protocol #1583
Open
pmelange
wants to merge
8
commits into
labgrid-project:master
Choose a base branch
from
pmelange:gpio_acitve_low_and_button_protocol
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Gpio acitve low and button protocol #1583
pmelange
wants to merge
8
commits into
labgrid-project:master
from
pmelange:gpio_acitve_low_and_button_protocol
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A button can be used to simulate pressing a physical button on a device. For example a DigitalOutputButtonDriver can be used when a reset button is connected via a relay to a DigitalOutput. In addition there are the ManualButtonDriver and ExternalButtonDriver drivers analogous to the ManualPowerDriver and ExternalPowerDriver drivers. Operations on a button include "press", "release", "press_for", and "get". Signed-off-by: Perry Melange <[email protected]>
…tput The "invert" method should invert the value of a digital output. Signed-off-by: Perry Melange <[email protected]>
The resources SysfsGPIO, NetworkSysfsGPIO and MatchedSysfsGPIO have been modified to have an additional optional active_low attribute (default False) which can be used to invert the logical value used on the gpio line. Signed-off-by: Perry Melange <[email protected]>
Update the GPIODigitalOutputDriver to also implement the ResetProtocol, PowerProtocol, and ButtonProtocol. Update the GpioDigitalOutput agent to use the new active_low attribute Signed-off-by: Perry Melange <[email protected]>
Signed-off-by: Perry Melange <[email protected]>
Add support for the power and button protocols and add the "invert" method of the io protocol to SysffsGPIO Signed-off-by: Perry Melange <[email protected]>
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]>
Also expand examples to call methods from the Power and Button protocols Signed-off-by: Perry Melange <[email protected]>
4 tasks
This PR is a reduced version of #1569 without the libgpiod code. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
As far as new features go...
ButtonProtocol is to be used in my test environment to control pressing the reset button of DUTs. For many of the DUTs, pressing the reset button when powering on provides (via uboot) a TFTP client or server or simply access to a web socket to be able to upload a new firmware image. A logical button is better for the test environment I am creating since it encapsulates the high/low logic levels of IO ports into something logical.
Extending the GPIO based drivers to the Reset, Power, and Button protocols was very straight forward and I did wonder why the Reset and Power protocols had not jet been implemented. They seem like logical extensions to general purpose IO lines.
Adding the active_low attribute was necessary because the IO lines used in the testbed are connected to relays which are active_low.
All development and testing was done on a raspberry pi 4 with opto-coupler relays connected to the GPIO lines to control power and reset buttons.
Checklist