Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Jul 9, 2024
0 parents commit f8863cc
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .gitignore
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/
6 changes: 6 additions & 0 deletions Cargo.toml
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]
38 changes: 38 additions & 0 deletions README.md
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
14 changes: 14 additions & 0 deletions src/lib.rs
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);
}
}

0 comments on commit f8863cc

Please sign in to comment.