[7/N] Obtain LP tokens from GPIO drivers - #6009
Open
bugadani wants to merge 1 commit into
Open
Conversation
bugadani
force-pushed
the
lpio-drivers
branch
2 times, most recently
from
July 31, 2026 14:29
d08fcb1 to
a0d8bfa
Compare
|
New commits in main have made this PR unmergeable. Please resolve the conflicts. |
|
New commits in main have made this PR unmergeable. Please resolve the conflicts. |
bugadani
marked this pull request as ready for review
August 4, 2026 07:55
bugadani
force-pushed
the
lpio-drivers
branch
4 times, most recently
from
August 4, 2026 08:21
064c544 to
a3d816b
Compare
bjoernQ
reviewed
Aug 4, 2026
| phantom: PhantomData<&'d mut ()>, | ||
| } | ||
| /// Tokens to hand out a pin to a low-power CPU. | ||
| // FIXME: tokens should be 'static to be handed out. |
bjoernQ
approved these changes
Aug 4, 2026
This file contains hidden or 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
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.
This approach commits us to fallible methods for LP_IO-specific functionality in the main GPIO drivers. If we do this, we'll also add fallible
.configure_deep_sleep_wakeup()functions in the future.These functions consume the driver instead of reborrowing. Either could work, but it depends whether it is actually safe to have non-static LowPower* types. Currently, I don't believe it is - we hand a pin to the LP core, then it has full unscoped control over it - which means the lifetime on those types is a bug.
Alternatives:
lp_io::Input<'d, LP_PIN_N>etc. This is a huge amount of code to maintain in parallel with the main GPIO driver. This could let us control these pins via the LP IOMUX, where it exists, but that actually has a reduced feature set so I'm not sure HP core firmware wants that.GpioDriver<'d, M = ()>orGpioDriver<'d, LowPowerPin<N>>- if it's semver-legal to introduce. I think this would be confusing UX.Changelog
esp-hal
into_lp*functions togpio::{Input, Output, Flex}drivers.LowPowerInput,LowPowerOutputandLowPowerOutputOpenDrainare no longer available on chips without a supported LP core.