-
Notifications
You must be signed in to change notification settings - Fork 69
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 rcc and gpio docs #117
Conversation
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.
Nice project. Small code examples always help along.
However I'm not so sure about the documentation of the registers in the rcc module.
I was wondering what one gets from reading those.
If I see ahb
being used in code I don't need this explanation (it's already there in the code)
If I'm fairly familiar with the HAL-doc, the headline gives me (almost all) the information I need. If I'm not familiar with the HAL-doc this would help. But then again I'd have to write an explanation like this for every struct in the docs, bloating it with redundant information.
Maybe a small introduction on "how to read the docs" is more efficient?
When building the docs to read it in context I also noticed that the index page is not really welcoming. Maybe improving this could be part of this PR and also a nice place to add said chapter.
The way I tend to read the docs for HALs, and/or how I want people to read them, is to pick some feature they want to use and find a function that accomplishes that. For example, someone wants to toggle a pin so they find the GPIO struct. The docs there tell you to call the In the F1 HAL, which I am much more familiar with, I kept running into the problem of not remembering where A "how to read the docs" section would be nice, but it would require people remembering where each struct comes from. Though perhaps one could link to that section instead of addding a bunch of |
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.
Thanks for your contribution! Just a few minor nits.
I see how the RCC docs are debatable. It would be nice if there was a better way to figure out from looking at the docs how a type can be constructed. And there is the potential issue of the docs becoming bloated and repetitive if we document that everywhere. However, keep in mind that the stm32f3xx-hal is probably the one code base that most embedded Rust beginners interact with very early in their learning curve, since that's what's used by the Discovery book. As such I think it doesn't hurt to err on the side of having "too much" documentation. I would also argue that in general we are pretty far away from having too much documentation ;) As such I welcome this change. |
Doc-Improvments are always much appreciated. I feel the same way, that the repetitive comments in the rcc module feel more like fighting against the limitation of documentation generation. But these additions are rather small and I really appreciate these additions as it is really easy to get lost in the generated documentation. And RCC is the module everyone has to use, when working with this crate, which makes good and comprehensible documentation even more important. |
5d7d6a2
to
e2c3fa5
Compare
Updated with the suggested length changes (though the last line is still quite long because of the URL. For now, I added a link to the examples on this repo at the currently released version. This is what I do in the f1 hal as well, though it's not without flaws:
|
Oops, fixed :) |
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 👍
Rebase needed to retrigger the CI, I guess?
Hey @TheZoq2, there are still two open suggestions, have you seen these? They are pretty nitpicky so I'd be fine with merging as is. Just wanted to make sure you didn't miss them. |
Co-authored-by: Jan Teske <jteske@posteo.net>
I only see one open suggestion which I now fixed, did I miss the other? |
This adds some documentation to the
rcc
andgpio
documentation to make it clear how to aquire instances of their structs. Similar to what the f1 crate already has.I don't have access to an f3 at the moment, so some of this may be wrong ;)