Macro microbit::display_pins [−][src]
macro_rules! display_pins {
($p0parts : expr, $p1parts : expr) => { ... };
}
Expand description
Create DisplayPins from a GPIO Parts
Example
use microbit::{
display_pins,
pac,
hal::gpio::{p0::Parts as P0Parts, p1::Parts as P1Parts},
};
// take the peripherals
let p = pac::Peripherals::take().unwrap();
// split off the P0 GPIO port
let p0parts = P0Parts::new(p.P0);
// split off the P1 GPIO port
let p1parts = P1Parts::new(p.P1);
let pins = display_pins!(p0parts, p1parts);