Skip to content

Commit a86300f

Browse files
committed
Added some more API doc content
1 parent 3079497 commit a86300f

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
lines changed

docs/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This folder contains the required files to automatically generate the Adafruit Beaglebone I/O Python API documentation, partly from the code docstrings and partly from a reStructuredText-formatted `index.rst` file.
44

55
```
6-
├── conf.py <- Sphinx configuration file
6+
├── conf.py <- Sphinx configuration file
77
├── index.rst <- Documentation will be generated based on this
88
└── Makefile <- Auxiliary Makefile to build documentation
99
```
@@ -54,14 +54,15 @@ For the sake of keeping things simple and with less maintenance, the approach of
5454

5555
This has the advantage of having a definition of the API in one place, but it also poses the disadvantage of some duplication, as the C modules do define some docstrings for their objects. Then again, the API itself has hardly changed in the last few years, and the Beaglebone is a mature platform, so it's unlikely that this will pose a significant maintenance overhead.
5656

57-
- The documentation in Python modules follows the Google readable docstring markup, which is fully supported by Sphinx.
58-
- The documentation in the `index.rst` file is written in [reStructuredText](http://docutils.sourceforge.net/rst.html), with Sphinx markup for defining the objects.
57+
- The documentation in the `index.rst` file is written in [reStructuredText](http://docutils.sourceforge.net/rst.html), extended with Sphinx markup for defining the objects.
58+
- The documentation in Python modules follows the Google readable docstring markup, which also builds upon reStructuredText and is fully supported by Sphinx.
5959

6060
## Further reference
6161

6262
- [Google readable docstring markup](https://google.github.io/styleguide/pyguide.html?showone=Comments#Comments)
6363
- [Google docstring examples](http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html)
64-
- [More Google docstring examples](http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html))
64+
- [More Google docstring examples](http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html)
6565
- [Sphinx docstring markup](http://www.sphinx-doc.org/en/stable/domains.html#the-python-domain)
66+
- [reStructuredText primer](http://www.sphinx-doc.org/en/stable/rest.html#rst-primer)
6667

6768

docs/index.rst

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6+
.. toctree::
7+
:hidden:
8+
:maxdepth: 2
9+
610
Adafruit Beaglebone IO Python API
711
=================================
812

@@ -22,6 +26,14 @@ Enables access to the Pulse Width Modulation (PWM) module, to easily and
2226
accurately generate a PWM output signal of a given duty cycle and
2327
frequency.
2428

29+
.. note::
30+
31+
You need to be part of the ``pwm`` group of the OS running on the
32+
Beaglebone to be able to run PWM code as a non-root user. The default
33+
user created upon the Debian image installation should already be
34+
part of the group. Otherwise, you can use
35+
``sudo usermod -a -G pwm userName`` to add ``userName`` to the group.
36+
2537
.. module:: Adafruit_BBIO.PWM
2638

2739
.. function:: start(channel, duty_cycle[, frequency=2000, polarity=0])
@@ -256,7 +268,6 @@ Example::
256268

257269
.. method:: xfer(values[,delay=0])
258270

259-
xfer([values]) -> [values]
260271
Perform an SPI transaction of values. Slave Select (SS or CS) will be
261272
released and reactivated between blocks.
262273

@@ -268,7 +279,6 @@ Example::
268279

269280
.. method:: xfer2(values)
270281

271-
xfer2([values]) -> [values]
272282
Perform an SPI transaction of values. Slave Select (SS or CS) will be
273283
held active between blocks.
274284

@@ -282,6 +292,21 @@ Example::
282292

283293
TODO
284294

295+
.. note::
296+
297+
You need to be part of the ``gpio`` group of the OS running on the
298+
Beaglebone to be able to run GPIO code as a non-root user. The default
299+
user created upon the Debian image installation should already be
300+
part of the group. Otherwise, you can use
301+
``sudo usermod -a -G gpio userName`` to add ``userName`` to the group.
302+
303+
.. note::
304+
305+
When coding with this module, you will often be using pin names for
306+
better readability. For easy reference, you can use the
307+
`Beaglebone pin names table <https://github.com/adafruit/adafruit-beaglebone-io-python/blob/master/source/common.c#L73>`_
308+
309+
285310
Example::
286311

287312
# Use the config-pin command line tool to set a pin's function to GPIO

0 commit comments

Comments
 (0)