mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2024-12-23 20:51:31 +11:00
Add Adafruit Macropad BSP
This commit is contained in:
parent
148cc2b8ea
commit
25cf81fdfe
|
@ -5,4 +5,5 @@ members = [
|
|||
"boards/pico",
|
||||
"boards/pico_explorer",
|
||||
"boards/pico_lipo_16mb",
|
||||
"boards/adafruit_macropad",
|
||||
]
|
||||
|
|
18
boards/adafruit_macropad/Cargo.toml
Normal file
18
boards/adafruit_macropad/Cargo.toml
Normal 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"]
|
64
boards/adafruit_macropad/src/lib.rs
Normal file
64
boards/adafruit_macropad/src/lib.rs
Normal 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 }
|
||||
},
|
||||
);
|
Loading…
Reference in a new issue