-
Notifications
You must be signed in to change notification settings - Fork 22
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
alt functions on pins #20
Comments
As far as I am aware, non of the board pages show the alternative functions of any of the pins, except for maybe the debug headers. I am currently working on is building the board pages from a JSON file instead of the markdown files. Take a look at the refactor-boards-pages branch for a proof of concept. Information like this could be added to the device JSON files on that branch. Do you feel like helping out with adding this information when the new JSON format is more definitive? If you do, I can provide you with more information on how I think that kind of information could be added. |
doing JSON seem like a cool idea ;)
one thing though is there a way that the collation / substitutions is done by github itself? |
Github pages is based on Jekyll. Jekyll is capable of using JSON and some other formats as data sources. Combine this with templates, and the board pages can be generated. Lookups shouldn't be too big of a problem. When generating the page, the pin name is known, for example
When a commit is pushed to a Github pages repository, Github runs something like |
thanks, i'd check out Jekyll ! :) |
I have converted some board pages to the new format. They are now based on JSON files. If you still feel up to it, you can use this to experiment with adding the alternative functions for microcontroller pins. |
thanks ! i'd take a look, at the moment got caught out with the daily grind so i may defer this. |
i got Jekyll running, and i noted a thing, in the json file the function is made on a per board per pin basis. while this should be ok, it would lead to quite a lot of duplications across boards e.g. all the stm32f103 PA1 will actually have the same alternate functions. would you prefer to continue with this or would you prefer 'macros'? (which i do not know how to do as i barely got ruby and jekyll running). another way though is that we can start with this brute force approach, i.e. specify the alt function per board per pin and make do with the dups and may be refactor the programming later. of course one of the considerations is that normally a PAxx gpio would have a set of alt functions assignments. But not all pins are gpios and hence won't have alt functions. |
i made a PR for Blue Pill STM32F103C8 added the alt functions |
As an answer to your comment before the PR: I already thought of an approach for this. I am sure that we do not want to go the brute force way. That will indeed lead to too much duplication and cleaning that up will take a lot of work. I want to expand on the existing JSON files in the I want to expand those files to include a mapping from the pin number ( I imagine something like this:
|
this is cool ;) |
Yeah, this will take some time. I will try to look into this the coming week. One thing I want to work out first is how I can prevent duplication between some devices. When that's sorted, making changes to the template isn't even that hard. Having this information will probably be valuable in the future too. It will, for example, make it possible to create a feature which highlights all pins that are related to SPI or more specific SPI1. It may also help in creating a separate page for each device, regardless of its board. So many ideas, so little time... |
Oh, and by the way, can you please split out those changes you made to the STM32F401 black pill page in a separate PR so that we can merge those improvements separately? |
hi, i've actually removed the image so that it isn't included. it is included accidentally. i've made a 3rd commit in the same PR which removes the image in the same pr so that what is left in the pr is just the changes for stm32f103c8 Blue Pill alt functions. |
I've pushed a branch with a proof of concept implementation of automatically mapping pin names to their alternate functions. Needs some more refinement, but this is how I would like to do it. |
i think it is a good start, but i'd guess there would be more works on the boards part and some programming to substitute alternate functions where they are relevant. i'd not be pushing any further changes as i'd think it is better for you to make the design decisions and programming. |
it seemed most of the boards do not show the alt functions on pins, i'd think showing the alt functions would be really helpful
The text was updated successfully, but these errors were encountered: