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

alternate pin function enums #431

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

alternate pin function enums #431

wants to merge 17 commits into from

Conversation

burrbull
Copy link
Member

No description provided.

@burrbull burrbull force-pushed the alt branch 3 times, most recently from 7c42080 to 57a03a5 Compare April 17, 2023 04:46
@burrbull burrbull force-pushed the alt branch 3 times, most recently from 0cfbb9a to 6e71ac9 Compare April 17, 2023 16:24
@burrbull burrbull marked this pull request as ready for review April 17, 2023 18:49
@burrbull
Copy link
Member Author

@richardeoin Is there other reason for new_unchecked except of possibility to release?

New API allows you to keep pins inside structure without advanced <PINS> generic (at least for simple cases). See:
https://github.com/stm32-rs/stm32f4xx-hal/blob/557b7f2de9963ef2cbe11b554d1eab7894b9a007/src/i2c.rs#L71-L74

@richardeoin
Copy link
Member

The new_unchecked methods are also useful for using a peripheral without encoding its GPIOs in the type system. In some situations the code and effort required to state the type of all GPIOs is excessive, so the new_unchecked methods are a useful escape hatch. For example to setup the GPIOs in main(), and setup a peripheral in my_func() without passing GPIOs as arguments to my_func(). With this PR there is less need for the new_unchecked methods, but I would rather keep them available for now.

Overall this PR is quite a nice usability improvement. I would like to play with it some more, but in general looks good! :)

@burrbull

This comment was marked as outdated.

@burrbull
Copy link
Member Author

burrbull commented Jul 1, 2023

rebased

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 this pull request may close these issues.

2 participants