Add Adafruit Macropad BSP

This commit is contained in:
Andrea Nall 2021-07-25 16:56:30 -05:00 committed by 9names
parent 148cc2b8ea
commit 25cf81fdfe
3 changed files with 83 additions and 0 deletions

View file

@ -5,4 +5,5 @@ members = [
"boards/pico", "boards/pico",
"boards/pico_explorer", "boards/pico_explorer",
"boards/pico_lipo_16mb", "boards/pico_lipo_16mb",
"boards/adafruit_macropad",
] ]

View file

@ -0,0 +1,18 @@
[package]
name = "adafruit_macropad"
version = "0.1.0"
authors = ["Andrea Nall <anall@andreanal.com>"]
edition = "2018"
description = "Board Support Package for the Adafruit Macropad"
license = "MIT OR Apache-2.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
cortex-m = "0.7.2"
rp2040-hal = { path = "../../rp2040-hal", version = "0.1.0" }
cortex-m-rt = { version = "0.6.14", optional = true }
[features]
default = ["rt"]
rt = ["cortex-m-rt","rp2040-hal/rt"]

View file

@ -0,0 +1,64 @@
#![no_std]
pub use rp2040_hal as hal;
#[cfg(feature = "rt")]
extern crate cortex_m_rt;
#[cfg(feature = "rt")]
pub use cortex_m_rt::entry;
pub use hal::pac;
hal::bsp_pins!(
Gpio0 { name: button },
Gpio1 { name: key1 },
Gpio2 { name: key2 },
Gpio3 { name: key3 },
Gpio4 { name: key4 },
Gpio5 { name: key5 },
Gpio6 { name: key6 },
Gpio7 { name: key7 },
Gpio8 { name: key8 },
Gpio9 { name: key9 },
Gpio10 { name: key10 },
Gpio11 { name: key11 },
Gpio12 { name: key12 },
Gpio13 { name: led },
Gpio14 {
name: speaker_shutdown
},
Gpio15 { name: speaker },
Gpio17 {
name: encoder_rota,
aliases: { PullUpInput: RotaryA }
},
Gpio18 {
name: encoder_rotb,
aliases: { PullUpInput: RotaryB }
},
Gpio19 { name: neopixel },
Gpio20 {
name: sda,
aliases: { FunctionI2C: Sda }
},
Gpio21 {
name: scl,
aliases: { FunctionI2C: Scl }
},
// This CS is on the wrong SPI channel so cannot be controlled by the peripheral
Gpio22 { name: oled_cs },
Gpio23 { name: oled_reset },
Gpio24 { name: oled_dc },
Gpio26 {
name: sclk,
aliases: { FunctionSpi: Sclk }
},
Gpio27 {
name: mosi,
aliases: { FunctionSpi: Mosi }
},
Gpio28 {
name: miso,
aliases: { FunctionSpi: Miso }
},
);