-
Notifications
You must be signed in to change notification settings - Fork 4
Fix Pin Modes #14
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
Fix Pin Modes #14
Conversation
…op level including
* commit 'c7ad6b17885043f18f25b3545453cec6d8c8eae2': Add shorthand constants back to GPIO module and fix example Constants under ESP32 instead of GPIO module
* commit '71d94b41a9f0e071b41356c47e3af78f78a7c5cc': Fix digital write instead of read Define both method styles in C. Alias methods aren't avaialble when top level including Define methods in C as snake case instead of camel case
Should catch original ESP32, S2, S3, C2, C3, C6 and H2 variants
Fixes the following: Pulldown resistor was not being enabled if requested Pull mode wasn't reset to floating if pullup was used and then mode was set again without pullup Makes the following available in mruby: Combined pullup pulldown mode Output open-drain Input-output open-drain
Not all of the channels are connected to pins
* variants: Limit ADCs per chip even though they all define 0..9
Numbers that didn't originate in C (example: defining HIGH as 1 in mruby) can cause the function to do nothing
Can we merge this please? Here's a summary of changes:
Then the 2 breaking changes:
EDIT: Added one more commit.
EDIT2: Once merged, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK 👍 Namespace constants have been reorganized and more constants can now be used. Thanks.
This fixes the following issues:
GPIO_MODE_INPUT_PULLDOWN
could never be set. It was using the same bit in the mask asGPIO_MODE_INPUT_PULLUP
, so either one would set the pullup resistor.GPIO_FLOATING
would not be set ifGPIO::pin_mode
is called first withGPIO_MODE_INPUT_PULLUP
and then later with plainGPIO_MODE_INPUT
. Instead, it would stayGPIO_MODE_INPUT_PULLUP
.This adds the following:
GPIO_MODE_OUTPUT_OD
andGPIO_MODE_INPUT_OUTPUT_OD
.GPIO_MODE_INPUT_PULLUP_PULLDOWN
which enables both pull resistors.Note: Again, this is based on my fork, and would integrate all my previous PRs. Relevant commits are: e57b1df and ce5917d.