Skip to content
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

Draft
wants to merge 62 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
281707d
push work in progress
2bndy5 Jul 9, 2024
76b9d59
add .github folder
2bndy5 Jul 9, 2024
7c32533
unify error type in impl EsbRadio for RF24
2bndy5 Jul 9, 2024
a397862
mark crate with `![no_std]`
2bndy5 Jul 9, 2024
2a571e1
prefer u8 over usize for memory footprint
2bndy5 Jul 9, 2024
541e3c2
doc updates
2bndy5 Jul 9, 2024
f3d23af
remove endian manipulation (for now)
2bndy5 Jul 9, 2024
0d613e3
refactor modules
2bndy5 Jul 10, 2024
75db3d4
add unit tests for most API
2bndy5 Jul 10, 2024
a68b6de
run unit tests in CI and upload reports to CodeCov
2bndy5 Jul 10, 2024
aa274b0
Create codecov config
2bndy5 Jul 10, 2024
7051e01
update README
2bndy5 Jul 11, 2024
0edefdd
complete unit tests :tada:
2bndy5 Jul 11, 2024
3c62d56
ignore doc snippet in tests
2bndy5 Jul 11, 2024
fbd92ff
add package metadata
2bndy5 Jul 11, 2024
53a4137
use macro to reduce duplicated code in unit tests
2bndy5 Jul 12, 2024
8cf3280
cast bool input as u8 when clearing status flags
2bndy5 Jul 18, 2024
14c41ee
ran cargo clippy and cargo fmt
2bndy5 Aug 1, 2024
f6df82a
some code review
2bndy5 Aug 1, 2024
f0d0fb2
review write()
2bndy5 Aug 1, 2024
961bc5d
simplify match branches in get_fifo_state()
2bndy5 Aug 2, 2024
e8c4717
switch to monorepo
2bndy5 Oct 8, 2024
984252c
add python binding
2bndy5 Oct 8, 2024
eb4bbd8
fix detection of /dev/gpiochipN on linux
2bndy5 Oct 8, 2024
8460599
use read buffer in py binding; add param defaults
2bndy5 Oct 8, 2024
7cdf02f
add node binding
2bndy5 Oct 10, 2024
f762264
use option for optional args (node binding)
2bndy5 Oct 10, 2024
f2d6c64
better optional arguments in node binding
2bndy5 Oct 10, 2024
6c1c577
rm node binding's generated index.*
2bndy5 Oct 11, 2024
96d51e0
publish with generated index.* from Linux build in node-packaging CI
2bndy5 Oct 11, 2024
a8abb14
add python examples and refactor API a bit
2bndy5 Oct 14, 2024
a8fee94
reviewing interrupt example
2bndy5 Oct 14, 2024
b572ade
another folder refactor
2bndy5 Oct 16, 2024
62a7e9c
some fixes for node example
2bndy5 Oct 16, 2024
5b52620
format TS and JS
2bndy5 Oct 16, 2024
49bb77c
[CI] don't format on yarn build; do it before release
2bndy5 Oct 16, 2024
dbb5d33
rename CI workflow
2bndy5 Oct 16, 2024
7478aa2
fix python scanner_curses example
2bndy5 Oct 19, 2024
8ef7171
more node examples
2bndy5 Oct 20, 2024
2d43231
document bindings' API
2bndy5 Oct 24, 2024
25f26c8
docs review
2bndy5 Oct 24, 2024
adb9e1b
add more node examples
2bndy5 Oct 24, 2024
2d38464
add to tests for coverage
2bndy5 Oct 25, 2024
40db4c9
rewrite examples with App class
2bndy5 Oct 26, 2024
02ac2d4
review available_pipe()
2bndy5 Oct 26, 2024
9fc47fc
rename listen methods
2bndy5 Oct 26, 2024
06f1b25
another refactor
2bndy5 Oct 29, 2024
9d4b6ed
add tests
2bndy5 Oct 29, 2024
29581f2
implicitly cast to bool in bindings
2bndy5 Oct 30, 2024
311aa28
add config context API
2bndy5 Nov 10, 2024
6748d1a
use clock_nanosleep() in bindings
2bndy5 Nov 10, 2024
60b524a
add example/node/ts/scanner_ui.ts
2bndy5 Nov 13, 2024
2a54b9f
some docs review
2bndy5 Dec 30, 2024
ea22257
bump macos host in py CI builds
2bndy5 Dec 30, 2024
f56b124
bump deps
2bndy5 Dec 31, 2024
ad73cec
expose `RF24::tx_delay` in bindings
2bndy5 Jan 8, 2025
dd18702
bump deps (again)
2bndy5 Jan 26, 2025
f76adb4
examples use `/dev/gpiochip0`
2bndy5 Jan 28, 2025
dfb5832
improve timeout calc in py examples
2bndy5 Jan 29, 2025
43166f3
reduce dependency tree for bindings on linux builds
2bndy5 Jan 29, 2025
8b672bb
examples/rust/getting-started
2bndy5 Jan 29, 2025
ca3cfe2
example/rust/streaming_data.rs
2bndy5 Jan 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .config/.readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
nodejs: latest
rust: latest
python: latest
jobs:
post_create_environment:
- corepack enable
- corepack prepare --activate [email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e
- asdf reshim nodejs
pre_build:
- yarn install
- yarn build:debug
- yarn docs

mkdocs:
configuration: docs/mkdocs.yml


# Optionally declare the Python requirements required to build your docs

python:
install:
- requirements: docs/requirements.txt
- method: pip
path: '.'
144 changes: 144 additions & 0 deletions .config/cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# git-cliff ~ configuration file
# https://git-cliff.org/docs/configuration

[changelog]
# template for the changelog header
header = """
# Changelog\n
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
<!-- markdownlint-disable MD024 -->\n
"""
# template for the changelog body
# https://keats.github.io/tera/docs/#introduction
body = """
{%- macro remote_url() -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
{%- endmacro -%}
{%- set UNRELEASED = "Unreleased" -%}
{%- set init_commit = "f8863cc36d66708bfa0fb2fb1a219c7b2f97f7d6" -%}
{%- set this_version = UNRELEASED -%}

{% if version -%}
{%- set this_version = version | trim_start_matches(pat="v") -%}
## [{{ this_version }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{%- if message %}

> {{ message }}
{%- endif %}
{% else -%}
## [{{ UNRELEASED }}]{% if previous and previous.timestamp %} - {{ previous.timestamp | date(format="%Y-%m-%d") }} to present{% endif %}
{% endif -%}

{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits %}
- {{ commit.message | split(pat="\n") | first | upper_first | trim }}\
{% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%}
{% if commit.remote.pr_number %} in \
[#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }})
{%- else %} in \
[`{{ commit.id | truncate(length=7, end="") }}`]({{ self::remote_url() }}/commit/{{commit.id }})
{%- endif -%}
{% endfor %}
{% endfor -%}

{% set last_commit = "HEAD" -%}
{%- set first_commit = init_commit -%}
{% if version -%}
{%- set last_commit = version -%}
{%- if previous and previous.version -%}
{%- set first_commit = previous.version -%}
{%- endif -%}
{%- endif %}
[{{ this_version }}]: {{ self::remote_url() }}/compare/{{ first_commit }}...{{ last_commit }}

Full commit diff: [`{% if previous.version -%}
{{ first_commit }}
{%- else -%}
{{ init_commit | truncate(length=7, end="") }}
{%- endif %}...{{ last_commit }}`][{{ this_version }}]
{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
## New Contributors
{%- endif -%}

{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution
{%- if contributor.pr_number %} in \
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
{%- endif %}
{%- endfor %}\n
"""
# template for the changelog footer
footer = """
<!-- generated by git-cliff -->
"""
# remove the leading and trailing whitespace from the templates
trim = true
# The file path for output. This can be overridden with `--output` CLI arg
# output = "CHANGELOG.md"

[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = true
# filter out the commits that are not conventional
filter_unconventional = false
# regex for preprocessing the commit messages
commit_preprocessors = [
# remove issue numbers from commits
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" },
]
# regex for parsing and grouping commits
commit_parsers = [
{ field = "github.pr_labels", pattern = "breaking", group = "<!-- 0 --> 💥 Breaking changes" },
{ field = "github.pr_labels", pattern = "breaking-change", group = "<!-- 0 --> 💥 Breaking changes" },
{ field = "github.pr_labels", pattern = "feature", group = "<!-- 1 --> 🚀 Added" },
{ field = "github.pr_labels", pattern = "enhancement", group = "<!-- 1 --> 🚀 Added" },
{ field = "github.pr_labels", pattern = "deprecated", group = "<!-- 2 --> 🚫 Deprecated" },
{ field = "github.pr_labels", pattern = "removed", group = "<!-- 3 --> 🗑️ Removed" },
{ field = "github.pr_labels", pattern = "bug", group = "<!-- 4 --> 🛠️ Fixed" },
{ field = "github.pr_labels", pattern = "security", group = "<!-- 5 --> 🔐 Security" },
{ field = "github.pr_labels", pattern = "dependencies", group = "<!-- 6 --> 📦 Dependency updates" },
{ field = "github.pr_labels", pattern = "test", group = "<!-- 7 -->🚦 Tests"},
{ field = "github.pr_labels", pattern = "tests", group = "<!-- 7 -->🚦 Tests"},
{ field = "github.pr_labels", pattern = "documentation", group = "<!-- 8 --> 📝 Documentation" },
{ field = "github.pr_labels", pattern = "refactor", group = "<!-- 9 --> 🗨️ Changed" },
{ field = "github.pr_labels", pattern = "skip-changelog", skip = true },
{ field = "github.pr_labels", pattern = "no-changelog", skip = true },
{ field = "github.pr_labels", pattern = "invalid", skip = true },
# The order of parsers matters. Put rules for PR labels first to prioritize PR labels.
{ message = "^[a|A]dd", group = "<!-- 1 --> 🚀 Added" },
{ message = "^[s|S]upport", group = "<!-- 1 --> 🚀 Added" },
{ message = "^.*: support", group = "<!-- 1 --> 🚀 Added" },
{ message = "^.*: add", group = "<!-- 1 --> 🚀 Added" },
{ message = "^.*: deprecated", group = "<!-- 2 --> 🚫 Deprecated" },
{ message = "[d|D]eprecate", group = "<!-- 2 --> 🚫 Deprecated" },
{ message = "[t|T]ests", group = "<!-- 7 -->🚦 Tests"},
{ message = "[r|R]emove", group = "<!-- 3 --> 🗑️ Removed" },
{ message = "^.*: remove", group = "<!-- 3 --> 🗑️ Removed" },
{ message = "^.*: delete", group = "<!-- 3 --> 🗑️ Removed" },
{ message = "^[f|F]ix", group = "<!-- 4 --> 🛠️ Fixed" },
{ message = "^.*: fix", group = "<!-- 4 --> 🛠️ Fixed" },
{ message = "^.*: secure", group = "<!-- 5 --> 🔐 Security" },
{ message = "[s|S]ecure", group = "<!-- 5 --> 🔐 Security" },
{ message = "[s|S]ecurity", group = "<!-- 5 --> 🔐 Security" },
{ message = "^.*: security", group = "<!-- 5 --> 🔐 Security" },
{ message = "doc", group = "<!-- 8 --> 📝 Documentation" },
{ message = "docs", group = "<!-- 8 --> 📝 Documentation" },
{ message = "documentation", group = "<!-- 8 --> 📝 Documentation" },
{ message = "[r|R]efactor", group = "<!-- 9 --> 🗨️ Changed" },
{ field = "github.pr_labels", pattern = ".*", group = "<!-- 9 --> 🗨️ Changed" },
{ message = "^.*", group = "<!-- 9 --> 🗨️ Changed" },
]
# filter out the commits that are not matched by commit parsers
filter_commits = true
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "oldest"

# [remote.github]
# owner = "cpp-linter"
# repo = "cpp-linter-rs"
22 changes: 22 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# required minimum nextest version
nextest-version = "0.9.77"

[profile.default]
# A profile to run most tests, except tests that run longer than 10 seconds
default-filter = "all()"

# This will flag any test that runs longer than 10 seconds. Useful when writing new tests.
slow-timeout = "10s"

[profile.ci]
# A profile to run only tests that use clang-tidy and/or clang-format
# NOTE: This profile is intended to keep CI runtime low. Locally, use default or all profiles

# This is all tests in tests/ folder + unit test for --extra-args.
default-filter = "all()"

# show wich tests were skipped
status-level = "skip"

# show log output from each test
failure-output = "immediate-final"
24 changes: 24 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.py text eol=lf
*.pyi text eol=lf
*.md text eol=lf
*.ts text eol=lf
*.js text eol=lf
*.mjs text eol=lf
*.hpp text eol=lf
*.h text eol=lf
*.cpp text eol=lf
*.c text eol=lf
*.rs text eol=lf
*.toml text eol=lf
*.lock text eol=lf
*.json text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
.gitignore text eol=lf
justfile text eol=lf
LICENSE text eol=lf
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: 2bndy5
32 changes: 32 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: "weekly"
groups:
actions:
patterns:
- "*"
- package-ecosystem: cargo
directory: /
schedule:
interval: "weekly"
groups:
cargo:
patterns:
- "*"

- package-ecosystem: pip
directory: /
schedule:
interval: "weekly"
groups:
pip:
patterns:
- "*"
66 changes: 66 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Docs

on:
push:
branches: [main]
paths:
- 'docs/**'
- 'lib/**'
- Cargo.toml
- '*.md'
- .github/workflows/docs.yml
pull_request:
branches: [main]
paths:
- 'docs/**'
- 'lib/**'
- Cargo.toml
- '*.md'
- .github/workflows/docs.yml

jobs:
supplemental:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@main
- name: Install Just
run: cargo binstall -y just
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: actions/setup-node@v4
with:
node-version: 20.x
- run: yarn install
- name: Build Node.js type definitions
run: yarn build:debug
- name: Generate Node.js API docs
run: yarn docs
- run: pip install -r docs/requirements.txt
- run: pip install .
- run: just docs-build
- name: Save docs build as artifact
uses: actions/upload-artifact@v4
with:
path: docs/site
name: supplemental-docs

api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@main
- name: Install Just
run: cargo binstall -y just
- run: just docs-rs
- name: save docs as artifact
uses: actions/upload-artifact@v4
with:
name: api-docs
path: target/doc

54 changes: 54 additions & 0 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Examples

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
cache: "pip"
cache-dependency-path: "examples/python/requirements*.txt"
- name: Install workflow tools
run: >-
python -m pip install
-r examples/python/requirements.txt
-r examples/python/requirements-dev.txt
- run: ruff check
- run: ruff format
- run: mypy

build-node:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- run: rustup update --no-self-update
- run: yarn install
- name: Build binding (debug)
run: yarn build:debug
- name: Lint examples
run: yarn examples-lint
- name: Compile examples
run: yarn examples-build

lint-rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup update --no-self-update
- uses: cargo-bins/cargo-binstall@main
- name: Install just
run: cargo binstall -y just
- run: just lint-examples
Loading