From 8f0a2788eb05813f61c38eb502fc88b5bba749b7 Mon Sep 17 00:00:00 2001 From: "Jonathan Pallant (Ferrous Systems)" Date: Thu, 23 Dec 2021 11:18:52 +0000 Subject: [PATCH] Renamed pico to rp-pico. --- Cargo.toml | 6 +++--- boards/{pico => rp-pico}/.gitignore | 0 boards/{pico => rp-pico}/CHANGELOG.md | 4 ++-- boards/{pico => rp-pico}/Cargo.toml | 2 +- boards/{pico => rp-pico}/README.md | 12 ++++++------ boards/{pico => rp-pico}/examples/pico_blinky.rs | 10 +++++----- .../examples/pico_countdown_blinky.rs | 8 ++++---- .../{pico => rp-pico}/examples/pico_gpio_in_out.rs | 6 +++--- boards/{pico => rp-pico}/examples/pico_i2c_pio.rs | 10 +++++----- boards/{pico => rp-pico}/examples/pico_pwm_blink.rs | 10 +++++----- boards/{pico => rp-pico}/examples/pico_rtic.rs | 6 +++--- boards/{pico => rp-pico}/examples/pico_usb_serial.rs | 6 +++--- .../examples/pico_usb_serial_interrupt.rs | 12 ++++++------ .../examples/pico_usb_twitchy_mouse.rs | 10 +++++----- boards/{pico => rp-pico}/src/lib.rs | 0 15 files changed, 51 insertions(+), 51 deletions(-) rename boards/{pico => rp-pico}/.gitignore (100%) rename boards/{pico => rp-pico}/CHANGELOG.md (70%) rename boards/{pico => rp-pico}/Cargo.toml (98%) rename boards/{pico => rp-pico}/README.md (92%) rename boards/{pico => rp-pico}/examples/pico_blinky.rs (94%) rename boards/{pico => rp-pico}/examples/pico_countdown_blinky.rs (95%) rename boards/{pico => rp-pico}/examples/pico_gpio_in_out.rs (96%) rename boards/{pico => rp-pico}/examples/pico_i2c_pio.rs (96%) rename boards/{pico => rp-pico}/examples/pico_pwm_blink.rs (95%) rename boards/{pico => rp-pico}/examples/pico_rtic.rs (94%) rename boards/{pico => rp-pico}/examples/pico_usb_serial.rs (98%) rename boards/{pico => rp-pico}/examples/pico_usb_serial_interrupt.rs (97%) rename boards/{pico => rp-pico}/examples/pico_usb_twitchy_mouse.rs (97%) rename boards/{pico => rp-pico}/src/lib.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index 670ef91..721b9ef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,13 +3,13 @@ resolver = "2" members = [ "rp2040-hal", "boards/adafruit-feather-rp2040", - "boards/adafruit-qt-py-rp2040", "boards/adafruit-itsy-bitsy-rp2040", "boards/adafruit-kb2040", - "boards/pico", + "boards/adafruit-macropad", + "boards/adafruit-qt-py-rp2040", "boards/pimoroni-pico-explorer", "boards/pimoroni-pico-lipo-16mb", - "boards/adafruit-macropad", + "boards/rp-pico", "boards/sparkfun-pro-micro-rp2040", ] diff --git a/boards/pico/.gitignore b/boards/rp-pico/.gitignore similarity index 100% rename from boards/pico/.gitignore rename to boards/rp-pico/.gitignore diff --git a/boards/pico/CHANGELOG.md b/boards/rp-pico/CHANGELOG.md similarity index 70% rename from boards/pico/CHANGELOG.md rename to boards/rp-pico/CHANGELOG.md index 21c6bcf..0da06f8 100644 --- a/boards/pico/CHANGELOG.md +++ b/boards/rp-pico/CHANGELOG.md @@ -19,5 +19,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial release -[Unreleased]: https://github.com/rp-rs/rp-hal/compare/pico-v0.1.0...HEAD -[0.1.0]: https://github.com/rp-rs/rp-hal/releases/tag/pico-v0.1.0 +[Unreleased]: https://github.com/rp-rs/rp-hal/compare/rp-pico-v0.1.0...HEAD +[0.1.0]: https://github.com/rp-rs/rp-hal/releases/tag/rp-pico-v0.1.0 diff --git a/boards/pico/Cargo.toml b/boards/rp-pico/Cargo.toml similarity index 98% rename from boards/pico/Cargo.toml rename to boards/rp-pico/Cargo.toml index 0a9c60a..12a4e95 100644 --- a/boards/pico/Cargo.toml +++ b/boards/rp-pico/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "pico" +name = "rp-pico" version = "0.1.0" authors = ["evan "] edition = "2018" diff --git a/boards/pico/README.md b/boards/rp-pico/README.md similarity index 92% rename from boards/pico/README.md rename to boards/rp-pico/README.md index 72c9003..6edf57d 100644 --- a/boards/pico/README.md +++ b/boards/rp-pico/README.md @@ -1,4 +1,4 @@ -# [pico] - Board Support for the [Raspberry Pi Pico] +# [rp-pico] - Board Support for the [Raspberry Pi Pico] You should include this crate if you are writing code that you want to run on a [Raspberry Pi Pico] - the original launch PCB for the RP2040 chip. @@ -7,7 +7,7 @@ This crate includes the [rp2040-hal], but also configures each pin of the RP2040 chip according to how it is connected up on the Pico. [Raspberry Pi Pico]: https://www.raspberrypi.org/products/raspberry-pi-pico/ -[pico]: https://github.com/rp-rs/rp-hal/tree/main/boards/pico +[rp-pico]: https://github.com/rp-rs/rp-hal/tree/main/boards/rp-pico [rp2040-hal]: https://github.com/rp-rs/rp-hal/tree/main/rp2040-hal [Raspberry Silicon RP2040]: https://www.raspberrypi.org/products/rp2040/ @@ -16,10 +16,10 @@ RP2040 chip according to how it is connected up on the Pico. To use this crate, your `Cargo.toml` file should contain: ```toml -pico = "0.1.0" +rp-pico = "0.1.0" ``` -In your program, you will need to call `pico::Pins::new` to create +In your program, you will need to call `rp_pico::Pins::new` to create a new `Pins` structure. This will set up all the GPIOs for any on-board devices. See the [examples](./examples) folder for more details. @@ -30,7 +30,7 @@ devices. See the [examples](./examples) folder for more details. To compile an example, clone the _rp-hal_ repository and run: ```console -rp-hal/boards/pico $ cargo build --release --example +rp-hal/boards/rp-pico $ cargo build --release --example ``` You will get an ELF file called @@ -44,7 +44,7 @@ USB drive exported by the RP2040 bootloader, simply boot your board into bootloader mode and run: ```console -rp-hal/boards/pico $ cargo run --release --example +rp-hal/boards/rp-pico $ cargo run --release --example ``` If you get an error about not being able to find `elf2uf2-rs`, try: diff --git a/boards/pico/examples/pico_blinky.rs b/boards/rp-pico/examples/pico_blinky.rs similarity index 94% rename from boards/pico/examples/pico_blinky.rs rename to boards/rp-pico/examples/pico_blinky.rs index f6bf340..87c2b34 100644 --- a/boards/pico/examples/pico_blinky.rs +++ b/boards/rp-pico/examples/pico_blinky.rs @@ -24,15 +24,15 @@ use embedded_time::rate::*; use panic_halt as _; // Pull in any important traits -use pico::hal::prelude::*; +use rp_pico::hal::prelude::*; // A shorter alias for the Peripheral Access Crate, which provides low-level // register access -use pico::hal::pac; +use rp_pico::hal::pac; // A shorter alias for the Hardware Abstraction Layer, which provides // higher-level drivers. -use pico::hal; +use rp_pico::hal; /// Entry point to our bare-metal application. /// @@ -54,7 +54,7 @@ fn main() -> ! { // // The default is to generate a 125 MHz system clock let clocks = hal::clocks::init_clocks_and_plls( - pico::XOSC_CRYSTAL_FREQ, + rp_pico::XOSC_CRYSTAL_FREQ, pac.XOSC, pac.CLOCKS, pac.PLL_SYS, @@ -73,7 +73,7 @@ fn main() -> ! { let sio = hal::Sio::new(pac.SIO); // Set the pins up according to their function on this particular board - let pins = pico::Pins::new( + let pins = rp_pico::Pins::new( pac.IO_BANK0, pac.PADS_BANK0, sio.gpio_bank0, diff --git a/boards/pico/examples/pico_countdown_blinky.rs b/boards/rp-pico/examples/pico_countdown_blinky.rs similarity index 95% rename from boards/pico/examples/pico_countdown_blinky.rs rename to boards/rp-pico/examples/pico_countdown_blinky.rs index 50bb1ce..15a79dd 100644 --- a/boards/pico/examples/pico_countdown_blinky.rs +++ b/boards/rp-pico/examples/pico_countdown_blinky.rs @@ -27,11 +27,11 @@ use panic_halt as _; // A shorter alias for the Peripheral Access Crate, which provides low-level // register access -use pico::hal::pac; +use rp_pico::hal::pac; // A shorter alias for the Hardware Abstraction Layer, which provides // higher-level drivers. -use pico::hal; +use rp_pico::hal; #[entry] fn main() -> ! { @@ -45,7 +45,7 @@ fn main() -> ! { // // The default is to generate a 125 MHz system clock let _clocks = hal::clocks::init_clocks_and_plls( - pico::XOSC_CRYSTAL_FREQ, + rp_pico::XOSC_CRYSTAL_FREQ, pac.XOSC, pac.CLOCKS, pac.PLL_SYS, @@ -64,7 +64,7 @@ fn main() -> ! { let sio = hal::Sio::new(pac.SIO); // Set the pins up according to their function on this particular board - let pins = pico::Pins::new( + let pins = rp_pico::Pins::new( pac.IO_BANK0, pac.PADS_BANK0, sio.gpio_bank0, diff --git a/boards/pico/examples/pico_gpio_in_out.rs b/boards/rp-pico/examples/pico_gpio_in_out.rs similarity index 96% rename from boards/pico/examples/pico_gpio_in_out.rs rename to boards/rp-pico/examples/pico_gpio_in_out.rs index dfe15d3..fce0686 100644 --- a/boards/pico/examples/pico_gpio_in_out.rs +++ b/boards/rp-pico/examples/pico_gpio_in_out.rs @@ -24,11 +24,11 @@ use panic_halt as _; // A shorter alias for the Peripheral Access Crate, which provides low-level // register access -use pico::hal::pac; +use rp_pico::hal::pac; // A shorter alias for the Hardware Abstraction Layer, which provides // higher-level drivers. -use pico::hal; +use rp_pico::hal; /// Entry point to our bare-metal application. /// @@ -49,7 +49,7 @@ fn main() -> ! { let sio = hal::Sio::new(pac.SIO); // Set the pins up according to their function on this particular board - let pins = pico::Pins::new( + let pins = rp_pico::Pins::new( pac.IO_BANK0, pac.PADS_BANK0, sio.gpio_bank0, diff --git a/boards/pico/examples/pico_i2c_pio.rs b/boards/rp-pico/examples/pico_i2c_pio.rs similarity index 96% rename from boards/pico/examples/pico_i2c_pio.rs rename to boards/rp-pico/examples/pico_i2c_pio.rs index 8eccbb4..6d350ee 100644 --- a/boards/pico/examples/pico_i2c_pio.rs +++ b/boards/rp-pico/examples/pico_i2c_pio.rs @@ -28,15 +28,15 @@ use embedded_time::rate::*; use panic_halt as _; // Pull in any important traits -use pico::hal::prelude::*; +use rp_pico::hal::prelude::*; // A shorter alias for the Peripheral Access Crate, which provides low-level // register access -use pico::hal::pac; +use rp_pico::hal::pac; // A shorter alias for the Hardware Abstraction Layer, which provides // higher-level drivers. -use pico::hal; +use rp_pico::hal; /// Prints the temperature received from the sensor fn print_temperature(serial: &mut impl FmtWrite, temp: [u8; 2]) { @@ -66,7 +66,7 @@ fn main() -> ! { // // The default is to generate a 125 MHz system clock let clocks = hal::clocks::init_clocks_and_plls( - pico::XOSC_CRYSTAL_FREQ, + rp_pico::XOSC_CRYSTAL_FREQ, pac.XOSC, pac.CLOCKS, pac.PLL_SYS, @@ -81,7 +81,7 @@ fn main() -> ! { let sio = hal::Sio::new(pac.SIO); // Set the pins up according to their function on this particular board - let pins = pico::Pins::new( + let pins = rp_pico::Pins::new( pac.IO_BANK0, pac.PADS_BANK0, sio.gpio_bank0, diff --git a/boards/pico/examples/pico_pwm_blink.rs b/boards/rp-pico/examples/pico_pwm_blink.rs similarity index 95% rename from boards/pico/examples/pico_pwm_blink.rs rename to boards/rp-pico/examples/pico_pwm_blink.rs index 2632a8e..5a0a986 100644 --- a/boards/pico/examples/pico_pwm_blink.rs +++ b/boards/rp-pico/examples/pico_pwm_blink.rs @@ -24,15 +24,15 @@ use embedded_time::rate::*; use panic_halt as _; // Pull in any important traits -use pico::hal::prelude::*; +use rp_pico::hal::prelude::*; // A shorter alias for the Peripheral Access Crate, which provides low-level // register access -use pico::hal::pac; +use rp_pico::hal::pac; // A shorter alias for the Hardware Abstraction Layer, which provides // higher-level drivers. -use pico::hal; +use rp_pico::hal; // The minimum PWM value (i.e. LED brightness) we want const LOW: u16 = 0; @@ -60,7 +60,7 @@ fn main() -> ! { // // The default is to generate a 125 MHz system clock let clocks = hal::clocks::init_clocks_and_plls( - pico::XOSC_CRYSTAL_FREQ, + rp_pico::XOSC_CRYSTAL_FREQ, pac.XOSC, pac.CLOCKS, pac.PLL_SYS, @@ -75,7 +75,7 @@ fn main() -> ! { let sio = hal::Sio::new(pac.SIO); // Set the pins up according to their function on this particular board - let pins = pico::Pins::new( + let pins = rp_pico::Pins::new( pac.IO_BANK0, pac.PADS_BANK0, sio.gpio_bank0, diff --git a/boards/pico/examples/pico_rtic.rs b/boards/rp-pico/examples/pico_rtic.rs similarity index 94% rename from boards/pico/examples/pico_rtic.rs rename to boards/rp-pico/examples/pico_rtic.rs index 0cf61f2..83f172d 100644 --- a/boards/pico/examples/pico_rtic.rs +++ b/boards/rp-pico/examples/pico_rtic.rs @@ -3,12 +3,12 @@ use panic_halt as _; -#[rtic::app(device = pico::hal::pac, peripherals = true)] +#[rtic::app(device = rp_pico::hal::pac, peripherals = true)] mod app { use embedded_hal::digital::v2::OutputPin; use embedded_time::duration::Extensions; - use pico::{ + use rp_pico::{ hal::{self, clocks::init_clocks_and_plls, watchdog::Watchdog, Sio}, XOSC_CRYSTAL_FREQ, }; @@ -42,7 +42,7 @@ mod app { .unwrap(); let sio = Sio::new(c.device.SIO); - let pins = pico::Pins::new( + let pins = rp_pico::Pins::new( c.device.IO_BANK0, c.device.PADS_BANK0, sio.gpio_bank0, diff --git a/boards/pico/examples/pico_usb_serial.rs b/boards/rp-pico/examples/pico_usb_serial.rs similarity index 98% rename from boards/pico/examples/pico_usb_serial.rs rename to boards/rp-pico/examples/pico_usb_serial.rs index 5f745c6..b28dba2 100644 --- a/boards/pico/examples/pico_usb_serial.rs +++ b/boards/rp-pico/examples/pico_usb_serial.rs @@ -21,11 +21,11 @@ use panic_halt as _; // A shorter alias for the Peripheral Access Crate, which provides low-level // register access -use pico::hal::pac; +use rp_pico::hal::pac; // A shorter alias for the Hardware Abstraction Layer, which provides // higher-level drivers. -use pico::hal; +use rp_pico::hal; // USB Device support use usb_device::{class_prelude::*, prelude::*}; @@ -52,7 +52,7 @@ fn main() -> ! { // // The default is to generate a 125 MHz system clock let clocks = hal::clocks::init_clocks_and_plls( - pico::XOSC_CRYSTAL_FREQ, + rp_pico::XOSC_CRYSTAL_FREQ, pac.XOSC, pac.CLOCKS, pac.PLL_SYS, diff --git a/boards/pico/examples/pico_usb_serial_interrupt.rs b/boards/rp-pico/examples/pico_usb_serial_interrupt.rs similarity index 97% rename from boards/pico/examples/pico_usb_serial_interrupt.rs rename to boards/rp-pico/examples/pico_usb_serial_interrupt.rs index 016a660..d7e38e5 100644 --- a/boards/pico/examples/pico_usb_serial_interrupt.rs +++ b/boards/rp-pico/examples/pico_usb_serial_interrupt.rs @@ -16,7 +16,7 @@ use cortex_m_rt::entry; // The macro for marking our interrupt functions -use pico::hal::pac::interrupt; +use rp_pico::hal::pac::interrupt; // GPIO traits use embedded_hal::digital::v2::OutputPin; @@ -29,15 +29,15 @@ use embedded_time::rate::*; use panic_halt as _; // Pull in any important traits -use pico::hal::prelude::*; +use rp_pico::hal::prelude::*; // A shorter alias for the Peripheral Access Crate, which provides low-level // register access -use pico::hal::pac; +use rp_pico::hal::pac; // A shorter alias for the Hardware Abstraction Layer, which provides // higher-level drivers. -use pico::hal; +use rp_pico::hal; // USB Device support use usb_device::{class_prelude::*, prelude::*}; @@ -74,7 +74,7 @@ fn main() -> ! { // // The default is to generate a 125 MHz system clock let clocks = hal::clocks::init_clocks_and_plls( - pico::XOSC_CRYSTAL_FREQ, + rp_pico::XOSC_CRYSTAL_FREQ, pac.XOSC, pac.CLOCKS, pac.PLL_SYS, @@ -137,7 +137,7 @@ fn main() -> ! { let sio = hal::Sio::new(pac.SIO); // Set the pins up according to their function on this particular board - let pins = pico::Pins::new( + let pins = rp_pico::Pins::new( pac.IO_BANK0, pac.PADS_BANK0, sio.gpio_bank0, diff --git a/boards/pico/examples/pico_usb_twitchy_mouse.rs b/boards/rp-pico/examples/pico_usb_twitchy_mouse.rs similarity index 97% rename from boards/pico/examples/pico_usb_twitchy_mouse.rs rename to boards/rp-pico/examples/pico_usb_twitchy_mouse.rs index cb2a659..09818b9 100644 --- a/boards/pico/examples/pico_usb_twitchy_mouse.rs +++ b/boards/rp-pico/examples/pico_usb_twitchy_mouse.rs @@ -18,7 +18,7 @@ use cortex_m_rt::entry; // The macro for marking our interrupt functions -use pico::hal::pac::interrupt; +use rp_pico::hal::pac::interrupt; // Ensure we halt the program on panic (if we don't mention this crate it won't // be linked) @@ -26,15 +26,15 @@ use panic_halt as _; // Pull in any important traits use embedded_time::fixed_point::FixedPoint; -use pico::hal::prelude::*; +use rp_pico::hal::prelude::*; // A shorter alias for the Peripheral Access Crate, which provides low-level // register access -use pico::hal::pac; +use rp_pico::hal::pac; // A shorter alias for the Hardware Abstraction Layer, which provides // higher-level drivers. -use pico::hal; +use rp_pico::hal; // USB Device support use usb_device::{class_prelude::*, prelude::*}; @@ -72,7 +72,7 @@ fn main() -> ! { // // The default is to generate a 125 MHz system clock let clocks = hal::clocks::init_clocks_and_plls( - pico::XOSC_CRYSTAL_FREQ, + rp_pico::XOSC_CRYSTAL_FREQ, pac.XOSC, pac.CLOCKS, pac.PLL_SYS, diff --git a/boards/pico/src/lib.rs b/boards/rp-pico/src/lib.rs similarity index 100% rename from boards/pico/src/lib.rs rename to boards/rp-pico/src/lib.rs