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

GPIO GPIO_CTRL registers field funcsel all have the same options #22

Closed
hmvp opened this issue Jun 30, 2021 · 2 comments · Fixed by #49
Closed

GPIO GPIO_CTRL registers field funcsel all have the same options #22

hmvp opened this issue Jun 30, 2021 · 2 comments · Fixed by #49
Assignees

Comments

@hmvp
Copy link
Contributor

hmvp commented Jun 30, 2021

According to 2.19.2 from the datasheet each pin has its own set of functions. This crate generates set functions for each function but each pin seems to have the same set of set functions (which seem to match gpio pin 0)

I expect to be able to do something like:

    p.IO_BANK0.gpio[16].gpio_ctrl.modify(|_,w|w.funcsel().spi0_rx());
    p.IO_BANK0.gpio[17].gpio_ctrl.modify(|_,w|w.funcsel().spi0_csn());
    p.IO_BANK0.gpio[18].gpio_ctrl.modify(|_,w|w.funcsel().spi0_sck());
    p.IO_BANK0.gpio[19].gpio_ctrl.modify(|_,w|w.funcsel().spi0_tx());

but all pins only have spi0_rx() for spi0 functions (which is wrong)

@anall
Copy link
Contributor

anall commented Jul 1, 2021

This is just an artifact of clustering them. These should probably just be renamed to spi to remove specific meaning (while the specific pin is still restricted to spi0_rx or whatever)

@hmvp
Copy link
Contributor Author

hmvp commented Jul 1, 2021

Ah yes the underlying bits will stay the same indeed.. Its a bit unfortunate that you lose the information about which spi is on that pin or if its an RX or TX pin, but I guess I need to add that myself with a comment...

Maybe it could be added to the doc string for that function so you see what is what without needing the datasheet..

@jonathanpallant jonathanpallant self-assigned this Dec 10, 2021
jonathanpallant added a commit that referenced this issue Dec 10, 2021
jonathanpallant added a commit that referenced this issue Dec 10, 2021
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

Successfully merging a pull request may close this issue.

3 participants