-
Notifications
You must be signed in to change notification settings - Fork 212
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
Question about trait CreateErasedPin
being #[doc(hidden)]
#1799
Comments
We are still refining the API for usability and in general there where and will be breaking changes for now. The fact the trait is doc-hidden is definitely to make the docs more readable since most users won't care much about those traits. Currently it's not planned to remove that trait but if we consider another solution as a better option, we might change code there. We usually provide migration guides with every release but in this case (since it's doc-hidden) we probably won't. I don't know enough about your code to suggest alternatives unfortunately - depending on what exactly you are trying to achieve maybe taking |
Thank you for you quick reply!
This definitely answers my question for now. This is just to highlight that moving the esp-hal/examples/src/bin/blinky_erased_pins.rs Lines 40 to 42 in af1febf
This would become something along the lines of (contrived example): fn new_any_input_with_pull_up<P: InputPin + CreateErasedPin>(pin: impl Peripheral<P = P> + 'static) -> AnyInput<'static> {
AnyInput(pin, Pull::Up)
}
let button = new_any_input_with_pull_up(button); Closing as this does not require any action for now, thanks for your help! |
As part of providing a higher-level abstraction, I'm trying to write a function that would internally instantiate a
gpio::AnyInput
. However, its constructor requires the passed peripheral to implementCreateErasedPin
.That trait not being part of
esp-hal
's documentation, as it is marked#[doc(hidden)]
, I was wondering whether that was only to simplify documentation, or whether that was meant to exclude this trait from the SemVer commitment ofesp-hal
.esp-hal/esp-hal/src/gpio/mod.rs
Lines 397 to 400 in 7ea471c
Is it ok to reference this trait in my function's list of bounds (so I am able to call
AnyInput::new()
in it), or could this be broken later by a change ofesp-hal
's API? Or is there a better way of doing this?The text was updated successfully, but these errors were encountered: