From 3120783000d0025b183b0397acaa8b769499eb38 Mon Sep 17 00:00:00 2001 From: krolyxon Date: Mon, 8 Jun 2026 23:10:46 +0530 Subject: Initial gh-pages firmware hosting --- .pio/libdeps/esp32-s3-n16r8/RF24/docs/Doxyfile | 393 +++++++++++++++++++++ .pio/libdeps/esp32-s3-n16r8/RF24/docs/README.md | 23 ++ .pio/libdeps/esp32-s3-n16r8/RF24/docs/arduino.md | 288 +++++++++++++++ .pio/libdeps/esp32-s3-n16r8/RF24/docs/attiny.md | 81 +++++ .pio/libdeps/esp32-s3-n16r8/RF24/docs/atxmega.md | 57 +++ .../esp32-s3-n16r8/RF24/docs/cross_compile.md | 63 ++++ .../esp32-s3-n16r8/RF24/docs/doxygen-custom.css | 166 +++++++++ .../esp32-s3-n16r8/RF24/docs/images/Logo large.png | Bin 0 -> 94683 bytes .../esp32-s3-n16r8/RF24/docs/images/favicon.ico | Bin 0 -> 4286 bytes .../esp32-s3-n16r8/RF24/docs/linux_install.md | 152 ++++++++ .pio/libdeps/esp32-s3-n16r8/RF24/docs/main_page.md | 90 +++++ .pio/libdeps/esp32-s3-n16r8/RF24/docs/migration.md | 287 +++++++++++++++ .pio/libdeps/esp32-s3-n16r8/RF24/docs/mraa.md | 42 +++ .pio/libdeps/esp32-s3-n16r8/RF24/docs/pico_sdk.md | 234 ++++++++++++ .../esp32-s3-n16r8/RF24/docs/portability.md | 40 +++ .../esp32-s3-n16r8/RF24/docs/python_wrapper.md | 138 ++++++++ .../esp32-s3-n16r8/RF24/docs/rpi_general.md | 120 +++++++ .../esp32-s3-n16r8/RF24/docs/using_cmake.md | 249 +++++++++++++ 18 files changed, 2423 insertions(+) create mode 100644 .pio/libdeps/esp32-s3-n16r8/RF24/docs/Doxyfile create mode 100644 .pio/libdeps/esp32-s3-n16r8/RF24/docs/README.md create mode 100644 .pio/libdeps/esp32-s3-n16r8/RF24/docs/arduino.md create mode 100644 .pio/libdeps/esp32-s3-n16r8/RF24/docs/attiny.md create mode 100644 .pio/libdeps/esp32-s3-n16r8/RF24/docs/atxmega.md create mode 100644 .pio/libdeps/esp32-s3-n16r8/RF24/docs/cross_compile.md create mode 100644 .pio/libdeps/esp32-s3-n16r8/RF24/docs/doxygen-custom.css create mode 100644 .pio/libdeps/esp32-s3-n16r8/RF24/docs/images/Logo large.png create mode 100644 .pio/libdeps/esp32-s3-n16r8/RF24/docs/images/favicon.ico create mode 100644 .pio/libdeps/esp32-s3-n16r8/RF24/docs/linux_install.md create mode 100644 .pio/libdeps/esp32-s3-n16r8/RF24/docs/main_page.md create mode 100644 .pio/libdeps/esp32-s3-n16r8/RF24/docs/migration.md create mode 100644 .pio/libdeps/esp32-s3-n16r8/RF24/docs/mraa.md create mode 100644 .pio/libdeps/esp32-s3-n16r8/RF24/docs/pico_sdk.md create mode 100644 .pio/libdeps/esp32-s3-n16r8/RF24/docs/portability.md create mode 100644 .pio/libdeps/esp32-s3-n16r8/RF24/docs/python_wrapper.md create mode 100644 .pio/libdeps/esp32-s3-n16r8/RF24/docs/rpi_general.md create mode 100644 .pio/libdeps/esp32-s3-n16r8/RF24/docs/using_cmake.md (limited to '.pio/libdeps/esp32-s3-n16r8/RF24/docs') diff --git a/.pio/libdeps/esp32-s3-n16r8/RF24/docs/Doxyfile b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/Doxyfile new file mode 100644 index 0000000..ec19193 --- /dev/null +++ b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/Doxyfile @@ -0,0 +1,393 @@ +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +PROJECT_ICON = images/favicon.ico + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = "Optimized high speed nRF24L01+ driver class documentation" + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "TMRh20 2020 - Optimized fork of the nRF24L01+ driver" + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = ./ + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand part +# of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to strip. +# Note that you can specify absolute paths here, but also relative paths, which will +# be relative from the directory where doxygen is started. +# +# This tag requires that the tag FULL_PATH_NAMES is set to YES. +STRIP_FROM_PATH = ../ + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL, +# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = ino=c \ + pde=c + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = YES + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# (including Cygwin) ands Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = YES + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = NO + +# Don't display the ugly/complicated "tree view" side menu. +# And, restore the top (simpler) navigation bar. +# As of doxygen v1.13.0, these default values changed from NO to YES +GENERATE_TREEVIEW = NO +DISABLE_INDEX = NO + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = ../ \ + ../utility/Template \ + ./ + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment), +# *.doc (to be provided as doxygen C comment), *.txt (to be provided as doxygen +# C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, +# *.vhdl, *.ucf, *.qsf and *.ice. + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.idl \ + *.ddl \ + *.odl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.cs \ + *.d \ + *.php \ + *.php4 \ + *.php5 \ + *.phtml \ + *.inc \ + *.m \ + *.markdown \ + *.md \ + *.mm \ + *.dox \ + *.py \ + *.f90 \ + *.f \ + *.for \ + *.tcl \ + *.vhd \ + *.vhdl \ + *.ucf \ + *.qsf \ + *.as \ + *.js + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = Makefile \ + configure + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = bcm2835* \ + readme* \ + runtest* \ + tests* \ + README* + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = _ + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = ../examples \ + ../examples_linux + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = YES + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = ../images + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = main_page.md + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = doxygen-custom.css + +# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output should be rendered +# with a dark or light theme. +# +# Possible values are: +# - LIGHT always generate light mode output +# - DARK always generate dark mode output +# - AUTO_LIGHT automatically set the mode according to the user preference, +# use light mode if no preference is set (the default) +# - AUTO_DARK automatically set the mode according to the user preference, +# use dark mode if no preference is set +# - TOGGLE allow to user to switch between light and dark mode via a button. +# +# The default value is: AUTO_LIGHT. +# +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE = TOGGLE + +# If the TIMESTAMP tag is set different from NO then each generated page will contain +# the date or date and time when the page was generated. Setting this to NO can help +# when comparing the output of multiple runs. +# +# Possible values are: YES, NO, DATETIME and DATE. +# +# The default value is: NO. + +TIMESTAMP = DATE + +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. +# The default value is: YES. + +GENERATE_LATEX = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# The PREDEFINED tag can be used to specify one or more macro names that are +# defined before the preprocessor is started (similar to the -D option of e.g. +# gcc). The argument of the tag is a list of macros of the form: name or +# name=definition (no spaces). If the definition and the "=" are omitted, "=1" +# is assumed. To prevent a macro definition from being undefined via #undef or +# recursively expanded use the := operator instead of the = operator. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +PREDEFINED = DOXYGEN_FORCED diff --git a/.pio/libdeps/esp32-s3-n16r8/RF24/docs/README.md b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/README.md new file mode 100644 index 0000000..935c171 --- /dev/null +++ b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/README.md @@ -0,0 +1,23 @@ +# Please browse the docs from either http://nrf24.github.io/RF24 + +## Intended for use in Doxygen + +The markdown files (\*.md) in this docs folder contain relative hyperlinks. Any relative hyperlinks will not work when viewing these markdown files in github. + +---- + +## Building the docs + +Navigate to the repo's docs folder: + +```shell +cd docs +``` + +Install Doxygen (v1.12.0 or newer) and run the following command from the repo's docs folder: + +```shell +doxygen +``` + +The Doxygen HTML output is now in docs/html. diff --git a/.pio/libdeps/esp32-s3-n16r8/RF24/docs/arduino.md b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/arduino.md new file mode 100644 index 0000000..a1068b4 --- /dev/null +++ b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/arduino.md @@ -0,0 +1,288 @@ +# Arduino + +@tableofcontents + + +RF24 is fully compatible with Arduino boards. + +See [Arduino Board reference](http://www.arduino.cc/en/Reference/Board) and [Arduino SPI reference](http://arduino.cc/en/Reference/SPI) for more information + +RF24 makes use of the standard hardware SPI pins (MISO, MOSI, SCK) and requires two additional pins, to control +the chip-select and chip-enable functions. + +```cpp +RF24 radio(ce_pin, cs_pin); +``` + +These pins must be chosen and designated by the user and can use any +available pins. + +## Alternate SPI Support + +RF24 supports alternate SPI methods, in case the standard hardware SPI pins are otherwise unavailable. + +### Software Driven SPI + +Software driven SPI is provided by the [DigitalIO library](https://github.com/greiman/DigitalIO). + +Setup: + +1. Install the digitalIO library +2. Open RF24_config.h in a text editor. + Uncomment the line + ```cpp + #define SOFTSPI + ``` + or add the build flag/option + ```shell + -DSOFTSPI + ``` +3. In your sketch, add + ```cpp + #include + ``` + +@note Note: Pins are listed as follows and can be modified by editing the RF24_config.h file. + +```cpp +#define SOFT_SPI_MISO_PIN 16 +#define SOFT_SPI_MOSI_PIN 15 +#define SOFT_SPI_SCK_PIN 14 +``` + +Or add the build flag/option + +```shell +-DSOFT_SPI_MISO_PIN=16 -DSOFT_SPI_MOSI_PIN=15 -DSOFT_SPI_SCK_PIN=14 +``` + +### Alternate Hardware (UART) Driven SPI + +The Serial Port (UART) on Arduino can also function in SPI mode, and can double-buffer data, while the +default SPI hardware cannot. + +The SPI_UART library is available at [TMRh20/Sketches](https://github.com/TMRh20/Sketches/tree/master/SPI_UART) + +Enabling: + +1. Install the SPI_UART library +2. Edit RF24_config.h and uncomment + ```cpp + #define SPI_UART + ``` +3. In your sketch, add + ```cpp + #include + ``` + +SPI_UART SPI Pin Connections: +| NRF |Arduino Uno Pin| +|----:|:--------------| +| MOSI| TX(0) | +| MISO| RX(1) | +| SCK | XCK(4) | +| CE | User Specified| +| CSN | User Specified| + +@note SPI_UART on Mega boards requires soldering to an unused pin on the chip. See [#24](https://github.com/TMRh20/RF24/issues/24) for more information on SPI_UART. + +### Using a specific SPI Bus + +An alternate SPI bus can be specified using the overloaded `RF24::begin(_SPI*)` method. +This is useful for some boards that offer more than 1 hardware-driven SPI bus or certain Arduino +cores that implement a software-driven (AKA bit-banged) SPI bus that does not use the DigitalIO +library. + +@warning The SPI bus object's `SPIClass::begin()` method **must** be called before +calling the overloaded `RF24::begin(_SPI*)` method. + +Below are some example snippets that demonstrate how this can be done. + +#### ESP8266 example + +@see The following example code is meant for the popular NodeMCU board. Please refer to the +[ESP8266 ArduinoCore's SPI documentation](https://arduino-esp8266.readthedocs.io/en/latest/libraries.html#spi) +for [other ESP8266-based boards](https://arduino-esp8266.readthedocs.io/en/latest/boards.html#). + +```cpp +#include +#include + +// notice these pin numbers are not the same used in the library examples +RF24 radio(D4, D3); // the (ce_pin, csn_pin) connected to the radio + +void setup() { + Serial.begin(115200); + while (!Serial) {} //some boards need this + + // by default (with no arguments passed) SPI uses D5 (HSCLK), D6 (HMISO), D7 (HMOSI) + SPI.pins(6, 7, 8, 0); + // this means the following pins are used for the SPI bus: + // MOSI = SD1 + // MISO = SD0 + // SCLK = CLK + // CSN = GPIO0 (labeled D3 on the board) + // **notice we also passed `D3` to the RF24 constructor's csn_pin parameter** + + SPI.begin(); + + if (!radio.begin(&SPI)) { + Serial.println(F("radio hardware not responding!!")); + while (1) {} // hold program in infinite loop to prevent subsequent errors + } + + // ... continue with program as normal (see library examples/ folder) +} +``` + +#### ESP32 example + +@see Please review the Espressif's +[SPI_Multiple_Buses.ino example for the ESP32](https://github.com/espressif/arduino-esp32/blob/master/libraries/SPI/examples/SPI_Multiple_Buses/SPI_Multiple_Buses.ino) +located in their ArduinoCore repository (along with the SPI library for the ESP32). + +```cpp +#include +#include + +// to use custom-defined pins, uncomment the following +// #define MY_MISO 26 +// #define MY_MOSI 27 +// #define MY_SCLK 25 +// #define MY_SS 32 // pass MY_SS as the csn_pin parameter to the RF24 constructor + +// notice these pin numbers are not the same used in the library examples +RF24 radio(2, 0); // the (ce_pin, csn_pin) connected to the radio + +SPIClass* hspi = nullptr; // we'll instantiate this in the `setup()` function +// by default the HSPI bus pre-defines the following pins +// HSPI_MISO = 12 +// HSPI_MOSI = 13 +// HSPI_SCLK = 14 +// HSPI_SS = 15 + +void setup() { + Serial.begin(115200); + while (!Serial) {} //some boards need this + + hspi = new SPIClass(HSPI); // by default VSPI is used + hspi->begin(); + // to use the custom defined pins, uncomment the following + // hspi->begin(MY_SCLK, MY_MISO, MY_MOSI, MY_SS) + + if (!radio.begin(hspi)) { + Serial.println(F("radio hardware not responding!!")); + while (1) {} // hold program in infinite loop to prevent subsequent errors + } + + // ... continue with program as normal (see library examples/ folder) +} +``` + +#### Teensy example + +@see The overloaded RF24::begin(\_SPI\*) is not needed according to the +[Teensyduino SPI documentation](https://www.pjrc.com/teensy/td_libs_SPI.html). +Please review the table provided in the +[Teensyduino documentation](https://www.pjrc.com/teensy/td_libs_SPI.html) for what pins are used by +default for certain Teensy boards. + +```cpp +#include +#include + +// these pins are the alternate SPI pins available for Teensy LC/3.0/3.1/3.2/3.5/3.6 +#define MY_MISO 8 +#define MY_MOSI 7 +#define MY_SCLK 14 + +// notice these pin numbers are not the same used in the library examples +RF24 radio(2, 0); // the (ce_pin, csn_pin) connected to the radio + +void setup() { + Serial.begin(115200); + while (!Serial) {} //some boards need this + + SPI.setMOSI(MY_MOSI); + SPI.setMISO(MY_MISO); + SPI.setSCK(MY_SCLK); + + if (!radio.begin()) { + Serial.println(F("radio hardware not responding!!")); + while (1) {} // hold program in infinite loop to prevent subsequent errors + } + + // ... continue with program as normal (see library examples/ folder) +} +``` + + diff --git a/.pio/libdeps/esp32-s3-n16r8/RF24/docs/attiny.md b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/attiny.md new file mode 100644 index 0000000..f048438 --- /dev/null +++ b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/attiny.md @@ -0,0 +1,81 @@ +# ATTiny + +@tableofcontents + +ATTiny support for this library relies on the SpenceKonde ATTinyCore. Be sure to have added this core to the Arduino Boards Manager with [this install guide](http://highlowtech.org/?p=1695) + +See the included rf24ping85 example for pin info and usage + +@warning The ATTiny2313 is unsupported due to lack of sufficient memory resources + +Some versions of Arduino IDE may require a patch to allow use of the full program space on ATTiny. See [this resource](https://github.com/TCWORLD/ATTinyCore/tree/master/PCREL%20Patch%20for%20GCC) for the ATTiny patch. + +ATTiny board support initially added from [jscrane/RF24](https://github.com/jscrane/RF24) + +## Hardware Configuration + +By [tong67](https://github.com/tong67) + +### ATtiny25/45/85 Pin map with CE_PIN 3 and CSN_PIN 4 + +```text + +-\/-+ + NC PB5 1|o |8 Vcc --- nRF24L01 VCC, pin2 --- LED --- 5V +nRF24L01 CE, pin3 --- PB3 2| |7 PB2 --- nRF24L01 SCK, pin5 +nRF24L01 CSN, pin4 --- PB4 3| |6 PB1 --- nRF24L01 MOSI, pin6 +nRF24L01 GND, pin1 --- GND 4| |5 PB0 --- nRF24L01 MISO, pin7 + +----+ +``` + +### ATtiny25/45/85 Pin map with CE_PIN 3 and CSN_PIN 3 - PB3 and PB4 are free to use for application + +- Circuit idea from [NerdRalph's 3 pin solution](http://nerdralph.blogspot.ca/2014/01/nrf24l01-control-with-3-attiny85-pins.html) +- Original RC combination was 1K/100nF. 22K/10nF combination worked better. +- For best settle-time delay value in `RF24::csn()` the timingSearch3pin.ino sketch can be used. +- This configuration is enabled when CE_PIN and CSN_PIN are equal, e.g. both 3 +- Because CE is always high the power consumption is higher than for 5 pins solution + +```text + ^^ + +-\/-+ nRF24L01 CE, pin3 ------| // + PB5 1|o |8 Vcc --- nRF24L01 VCC, pin2 ------x----------x--|<|-- 5V + NC PB3 2| |7 PB2 --- nRF24L01 SCK, pin5 --|<|---x-[22k]--| LED + NC PB4 3| |6 PB1 --- nRF24L01 MOSI, pin6 1n4148 | +nRF24L01 GND, pin1 -x- GND 4| |5 PB0 --- nRF24L01 MISO, pin7 | + | +----+ | + |-----------------------------------------------||----x-- nRF24L01 CSN, pin4 + 10nF +``` + +### ATtiny24/44/84 Pin map with CE_PIN 8 and CSN_PIN 7 + +- Schematic provided and successfully tested by [Carmine Pastore](https://github.com/Carminepz) + +```text + +-\/-+ +nRF24L01 VCC, pin2 --- VCC 1|o |14 GND --- nRF24L01 GND, pin1 + PB0 2| |13 AREF + PB1 3| |12 PA1 + PB3 4| |11 PA2 --- nRF24L01 CE, pin3 + PB2 5| |10 PA3 --- nRF24L01 CSN, pin4 + PA7 6| |9 PA4 --- nRF24L01 SCK, pin5 +nRF24L01 MISO, pin7 --- PA6 7| |8 PA5 --- nRF24L01 MOSI, pin6 + +----+ +``` + +### ATtiny2313/4313 Pin map with CE_PIN 12 and CSN_PIN 13 + +```text + +-\/-+ + PA2 1|o |20 VCC --- nRF24L01 VCC, pin2 + PD0 2| |19 PB7 --- nRF24L01 SCK, pin5 + PD1 3| |18 PB6 --- nRF24L01 MOSI, pin6 + PA1 4| |17 PB5 --- nRF24L01 MISO, pin7 + PA0 5| |16 PB4 --- nRF24L01 CSN, pin4 + PD2 6| |15 PB3 --- nRF24L01 CE, pin3 + PD3 7| |14 PB2 + PD4 8| |13 PB1 + PD5 9| |12 PB0 +nRF24L01 GND, pin1 --- GND 10| |11 PD6 + +----+ +``` diff --git a/.pio/libdeps/esp32-s3-n16r8/RF24/docs/atxmega.md b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/atxmega.md new file mode 100644 index 0000000..721c088 --- /dev/null +++ b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/atxmega.md @@ -0,0 +1,57 @@ +# ATXMEGA + +@tableofcontents + +The RF24 driver can be build as a static library with Atmel Studio 7 in order to be included as any other library in another program for the XMEGA family. + +Currently only the [ATXMEGA D3](https://www.microchip.com/wwwproducts/en/ATxmega64d3) family is implemented. + +## Preparation + +Create an empty GCC Static Library project in Atmel Studio 7. + +As not all files are required, copy the following directory structure in the project: + +```text +utility\ + ATXMegaD3\ + compatibility.c + compatibility.h + gpio.cpp + gpio.h + gpio_helper.c + gpio_helper.h + includes.h + RF24_arch_config.h + spi.cpp + spi.h +nRF24L01.h +printf.h +RF24.cpp +RF24.h +RF24_config.h +``` + +## Usage + +Add the library to your project! + +In the file where the `main()` is put the following in order to update the millisecond functionality: + +```cpp +ISR(TCE0_OVF_vect) +{ + update_milisec(); +} +``` + +Declare the rf24 radio with `RF24 radio(XMEGA_PORTC_PIN3, XMEGA_SPI_PORT_C);` + +1. First parameter is the CE pin which can be any available pin on the microcontroller. +2. Second parameter is the CS which can be on port C (**XMEGA_SPI_PORT_C**) or on port D (**XMEGA_SPI_PORT_D**). + +Call the `__start_timer()` to start the millisecond timer. + +@note The millisecond functionality is based on the TCE0 so don't use these pins as IO. + +@note The operating frequency of the uC is 32MHz. If you have a different frequency, change the TCE0 registers appropriately in function `__start_timer()` in **compatibility.c** file for your frequency. diff --git a/.pio/libdeps/esp32-s3-n16r8/RF24/docs/cross_compile.md b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/cross_compile.md new file mode 100644 index 0000000..b1a4396 --- /dev/null +++ b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/cross_compile.md @@ -0,0 +1,63 @@ +# Linux cross-compilation + +@tableofcontents + + +@warning These instructions are no longer recommended because they involve disabling security measures +for the target system. Please try the [instructions using CMake](using_cmake.md). + +RF24 library supports cross-compilation. Advantages of cross-compilation: + +- development tools don't have to be installed on target machine +- resources of target machine don't have to be sufficient for compilation +- compilation time can be reduced for large projects + +Following prerequisites need to be assured: + +- ssh password-less access to target machine [Here is a hint](https://linuxconfig.org/passwordless-ssh) +- sudo of a remote user without password [Here is a hint](http://askubuntu.com/questions/334318/sudoers-file-enable-nopasswd-for-user-all-commands) +- cross-compilation toolchain for your target machine; for RPi + ```shell + git clone https://github.com/raspberrypi/tools rpi_tools + ``` + and cross-compilation tools must be in PATH, for example + ```shell + export PATH=$PATH:/your/dir/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin + ``` + +## Cross compilation steps + +1. clone RF24 to a machine for cross-compilation + ```shell + git clone https://github.com/nRF24/RF24 + cd RF24 + ``` +2. configure for cross compilation + ```shell + ./configure --remote=pi@target_linux_host + ``` + eventually + ```shell + ./configure --remote=pi@target_linux_host --driver= + ``` +3. build + ```shell + make + ``` +4. (optional) install library to cross-compilation machine into cross-environment - important for compilation of examples + ```shell + sudo make install + ``` +5. upload library to target machine + ```shell + make upload + ``` +6. (optional) compile examples + ```shell + cd examples_linux + make + ``` +7. (optional) upload examples to target machine + ```shell + make upload + ``` diff --git a/.pio/libdeps/esp32-s3-n16r8/RF24/docs/doxygen-custom.css b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/doxygen-custom.css new file mode 100644 index 0000000..4a3c469 --- /dev/null +++ b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/doxygen-custom.css @@ -0,0 +1,166 @@ +table.markdownTable th { + color: unset; +} + +/* overrides from default CSS for some admonitions */ +dl.note, +dl.remark, +dl.warning, +dl.attention, +dl.important, +dl.deprecated, +dl.see { + color: unset; + box-shadow: 5px 5px 5px hsla(0, 0%, 19.2%, 0.5); +} + +dl.remark { + background: var(--remark-color-bg); + border-left: 8px solid var(--remark-color-hl); +} + +dl.remark dt { + color: var(--remark-color-hl); +} + +dl.important dt { + color: var(--important-color-hl); +} + +dl.important { + background: var(--important-color-bg); + border-left: 8px solid var(--important-color-hl); +} + +dl.attention dt { + color: var(--attention-color-hl); +} + +dl.attention { + background: var(--attention-color-bg); + border-left: 8px solid var(--attention-color-hl); +} + +dl.deprecated dt { + color: var(--deprecated-color-hl); +} + +dl.deprecated { + background: var(--deprecated-color-bg); + border-left: 8px solid var(--deprecated-color-hl); +} + +/* special rules to accent `/see` or `/sa` command output */ +dl.see { + background: var(--seealso-color-bg); + border-left: 8px solid var(--seealso-color-hl); +} + +dl.see dt { + color: var(--seealso-color-hl); +} + +dl.see { + padding: 10px; + margin: 10px 0px; + overflow: hidden; + margin-left: 0; + border-radius: 4px; +} + +dl.see dd { + margin-left: 0; +} + +/* admonition icons */ +dl.note dt::before { + background-color: var(--note-color-hl); + mask-image: var(--note-icon); +} + +dl.see dt::before { + background-color: var(--seealso-color-hl); + mask-image: var(--seealso-icon); +} + +dl.remark dt::before { + background-color: var(--remark-color-hl); + mask-image: var(--remark-icon); +} + +dl.warning dt::before { + background-color: var(--warning-color-hl); + mask-image: var(--warning-icon); +} + +dl.deprecated dt::before { + background-color: var(--deprecated-color-hl); + mask-image: var(--deprecated-icon); +} + +dl.important dt::before { + background-color: var(--important-color-hl); + mask-image: var(--important-icon); +} + +dl.attention dt::before { + background-color: var(--attention-color-hl); + mask-image: var(--attention-icon); +} + +dl.note dt::before, +dl.see dt::before, +dl.warning dt::before, +dl.remark dt::before, +dl.deprecated dt::before, +dl.important dt::before, +dl.attention dt::before { + vertical-align: middle; + background-repeat: no-repeat; + content: ""; + display: inline-block; + height: 2em; + width: 2em; + margin-right: 0.25rem; +} + +dl.note dt, +dl.see dt, +dl.warning dt, +dl.remark dt, +dl.deprecated dt, +dl.important dt, +dl.attention dt { + margin-top: -0.35em; + margin-bottom: 0.5em; +} + +/* icon SVG data */ +*:root { + --note-icon: url('data:image/svg+xml;utf8,'); + --warning-icon: url('data:image/svg+xml;utf8,'); + --remark-icon: url('data:image/svg+xml;utf8,'); + --attention-icon: url('data:image/svg+xml;utf8,'); + --important-icon: url('data:image/svg+xml;utf8,'); + --seealso-icon: url('data:image/svg+xml;utf8,'); + --deprecated-icon: url('data:image/svg+xml;utf8,'); +} + +/* color overrides */ +html, +html.dark-mode { + --note-color-hl: hsl(213.7, 92.8%, 62%); + --note-color-bg: hsla(213.7, 92.8%, 62%, 12.5%); + --warning-color-hl: hsl(40.6, 72.1%, 47.8%); + --warning-color-bg: hsla(40.6, 72.1%, 47.8%, 12.5%); + --attention-color-hl: hsl(2.7, 92.6%, 62.9%); + --attention-color-bg: hsla(2.7, 92.6%, 62.9%, 12.5%); + --deprecated-color-hl: hsl(0, 0%, 47%); + --deprecated-color-bg: hsla(0, 0%, 47%, 12.5%); + --seealso-color-hl: hsl(323, 72%, 52%); + --seealso-color-bg: hsla(323, 72%, 52%, 12.5%); + --remark-color-hl: hsl(128.4, 49.2%, 48.6%); + --remark-color-bg: hsla(128.4, 49.2%, 48.6%, 12.5%); + --important-color-hl: hsl(262.4, 89.8%, 73.1%); + --important-color-bg: hsla(262.4, 89.8%, 73.1%, 12.5%); +} \ No newline at end of file diff --git a/.pio/libdeps/esp32-s3-n16r8/RF24/docs/images/Logo large.png b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/images/Logo large.png new file mode 100644 index 0000000..25e4215 Binary files /dev/null and b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/images/Logo large.png differ diff --git a/.pio/libdeps/esp32-s3-n16r8/RF24/docs/images/favicon.ico b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/images/favicon.ico new file mode 100644 index 0000000..c15a165 Binary files /dev/null and b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/images/favicon.ico differ diff --git a/.pio/libdeps/esp32-s3-n16r8/RF24/docs/linux_install.md b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/linux_install.md new file mode 100644 index 0000000..73ca893 --- /dev/null +++ b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/linux_install.md @@ -0,0 +1,152 @@ +# Linux Installation + +@tableofcontents + +Generic Linux devices are supported via SPIDEV, PiGPIO, MRAA, RPi native via BCM2835, or using LittleWire. + +@note The SPIDEV option should work with most Linux systems supporting spi userspace device. + + +### Automatic Installation (New) + +Using CMake: (See the [instructions using CMake](using_cmake.md) for more information and options) + +1. Download the install.sh file from [https://github.com/nRF24/.github/blob/main/installer/install.sh](https://github.com/nRF24/.github/blob/main/installer/install.sh) + ```shell + wget https://raw.githubusercontent.com/nRF24/.github/main/installer/install.sh + ``` +2. Make it executable + ```shell + chmod +x install.sh + ``` +3. Run it and choose your options + ```shell + ./install.sh + ``` + + @warning + `SPIDEV` is now always selected as the default driver because + all other Linux drivers are being removed in the future. + See [RF24 issue #971](https://github.com/nRF24/RF24/issues/971) for rationale. + + It will also ask to install a python package named [pyRF24](https://github.com/nRF24/pyRF24). + This is not the same as the traditionally provided python wrappers because the pyRF24 package can be + used independent of the C++ installed libraries. For more information on this newer python + package, please check out [the pyRF24 documentation](https://nrf24.github.io/pyRF24/). +4. Try an example from one of the libraries + ```shell + cd ~/rf24libs/RF24/examples_linux + ``` + + Edit the gettingstarted example, to set your pin configuration + ```shell + nano gettingstarted.cpp + ``` + + Build the examples. Remember to set the `RF24_DRIVER` option according to the one that was + selected during the scripted install. + ```shell + mkdir build && cd build + cmake .. -D RF24_DRIVER=SPIDEV + make + ``` + + Run the example + ```shell + sudo ./gettingstarted + ``` + +See the [instructions using CMake](using_cmake.md) for more information and options + +## Automated Install (Deprecated - 32 bit only) + +**Designed & Tested on RPi** - Defaults to SPIDEV on devices supporting it + +1. Install prerequisites if there are any (pigpio, MRAA, LittleWire libraries, setup SPI device etc) +2. Download the install.sh file from [http://tmrh20.github.io/RF24Installer/RPi/install.sh](http://tmrh20.github.io/RF24Installer/RPi/install.sh) + ```shell + wget http://tmrh20.github.io/RF24Installer/RPi/install.sh + ``` +3. Make it executable + ```shell + chmod +x install.sh + ``` +4. Run it and choose your options + ```shell + ./install.sh + ``` + + @warning + `SPIDEV` is now always selected as the default driver because + all other Linux drivers are being removed in the future. + See [RF24 issue #971](https://github.com/nRF24/RF24/issues/971) for rationale. + +5. Run an example from one of the libraries + ```shell + cd rf24libs/RF24/examples_linux + ``` + Edit the gettingstarted example, to set your pin configuration + ```shell + nano gettingstarted.cpp + make + sudo ./gettingstarted + ``` + +## Manual Install (Deprecated - 32 bit only) + +1. Install prerequisites if there are any (pigpio, MRAA, LittleWire libraries, setup SPI device etc) + @note See the [MRAA](http://iotdk.intel.com/docs/master/mraa/index.html) documentation for more info on installing MRAA +2. Make a directory to contain the RF24 and possibly RF24Network lib and enter it + ```shell + mkdir ~/rf24libs + cd ~/rf24libs + ``` +3. Clone the RF24 repo + ```shell + git clone https://github.com/tmrh20/RF24.git RF24 + ``` +4. Change to the new RF24 directory + ```shell + cd RF24 + ``` +5. Configure build environment using the command: + ```shell + ./configure + ``` + It automatically detects device and build environment. + + @warning + `SPIDEV` is now always selected as the default driver because + all other Linux drivers are being removed in the future. + See [RF24 issue #971](https://github.com/nRF24/RF24/issues/971) for rationale. + + For overriding automatic detections, use command-line arguments, see + ```shell + ./configure --help + ``` + for description. +6. Build the library, and run an example file + ```shell + make + sudo make install + ``` + ```shell + cd examples_linux + ``` + Edit the gettingstarted example, to set your pin configuration + ```shell + ano gettingstarted.cpp + make + sudo ./gettingstarted + ``` + +### Build using SPIDEV (Deprecated - 32 bit only) + +1. Make sure that spi device support is enabled and /dev/spidev\.\ is present +2. Manual Install using SPIDEV: + ```shell + ./configure --driver=SPIDEV + make + sudo make install + ``` +3. See the gettingstarted example for an example of pin configuration diff --git a/.pio/libdeps/esp32-s3-n16r8/RF24/docs/main_page.md b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/main_page.md new file mode 100644 index 0000000..6539549 --- /dev/null +++ b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/main_page.md @@ -0,0 +1,90 @@ +# Optimized High Speed Driver for nRF24L01(+) 2.4GHz Wireless Transceiver + +@tableofcontents + +## Design Goals + +This library fork is designed to be... + +- More compliant with the manufacturer specified operation of the chip, while allowing advanced users + to work outside the recommended operation. +- Utilize the capabilities of the radio to their full potential via Arduino +- More reliable, responsive, bug-free and feature rich +- Easy for beginners to use, with well documented examples and features +- Consumed with a public interface that's similar to other Arduino standard libraries + +## News + +See the releases' descriptions on +[the library's release page](http://github.com/nRF24/RF24/releases) for a list of +changes. + +> [!IMPORTANT] +> There's going to be major changes in v2.0. +> As of v1.5, there is [newer API](migration.md) that should be used instead of +> the @ref deprecated "deprecated API". +> +> See our [migration guide](migration.md) to understand what you should update in your code. + +## Useful References + +- [RF24 Class Documentation](classRF24.html) +- [Support & Configuration](pages.html) +- [Source Code](https://github.com/nRF24/RF24/) +- [Datasheets](https://github.com/nRF24/RF24/tree/master/datasheets) + +### Additional Information and Add-ons + +- [RF24Network](http://nRF24.github.io/RF24Network): OSI Network Layer for multi-device communication. Create a home sensor network. +- [RF24Mesh](http://nRF24.github.io/RF24Mesh): Dynamic Mesh Layer for RF24Network +- [RF24Ethernet](http://nRF24.github.io/RF24Ethernet): TCP/IP Radio Mesh Networking (shares Arduino Ethernet API) +- [RF24Audio](http://nRF24.github.io/RF24Audio): Realtime Wireless Audio streaming +- [nrf_to_nrf](https://github.com/TMRh20/nrf_to_nrf): OSI Layer 2 radio driver for NRF52x radios. Replaces RF24 layer for new radio devices. +- [RF24G](https://hobietime.github.io/RF24G/html/): Create a true mesh of up to 7 nrf24l01 and/or nrf52x devices +- [TMRh20 Blog: RF24 Optimization Overview](http://tmrh20.blogspot.com/2014/03/high-speed-data-transfers-and-wireless.html) +- [TMRh20: RPi/Linux with RF24Gateway](http://tmrh20.blogspot.com/2016/08/raspberry-pilinux-with-nrf24l01.html) +- [All TMRh20 Documentation Main Page](http://tmrh20.github.io/) + +### More Information + +- [Project Blog: TMRh20.blogspot.com](http://TMRh20.blogspot.com) +- [Maniacal Bits Blog](http://maniacalbits.blogspot.ca/) +- [Original Maniacbug RF24Network Blog Post](https://maniacbug.wordpress.com/2012/03/30/rf24network/) +- [ManiacBug on GitHub](https://github.com/maniacbug/RF24) (Original Library Author) +- [MySensors.org](http://www.mysensors.org/) (User friendly sensor networks/IoT) + +## Platform Support Pages + +- [Arduino](arduino.md) (Uno, Nano, Mega, Due, Galileo, etc) +- [ATTiny](attiny.md) +- [Pico SDK support](pico_sdk.md) +- [Linux Installation](linux_install.md) (or the alternative [instructions using CMake](using_cmake.md)), + ([Linux/RPi General](rpi_general.md), [MRAA](mraa.md) supported boards (Galileo, Edison, etc), LittleWire) +- [Cross-compilation](cross_compile.md) for linux devices +- [Python wrapper](python_wrapper.md) available for Linux devices + +### General µC Pin layout + +@see also the individual board [support pages](pages.html) for more info + +Observe + +![pinout.jpg](images/pinout.jpg) + +The table below shows how to connect the the pins of the NRF24L01(+) to different boards. +CE and CSN are configurable. + +| PIN | NRF24L01 | Arduino UNO | ATtiny25/45/85 [0] | ATtiny44/84 [1] | LittleWire [2] | RPI | RPi -P1 Connector | +| --- | -------- | ----------- | ------------------ | --------------- | ----------------------- | ---------- | ----------------- | +| 1 | GND | GND | pin 4 | pin 14 | GND | rpi-gnd | (25) | +| 2 | VCC | 3.3V | pin 8 | pin 1 | regulator 3.3V required | rpi-3v3 | (17) | +| 3 | CE | digIO 7 | pin 2 | pin 12 | pin to 3.3V | rpi-gpio22 | (15) | +| 4 | CSN | digIO 8 | pin 3 | pin 11 | RESET | rpi-gpio8 | (24) | +| 5 | SCK | digIO 13 | pin 7 | pin 9 | SCK | rpi-sclk | (23) | +| 6 | MOSI | digIO 11 | pin 6 | pin 7 | MOSI | rpi-mosi | (19) | +| 7 | MISO | digIO 12 | pin 5 | pin 8 | MISO | rpi-miso | (21) | +| 8 | IRQ | - | - | - | - | - | - | + +- [0] https://learn.sparkfun.com/tutorials/tiny-avr-programmer-hookup-guide/attiny85-use-hints +- [1] http://highlowtech.org/?p=1695 The ATTiny2313 is unsupported due to lack of sufficient memory resources. +- [2] http://littlewire.github.io/ diff --git a/.pio/libdeps/esp32-s3-n16r8/RF24/docs/migration.md b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/migration.md new file mode 100644 index 0000000..b4d3782 --- /dev/null +++ b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/migration.md @@ -0,0 +1,287 @@ +# Migration guide + +@tableofcontents + + + +This is a collection of snippets that highlight preferred API over the deprecated original API. + +## isAckPayloadAvailable() + +> **Deprecated since v1.4.2** + +This function is equivalent to `RF24::available()`. +Any use of `RF24::isAckPayloadAvailable()` is interchangeable with `RF24::available()`. + + + + +
OldNew (supported)
+ +```cpp +if radio.isAckPayloadAvailable() { /* .. */ } +``` + + + +```cpp +if radio.available() { /* .. */ } +``` + +
+ +## 64-bit integer addresses + +Any function that accept an address in the form of `uint64_t` is discouraged. This includes + +- `RF24::openReadingPipe(uint8_t, uint64_t)` + > **Deprecated since v1.3.11** +- `RF24::openWritingPipe(uint64_t)` + > **Deprecated since v1.3.11** +- `RF24::stopListening(const uint64_t)` + > **Deprecated since v1.5** + +These functions' address parameter use a 64-bit unsigned integer (`uint64_t`). +The nRF24L01 can only use up to 40 bit addresses. +Thus, there is an unused 24 bits being allocated for addresses using these functions. + +There are overloaded functions that use a buffer instead: + +- `RF24::openReadingPipe(uint8_t, const uint8_t*)` +- `RF24::openWritingPipe(const uint8_t*)` +- `RF24::stopListening(const uint8_t*)` + +These eliminate the unnecessary 24 bits by only using the length of the buffer (`uint8_t*`) +specified by `RF24::setAddressWidth()`. + +@see The `RF24::openWritingPipe(const uint8_t*)` is now deprecated in favor of the +overloaded `RF24::stopListening(const uint8_t*)` function. +See the section below for more detail. + +> [!CAUTION] +> The endianness (byte order) of a buffer is reversed compared to a 64-bit integer. +> ```c +> uint64_t address = 0xB3B4B5B6C2; +> // is the same address as +> uint8_t address[5] = {0xC2, 0xB6, 0xB5, 0xB4, 0xB3}; +> ``` +> Notice the MSB (Most Significant Byte) `0xC2` is last in the integer but first in the buffer. + + + + +
OldNew (supported)
+ +```cpp +uint64_t address = 0xB3B4B5B6C2; +radio.openReadingPipe(1, address); +``` + + + +```cpp +uint8_t address[5] = {0xC2, 0xB6, 0xB5, 0xB4, 0xB3}; +radio.openReadingPipe(1, address); +``` + +
+ +> [!NOTE] +> Our examples actually use a C-string casted as an array of 6 bytes. +> That's because a C-string (`char*`) must be NULL terminated (`\0` at the end) in memory. +> ```c +> uint8_t address[][6] = { "1Node", "2Node" }; +> // is equivalent to +> uint8_t address[][6] = { { '1', 'N', 'o', 'd', 'e', '\0' }, +> { '2', 'N', 'o', 'd', 'e', '\0' } }; +> ``` + +## isFifo(bool, bool) + +> **Deprecated since v1.4.11** + +Introduced as a compliment to `RF24::isFifo(bool)` in v1.4.3, this function was +supposed to provide a specific detail about a specified radio's FIFO. However, it was +discovered that the function may not highlight binary corruption (`RF24_FIFO_INVALID`) +observed in the SPI bus' MISO line. + +A fix was introduced using enumerated values of `rf24_fifo_state_e`. +Since then, `RF24::isFifo(bool)` is now preferred as it accurately describes the result. + + + + +
OldNew (supported)
+ +```cpp +bool rxFifoEmpty = radio.isFifo(false, true); +``` + + + +```cpp +bool rxFifoEmpty = radio.isFifo(false) == RF24_FIFO_EMPTY; +``` + +
+ +## maskIRQ() + +> **Deprecated since v1.5** + +Originally `RF24::maskIRQ()` was the only function provided to influence the radio's IRQ pin. +However, the 3 required boolean parameters made this prone to bugs in user code. +The parameters' meaning was confusingly reversed, and they were easily misplaced in the wrong order. + +A better approach was introduced with `RF24::setStatusFlags()`. +It's 1 parameter accepts values defined by the `rf24_irq_flags_e` enumerated constants. +These constant values specify individual events; +they can also be OR'd together to specify multiple events. + + + + +
OldNew (supported)
+ +```cpp +// IRQ pin only activated by "RX Data Ready" event +radio.maskIRQ(1, 1, 0); + +// IRQ pin activated by "TX Data Sent" and TX Data Failed" events +radio.maskIRQ(0, 0, 1); + +// IRQ pin activated by all events +radio.maskIRQ(0, 0, 0); + +// IRQ pin disabled +radio.maskIRQ(1, 1, 1); +``` + + + +```cpp +// IRQ pin only activated by "RX Data Ready" event +radio.setStatusFlags(RF24_RX_DR); + +// IRQ pin activated by "TX Data Sent" and TX Data Failed" events +radio.setStatusFlags(RF24_TX_DS | RF24_TX_DF); + +// IRQ pin activated by all events +radio.setStatusFlags(RF24_IRQ_ALL); + +// IRQ pin disabled +radio.setStatusFlags(RF24_IRQ_NONE); +// or equivalently +radio.setStatusFlags(); +``` + +
+ +## whatHappened() + +> **Deprecated since v1.5** + +Originally, `RF24::whatHappened()` was the only way to clear the events that triggered the IRQ pin. +Like `maskIRQ()`, this was also prone to bugs because of the 3 required boolean parameters +(passed by reference). + +The aptly named `RF24::clearStatusFlags()` is designed to be a replacement for `RF24::whatHappened()`. +Like `RF24::clearStatusFlags()`, `RF24::setStatusFlags()` takes 1 parameter whose value is defined by +the `rf24_irq_flags_e` enumerated constants. These constant values specify individual flags; +they can also be OR'd together to specify multiple flags. + +Additionally, `RF24::clearStatusFlags()` returns the STATUS byte containing the flags that +caused the IRQ pin to go active LOW. +This allows the user code to allocate less memory when diagnosing the IRQ pin's meaning. + + + + +
OldNew (supported)
+ +```cpp +bool tx_ds, tx_df, rx_dr; +radio.whatHappened(tx_ds, tx_df, rx_dr); +``` + + + +```cpp +uint8_t flags = radio.clearStatusFlags(); +// or equivalently +uint8_t flags = radio.clearStatusFlags(RF24_IRQ_ALL); + +// focus on the events you care about +if (flags & RF24_TX_DS) { /* TX data sent */ } +if (flags & RF24_TX_DF) { /* TX data failed to send */ } +if (flags & RF24_RX_DR) { /* RX data is in the RX FIFO */ } + +// only clear the "TX Data Sent" and TX Data Failed" events +radio.clearStatusFlags(RF24_TX_DS | RF24_TX_DF); + +// only clear the "RX Data Ready" event +radio.clearStatusFlags(RF24_RX_DR); +``` + +
+ +## openWritingPipe(const uint8_t*) + +> Deprecated since v1.5 + +Originally, `RF24::openWritingPipe(const uint8_t*)` was just a compliment to +`RF24::openReadingPipe()`. +It changes the address on pipe 0 because that is the only pipe that can be +used for transmitting. + +Unfortunately, there was a bug that prevented the given TX address from being +persistent on pipe 0 if the user code also set an RX address to pipe 0. +This bug would surface when switching between RX mode and TX mode (via +`RF24::startListening()` and `RF24::stopListening()` respectively) or after +`RF24::stopConstCarrier()` (if `RF24::isPVariant()` returns `true`). + +The solution is to cache the TX address on the `RF24` instance. +Consequently, this solution did not fit well with the traditional order of +functions used to set up the radio's TX or RX mode. + +By overloading `RF24::stopListening(const uint8_t*)`, we are able to ensure proper radio +setup without requiring certain functions are called in a certain order. + +- Use `RF24::stopListening(const uint8_t*)` to set the TX address and enter inactive TX mode. + `RF24::openReadingPipe()` can now (as of v1.5) be used in TX mode without consequence. +- Use `RF24::stopListening()` to enter inactive TX mode without changing the TX address. + +> [!warning] +> Avoid using pipe 0 for RX operations to improve performance and reliability. +> +> For implementation detail, see the source for `RF24::openReadingPipe()` and +> `RF24::stopListening()`. Ultimately, the datasheet's Appendix A has a detailed +> example outlining the order of a proper radio setup. + + + + +
OldNew (supported)
+ +```cpp +// set TX address (pipe 0) +radio.openWritingPipe(tx_address); + +// set RX address (pipe 1) +radio.openReadingPipe(1, rx_address); + +// idle radio using inactive TX mode +radio.stopListening(); +``` + + + +```cpp +// set TX address (pipe 0) +radio.stopListening(tx_address); // enters inactive TX mode + +// set RX address (pipe 1) +radio.openReadingPipe(1, rx_address); +``` + +
diff --git a/.pio/libdeps/esp32-s3-n16r8/RF24/docs/mraa.md b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/mraa.md new file mode 100644 index 0000000..175b7b4 --- /dev/null +++ b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/mraa.md @@ -0,0 +1,42 @@ +# MRAA + +@tableofcontents + + +MRAA is a Low Level Skeleton Library for Communication on GNU/Linux platforms. +Review the [MRAA documentation](http://iotdk.intel.com/docs/master/mraa/index.html) for more information + +RF24 supports all MRAA supported platforms, but it might not have been tested on each individual platform due to the wide range of hardware support: + +- [Report an RF24 bug or issue](https://github.com/TMRh20/RF24/issues) + +## Setup and installation + +Build using the **MRAA** library from [MRAA documentation](http://iotdk.intel.com/docs/master/mraa/index.html) + +MRAA is not included. + +1. Install, and build MRAA + ```shell + git clone https://github.com/intel-iot-devkit/mraa.git + cd mraa + mkdir build + cd build + cmake .. -DBUILDSWIGNODE=OFF + sudo make install + ``` +2. Complete the install + ```shell + nano /etc/ld.so.conf + ``` + Add the line + ```shell + /usr/local/lib/arm-linux-gnueabihf + ``` + Run + ```shell + sudo ldconfig + ``` +3. Install RF24, using MRAA + + See [Linux Install instructions](linux_install.md) diff --git a/.pio/libdeps/esp32-s3-n16r8/RF24/docs/pico_sdk.md b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/pico_sdk.md new file mode 100644 index 0000000..6b17927 --- /dev/null +++ b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/pico_sdk.md @@ -0,0 +1,234 @@ +# Raspberry Pi Pico SDK (for the RP2040) + +@tableofcontents + + +Just to be very clear and concise: The following instructions are +**not required to use the Arduino IDE** with any RP2040-based boards. +These instructions pertain to using only [Raspberry Pi's Pico SDK](https://github.com/raspberrypi/pico-sdk) +for RP2040 based boards. + +## Prerequisite + +Follow Raspberry Pi's +["Getting Started with Pico" document](https://rptl.io/pico-get-started) to +setup a proper development environment on your host PC (the machine that +will build your project). Notice that the setup instructions are a little +different for building on a Windows PC. + +Either set an environment variable named `PICO_SDK_PATH` that points to your +local clone of the pico-sdk or put the pico-sdk next to the RF24 folder or +next to the folder containing your project using the RF24 library: + + path/to/github/repos/ + pico-sdk/ + RF24/ + my_rf24_project/ + +Alternatively, the RF24 repository (and optionally the RF24Network and RF24Mesh +repositories) can be included into your project's "lib" folder as copies or +git submodules. For more detail, see the below instructions to incorporate +RF24 libs into your project. + +## Building the RF24 examples for the Pico SDK + +Each example imports a set of constants (`CE_PIN`, `CSN_PIN`, `IRQ_PIN`) from the +examples_pico/defaultPins.h file. Default values for SPI pins (SCK, MOSI, MISO) +come from the Pico SDK repository's +[pico-sdk/src/boards/include/boards/\.h files](https://github.com/raspberrypi/pico-sdk/tree/master/src/boards/include/boards) + +1. Create a "build" directory in the RF24 repository's root directory and + navigate to it: + ```sh + cd RF24 + mkdir build + cd build + ``` +2. Configure CMake for your desired build type and specific RP2040-based board + ```sh + cmake ../examples_pico -DCMAKE_BUILD_TYPE=Release -DPICO_BOARD=pico + ``` + Or if building on a Windows PC: + ```sh + cmake -G "NMake Makefiles" ../examples_pico -DCMAKE_BUILD_TYPE=Release -DPICO_BOARD=pico + ``` + The supported RP2040-based boards are listed in header files in the Pico SDK + repository's [pico-sdk/src/boards/include/boards/\.h files](https://github.com/raspberrypi/pico-sdk/tree/master/src/boards/include/boards). + If the `-DPICO_BOARD` option is not specified, then the Pico SDK will default to building for the Raspberry Pi Pico board. +3. Build the examples using the CMakeLists.txt file located in the + RF24/examples_pico directory. + ```sh + cmake --build . --config Release + ``` + Notice we specified the build type again using the `--config` option. + + @note If you see an error stating "'PICO_DEFAULT_SPI_SCK_PIN' was not declared in this scope", + then it means the board you selected with the `-DPICO_BOARD` option (in step 2) does not have a + default set of SPI pins defined for it. To workaround this error, see the below instructions to + use different pins for the SPI bus. + + @warning If doing consecutive build attempts, it is strongly encouraged to delete all files in the build + directory before re-attempting to build the project. + +## Incorporating RF24 libs into your project + +In order to use the RF24 libraries in your RP2040 based project: + +1. Make a copy of the RF24 library (and optionally RF24Network and RF24Mesh + libraries) in a "lib" directory located in your project's root directory. + + path/to/my/project/ + lib/ + RF24/ + RF24Network/ + RF24Mesh/ + src/ + CMakeLists.txt + ... + + Alternatively you can add the RF24\* repositories as [git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules). +2. Include their CMakeLists.txt files from the RF24 libraries in your project's top-level + CMakeLists.txt file (usually located in the "src" directory). The following snippet + assumes that your project's "src" directory is on the same level as the previously + mentioned "lib" directory. + ```cmake + include(../lib/RF24/CMakeLists.txt) + include(../lib/RF24Network/CMakeLists.txt) + include(../lib/RF24Mesh/CMakeLists.txt) + ``` +3. In the same CMakeLists.txt file from step 2, add the RF24 libraries into the + `target_link_libraries` configuration: + ```cmake + target_link_libraries(${CMAKE_PROJECT_NAME} + # ... Your project's other libraries ... + RF24 + RF24Network + RF24Mesh + ) + ``` + If you are using tinyUSB, this line (or similar) should already exist: + ```cmake + target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}) + ``` +4. Finally, remember to include the necessary RF24\* libraries' header files in your + project's source code where applicable. + ```cpp + #include + #include + #include + ``` + @note Any of the project's source file(s) that includes any of RF24\* libraries must be a C++ file. + It is highly recommended to use the `.cpp` file extension for such project source files. + +## Using different pins for the SPI bus + +Initially (without modification), the SPI bus uses the default pins defined in the +Pico SDK repository's [pico-sdk/src/boards/include/boards/\.h files](https://github.com/raspberrypi/pico-sdk/tree/master/src/boards/include/boards). +However, there may be some boards that do not define the necessary pins to use as defaults. This can +be remedied using either project source code or build-time configuration. + +@warning There is no support for software driven SPI on RP2040 based boards at this time. +If someone is so inclined to implement this using the Pico SDK's PIO (Programmable Input +Output) feature, please submit an issue or pull request to the +[RF24 repository](http://github.com/nRF24/RF24). + +@note Before deciding what pins to use for the SPI bus, review the +[GPIO pins' "Function Select Table" in the Pico SDK documentation](https://raspberrypi.github.io/pico-sdk-doxygen/group__hardware__gpio.html#details). +There are essentially 2 SPI buses with multiple pin options for each. + +### Project Source code option + +This option is the most reliable and flexible. It involves calling `SPI.begin()` and then passing the `SPI` object to `RF24::begin(_SPI*)`. + +```cpp +#include + +RF24 radio(7, 8); // pin numbers connected to the radio's CE and CSN pins (respectively) +SPI spi; + +int main() +{ + // again please review the GPIO pins' "Function Select Table" in the Pico SDK docs + spi.begin(spi0, 2, 3, 4); // spi0 or spi1 bus, SCK, TX, RX + + if (!radio.begin(&spi)) { + printf("Radio hardware is not responding!\n"); + } + // continue with program as normal ... +} +``` + +### Build-time configuration option + +To specify the default SPI pins used at build time, you can use either: + +1. declare these pins in the CMakeLists.txt file + ```cmake + target_compile_definitions(${CMAKE_PROJECT_NAME} + PUBLIC PICO_DEFAULT_SPI=0 # can only be 0 or 1 (as in `spi0` or `spi1`) + PUBLIC PICO_DEFAULT_SPI_SCK_PIN=2 # depends on which SPI bus (0 or 1) is being used + PUBLIC PICO_DEFAULT_SPI_TX_PIN=3 # depends on which SPI bus (0 or 1) is being used + PUBLIC PICO_DEFAULT_SPI_RX_PIN=4 # depends on which SPI bus (0 or 1) is being used + ) + ``` +2. additional command line arguments + ```shell + cmake --build . --config Release -DPICO_DEFAULT_SPI=0 -DPICO_DEFAULT_SPI_SCK_PIN=2 -DPICO_DEFAULT_SPI_TX_PIN=3 -DPICO_DEFAULT_SPI_RX_PIN=4 + ``` + +## Using Multiple Radios + +It is possible to drive multiple nRF24L01 transceivers on a single board. To do this each radio needs dedicated digital output pins for the CE and CSN pins. + +@warning The RPi Pico board's 3v regulator is typically insufficient to power more than 1 radio. +It is also worth mentioning that the RPi Pico board uses a switching regulator which inherently +produces electrical noise (a not steady 3v signal otherwise referred to as "power instability"). + +If you want to drive each radio with a separate SPI bus, then the following example will demonstrate how to do that. + +```cpp +#include + +// Declare the pin numbers connected to the radios' CE and CSN pins (respectively) +RF24 radio0(8, 5); // first radio object +RF24 radio1(14, 13); // second radio object + +// By default, one SPI bus instance is created by the RF24 lib. We'll use this +// default instance of the `spi0` interface for our first radio, but we want a +// different SPI bus for the second radio. +// +// So, here we declare a second SPI bus instance: +SPI my_spi; // we specify the `spi1` bus interface below + +bool setupRadios() +{ + // Initialize the first radio using the default SPI instance + if (!radio0.begin()) { + printf("Radio0 hardware is not responding!\n"); + return false; + } + // first radio object initialized successfully + + // specify the the second SPI bus interface and corresponding GPIO pins + my_spi.begin(spi1, 10, 11, 12); // spi1 bus, SCK, TX, RX + if (!radio1.begin(&my_spi)) { + printf("Radio1 hardware is not responding!\n"); + return false; + } + // second radio object initialized successfully + + return true; +} + +int main() +{ + stdio_init_all(); // init necessary IO for the RP2040 + + while (!setupRadios()) { // if either radioX.begin() failed + sleep_ms(1000); // add 1 second delay for console readability + // hold program in infinite attempts to initialize the radios + } + + // continue with program as normal ... +} +``` diff --git a/.pio/libdeps/esp32-s3-n16r8/RF24/docs/portability.md b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/portability.md new file mode 100644 index 0000000..2fe25eb --- /dev/null +++ b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/portability.md @@ -0,0 +1,40 @@ +# RF24 Portability + +@tableofcontents + +The RF24 radio driver mainly utilizes the [Arduino API](http://arduino.cc/en/reference/homePage) +for GPIO, SPI, and timing functions, which are easily replicated on various platforms. + +Support files for these platforms are stored under RF24/utility, and can be modified to provide the +required functionality. + +## Basic Hardware Template + +### RF24/utility + +The RF24 library now includes a basic hardware template to assist in porting to various platforms. + +The following files can be included to replicate standard Arduino functions as needed, allowing devices from ATTiny to Raspberry Pi to utilize the same core RF24 driver. + +| File | Purpose | +| ------------------ | ---------------------------------------------------------------------------- | +| RF24_arch_config.h | Basic Arduino/AVR compatibility, includes for remaining support files, etc | +| includes.h | Linux only. Defines specific platform, include correct RF24_arch_config file | +| spi.h | Provides standardized SPI (`transfer()`) methods | +| gpio.h | Provides standardized GPIO (`digitalWrite()`) methods | +| compatibility.h | Provides standardized timing (`millis()`, `delay()`) methods | +| your_custom_file.h | Provides access to custom drivers for spi, gpio, etc | + +Examples are provided via the included hardware support templates in **RF24/utility** + +See the [modules](modules.html) page for examples of class declarations. + +## Device Detection + +1. The main detection for Linux devices is done in the configure script, with the includes.h from the proper hardware directory copied to RF24/utility/includes.h +2. Secondary detection is completed in RF24_config.h, causing the include.h file to be included for all supported Linux devices +3. RF24.h contains the declaration for SPI and GPIO objects 'spi' and 'gpio' to be used for porting-in related functions. + +## Code + +To have your ported code included in this library, or for assistance in porting, create a pull request or open an issue at [RF24 Library issues](https://github.com/nRF24/RF24) diff --git a/.pio/libdeps/esp32-s3-n16r8/RF24/docs/python_wrapper.md b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/python_wrapper.md new file mode 100644 index 0000000..58e3935 --- /dev/null +++ b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/python_wrapper.md @@ -0,0 +1,138 @@ +# Python Wrapper + +@tableofcontents + +@remark +@parblock +We recommend using the newer [pyRF24 package](https://github.com/nRF24/pyRF24) +[available from pypi](https://pypi.org/project/pyrf24/) because + +1. it is [practically drop-in compatible](https://nrf24.github.io/pyRF24/#migrating-to-pyrf24) +2. easier to install or get updates with popular package managers like pip +3. does not require the C++ libraries to be installed -- it uses its own isolated binaries +4. includes wrappers for RF24, RF24Network, RF24Mesh libraries +5. includes a new [fake BLE implementation](https://nrf24.github.io/pyRF24/ble_api.html) +6. has its own [dedicated documentation](https://nRF24.github.io/pyRF24) +7. is compatible with python's builtin `help()` +8. includes typing stub files for type checking tools like mypy + +The only reason that you should need to keep using these older individual python +wrappers is if you must use python v3.6 or older. + +You **cannot** use these individual wrappers in combination with the pyRF24 package. +@endparblock + +## Python Wrapper Prerequisites + +These instructions work for the RF24, RF24Network, and RF24Mesh libraries, but +the C++ source code needs to be built and installed for the corresponding +python wrapper(s) to work. + +@see Review [installing with CMake](using_cmake.md) and [Linux/RPi General](rpi_general.md). + +@note The interrupt_configure.py example uses the +[gpiod library](https://pypi.org/project/gpiod) to watch the radio's IRQ pin. + +> [!warning] +> Recent updates to pip mandate that users manage a python virtual environment. +> This is good practice because it avoids the risk that installing a package with pip will +> mess up a system-installed package. +> +> For information about using up a python virtual environment, see the official +> [instructions using the python standard library `venv`](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/) +> (which is a minimized variant of +> [the `virtualenv` library](https://virtualenv.pypa.io/en/stable/index.html)). +> +> There's also a note at the end of these instructions that talks about +> using `sudo` within a python virtual environment. + +### Python2 + +```shell +sudo apt-get install python-dev libboost-python-dev python-pip +``` + +Next, install some up-to-date python packages. + +```shell +python -m pip install --upgrade pip setuptools +``` + +### Python3 + +```shell +sudo apt-get install python3-dev libboost-python-dev python3-pip +``` + +## Installation + +> [!note] +> If using **older versions of RF24* libraries** with python3, +> the setup.py script needed a manually created symlink for the boost.python library. +> ```shell +> sudo ln -s $(ls /usr/lib/$(ls /usr/lib/gcc | tail -1)/libboost_python3*.so | tail -1) /usr/lib/$(ls /usr/lib/gcc | tail -1)/libboost_python3.so +> ``` +> This is no longer needed with the latest versions of RF24 libraries. + +1. Install the library. + + This step needs to be executed from the appropriate directory of + the cloned RF24* repository: + - navigate to *pyRF24* directory in the RF24 cloned repository + - navigate to *RPi/pyRF24Network* directory in the RF24Network cloned repository + - navigate to *pyRF24Mesh* directory in the RF24Mesh cloned repository + + When in the correct directory, run the following command: + ```shell + python3 -m pip install -v . + ``` + @note Building/installing takes several minutes on arm-based machines. + Machines with RAM less than 1GB may need to increase amount of swap for build. + The `-v` option enables pip's verbose output to show that the process has not frozen. + + See the additional [Platform Support pages](pages.html) for information on connecting your hardware. + + See the included [\*.py files in the "examples_linux" folder](examples.html) for usage information. +2. Running the Example + + The python examples location differ for each RF24* repositories. + - navigate to *examples_linux* directory in the RF24 cloned repository + - navigate to *RPi/pyRF24Network/examples* directory in the RF24Network cloned repository + - navigate to *examples_RPi* directory in the RF24Mesh cloned repository + + Navigate to the examples_linux directory + ```shell + cd ../examples_linux + ``` + Edit the getting_started.py example to configure the appropriate pins per the [Linux/RPi General](rpi_general.md) documentation. + ```shell + nano getting_started.py + ``` + Configure another device, Arduino or RPi with the same example code. It could be C++ or python (see the [list of available examples](examples.html)), but we'll use the same example file on a different device in this tutorial. + + Run the example + ```shell + python getting_started.py + ``` + or for python3 + ```shell + python3 getting_started.py + ``` + + @note + @parblock + Running the python wrappers built with 'pigpio' or 'RPi' drivers requires `sudo` permission. + + If you are working in a python virtual environment (aka "venv"), then the + virtual environment's python executable must be specified after `sudo`. Otherwise, + `sudo` may invoke the system-installed python executable which can lead to errors. + + Assuming the python virtual environment is located in `~/venv`, use the following command: + ``` + sudo ~/venv/bin/python getting_started.py + ``` + This `sudo` advice must be observed even while the virtual environment is activated. + + See more information about python virtual environments in the + [python documentation](https://docs.python.org/3/library/venv.html). + @endparblock diff --git a/.pio/libdeps/esp32-s3-n16r8/RF24/docs/rpi_general.md b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/rpi_general.md new file mode 100644 index 0000000..d7d1172 --- /dev/null +++ b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/rpi_general.md @@ -0,0 +1,120 @@ +# Linux General/Raspberry Pi + +@tableofcontents + + +RF24 supports a variety of Linux based devices via various drivers. Some boards like RPi can utilize multiple methods +to drive the GPIO and SPI functionality. + +## Potential PreConfiguration + +If SPI is not already enabled, load it on boot: + +```shell +sudo raspi-config +``` + +1. Update the tool via the menu as required +2. Select **Advanced** and **enable the SPI kernel module** +3. Update other software and libraries + ```shell + sudo apt-get update + sudo apt-get upgrade + ``` + +## Build Options + +The default build on Raspberry Pi utilizes the included **BCM2835** driver from [the BCM2835 Library](http://www.airspayce.com/mikem/bcm2835) + +1. See [the Linux section for automated installation](linux_install.md). +2. Manual install: + ```shell + make + sudo make install + ``` + +## Connections and Pin Configuration + +Using pin 15(GPIO22) for CE, pin 24(GPIO8 commonly labeled as CE0) for CSN + +Can use any available SPI BUS for CSN. + +In general, use + +```cpp +RF24 radio(, *10+); +``` + +for proper constructor to address the correct spi device at /dev/spidev\.\ + +Choose any GPIO output pin for radio CE pin. + +> [!WARNING] +> The pin numbers may be different for certain systems. +> In this library's examples, we use the BCM pin numbers for BroadCom chips such as +> those used on all Raspberry Pi models. +> +> For Raspberry Pi clones, such as Orange Pi or Banana Pi, defer to the pin numbers described +> in their corresponding documentation/manual. +> +> Hint: If libgpiod is installed (not required for this library), +> then you can use the included +> [CLI tools shipped with libgpiod](https://libgpiod.readthedocs.io/en/latest/gpio_tools.html) +> to gleam system-specific details. + +### Linux kernel (SPIDEV driver) and the GPIO chip number + +This RF24 library, as of v1.4.9, uses the Linux kernel's Character Device API to interface +with GPIO pins (AKA "lines" in kernel docs). Previous versions used the deprecated "sys fs" interface. + +By default, this library attempts to use pins exposed via `/dev/gpiochip0`. +Some systems have multiple public-facing GPIO chips integrated (ie nVidia Jetson series). +If your system exposes the desired GPIO pins via a different chip (ie `/dev/gpiochip4`), then the +`RF24_LINUX_GPIO_CHIP` can be set to the correct value when compiling the library. + +```shell +cmake .. -DRF24_LINUX_GPIO_CHIP="/dev/gpiochip4" +``` + +### General + +```cpp +RF24 radio(22, 0); +``` + +### MRAA Constructor + +```cpp +RF24 radio(15, 0); +``` + +See [the MRAA documentation for Raspberry Pi support](http://iotdk.intel.com/docs/master/mraa/rasppi.html) + +### SPI_DEV Constructor + +```cpp +RF24 radio(22, 0); +``` + +See [the Raspberry Pi documentation about the GPIO pins](https://www.raspberrypi.com/documentation/computers/os.html#gpio-and-the-40-pin-header) + +### Pins + +| PIN | NRF24L01 | RPI | RPi -P1 Connector | +| --- | -------- | ---------- | ----------------- | +| 1 | GND | rpi-gnd | (25) | +| 2 | VCC | rpi-3v3 | (17) | +| 3 | CE | rpi-gpio22 | (15) | +| 4 | CSN | rpi-gpio8 | (24) | +| 5 | SCK | rpi-sclk | (23) | +| 6 | MOSI | rpi-mosi | (19) | +| 7 | MISO | rpi-miso | (21) | +| 8 | IRQ | - | - | + +## brief history of RF24 library lineage + +Based on the arduino lib from [J. Coliz](maniacbug@ymail.com), +the library was berryfied by [Purinda Gunasekara](purinda@gmail.com) +then forked from github [stanleyseow/RF24](https://github.com/stanleyseow/RF24) to [jscrane/RF24-rpi](https://github.com/jscrane/RF24-rpi) + +Network lib also based on [farconada/RF24Network](https://github.com/farconada/RF24Network) diff --git a/.pio/libdeps/esp32-s3-n16r8/RF24/docs/using_cmake.md b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/using_cmake.md new file mode 100644 index 0000000..ed2780a --- /dev/null +++ b/.pio/libdeps/esp32-s3-n16r8/RF24/docs/using_cmake.md @@ -0,0 +1,249 @@ +# Using CMake + +@tableofcontents + + +A more modern approach instead of using hand-crafted _Makefiles_ & _configure_ scripts +to build & install software. Please note that these instructions are not needed if you +have already installed the library using [these older instructions](linux_install.md) + +## Installing the library + +You can install the library in a few different ways. + +- Building and installing the library from source code is preferable since it will include all the latest changes. +- Installing the library (via a package manager) from a pre-built package is mostly for cross-compiling purposes, but it can be useful for environments that don't have all the build-time dependencies (namely CMake). + +@warning If you have previously installed the library from source code using the +[the older instructions](linux_install.md), then you will need to +uninstall it manually to avoid runtime conflicts. +```shell +sudo rm /usr/local/lib/librf24.* +sudo rm /usr/local/lib/librf24-bcm.so +sudo rm -r /usr/local/include/RF24 +``` + +The _librf24-bcm.so_ file may not exist if you used CMake to install the library. + +### Automatic Installation + +There is a newer automatic install script that makes use of the CMake approach. + +1. Download the install.sh file from [https://github.com/nRF24/.github/blob/main/installer/install.sh](https://github.com/nRF24/.github/blob/main/installer/install.sh) + ```shell + wget https://raw.githubusercontent.com/nRF24/.github/main/installer/install.sh + ``` +2. Make it executable + ```shell + chmod +x install.sh + ``` +3. Run it and choose your options + ```shell + ./install.sh + ``` + + @warning + `SPIDEV` is now always selected as the default driver because + all other Linux drivers are being removed in the future. + See [RF24 issue #971](https://github.com/nRF24/RF24/issues/971) for rationale. + + It will also ask to install a python package named [pyRF24](https://github.com/nRF24/pyRF24). + This is not the same as the traditionally provided python wrappers as the pyRF24 package can be + used independent of the C++ installed libraries. For more information on this newer python + package, please check out [the pyRF24 documentation](https://nrf24.github.io/pyRF24/). +4. Try an example from one of the libraries + ```shell + cd ~/rf24libs/RF24/examples_linux + ``` + + Edit the gettingstarted example, to set your pin configuration + ```shell + nano gettingstarted.cpp + ``` + + Build the examples. Remember to set the `RF24_DRIVER` option according to the one that was + selected during the scripted install. + ```shell + mkdir build && cd build + cmake .. -D RF24_DRIVER=SPIDEV + make + ``` + + Run the example + ```shell + sudo ./gettingstarted + ``` + +### Building from source code + +1. Install prerequisites if there are any (PiGPIO, WiringPi, MRAA, LittleWire libraries, and enable the SPI bus(es) in the OS). + + CMake may need to be installed + ```shell + sudo apt-get install cmake + ``` + @note See the [MRAA documentation](http://iotdk.intel.com/docs/master/mraa/index.html) for more information on installing MRAA. +2. Make a directory to contain the RF24 library and possibly other RF24\* libraries and enter it + ```shell + mkdir ~/rf24libs + cd ~/rf24libs + ``` +3. Clone the [RF24 repo](https://github.com/nRF24/RF24) and navigate to it + ```shell + git clone https://github.com/nRF24/RF24.git RF24 + cd RF24 + ``` +4. Create a build directory inside the RF24 directory and navigate to it. + ```shell + mkdir build + cd build + ``` +5. Configure build environment + + @note When using these instructions to install RF24Mesh, RF24Network, or RF24Gateway, + the following `RF24_DRIVER` option is only needed for the RF24 library and + examples as well as the examples for RF24Network, RF24Mesh, and RF24Gateway. The `RF24_DRIVER` + option is not needed when installing the libraries for RF24Network, RF24Mesh, and RF24Gateway. + + Instead of specifying the `RF24_DRIVER` option in the CLI, it is recommended to use a environment + variable named `RF24_DRIVER`. + + ```shell + export RF24_DRIVER=SPIDEV + ``` + + These instructions assume you have not set an environment variable. + + ```shell + cmake .. -D RF24_DRIVER=SPIDEV + ``` + Instead of using `SPIDEV` driver (recommended), you can also specify the `RPi`, `wiringPi`, + `MRAA`, or `LittleWire` as alternative drivers. + + @warning + `SPIDEV` is now always selected as the default driver because + all other Linux drivers are being removed in the future. + See [RF24 issue #971](https://github.com/nRF24/RF24/issues/971) for rationale. +6. Build and install the library + ```shell + make + sudo make install + ``` +7. Build the examples + + Navigate to the _examples_linux_ directory + ```shell + cd ../examples_linux + ``` + Make sure the pins used in the examples match the pins you used to connect the radio module + ```shell + nano gettingstarted.cpp + ``` + and edit the pin numbers as directed in the [linux/RPi general documentation](rpi_general.md). + Create a build directory in the examples_linux directory and navigate to it. + ```shell + mkdir build + cd build + ``` + Now you are ready to build the examples. + ```shell + cmake .. + make + ``` + If using the `MRAA` or `wiringPi` drivers, then you may need to specify the `RF24_DRIVER` + option again. + ```shell + cmake .. -D RF24_DRIVER=wiringPi + make + ``` + + Remember that the `RF24_DRIVER` option is needed for the RF24Network, RF24Mesh, and RF24Gateway + examples if you specified that option (via CLI or environment variable) when installing the + RF24 library and examples. +8. Run an example file + ```shell + sudo ./gettingstarted + ``` + +### Using a package manager + +The RF24 library now (as of v1.4.1) has pre-built packages (.deb or .rpm files) that +can be installed on a Raspberry Pi. These packages can be found on the library's +[GitHub release page](https://GitHub.com/nRF24/RF24/releases) + +1. Download the appropriate package for your machine + + Go to the library's [GitHub release page](https://GitHub.com/nRF24/RF24/releases), and look for + the latest release's assets. + + For all Raspberry Pi variants using the Raspberry Pi OS (aka Raspbian), you need the file marked + for _armhf_ architecture. + + For Raspberry Pi variants using a 64-bit OS (like Ubuntu), you need the file marked for + _arm64_ architecture. + + Notice that the filenames will include the name of the utility driver that the package was built with. + This does not mean that the LittleWire, MRAA, or wiringPi libraries are included in the package (you will still + need to install those yourself beforehand). +2. Install the downloaded pkg + + If you downloaded the file directly from your target machine using the desktop environment, then + you only need to double-click the package (deb or rpm) file, and the OS should do the rest. + + If you downloaded the file remotely and want to copy it over ssh, then use the `scp` command in a terminal. + ```shell + scp pkg_filename.deb pi@host_name:~/Downloads + ``` + @note You do not need to do this from within an ssh session. Also, you can use the target machine's IP + address instead of its host name. + + The `scp` command will ask you for a password belonging to the user's name on the remote machine (we used + `pi` in the above example). + + Now you can open up a ssh session and install the copied package from the terminal. + ```shell + ssh pi@host_name + cd Downloads + dpkg -i pkg_filename.deb + ``` + +## Cross-compiling the library + +The RF24 library comes with some pre-made toolchain files (located in the +_RF24/cmake/toolchains_ directory) to use in CMake. To use these toolchain files, +additional command line options are needed when configuring CMake to build the library +(step 5 in the above instructions to build from source). + +```shell +cmake .. -D CMAKE_TOOLCHAIN_FILE=cmake/toolchains/armhf.cmake +make +``` + +If you plan on using the cross-compiled library with your personal cross-compiled +project, then it is advised to specify the path that your project will look in when +linking to the RF24 library: + +```shell +cmake .. -D CMAKE_INSTALL_PREFIX=/usr/arm-linux-gnueabihf -D CMAKE_TOOLCHAIN_FILE=cmake/toolchains/armhf.cmake +make +sudo make install +``` + +Remember to also specify the `RF24_DRIVER` option (via CLI or environment variable) if +not using the auto-configuration feature (see step 5 in the above instructions to build +from source). + +### Installing the library remotely + +To install remotely, you can create an installable package file using CMake's built-in +program called CPack. + +```shell +cmake .. -D CMAKE_TOOLCHAIN_FILE=cmake/toolchains/armhf.cmake +make +cpack +``` + +This will create a deb file and a rpm file in a new sub-directory called "pkgs" within +the build directory. You can use either of these packages to install the library to +your target machine (see the above instructions about using a package manager). -- cgit v1.2.3