[][src]Module rmicrobit::gpio

Support for the GPIO peripheral.

The types in this module provide structured access to the micro:bit's GPIO pins, organised in functional groups.

This system supports working with different devices without having to manage a shared reference to the single GPIO peripheral.

The structs don't hold any data at runtime; they exist to manage ownership of the pins.

Use GPIO.split_by_kind() to retrieve one instance of each XxxPins type.

Example

use rmicrobit::prelude::*;
use rmicrobit::gpio::PinsByKind;
let p: nrf51::Peripherals = _;
let PinsByKind {display_pins, button_pins, ..} = p.GPIO.split_by_kind();

Structs

ButtonPins

The GPIO pins connected to the micro:bit's user buttons.

DisplayPins

The GPIO pins connected to the micro:bit's LED display.

EdgeConnectorPins

The GPIO pins available on the edge connector and not otherwise connected.

I2cPins

The GPIO pins used for the micro:bit's I2C interface.

OtherPins

The remaining GPIO pins.

PinsByKind

The micro:bit's GPIO pins, organised in functional groups.

SerialPins

The GPIO pins connected to the micro:bit's USB serial port.

Traits

MicrobitGpioExt

Extension trait to split the GPIO peripheral into functional groups.