-
Notifications
You must be signed in to change notification settings - Fork 214
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
Ensure the PAC crates are never exposed publicly #2525
Comments
This is annoying because even if we newtyped the RegisterBlock, if third parties try to write a driver using the same I guess if we can live with multiple PACs in the same project, we can "just" expose the address, and make the user convert it to "a" PAC peripheral, but I'm worried this might cause problems. |
I think upstream rust would have a stroke at this comment, this completely eliminates pointer provenance :D. I think this is a use-case we want to support though, SCCB is the perfect example tbh. |
svd2rust does that already, we're casting a random number to a typed pointer in the PACs. |
True, it's no different. I guess it just feels less bad when machine-generated code is doing it 😅. |
Maybe just mark the PAC exposing APIs as unstable indefinitely? I feel like the moment one needs to write a 3rd party driver, they need to touch the PAC, period. Adding to the list of exposed PAC is https://github.com/esp-rs/esp-hal/blob/main/esp-hal/src/pcnt/channel.rs#L12 . (My IDE never seems to do the right thing with this, so I'll be happy to see it refactored) |
I think this issue needs to be expanded, as this is not specific only to the PACs. We additionally re-export |
Just because the list contains a |
I opened #2589. As far as I know, the rt crates aren't exposed in the public API (which is what this issue is tracking), but I agree there are some interactions we need to be aware of with these dependencies. |
The PACs will probably never be 1.0, therefore we need to keep it out of the public API in esp-hal.
This is currently exposed in a few places
interrupt::enable*
takespac::Interrupt
Instance
traits expose* const peripheral::RegisterBlock
esp_hal::peripherals::*
implementDeref
, which deref to the pac typesThe text was updated successfully, but these errors were encountered: