Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add initializers for peripherals based on numbers #60

Merged
merged 6 commits into from
Dec 2, 2023
Merged

Conversation

chrysn
Copy link
Member

@chrysn chrysn commented Oct 12, 2023

Since RIOT-OS/rust-riot-sys#17 is in, there are riot-sys functions that allow going from device numbers to device types. (That's typically an identity transformation, but we can't know that generally).

This adds a first bout of initializers to wrappers that are based on such numbers.

As a PR, this builds on #34, because practical applications can likely only pull valid input from a match on BOARD (and we really want that const).

ADC is not in because it'll depend on RIOT-OS/rust-riot-sys#34 to do anything sensible.

@chrysn
Copy link
Member Author

chrysn commented Oct 13, 2023

Added a test, along with a commit that illustrates how I think board dependent pins are best handled with the number based initializers. (As long as the boards don't provide a more high-level enumeration of user usable peripherals, that is).

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

Successfully merging this pull request may close these issues.

1 participant