.cargo | ||
.github/workflows | ||
boards | ||
rp2040-hal | ||
.gitignore | ||
APACHE2.0 | ||
Cargo.toml | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
memory.x | ||
MIT | ||
README.md |
rp-hal
A Rust HAL and board support packages for the RP family of microcontrollers from the Raspberry Pi Foundation
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
Packages
This git repository is organised as a Cargo Workspace.
There is a Hardware Abstraction Layer (or HAL) crate for the RP2040 chip, and Board Support Package crates for a number of RP2040 based PCBs. If you are writing code that should run on any microcontroller, consider using the generic Rust Embedded Working Group's Embedded HAL.
If you are writing code that should work on any RP2040 device, use the HAL crate. If you are running code on a specific board, use the appropriate BSP crate (which will include the HAL crate for you). Please note, you cannot depend on multiple BSP crates; you have to pick one, or use Cargo Features to select one at build time.
Each BSP will include some examples to show off the features of that particular board.
rp2040-hal - The HAL for the Raspberry Pi Silicon RP2040
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 Support Package (see later on).
The crate provides high-level drivers for the RP2040's internal peripherals, such as the SPI Controller and the I²C Controller. It doesn't know anything about how your particular board is wired up (such as what each IO pin of the RP2040 is connected to).
There are examples in this crate to show how to use various peripherals (GPIO, I²C, SPI, UART, etc) but note that the pin-outs may not match any particular board.
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.
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.
adafruit_macropad - Board Support for the Adafruit Macropad
You should include this crate if you are writing code that you want to run on an Adafruit Macropad - a 3x4 keyboard and OLED combo board from Adafruit.
This crate includes the rp2040-hal, but also configures each pin of the RP2040 chip according to how it is connected up on the Macropad.
feather_rp2040 - Board Support for the Adafruit Feather RP2040
You should include this crate if you are writing code that you want to run on an Adafruit Feather RP2040 - a Feather form-factor RP2040 board from Adafruit.
This crate includes the rp2040-hal, but also configures each pin of the RP2040 chip according to how it is connected up on the Feather RP2040.
pico_explorer - Board Support for the Pimoroni Pico Explorer
You should include this crate if you are writing code that you want to run on a Pimoroni Pico Explorer - a board featuring a small LCD screen, a breadboard and some breakout headers.
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 Explorer.
pico_lipo_16mb - Board Support for the Pimoroni Pico Lipo 16MB
You should include this crate if you are writing code that you want to run on a Pimoroni Pico Lipo 16MB - a board with USB-C, STEMMA QT/Qwiic connectors, plus a Li-Po battery charging circuit.
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 Lipo.
Note that if you use this crate the compiler will expect the full 16MB flash space, and so it may not work if you only have the 4MB variant.
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 a Sparkfun Pro Micro RP2040 - a smaller RP2040 board with USB-C and a WS2812B addressable LED.
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.
Roadmap
NOTE These packages are under active development. As such, it is likely to remain volatile until a 1.0.0 release.
See the open issues for a list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
The steps are:
- Fork the Project by clicking the 'Fork' button at the top of the page.
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Make some changes to the code or documentation.
- Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Feature Branch (
git push origin feature/AmazingFeature
) - Create a New Pull Request
- An admin will review the Pull Request and discuss any changes that may be required.
- Once everyone is happy, the Pull Request can be merged by an admin, and your work is part of our project!
Code of Conduct
Contribution to this crate is organized under the terms of the Rust Code of Conduct, and the maintainer of this crate, the rp-rs team, promises to intervene to uphold that code of conduct.
License
The contents of this repository are dual-licensed under the MIT OR Apache
2.0 License. That means you can chose either the MIT licence or the
Apache-2.0 when you re-use this code. See MIT
or APACHE2.0
for more
information on each specific licence.
Any submissions to this project (e.g. as Pull Requests) must be made available under these terms.
Contact
Project Link: https://github.com/rp-rs/rp-hal/issues Matrix: #rp-rs:matrix.org