Skip to content

Commit f0870f2

Browse files
committedNov 9, 2020
init commit
1 parent 9f107ae commit f0870f2

21 files changed

+1956
-0
lines changed
 

‎.github/workflows/build.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Build CI
2+
3+
on: [pull_request, push]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
steps:
10+
- name: Set up Python 3.6
11+
uses: actions/setup-python@v1
12+
with:
13+
python-version: 3.7
14+
- name: Checkout Current Repo
15+
uses: actions/checkout@v1
16+
with:
17+
submodules: true
18+
- name: Install dependencies
19+
run: |
20+
sudo apt install python-dev libboost-python-dev python-setuptools python-rpi.gpio
21+
python -m pip install --upgrade pip
22+
- name: Pip install pylint, Sphinx, & sphinx-rtd-theme
23+
run: |
24+
pip install pylint Sphinx sphinx-rtd-theme
25+
- name: Library version
26+
run: git describe --dirty --always --tags
27+
# - name: check python examples PEP8 compliance
28+
# run: |
29+
# pylint examples/*.py --disable=invalid-name,no-name-in-module,no-member,duplicate-code
30+
# invalid-name,no-name-in-module,no-member are errors related to C++ wrapped into a python package; Applies to RPi.GPIO package as well.
31+
# duplicate-code error gets flagged because some examples use similar code snippets
32+
- name: Build docs
33+
working-directory: docs
34+
run: sphinx-build -E -W -b html . _build/html

‎.github/workflows/release.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release Actions
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
upload-pypi:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Set up Python 3.6
12+
uses: actions/setup-python@v1
13+
with:
14+
python-version: 3.7
15+
- name: Checkout Current Repo
16+
uses: actions/checkout@v1
17+
with:
18+
submodules: true
19+
- name: Install dependencies
20+
run: |
21+
sudo apt install python-dev libboost-python-dev python-setuptools python-rpi.gpio
22+
python -m pip install --upgrade pip
23+
pip install setuptools wheel twine
24+
- name: Build and publish
25+
env:
26+
TWINE_USERNAME: __token__
27+
TWINE_PASSWORD: ${{ secrets.pypi_token }}
28+
run: |
29+
python setup.py sdist
30+
twine upload dist/*

‎.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,6 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130+
131+
# exclude local VSCode's settings folder
132+
.vscode/

‎LICENSE

+339
Large diffs are not rendered by default.

‎README.rst

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
Introduction
2+
============
3+
4+
This is the official home of the python wrappers for the RF24 stack. It is meant for Linux-based SoC boards like the Raspberry Pi.
5+
6+
.. warning:: This repo is currently under construction and is meant as a place holder for the proper package name on pypi.org
7+
8+
Pinout
9+
======
10+
11+
.. image:: https://lastminuteengineers.com/wp-content/uploads/2018/07/Pinout-nRF24L01-Wireless-Transceiver-Module.png
12+
:target: https://lastminuteengineers.com/nrf24l01-arduino-wireless-communication/#nrf24l01-transceiver-module-pinout
13+
14+
The nRF24L01's CE and IRQ pins can be connected to other GPIO pins on the SoC. The MISO, MOSI, SCK are limited to the corresponding counterparts on the SoC's SPI bus. The CSN pin is limited to the chosen SPI bus's "Chip Select" options (Also labeled as "CE" pins on many Raspberry Pi pinout diagrams). The following table shows the default pins used in all the `examples <examples.html>`_ for this package.
15+
16+
.. csv-table::
17+
:header: nRF24L01, Raspberry Pi
18+
19+
GND, GND
20+
VCC, 3V
21+
CE, GPIO22
22+
CSN, "GPIO8 (CE0)"
23+
SCK, "GPIO11 (SCK)"
24+
MOSI, "GPIO10 (MOSI)"
25+
MISO, "GPIO9 (MISO)"
26+
IRQ, GPIO12
27+
28+
The IRQ pin is not typically connected, and it is only used in the interrupt_configure example.
29+
30+
.. warning:: If connecting a nRF24L01+PA+LNA module to the Raspberry Pi, you MUST use a external 3V power supply because the Raspberry Pi (all models) do not provide enough power for the nRF24L01+PA+LNA modules.
31+
32+
.. important:: It is highly recommended that the nRF24L01's VCC and GND pins have a parallel capacitor to stablize the power supply. Usually 100 microfarad is enough, but the capacitance ultimately depends on the nature of your power supply's stability.
33+
34+
Dependencies
35+
============
36+
37+
To build this python package locally, you need to have boost.python installed.
38+
39+
.. code-block::
40+
41+
sudo apt install libboost-python-dev
42+
43+
Make sure that the following dependencies are also installed (sometimes the OS comes with these included). Notice that RPi.GPIO (for python) is used to manage the GPIO pins on the Raspberry Pi.
44+
45+
.. code-block::
46+
47+
sudo apt install python3-dev python3-setuptools python3-rpi.gpio
48+
49+
Documentation
50+
=============
51+
52+
Before submitting contributions, you should make sure that any documentation changes builds successfully. This can be done locally.
53+
54+
Documentation Dependencies
55+
--------------------------
56+
57+
This package's documentation is built with the python package Sphinx and the readthedocs theme for sphinx.
58+
59+
.. code-block::
60+
61+
pip install Sphinx sphinx-rtd-theme
62+
63+
To build the documentation locally:
64+
65+
.. code-block::
66+
67+
cd docs
68+
sphinx build -E -W . _build
69+
70+
The "docs/_build" folder should now contain the html files that would be hosted on deployment. direct your internet browser to the html files in this folder to make sure your changes have been rendered correctly.
71+
72+
.. note:: The flags ``-E`` and ``-W`` will ensure the docs fail to build on any error or warning (just like it does when deploying the docs online).

0 commit comments

Comments
 (0)
Please sign in to comment.