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

export all peripherals #132

Merged

Conversation

hackaugusto
Copy link
Contributor

My motivation for this was to use the SPI. I'm not sure if the idea was not to export all peripherals just to keep the API clean (or for some other reason), so fell free to close the PR if this doesn't fit the crate's goals.

Copy link
Member

@BartMassey BartMassey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think some of these peripherals are "legacy" and are included for back-compatibility: better alternatives are available. Examples are UART (vs UARTE), TWI (vs TWIM), SPI (vs SPIM). While we should still definitely import these, it would be nice to mark this somehow (probably in the doc comment) to avoid very minor footguns.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to do the same with src/v1 just for old times' sake? Not sure how many of these peripherals are supported on the nRF51 but it would be easy to look up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the the peripherals to v1 too 👍

@qwandor
Copy link
Member

qwandor commented Mar 6, 2024

Are all of these peripherals actually usable on the microbit, i.e. connected to something electrically?

@BartMassey
Copy link
Member

@qwandor Quickly inventorying, they are. Several are internal and the rest are configurable to arbitrary GPIO pins.

@hackaugusto hackaugusto force-pushed the hacka-add-all-peripherals-to-board branch 2 times, most recently from 104304c to 4a25bd5 Compare March 13, 2024 16:34
@hackaugusto
Copy link
Contributor Author

I think some of these peripherals are "legacy" and are included for back-compatibility: better alternatives are available. Examples are UART (vs UARTE), TWI (vs TWIM), SPI (vs SPIM). While we should still definitely import these, it would be nice to mark this somehow (probably in the doc comment) to avoid very minor footguns.

I'm not sure which peripherals are considered legacy, should I only add comments for the ones you mentioned?

@hackaugusto hackaugusto force-pushed the hacka-add-all-peripherals-to-board branch from 4a25bd5 to f1184c0 Compare March 13, 2024 16:36
@qwandor qwandor added this pull request to the merge queue Apr 9, 2024
Merged via the queue into nrf-rs:main with commit 7535308 Apr 9, 2024
9 checks passed
@hackaugusto hackaugusto deleted the hacka-add-all-peripherals-to-board branch April 9, 2024 16:04
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.

3 participants