Skip to content
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

Document using peripheral drivers in generic contexts #2706

Open
bugadani opened this issue Dec 9, 2024 · 4 comments
Open

Document using peripheral drivers in generic contexts #2706

bugadani opened this issue Dec 9, 2024 · 4 comments
Labels
1.0-blocker documentation Improvements or additions to documentation

Comments

@bugadani
Copy link
Contributor

bugadani commented Dec 9, 2024

It's not obvious to users what/how they should use to create functions that accept any peripheral singleton of a particular type (e.g. any UART, any SPI). We internally use the Instance traits but we don't intend to stabilize those just yet, so users "can't" use them. We should document the intended solution for both the simple "function takes any peripheral" case, as well as "function takes any peripheral and a compatible DMA channel or other associated resource" case.

@bugadani bugadani added documentation Improvements or additions to documentation 1.0-blocker labels Dec 9, 2024
@github-project-automation github-project-automation bot moved this to Todo in esp-rs Dec 9, 2024
@MabezDev
Copy link
Member

MabezDev commented Dec 9, 2024

Won't the Instance traits still be public? We'll need them for our constructors, so I think end users can still use the Instance trait bounds. Regardless though, as you mentioned we should document a few cases demonstrating this.

@MabezDev
Copy link
Member

Where do you think this content belongs? In the book, or in the API docs somewhere?

@bugadani
Copy link
Contributor Author

We should maybe have a "Concepts" chapter in the book for this and related how-tos.

@bjoernQ
Copy link
Contributor

bjoernQ commented Jan 20, 2025

We should maybe have a "Concepts" chapter in the book for this and related how-tos.

Sounds good but on the other hand explaining things in module level / crate level docs would limit the number of documents a user needs to look at? e.g. the stdlib explains a few advanced concepts in module level docs (e.g. https://doc.rust-lang.org/std/ptr/index.html#provenance )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.0-blocker documentation Improvements or additions to documentation
Projects
Status: Todo
Development

No branches or pull requests

3 participants