From fa5f950f55e92ac4e6e0fe7ad0d77c9287d807f9 Mon Sep 17 00:00:00 2001 From: Jacob Rosenthal Date: Tue, 8 Dec 2020 22:03:32 -0700 Subject: [PATCH] Description --- boards/pygamer/src/lib.rs | 27 +++++++++++++++++++++++++++ boards/pygamer/src/pins.rs | 4 ++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/boards/pygamer/src/lib.rs b/boards/pygamer/src/lib.rs index f122e5dbbd91..1730ab72bcb5 100644 --- a/boards/pygamer/src/lib.rs +++ b/boards/pygamer/src/lib.rs @@ -1,3 +1,30 @@ +//! `pygamer` is a Board Support Package (BSP) which provides a type-safe API +//! for the Adafruit [Pygamer]. +//! +//! This crate is essentially a thin wrapper for [atsamd-hal], and re-exports it +//! along with some of its members. +//! +//! Instead of interacting with the hal pin numbers [Pins] lets you use +//! descriptive labels printed on the board like d13 or neopixel. +//! ```ignore +//! let mut pins = Pins::new(peripherals.PORT); +//! let mut red_led = pins.d13.into_open_drain_output(&mut pins.port); +//! ``` +//! +//! The `split()` fn goes further and returns a [Sets] struct which you interact +//! with groups of pins like a bus or peripheral and offers an `init()`. +//! ```ignore +//! let mut sets = Pins::new(peripherals.PORT).split(); +//! let timer = SpinTimer::new(4); +//! let mut neopixel = sets.neopixel.init(timer, &mut sets.port); +//! ``` +//! +//! Visit the Adafruit for an overview of [pinout] and available connectors. +//! +//! [Pygamer]: https://www.adafruit.com/product/4242 +//! [atsamd-hal]: https://github.com/atsamd-rs/atsamd +//! [pinout]: https://learn.adafruit.com/adafruit-pygamer + #![no_std] #![recursion_limit = "1024"] diff --git a/boards/pygamer/src/pins.rs b/boards/pygamer/src/pins.rs index d4ce5e723e0e..4bb663957d03 100644 --- a/boards/pygamer/src/pins.rs +++ b/boards/pygamer/src/pins.rs @@ -552,9 +552,9 @@ pub struct Analog { /// Digital pins pub struct Digital { - /// also usabe as A8 + /// also usable as A8 pub d2: Pb3>, - /// also usabe as A9 + /// also usable as A9 pub d3: Pb2>, pub d5: Pa16>, pub d6: Pa18>,