nrf-rs / microbit

A Rust crate for BBC micro:bit development
BSD Zero Clause License
276 stars 61 forks source link

export all peripherals #132

Closed hackaugusto closed 7 months ago

hackaugusto commented 9 months ago

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.

qwandor commented 8 months ago

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

BartMassey commented 8 months ago

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

hackaugusto commented 8 months ago

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?