[][src]Crate rmicrobit

A library for working with the micro:bit.

Features

This crate currently provides:

  • Support for the 5×5 LED display (see display)
  • A library for working with 5×5 images (see graphics)
  • Support for the hardware buttons (see buttons)

Getting started

See How to use rmicrobit.

Examples

There are a number of example programs in the examples directory. You can run an example as follows:

cargo run --example scroll_text -- -x microbit.gdb

examples/demo demonstrates all the features of this crate, using the cortex-m-rtfm framework.

Tests

There are a few tests which can be run on the host machine. Run them as follows (from a checked-out working copy of rmicrobit):

cargo test --lib --target x86_64-unknown-linux-gnu

(or substitute your development machine's native target)

Re-exports

The following dependencies are re-exported under rmicrobit::, so that crates using this library can be sure to be using consistent versions:

  • nrf51 (register-level access to the SoC peripherals)
  • nrf51_hal (higher-level access to the SoC peripherals)
  • embedded_hal (traits used by some nrf51_hal interfaces)

In particular, if you use cortex-m-rtfm, use rmicrobit::nrf51 as the device parameter to #[app].

Re-exports

pub use embedded_hal;
pub use nrf51_hal;
pub use nrf51_hal::nrf51;

Modules

_doc_setup

How to use rmicrobit.

buttons

Support for hardware buttons.

display

Support for the 5×5 LED display.

gpio

Support for the GPIO peripheral.

graphics

Graphics for rendering on the 5×5 LED display.

prelude

Traits intended to be globally imported.