-
Notifications
You must be signed in to change notification settings - Fork 242
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
Improve Spi device/peripheral docs #699
Conversation
Very nice docs, thanks a lot! |
rp2040-hal/src/spi.rs
Outdated
//! let spi_device = peripherals.SPI0; | ||
//! let spi_pin_layout = (mosi, sclk); | ||
//! | ||
//! let spi = Spi::new(spi_device, spi_pin_layout) |
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.
This still fails to compile:
help: consider giving `spi` an explicit type, where the value of const parameter `DS` is specified
That's a little bit unfortunate, as the type annotation clutters the code. Any suggestion on how to express this in a more readable way would be welcome!
//! let spi = Spi::new(spi_device, spi_pin_layout) | |
//! let spi = Spi::<_, _, _, 8>::new(spi_device, spi_pin_layout) |
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.
I made fu5ha#1 on top of this which is unfortunately a breaking change but would improve the type inference ergonomics for this. It's a bit unfortunate Rust can't infer the type default as-is, but yeah.
Don't worry about the CI error in "Verify build on MSRV". That's known, not caused by this change, and already fixed in #698. |
#698 is now merged, so this just needs a rebase to fix that test, right? |
e152738
to
2af733e
Compare
Documents the types of the
Spi
struct and brushes up a few other docs.