-
Notifications
You must be signed in to change notification settings - Fork 37
Add input buffer enable/disable support. #534
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
base: main
Are you sure you want to change the base?
Add input buffer enable/disable support. #534
Conversation
felipebalbi
left a comment
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.
LGTM, but shouldn't every Output have input buffer disabled?
| } | ||
|
|
||
| /// Set the input buffer state | ||
| /// |
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.
nit: This blank line is not necessary
|
|
|
||
| /// Set the input buffer state | ||
| /// | ||
| pub fn set_input_buffer(&mut self, enable: bool) { |
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.
We can already do this with Sense enabled and disabled state. If we add this API, this would break the typestate.
/// Return a new Flex pin instance with level sensing disabled.
///
/// Consumes less power than a flex pin with sensing enabled.
#[must_use]
pub fn disable_sensing(self) -> Flex<'d, SenseDisabled> {
// Cloning the pin is ok since we consume self immediately
let new_pin = unsafe { self.pin.clone_unchecked() };
drop(self);
Flex::<SenseDisabled>::new(new_pin)
}
when you try to read, grab a |
We could do that. Right now sensing is enforced with typestate. |
Add a new function to set input buffer (enable/disable) for power saving. For Surface products, gpio configured as output pin should has input buffer disabled in deep doze.
