-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement nRF24L01 driver #1
base: main
Are you sure you want to change the base?
Conversation
2bndy5
commented
Jul 9, 2024
•
edited
Loading
edited
- add source code to drive the nRF24L01
- add a build/test/lint CI workflows; no release CI for crates.io (yet)
- add unit tests using embedded-hal-mock (and activate codecov)
- add (Linux only) FFI bindings (consider FFI bindings #2)
- python binding
- node binding
- add examples
- python examples
- node.js (typescript) examples
- rust examples
includes - CI workflow - funding info - dependabot config
- prefer to `use rf24_rs::radio::prelude::*` in user code to pull in all the required radio traits. - support LNA_CUR bit in non-plus/clones - prefer to `use rf24_rs::radio::{RF24 Nrf24Error}` in user code because namespaces will be very important in the future
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
- add badges - tick first milestone in roadmap
rust is so cool! This new macro generates rust code at compile time and then compiles everything with the generated code in place of the macro calls.
removes the need to construct a mutable byte
This is just an informative collection of my thoughts, and reasons why I paused this development. ExamplesHere's the chips I'm looking to support (initially) in the examples:
Writing the examples is tough. The embedded-hal implementations for various chips are not conformed like the Arduino Cores for various chips families. Writing an example for the RP2040 will look significantly different from an example for the ATSAMD21. Due to this complexity, I've decided to try and put the examples in its own "crate" (a rust term for a library) in a sub-directory named "examples". This way I can allow users to control which chip to compile for using cargo features defined in examples/cargo.toml. Furthermore, flashing the compiled binary to a board requires a separate dependency called probe.rs. This is another reason why the examples need to use a separate crate. Embassy ProjectThere is an embassy project that focuses on some SoC (System on Chip) that employ an RTOS. This seems useful for multi-processing, but it is ultimately unnecessary for simple examples. Nonetheless, I could use this embassy project for ESP32, RP2040, and nRF5x chips because they seem to have a somewhat unified API for those chips (I think). No STD libs in embedded-halSee the embedded-hal book about rationale. Basically, driver libraries for embedded-hal projects cannot use rust's standard libraries. This includes This will be a problem down the road when I get around to implementing the Mesh layer because we need a way to dynamically allocate memory as Logical Addresses are assigned to a mesh node's ID. There are third party libs that aim to accommodate this shortcoming, but I'll cross that bridge when I get there. Tip The embeded-hal implementations on Linux and ESP32 boards can use the std libs. 🎉 The embedded-hal framework (which doesn't impose embedded-hal implementations use uniformed API names for data structures) had been in beta for years. It only reached a stable release in Jan 2024. This fact has caused a side effect that can be seen in many embedded-hal implementations; they still support embedded-hal framework v0.2.x (the last beta release) as an optional cargo feature. This driver library will only support v1+ of the embedded-hal framework (unless requested otherwise). |
aec4db1
to
6031361
Compare
introduce supplemental docs (using mkdocs) and WIP examples (incomplete at this time) migrate to using [just](https://just.systems) as a task runner and utilize it in CI jobs.
c737ef4
to
2c76611
Compare
8a682e7
to
0dacebb
Compare
review python examples too
6b84c93
to
d747b35
Compare
|
considering we might be distributing multiple rust crates from 1 repo. also review rust docs - added API layout to landing page - filled in some missing info in functions' docs review `print_details()` output - show pipe information in `print_details()` - show TX address in `print_details()` - fix IRQ settings' output
47f9a35
to
a959097
Compare
Only the node binding's `StatusFlags` and `WriteConfig` interfaces must use explicit boolean values. To implicitly cast those interfaces' values to boolean would - incur much more overhead - lose precise typing information See napi-rs docs about Env and Context.