mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2025-01-11 21:11:31 +11:00
Addressing review comments.
This commit is contained in:
parent
0beedde69b
commit
fc0075a381
43
README.md
43
README.md
|
@ -8,7 +8,7 @@
|
||||||
<h3 align="center">rp-hal</h3>
|
<h3 align="center">rp-hal</h3>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
Rust support for the "Raspberry Pi Silicon" family of microcontrollers
|
Rust support for the "Raspberry Silicon" family of microcontrollers
|
||||||
<br />
|
<br />
|
||||||
<a href="https://docs.rs/rp2040-hal"><strong>Explore the API docs »</strong></a>
|
<a href="https://docs.rs/rp2040-hal"><strong>Explore the API docs »</strong></a>
|
||||||
<br />
|
<br />
|
||||||
|
@ -40,23 +40,26 @@
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
So, you want to program your Raspberry Pi Silicon, using the Rust programming
|
So, you want to program your new Raspberry Silicon microcontroller, using the
|
||||||
language. You've come to the right place!
|
Rust programming language. You've come to the right place!
|
||||||
|
|
||||||
This repository is `rp-hal` - a collection of high-level drivers for the RP2040
|
This repository is `rp-hal` - a collection of high-level drivers for the
|
||||||
and various associated boards, like the Raspberry Pi Pico and the Adafruit
|
Raspberry Silicon RP2040 micontroller and various associated boards, like the
|
||||||
Feather RP2040.
|
Raspberry Pi Pico and the Adafruit Feather RP2040.
|
||||||
|
|
||||||
If you want to write an application for Raspberry Pi Silicon, check out our
|
If you want to write an application for Raspberry Silicon, check out our
|
||||||
[RP2040 Project Template](https://github.com/rp-rs/rp2040-project-template).
|
[RP2040 Project Template](https://github.com/rp-rs/rp2040-project-template).
|
||||||
|
|
||||||
If you want to write code that uses the Raspberry Pi Silicon PIO State Machines, check out [pio-rs](https://github.com/rp-rs/pio-rs). You can even compile PIO programs at run-time, on the RP2040 itself!
|
If you want to write code that uses the Raspberry Silicon PIO State Machines,
|
||||||
|
check out [pio-rs](https://github.com/rp-rs/pio-rs). You can even compile PIO
|
||||||
|
programs at run-time, on the RP2040 itself!
|
||||||
|
|
||||||
If you want to try out some examples on one of our supported boards, check out
|
If you want to try out some examples on one of our supported boards, check out
|
||||||
the list of *Board Support Packages* below, and click through to see the various
|
the list of *Board Support Packages* below, and click through to see the various
|
||||||
examples for each board.
|
examples for each board.
|
||||||
|
|
||||||
Before trying any of the examples, please ensure you have the latest stable version of Rust installed, along with the right target support:
|
Before trying any of the examples, please ensure you have the latest stable
|
||||||
|
version of Rust installed, along with the right target support:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
rustup self update
|
rustup self update
|
||||||
|
@ -94,10 +97,10 @@ Each BSP includes some examples to show off the features of that particular boar
|
||||||
[Embedded HAL]: https://github.com/rust-embedded/embedded-hal
|
[Embedded HAL]: https://github.com/rust-embedded/embedded-hal
|
||||||
[Cargo Features]: https://doc.rust-lang.org/cargo/reference/features.html
|
[Cargo Features]: https://doc.rust-lang.org/cargo/reference/features.html
|
||||||
|
|
||||||
### [rp2040-hal] - The HAL for the [Raspberry Pi Silicon RP2040]
|
### [rp2040-hal] - The HAL for the [Raspberry Silicon RP2040]
|
||||||
|
|
||||||
You should include this crate in your project if you want to write a driver or
|
You should include this crate in your project if you want to write a driver or
|
||||||
library that runs on the [Raspberry Pi Silicon RP2040], or if you are writing a Board
|
library that runs on the [Raspberry Silicon RP2040], or if you are writing a Board
|
||||||
Support Package (see later on).
|
Support Package (see later on).
|
||||||
|
|
||||||
The crate provides high-level drivers for the RP2040's internal peripherals,
|
The crate provides high-level drivers for the RP2040's internal peripherals,
|
||||||
|
@ -110,7 +113,7 @@ There are examples in this crate to show how to use various peripherals
|
||||||
particular board.
|
particular board.
|
||||||
|
|
||||||
[rp2040-hal]: https://github.com/rp-rs/rp-hal/tree/main/rp2040-hal
|
[rp2040-hal]: https://github.com/rp-rs/rp-hal/tree/main/rp2040-hal
|
||||||
[Raspberry Pi Silicon RP2040]: https://www.raspberrypi.org/products/rp2040/
|
[Raspberry Silicon RP2040]: https://www.raspberrypi.org/products/rp2040/
|
||||||
|
|
||||||
### [pico] - Board Support for the [Raspberry Pi Pico]
|
### [pico] - Board Support for the [Raspberry Pi Pico]
|
||||||
|
|
||||||
|
@ -195,12 +198,12 @@ the Arm ELF file to a UF2 format image.
|
||||||
For boards with USB Device support like the Raspberry Pi Pico, we recommend you
|
For boards with USB Device support like the Raspberry Pi Pico, we recommend you
|
||||||
use the UF2 process.
|
use the UF2 process.
|
||||||
|
|
||||||
The RP2040 contains a Cortex-M0+ processor, which implements the Thumb-2 format
|
The RP2040 contains two Cortex-M0+ processors, which execute Thumb-2 encoded
|
||||||
of the ARMv6-M instruction set. There are no operating-specific features in the
|
ARMv6-M instructions. There are no operating-specific features in the binaries
|
||||||
binaries produced - they are for 'bare-metal' systems. For compatibilty with
|
produced - they are for 'bare-metal' systems. For compatibilty with other Arm
|
||||||
other Arm code (e.g. as produced by GCC), Rust uses the *Arm
|
code (e.g. as produced by GCC), Rust uses the *Arm Embedded-Application Binary
|
||||||
Embedded-Application Binary Interface* standard or EABI. Therefore, any Rust
|
Interface* standard or EABI. Therefore, any Rust code for the RP2040 should be
|
||||||
code for the RP2040 should be compiled with the target `thumbv6m-none-eabi`.
|
compiled with the target *`thumbv6m-none-eabi`*.
|
||||||
|
|
||||||
More details can be found in the [Project Template](https://github.com/rp-rs/rp2040-project-template).
|
More details can be found in the [Project Template](https://github.com/rp-rs/rp2040-project-template).
|
||||||
|
|
||||||
|
@ -223,7 +226,7 @@ runner = "elf2uf2-rs -d"
|
||||||
The `thumbv6m-none-eabi` target may be replaced by the all-Arm wildcard
|
The `thumbv6m-none-eabi` target may be replaced by the all-Arm wildcard
|
||||||
`'cfg(all(target_arch = "arm", target_os = "none"))'`.
|
`'cfg(all(target_arch = "arm", target_os = "none"))'`.
|
||||||
|
|
||||||
*Step 3* - Boot your RP2040 into "USB Bootloder mode", typically by rebooting
|
*Step 3* - Boot your RP2040 into "USB Bootloader mode", typically by rebooting
|
||||||
whilst holding some kind of "Boot Select" button. On Linux, you will also need
|
whilst holding some kind of "Boot Select" button. On Linux, you will also need
|
||||||
to 'mount' the device, like you would a USB Thumb Drive.
|
to 'mount' the device, like you would a USB Thumb Drive.
|
||||||
|
|
||||||
|
@ -247,7 +250,7 @@ probe-rs can autodetect your debug probe, which can make it easier to use.
|
||||||
Currently, probe-rs supports the slightly unusual debug hardware in the RP2040,
|
Currently, probe-rs supports the slightly unusual debug hardware in the RP2040,
|
||||||
but the last released probe-run tool (v0.2.6, as of September 2021), does not.
|
but the last released probe-run tool (v0.2.6, as of September 2021), does not.
|
||||||
However, there is a special version of probe-run for the RP2040 called
|
However, there is a special version of probe-run for the RP2040 called
|
||||||
[probe-run-rs].
|
[probe-run-rp](https://github.com/rp-rs/probe-run/tree/rp2040-support).
|
||||||
|
|
||||||
*Step 1* - Install `probe-run-rp`:
|
*Step 1* - Install `probe-run-rp`:
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ RP2040 chip according to how it is connected up on the Feather.
|
||||||
[adafruit_macropad]: https://github.com/rp-rs/rp-hal/tree/main/boards/adafruit_macropad
|
[adafruit_macropad]: https://github.com/rp-rs/rp-hal/tree/main/boards/adafruit_macropad
|
||||||
[Adafruit Macropad]: https://www.adafruit.com/product/5128
|
[Adafruit Macropad]: https://www.adafruit.com/product/5128
|
||||||
[rp2040-hal]: https://github.com/rp-rs/rp-hal/tree/main/rp2040-hal
|
[rp2040-hal]: https://github.com/rp-rs/rp-hal/tree/main/rp2040-hal
|
||||||
[Raspberry Pi Silicon RP2040]: https://www.raspberrypi.org/products/rp2040/
|
[Raspberry Silicon RP2040]: https://www.raspberrypi.org/products/rp2040/
|
||||||
|
|
||||||
## Using
|
## Using
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ RP2040 chip according to how it is connected up on the Feather.
|
||||||
[Adafruit Feather RP2040]: https://www.adafruit.com/product/4884
|
[Adafruit Feather RP2040]: https://www.adafruit.com/product/4884
|
||||||
[feather_rp2040]: https://github.com/rp-rs/rp-hal/tree/main/boards/feather_rp2040
|
[feather_rp2040]: https://github.com/rp-rs/rp-hal/tree/main/boards/feather_rp2040
|
||||||
[rp2040-hal]: https://github.com/rp-rs/rp-hal/tree/main/rp2040-hal
|
[rp2040-hal]: https://github.com/rp-rs/rp-hal/tree/main/rp2040-hal
|
||||||
[Raspberry Pi Silicon RP2040]: https://www.raspberrypi.org/products/rp2040/
|
[Raspberry Silicon RP2040]: https://www.raspberrypi.org/products/rp2040/
|
||||||
|
|
||||||
## Using
|
## Using
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ RP2040 chip according to how it is connected up on the Pico.
|
||||||
[Raspberry Pi Pico]: https://www.raspberrypi.org/products/raspberry-pi-pico/
|
[Raspberry Pi Pico]: https://www.raspberrypi.org/products/raspberry-pi-pico/
|
||||||
[pico]: https://github.com/rp-rs/rp-hal/tree/main/boards/pico
|
[pico]: https://github.com/rp-rs/rp-hal/tree/main/boards/pico
|
||||||
[rp2040-hal]: https://github.com/rp-rs/rp-hal/tree/main/rp2040-hal
|
[rp2040-hal]: https://github.com/rp-rs/rp-hal/tree/main/rp2040-hal
|
||||||
[Raspberry Pi Silicon RP2040]: https://www.raspberrypi.org/products/rp2040/
|
[Raspberry Silicon RP2040]: https://www.raspberrypi.org/products/rp2040/
|
||||||
|
|
||||||
## Using
|
## Using
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ RP2040 chip according to how it is connected up on the Pico Explorer.
|
||||||
[Pimoroni Pico Explorer]: https://shop.pimoroni.com/products/pico-explorer-base
|
[Pimoroni Pico Explorer]: https://shop.pimoroni.com/products/pico-explorer-base
|
||||||
[pico_explorer]: https://github.com/rp-rs/rp-hal/tree/main/boards/pico_explorer
|
[pico_explorer]: https://github.com/rp-rs/rp-hal/tree/main/boards/pico_explorer
|
||||||
[rp2040-hal]: https://github.com/rp-rs/rp-hal/tree/main/rp2040-hal
|
[rp2040-hal]: https://github.com/rp-rs/rp-hal/tree/main/rp2040-hal
|
||||||
[Raspberry Pi Silicon RP2040]: https://www.raspberrypi.org/products/rp2040/
|
[Raspberry Silicon RP2040]: https://www.raspberrypi.org/products/rp2040/
|
||||||
|
|
||||||
## Using
|
## Using
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# [pro_micro_rp2040] - Board Support for the [Sparkfun Pro Micro RP2040]
|
# [pro_micro_rp2040] - Board Support for the [Sparkfun Pro Micro RP2040]
|
||||||
|
|
||||||
You should include this crate if you are writing code that you want to run on
|
You should include this crate if you are writing code that you want to run on
|
||||||
a [Sparkfun Pro Micro RP2040] - a smaller [RP2040][Raspberry Pi Silicon RP2040] board with USB-C and a WS2812B addressable LED.
|
a [Sparkfun Pro Micro RP2040] - a smaller [RP2040][Raspberry Silicon RP2040] board with USB-C and a WS2812B addressable LED.
|
||||||
|
|
||||||
This crate includes the [rp2040-hal], but also configures each pin of the
|
This crate includes the [rp2040-hal], but also configures each pin of the
|
||||||
RP2040 chip according to how it is connected up on the Pro Micro RP2040.
|
RP2040 chip according to how it is connected up on the Pro Micro RP2040.
|
||||||
|
@ -9,7 +9,7 @@ RP2040 chip according to how it is connected up on the Pro Micro RP2040.
|
||||||
[Sparkfun Pro Micro RP2040]: https://www.sparkfun.com/products/18288
|
[Sparkfun Pro Micro RP2040]: https://www.sparkfun.com/products/18288
|
||||||
[pro_micro_rp2040]: https://github.com/rp-rs/rp-hal/tree/main/boards/pro_micro_rp2040
|
[pro_micro_rp2040]: https://github.com/rp-rs/rp-hal/tree/main/boards/pro_micro_rp2040
|
||||||
[rp2040-hal]: https://github.com/rp-rs/rp-hal/tree/main/rp2040-hal
|
[rp2040-hal]: https://github.com/rp-rs/rp-hal/tree/main/rp2040-hal
|
||||||
[Raspberry Pi Silicon RP2040]: https://www.raspberrypi.org/products/rp2040/
|
[Raspberry Silicon RP2040]: https://www.raspberrypi.org/products/rp2040/
|
||||||
|
|
||||||
## Using
|
## Using
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<h3 align="center">rp-hal</h3>
|
<h3 align="center">rp-hal</h3>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
High-level Rust drivers for the Raspberry Pi Silicon RP2040 Microcontroller
|
High-level Rust drivers for the Raspberry Silicon RP2040 Microcontroller
|
||||||
<br />
|
<br />
|
||||||
<a href="https://docs.rs/rp2040-hal"><strong>Explore the API docs »</strong></a>
|
<a href="https://docs.rs/rp2040-hal"><strong>Explore the API docs »</strong></a>
|
||||||
<br />
|
<br />
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
This is the `rp2040-hal` package - a library crate of high-level Rust drivers
|
This is the `rp2040-hal` package - a library crate of high-level Rust drivers
|
||||||
for the Raspberry Pi Silicon RP2040 microcontroller, along with a collection of
|
for the Raspberry Silicon RP2040 microcontroller, along with a collection of
|
||||||
non-board specific example programs for you to study. You should use this crate
|
non-board specific example programs for you to study. You should use this crate
|
||||||
in your application if you want to write code for the RP2040 microcontroller.
|
in your application if you want to write code for the RP2040 microcontroller.
|
||||||
The *HAL* in the name standards for *Hardware Abstraction Layer*, and comes from
|
The *HAL* in the name standards for *Hardware Abstraction Layer*, and comes from
|
||||||
|
|
|
@ -20,7 +20,7 @@ use panic_halt as _;
|
||||||
// Alias for our HAL crate
|
// Alias for our HAL crate
|
||||||
use rp2040_hal as hal;
|
use rp2040_hal as hal;
|
||||||
|
|
||||||
// Traits we need
|
// Some traits we need
|
||||||
use embedded_hal::PwmPin;
|
use embedded_hal::PwmPin;
|
||||||
use embedded_time::rate::*;
|
use embedded_time::rate::*;
|
||||||
use rp2040_hal::clocks::Clock;
|
use rp2040_hal::clocks::Clock;
|
||||||
|
|
Loading…
Reference in a new issue