Skip to content
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

Module dynamic GPIO configuration from pin number change #4

Closed
Wiguwbe opened this issue May 4, 2023 · 2 comments
Closed

Module dynamic GPIO configuration from pin number change #4

Wiguwbe opened this issue May 4, 2023 · 2 comments
Assignees

Comments

@Wiguwbe
Copy link
Collaborator

Wiguwbe commented May 4, 2023

The module, upon receiving a pin number change, should destroy the old configuration and initialize a new one, for the respective LED/GPIO.

DoD: module re-initializes new GPIO configuration after pin change

Blocker: #3

@Wiguwbe
Copy link
Collaborator Author

Wiguwbe commented May 13, 2023

Because of the arbitrary nature of LED's pin selection, allowing for selecting any available number, the module needs to fetch the GPIO through the global number,

So the legacy GPIO interface was used to request/free, while the new interface was used to set the values.

(There may be other ways to do this, that was the fastest found).

Upon a pin change through userspace, the module is able to configure a new GPIO device/pin and free/release the previous one set.

It also allows to undefine the pin number (-1).

For testing purposes, the module initialized the GPIO as HIGH, allowing it to be visualized.

2 LEDs were attached to pins 65 and 66 and the module initialized with 1 LED. The LED's pin was then changed between 65, 66 and -1 and the respective LED was lighted.

(Waiting on final clean build to push changes)

@Wiguwbe
Copy link
Collaborator Author

Wiguwbe commented May 13, 2023

Code pushed in 4654885

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

No branches or pull requests

1 participant