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

Revise GPIO Output drivers #3016

Open
bugadani opened this issue Jan 22, 2025 · 3 comments · May be fixed by #3029
Open

Revise GPIO Output drivers #3016

bugadani opened this issue Jan 22, 2025 · 3 comments · May be fixed by #3029
Labels
Milestone

Comments

@bugadani
Copy link
Contributor

The points to think about:

  • We may not need a separate OutputOpenDrain driver. In fact, for future proofing reasons, we might want to prefer encoding the output mode in the associated configuration.
  • We might want to omit the initial level from the associated configuration, and just pass it to the constructor. Setting the initial level is important to avoid glitches, but during operation the output level is already controlled by the driver. Including it in the configuration would mean either of the following:
    • We have an alternative way of specifying the output level, which is not ideal
    • Or, we would have to ignore a configuration field, which is not ideal
@MabezDev
Copy link
Member

Maybe we can also see if we can make config application completely infallible, might be worth exploring. Looking at the esp-idf gpio API, it seems most (all?) the errors returned are INVALID_ARG where someone passes a pin that doesn't exist in (and maybe where a pin can't go into a specific mode like some inputs on the esp32).

@MabezDev MabezDev added this to the 1.0.0-beta.0 milestone Jan 22, 2025
@Dominaezzz
Copy link
Collaborator

Maybe we can also see if we can make config application completely infallible, might be worth exploring

Yes please, less errors to handle the better. Errors make it more difficult to write robust firmware.

@bugadani bugadani linked a pull request Jan 24, 2025 that will close this issue
@bjoernQ
Copy link
Contributor

bjoernQ commented Jan 24, 2025

We might want to omit the initial level from the associated configuration, and just pass it to the constructor.

I agree - an initial level is special enough to not have it in the config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

4 participants