-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f8863cc
Showing
4 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Created by https://www.toptal.com/developers/gitignore/api/rust | ||
# Edit at https://www.toptal.com/developers/gitignore?templates=rust | ||
|
||
### Rust ### | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
debug/ | ||
target/ | ||
|
||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries | ||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html | ||
Cargo.lock | ||
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
# MSVC Windows builds of rustc generate these, which store debugging information | ||
*.pdb | ||
|
||
# End of https://www.toptal.com/developers/gitignore/api/rust | ||
|
||
# .vscode settings | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[package] | ||
name = "rf24-rs" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# rf24-rs | ||
This is a pure-rust driver for the nRF24L01 wireless transceivers. | ||
|
||
> [!warning] | ||
> This project is a Work-In-Progress. | ||
> This warning will be removed when this project is ready for deployment. | ||
## Supported platforms | ||
This project aims to support the [embedded rust][embedded-rs] ecosystem. | ||
This includes but is not limited to Linux on RPi. Points of interest: | ||
- [crates.io for embedded-hal crates][crates-hal] or | ||
- [awesome embedded rust][awesome-hal] | ||
- the [embedded-hal][eh] | ||
|
||
## Goals | ||
Here is the intended roadmap: | ||
- [ ] implement driver for the nRF24L01 (OTA compatible with other RF24 library) | ||
|
||
This should be HAL-agnostic in terms of MCU. It would also be nice to | ||
reimplement the same API (using [rust's `trait` feature][rust-traits]) | ||
for use on nRF5x radios. | ||
- [ ] implement network layers (OTA compatible with RF24Network and RF24Mesh libraries) | ||
- [ ] implement ESB support for nRF5x MCUs. This might be guarded under [cargo features][cargo-feat]. | ||
|
||
## Why? | ||
Mostly because I :heart: rust. There are [other driver the nRF24L01 in pure rust][crates-rf24], | ||
but they all seem unmaintained or designed to be application-specific. There's even | ||
a [crate to use the nRF5x chips' ESB support][crate-esb], but this too seems lacking | ||
maintainers' attention. | ||
|
||
[embedded-rs]: https://docs.rust-embedded.org/book/ | ||
[crates-hal]: https://crates.io/search?q=embedded-hal | ||
[awesome-hal]: https://github.com/rust-embedded/awesome-embedded-rust | ||
[eh]: https://github.com/rust-embedded/embedded-hal | ||
[cargo-feat]: https://doc.rust-lang.org/cargo/reference/features.html | ||
[rust-traits]: https://doc.rust-lang.org/book/ch19-03-advanced-traits.html#advanced-traits | ||
[crates-rf24]: https://crates.io/search?q=rf24 | ||
[crate-esb]: https://crates.io/crates/esb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
pub fn add(left: usize, right: usize) -> usize { | ||
left + right | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
#[test] | ||
fn it_works() { | ||
let result = add(2, 2); | ||
assert_eq!(result, 4); | ||
} | ||
} |