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

Add stm32f1 GPIO AF maps #10

Open
Dirbaio opened this issue May 1, 2021 · 2 comments
Open

Add stm32f1 GPIO AF maps #10

Dirbaio opened this issue May 1, 2021 · 2 comments

Comments

@Dirbaio
Copy link
Member

Dirbaio commented May 1, 2021

The F1 GPIO mapping works completely different, by "remapping" all the pins for a peripheral together.

Invent some YAML format to represent that, and extract it from the GPIO XMLs.

@DCNick3
Copy link
Contributor

DCNick3 commented Dec 28, 2021

Copying over from #85:

True... It seems they're all "compatible" in the sense that a given bit is either present or not present, but it never does X in one chip and Y in another chip. It's like the RCC's. In this case what we've done is "merge" all the yamls to obtain a single one with all the bits, that works for all the chips in the family. The merge_regs.py script does this.

#10 is about adding info on the YAMLs about pinouts. Something like "peripehral X with remap=0 uses pins XXX, with remap=1 uses pins YYY". Since it works differently than all the other stm32 families it'll need a new YAML format.

This info is then used in embassy-stm32 to autogenerate the trait implementations to enforce correct pins when creating an UART etc.

@DCNick3
Copy link
Contributor

DCNick3 commented Dec 28, 2021

This seems to be possible, but may require API changes. Because in F1 you can't change pin functions independently, the pin trait bounds like SclPin<T: Instance> would not work as-is, they would rather need to be defined on tuples of pins, not on individual ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants