-
Notifications
You must be signed in to change notification settings - Fork 124
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
Rustdoc output would benefit from some top-level docs / some readme suggestions #199
Comments
Yeah, 100% agree there's lots of room for improvement on docs. You can see docs for a particular chip at https://docs.embassy.dev/stm32-metapac, just pick the chip from the top menu. Sadly docs.rs doesn't support building docs multiple times for different features. |
Oh, that link is fantastic. Can I send a PR adding it near the top of the README to ensure that new visitors find it?
Or targets, for that matter! It's a great service but very limited. I'm quite happy to help with the docs, fwiw. I'm rather familiar with the STM32 family and have been looking for an alternate PAC. I would need a couple of pointers for getting started -- in particular, any worked example that shows how you're expecting your APIs to be used would be very helpful, as inferring that from generated code can be difficult. But since I'm bringing up an stm32c011 board and your support seems like the most mature, I'm quite motivated to help. |
Couldn't find an example using a recent version of the crate, so, wrote one by reverse engineering the generated code. Maybe this will help someone else! https://github.com/cbiffle/stm32c0-metapac-example It works (though note that you need a post-0.12 git build of openocd to actually program the part). So far I like your generated APIs quite a bit. The quality of the generated code is similar to, but possibly slightly less compact than, svd2rust-generated equivalents. I'll investigate that further as I port a real application over. Is there an area where you'd be most excited about rustdoc help? |
Hi! This crate looks exciting and at @Dirbaio's suggestion I'm trying to evaluate it for an application. I was about a week away from doing this myself out of frustration with other options, so I'm delighted to see you've already put so much work into it.
I ran into a series of problems trying to evaluate it, and I thought you might want to hear about them / see if there are improvements possible.
The first place I went was https://docs.rs/stm32-metapac/latest/stm32_metapac/ . (Normally when someone suggests "have a look at crate X," docs.rs/X is a good place to start.) I was greeted with a long list of modules with no introductory documentation, no information about what stm32 chip I'm looking at / the docs were generated for, etc. (One advantage of the stm32-rs project's "we're going to squat on every possible stm32 crate name" approach is that it interacts better with docs.rs, since I can pull up the g0 docs or the h7 docs specifically -- even if their use of features means I sometimes can't see the right variant.)
So, I poked down into a few modules for peripherals I'm familiar with, like
flash
andrcc
, and the situation became no clearer. (I would have at this point written it off as a half-finished crate, were it not for Dario's endorsement.)Having had docs.rs issues myself, I figured this was a difficult documentation generation problem, so I came to the repo looking for links to generated docs in the readme, without success. Even the README is focused on being a repository for stm32 data (which is useful! and thank you for organizing it) but gives me no sense of
I think this could be improved by
Finally, when I saw "Register blocks for all peripherals" marked as "work in progress" I would normally have turned around and walked away -- the register blocks for peripherals are basically the whole reason I use a PAC in the first place. But I see this is being used by some projects, so, it might be worth providing something more specific than "work in progress." For instance: are there devices/subfamilies where you're pretty sure the registers are correct and/or complete? Currently I'm going to need to go through and audit all the decisions related to peripheral mapping to my target micros, as I've previously done for the SVDs and giant stack of YAML patches in the other crate I've used, and having a sense of whether the file I'm reading is expected to be correct or a "work in progress" would be very helpful.
Thanks again for putting this together, and I hope this was helpful instead of sounding like a bunch of complaints. I would like something like this approach to succeed!
The text was updated successfully, but these errors were encountered: