2021-08-25 08:33:03 +10:00
|
|
|
<!-- PROJECT LOGO -->
|
|
|
|
<br />
|
|
|
|
<p align="center">
|
2022-08-26 21:15:24 +10:00
|
|
|
<a href="https://github.com/rp-rs/rp-hal">
|
2021-08-25 08:33:03 +10:00
|
|
|
<img src="https://www.svgrepo.com/show/281119/microchip.svg" alt="Logo" width="140" height="140">
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<h3 align="center">rp-hal</h3>
|
|
|
|
|
|
|
|
<p align="center">
|
2021-09-28 18:26:31 +10:00
|
|
|
High-level Rust drivers for the Raspberry Silicon RP2040 Microcontroller
|
2021-08-25 08:33:03 +10:00
|
|
|
<br />
|
2021-09-27 23:32:11 +10:00
|
|
|
<a href="https://docs.rs/rp2040-hal"><strong>Explore the API docs »</strong></a>
|
2021-08-25 08:33:03 +10:00
|
|
|
<br />
|
|
|
|
<br />
|
2021-09-27 23:32:11 +10:00
|
|
|
<a href="https://github.com/rp-rs/rp-hal/tree/main/boards/pico/examples">View Demos</a>
|
2021-08-25 08:33:03 +10:00
|
|
|
·
|
2021-09-27 23:32:11 +10:00
|
|
|
<a href="https://github.com/rp-rs/rp-hal/issues">Report a Bug</a>
|
2021-08-25 08:33:03 +10:00
|
|
|
·
|
2021-09-27 23:32:11 +10:00
|
|
|
<a href="https://matrix.to/#/#rp-rs:matrix.org">Chat on Matrix</a>
|
2021-08-25 08:33:03 +10:00
|
|
|
</p>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- TABLE OF CONTENTS -->
|
|
|
|
<details open="open">
|
|
|
|
<summary><h2 style="display: inline-block">Table of Contents</h2></summary>
|
|
|
|
<ol>
|
2021-09-27 23:32:11 +10:00
|
|
|
<li><a href="#introduction">Introduction</a></li>
|
2021-08-25 08:33:03 +10:00
|
|
|
<li>
|
|
|
|
<a href="#getting-started">Getting Started</a>
|
|
|
|
<ul>
|
|
|
|
<li><a href="#prerequisites">Prerequisites</a></li>
|
|
|
|
<li><a href="#installation">Installation</a></li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<li><a href="#roadmap">Roadmap</a></li>
|
|
|
|
<li><a href="#contributing">Contributing</a></li>
|
|
|
|
<li><a href="#license">License</a></li>
|
|
|
|
<li><a href="#contact">Contact</a></li>
|
|
|
|
<li><a href="#acknowledgements">Acknowledgements</a></li>
|
|
|
|
</ol>
|
|
|
|
</details>
|
|
|
|
|
2021-09-27 23:32:11 +10:00
|
|
|
<!-- INTRODUCTION -->
|
|
|
|
## Introduction
|
|
|
|
|
|
|
|
This is the `rp2040-hal` package - a library crate of high-level Rust drivers
|
2021-09-28 18:26:31 +10:00
|
|
|
for the Raspberry Silicon RP2040 microcontroller, along with a collection of
|
2021-09-27 23:32:11 +10:00
|
|
|
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.
|
|
|
|
The *HAL* in the name standards for *Hardware Abstraction Layer*, and comes from
|
|
|
|
the fact that many of the drivers included implement the generic
|
|
|
|
hardware-abstraction interfaces defined in the Rust Embedded Working Group's
|
|
|
|
[embedded-hal](https://github.com/rust-embedded/embedded-hal) crate.
|
|
|
|
|
|
|
|
We also provide a series of *Board Support Package* (BSP) crates, which take
|
|
|
|
this HAL crate and pre-configure the pins according to a specific PCB design. If
|
2022-04-29 16:30:37 +10:00
|
|
|
you are using one of the supported boards, you should use one of those crates in
|
2021-09-27 23:32:11 +10:00
|
|
|
preference, and return here to see documentation about specific peripherals on
|
|
|
|
the RP2040 and how to use them. See the `boards` folder in
|
|
|
|
https://github.com/rp-rs/rp-hal/ for more details.
|
|
|
|
|
2021-08-25 08:33:03 +10:00
|
|
|
<!-- GETTING STARTED -->
|
|
|
|
## Getting Started
|
|
|
|
|
2021-09-27 23:32:11 +10:00
|
|
|
To include this crate in your project, amend your `Cargo.toml` file to include
|
2021-08-25 08:33:03 +10:00
|
|
|
|
|
|
|
```toml
|
2022-11-11 19:34:04 +11:00
|
|
|
rp2040-hal = "0.6.0"
|
2021-08-25 08:33:03 +10:00
|
|
|
```
|
|
|
|
|
2021-09-27 23:32:11 +10:00
|
|
|
To obtain a copy of the source code (e.g. if you want to propose a bug-fix or
|
|
|
|
new feature, or simply to study the code), run:
|
2021-08-25 08:33:03 +10:00
|
|
|
|
2021-09-27 23:32:11 +10:00
|
|
|
```console
|
|
|
|
$ git clone https://github.com/rp-rs/rp-hal.git
|
2021-08-25 08:33:03 +10:00
|
|
|
```
|
|
|
|
|
2021-09-27 23:32:11 +10:00
|
|
|
For details on how to program an RP2040 microcontroller, see the [top-level
|
|
|
|
rp-hal README](https://github.com/rp-rs/rp-hal/).
|
|
|
|
|
2021-08-25 08:33:03 +10:00
|
|
|
<!-- ROADMAP -->
|
|
|
|
## Roadmap
|
|
|
|
|
2021-09-27 23:32:11 +10:00
|
|
|
NOTE This HAL is under active development. As such, it is likely to remain
|
|
|
|
volatile until a 1.0.0 release.
|
2021-08-25 08:33:03 +10:00
|
|
|
|
2021-09-27 23:32:11 +10:00
|
|
|
See the [open issues](https://github.com/rp-rs/rp-hal/issues) for a list of
|
|
|
|
proposed features (and known issues).
|
2021-08-25 08:33:03 +10:00
|
|
|
|
2021-10-02 15:36:40 +10:00
|
|
|
### Support for embedded-hal 1.0
|
|
|
|
|
|
|
|
We plan to support embedded-hal 1.0 soon after it is released.
|
|
|
|
|
|
|
|
For now, there is preliminary support for alpha versions of embedded-hal, which can
|
|
|
|
be enabled with the feature `eh1_0_alpha`. Please note that this support does not
|
|
|
|
provide any semver compatibility guarantees: With that feature activated, there
|
|
|
|
will be breaking changes even in minor versions of rp2040-hal.
|
|
|
|
|
|
|
|
Support for embedded-hal 1.0(-alpha) exists in parallel to support for
|
|
|
|
embedded-hal 0.2: Traits of both versions are implemented and can be used
|
|
|
|
at the same time.
|
2022-06-24 08:19:41 +10:00
|
|
|
The new blocking [SPI traits](https://docs.rs/embedded-hal/1.0.0-alpha.8/embedded_hal/spi/blocking/index.html)
|
|
|
|
are not yet implemented.
|
2021-08-25 08:33:03 +10:00
|
|
|
|
|
|
|
<!-- CONTRIBUTING -->
|
|
|
|
## Contributing
|
|
|
|
|
2021-09-27 23:32:11 +10:00
|
|
|
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**.
|
2021-08-25 08:33:03 +10:00
|
|
|
|
|
|
|
1. Fork the Project
|
|
|
|
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
|
|
|
|
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
|
|
|
|
4. Push to the Branch (`git push origin feature/AmazingFeature`)
|
|
|
|
5. Open a Pull Request
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- LICENSE -->
|
|
|
|
## License
|
|
|
|
|
|
|
|
Distributed under the MIT OR Apache2.0 License. See `MIT` or `APACHE2.0` for more information.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- CONTACT -->
|
|
|
|
## Contact
|
|
|
|
|
|
|
|
Project Link: [https://github.com/rp-rs/rp-hal/issues](https://github.com/rp-rs/rp-hal/issues)
|
|
|
|
Matrix: [#rp-rs:matrix.org](https://matrix.to/#/#rp-rs:matrix.org)
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ACKNOWLEDGEMENTS -->
|
|
|
|
## Acknowledgements
|
|
|
|
|
|
|
|
* [Othneil Drew's README template](https://github.com/othneildrew)
|