Skip to content

Commit

Permalink
proofread docs
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Nov 26, 2021
1 parent a3d8131 commit 0cca768
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 43 deletions.
2 changes: 0 additions & 2 deletions circuitpython_nrf24l01/fake_ble.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ class QueueElement:
:param bytes,bytearray buffer: the validated BLE payload (not including
the CRC checksum). The buffer passed here is decoded into this class's
properties.
.. versionadded:: v2.1.0
"""

def __init__(self, buffer):
Expand Down
2 changes: 1 addition & 1 deletion circuitpython_nrf24l01/network/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def __init__(self, spi, csn, ce_pin, spi_frequency=10000000):
self.max_message_length = 144 #: The maximum length of a frame's message.
#: The queue (FIFO) of recieved frames for this node
self.queue = FrameQueueFrag()
#: A buffer containing the last frame received by the network node
#: A buffer containing the last frame handled by the network node
self.frame_buf = RF24NetworkFrame()
self.address_suffix = bytearray([0xC3, 0x3C, 0x33, 0xCE, 0x3E, 0xE3])
"""Each byte in this `bytearray` corresponds to the unique byte per pipe and
Expand Down
2 changes: 1 addition & 1 deletion circuitpython_nrf24l01/rf24_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def release_address(self) -> bool:
return True
return False

def renew_address(self, timeout: int = 7):
def renew_address(self, timeout: int = 7.5):
"""Connect to the mesh network and request a new `node_address`."""
if self._rf24.available():
self.update()
Expand Down
8 changes: 2 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,19 @@
"sphinx.ext.todo",
"sphinx.ext.viewcode",
"sphinx.ext.graphviz",
"sphinx_immaterial"
"sphinx_immaterial",
# "rst2pdf.pdfbuilder", # for local pdf builder support
]

# Uncomment the below if you use native CircuitPython modules such as
# digitalio, micropython and busio. List the modules you use. Without it, the
# autodoc module docs will fail to generate with a warning.
autodoc_mock_imports = ["digitalio", "busio", "usb_hid", "microcontroller", "logging"]
autodoc_mock_imports = ["digitalio", "busio", "microcontroller"]
autodoc_member_order = "bysource"

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
"Adafruit_logging": (
"https://circuitpython.readthedocs.io/projects/logging/en/latest/",
None,
),
}

html_baseurl = "https://circuitpython-nrf24l01.readthedocs.io/"
Expand Down
6 changes: 3 additions & 3 deletions docs/core_api/advanced_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -271,16 +271,16 @@ Debugging Output
Changed this method's name from the private method ``_dump_pipes()`` to a public method
``print_pipes()``.

.. automethod:: circuitpython_nrf24l01.rf24.address_repr
.. autofunction:: circuitpython_nrf24l01.rf24.address_repr

This method is primarily used in :meth:`~RF24.print_details()` to
This method is primarily used in :meth:`~RF24.print_pipes()` to
display how the address is used by the radio.

.. code-block:: python
>>> from circuitpython_nrf24l01.rf24 import address_repr
>>> address_repr(b"1Node")
'65646f4e31'
'65646F4E31'
:param bytes,bytearray buf: The buffer of bytes to convert into a hexlified
string.
Expand Down
2 changes: 1 addition & 1 deletion docs/core_api/ble_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ FakeBLE class

.. automethod:: circuitpython_nrf24l01.fake_ble.FakeBLE.interrupt_config

.. warning:: The :py:attr:`circuitpython_nrf24l01.rf24.RF24.irq_df`
.. warning:: The :py:attr:`~circuitpython_nrf24l01.rf24.RF24.irq_df`
attribute is not implemented for BLE operations.

.. seealso::
Expand Down
19 changes: 12 additions & 7 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,13 @@ The `adafruit_bus_device`, `Adafruit_Blinka library <https://github.com/adafruit
and `SpiDev <https://pypi.org/project/spidev/>`_ libraries
are installed automatically on Linux when installing this library.

.. versionadded:: 2.1.0 Added support for the
`SpiDev <https://pypi.org/project/spidev/>`_ module
.. versionadded:: 2.1.0
Added support for the `SpiDev <https://pypi.org/project/spidev/>`_ module

.. important:: This library supports Python 3.7 or newer because it use
the function :py:func:`time.monotonic_ns()` which returns an arbitrary time "counter"
as an `int` of nanoseconds. CircuitPython firmware also supports :py:func:`time.monotonic_ns()`.
.. important::
This library supports Python 3.7 or newer because it uses the function
:py:func:`time.monotonic_ns()` which returns an arbitrary time "counter" as an `int` of
nanoseconds. CircuitPython firmware also supports :py:func:`time.monotonic_ns()`.


Installing from PyPI
Expand Down Expand Up @@ -196,7 +197,10 @@ to the MCU via a digital input pin during the interrupt example.
Using The Examples
==================

See `examples <examples.html>`_ for testing certain features of this the library. The examples were developed and tested on both Raspberry Pi and ItsyBitsy M4. Pins have been hard coded in the examples for the corresponding device, so please adjust these accordingly to your circuitpython device if necessary.
See `examples <examples.html>`_ for testing certain features of this the library.
The examples were developed and tested on both Raspberry Pi and ItsyBitsy M4.
Pins have been hard coded in the examples for the corresponding device, so please adjust these
accordingly to your circuitpython device if necessary.

For an interactive REPL
---------------------------
Expand All @@ -205,7 +209,8 @@ All examples can be imported from within an interactive python REPL.

1. Make sure the examples are located in the current working directory.
On CircuitPython devices, this will be the root directory of the CIRCUITPY drive.
2. Import everything from desired the example. The following code snippet demonstrates running the `Simple Test example <examples.html#simple-test>`_
2. Import everything from the desired example. The following code snippet demonstrates running the
`Simple Test example <examples.html#simple-test>`_

.. code-block:: python
Expand Down
9 changes: 5 additions & 4 deletions docs/network_docs/mesh_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@ Basic API
for quicker operation.

:param bytes,bytearray message: The frame's `message` to be transmitted.
:param str,int message_type: The `int` that describes the frame header's `message_type`.

.. note:: Be mindful of the message's size as this cannot exceed
`MAX_FRAG_SIZE` (24 bytes) if `fragmentation` is disabled. If `fragmentation` is
enabled (it is by default), then the message's size must be less than
.. note::
Be mindful of the message's size as this cannot exceed `MAX_FRAG_SIZE` (24 bytes) if
`fragmentation` is disabled. If `fragmentation` is enabled (it is by default), then
the message's size must be less than
:attr:`~circuitpython_nrf24l01.rf24_network.RF24Network.max_message_length`.
:param str,int message_type: The `int` that describes the frame header's `message_type`.
:param int to_node_id: The unique mesh network `node_id` of the frame's destination.
Defaults to ``0`` (which is reserved for the master node.

Expand Down
15 changes: 6 additions & 9 deletions docs/network_docs/network_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@ Basic API
A `bool` describing if the message has been transmitted. This does not necessarily
describe if the message has been received at its target destination.

.. note::
This function will always return `True` if a message is directed to a node's pipe
that does not have `auto_ack` enabled (which will likely be pipe 0 in most network
contexts).
.. tip:: |use_msg_t|

Advanced API
Expand All @@ -130,10 +126,13 @@ Advanced API
describe if the message has been received at its target destination.

.. note::
This function will always return if a message is directed to a node's pipe
For multicasted messages, the radio's `auto_ack` feature is not used.

This function will always return `True` if a message is directed to a node's pipe
that does not have `auto_ack` enabled (which will likely be pipe 0 in most network
contexts).
.. tip:: To ensure a message has been delivered to its target destination, set the
.. tip::
To ensure a message has been delivered to its target destination, set the
header's `message_type` to an `int` in range [65, 127]. This will invoke a
`NETWORK_ACK` response message.

Expand All @@ -145,9 +144,7 @@ Advanced API

.. code-block:: python
from circuitpython_nrf24l01.network.structs import (
FrameQueue, RF24NetworkFrame, RF24NetworkHeader
)
from circuitpython_nrf24l01.network.structs import FrameQueue, RF24NetworkFrame, RF24NetworkHeader
my_q = FrameQueue()
for i in range(my_q.max_queue_size):
Expand Down
2 changes: 1 addition & 1 deletion docs/network_docs/shared_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Order of Inheritence
}

The ``RadioMixin`` and ``NetworkMixin`` classes are not documented directly. Instead, this
documentation follows the OSI (Open Systems Interconnection) model. This is done to mimmic how the
documentation follows the OSI (Open Systems Interconnection) model. This is done to mimic how the
TMRh20 C++ libraries and documentation are structured.

Consequentially, all functions and members inherited from the ``NetworkMixin`` class are
Expand Down
8 changes: 0 additions & 8 deletions docs/network_docs/topology.rst
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,6 @@ For example:

.. csv-table::
:header: "pipe", "Phsyical Address (hexadecimal)"
:width: 10
:widths: 1, 9

1, ``CC CC CC CC 3C``
2, ``CC CC CC CC 33``
Expand All @@ -245,8 +243,6 @@ For example:

.. csv-table::
:header: "pipe", "Phsyical Address (hexadecimal)"
:width: 10
:widths: 1, 9

1, ``CC CC CC 3C 3C``
2, ``CC CC CC 3C 33``
Expand All @@ -258,8 +254,6 @@ For example:

.. csv-table::
:header: "pipe", "Phsyical Address (hexadecimal)"
:width: 10
:widths: 1, 9

1, ``CC CC CC 33 3C``
2, ``CC CC CC 33 33``
Expand All @@ -271,8 +265,6 @@ For example:

.. csv-table::
:header: "pipe", "Phsyical Address (hexadecimal)"
:width: 10
:widths: 1, 9

1, ``CC 3C 33 CE 3C``
2, ``CC 3C 33 CE 33``
Expand Down

0 comments on commit 0cca768

Please sign in to comment.