summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBenjamin Shockley <benjaminshockley@hotmail.com>2020-08-20 13:48:15 -0500
committerGitHub <noreply@github.com>2020-08-20 13:48:15 -0500
commit0084f0af24e4e219bc040c52ee723959423de6e2 (patch)
tree1aebdb362f08bf6417caa87836e3e4e739afc964 /docs
parent9aebe2f1efc99871fcf283c304e3a8700050d736 (diff)
parent4d7b9cde33934a44c4c905a49d2f831339fc8bd2 (diff)
Merge pull request #2 from adafruit/master
Master
Diffstat (limited to 'docs')
-rw-r--r--docs/README.md4
-rw-r--r--docs/autoapi/templates/python/module.rst93
-rw-r--r--docs/c2rst.py19
-rw-r--r--docs/design_guide.rst8
-rw-r--r--docs/drivers.rst245
-rw-r--r--docs/index.rst1
-rw-r--r--docs/library/builtins.rst10
-rw-r--r--docs/library/network.rst3
-rw-r--r--docs/porting.rst42
-rw-r--r--docs/requirements.txt5
-rw-r--r--docs/rstjinja.py24
-rw-r--r--docs/shared_bindings_matrix.py158
-rw-r--r--docs/supported_ports.rst13
13 files changed, 362 insertions, 263 deletions
diff --git a/docs/README.md b/docs/README.md
index b01ae9d49..e98b46f67 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -34,10 +34,10 @@ All commands will, by default, run with `-E` (forces a rebuild from scratch of d
# will turn OFF the force rebuild
make html FORCE=
-
+
# will turn OFF the verbosity
make html VERBOSE=
-
+
# will turn OFF the force rebuild and make it doubly verbose when running
make html FORCE= VERBOSE="-v -v"
diff --git a/docs/autoapi/templates/python/module.rst b/docs/autoapi/templates/python/module.rst
new file mode 100644
index 000000000..7ede6bdfd
--- /dev/null
+++ b/docs/autoapi/templates/python/module.rst
@@ -0,0 +1,93 @@
+{% if not obj.display %}
+:orphan:
+
+{% endif %}
+:mod:`{{ obj.name }}`
+======={{ "=" * obj.name|length }}
+
+.. py:module:: {{ obj.name }}
+
+{% if obj.docstring %}
+.. autoapi-nested-parse::
+
+ {{ obj.docstring|prepare_docstring|indent(3) }}
+
+{% endif %}
+
+{% block subpackages %}
+{% set visible_subpackages = obj.subpackages|selectattr("display")|list %}
+{% if visible_subpackages %}
+.. toctree::
+ :titlesonly:
+ :maxdepth: 3
+
+{% for subpackage in visible_subpackages %}
+ {{ subpackage.short_name }}/index.rst
+{% endfor %}
+
+
+{% endif %}
+{% endblock %}
+{% block submodules %}
+{% set visible_submodules = obj.submodules|selectattr("display")|list %}
+{% if visible_submodules %}
+
+.. toctree::
+ :titlesonly:
+ :maxdepth: 1
+
+{% for submodule in visible_submodules %}
+ {{ submodule.short_name }}/index.rst
+{% endfor %}
+
+
+{% endif %}
+{% endblock %}
+{% block content %}
+{% if obj.all is not none %}
+{% set visible_children = obj.children|selectattr("short_name", "in", obj.all)|list %}
+{% elif obj.type is equalto("package") %}
+{% set visible_children = obj.children|selectattr("display")|list %}
+{% else %}
+{% set visible_children = obj.children|selectattr("display")|rejectattr("imported")|list %}
+{% endif %}
+{% if visible_children %}
+
+{% set visible_classes = visible_children|selectattr("type", "equalto", "class")|list %}
+{% set visible_functions = visible_children|selectattr("type", "equalto", "function")|list %}
+{% if "show-module-summary" in autoapi_options and (visible_classes or visible_functions) %}
+{% block classes %}
+{% if visible_classes %}
+Classes
+~~~~~~~
+
+.. autoapisummary::
+
+{% for klass in visible_classes %}
+ {{ klass.id }}
+{% endfor %}
+
+
+{% endif %}
+{% endblock %}
+
+{% block functions %}
+{% if visible_functions %}
+Functions
+~~~~~~~~~
+
+.. autoapisummary::
+
+{% for function in visible_functions %}
+ {{ function.id }}
+{% endfor %}
+
+
+{% endif %}
+{% endblock %}
+{% endif %}
+{% for obj_item in visible_children %}
+{{ obj_item.rendered|indent(0) }}
+{% endfor %}
+{% endif %}
+{% endblock %}
diff --git a/docs/c2rst.py b/docs/c2rst.py
deleted file mode 100644
index 904fb7408..000000000
--- a/docs/c2rst.py
+++ /dev/null
@@ -1,19 +0,0 @@
-import sphinx.parsers
-
-class CStrip(sphinx.parsers.Parser):
- def __init__(self):
- self.rst_parser = sphinx.parsers.RSTParser()
-
- def parse(self, inputstring, document):
- # This setting is missing starting with Sphinx 1.7.1 so we set it ourself.
- document.settings.tab_width = 4
- document.settings.character_level_inline_markup = False
- stripped = []
- for line in inputstring.split("\n"):
- line = line.strip()
- if line == "//|":
- stripped.append("")
- elif line.startswith("//| "):
- stripped.append(line[len("//| "):])
- stripped = "\r\n".join(stripped)
- self.rst_parser.parse(stripped, document)
diff --git a/docs/design_guide.rst b/docs/design_guide.rst
index e7b3832bc..6f87ecf79 100644
--- a/docs/design_guide.rst
+++ b/docs/design_guide.rst
@@ -60,6 +60,7 @@ For example, a user can then use ``deinit()```::
import digitalio
import board
+ import time
led = digitalio.DigitalInOut(board.D13)
led.direction = digitalio.Direction.OUTPUT
@@ -79,6 +80,7 @@ Alternatively, using a ``with`` statement ensures that the hardware is deinitial
import digitalio
import board
+ import time
with digitalio.DigitalInOut(board.D13) as led:
led.direction = digitalio.Direction.OUTPUT
@@ -474,6 +476,8 @@ properties.
+-----------------------+-----------------------+-------------------------------------------------------------------------+
| ``distance`` | float | centimeters |
+-----------------------+-----------------------+-------------------------------------------------------------------------+
+| ``proximity`` | int | non-unit-specifc proximity values (monotonic but not actual distance) |
++-----------------------+-----------------------+-------------------------------------------------------------------------+
| ``light`` | float | non-unit-specific light levels (should be monotonic but is not lux) |
+-----------------------+-----------------------+-------------------------------------------------------------------------+
| ``lux`` | float | SI lux |
@@ -500,6 +504,10 @@ properties.
+-----------------------+-----------------------+-------------------------------------------------------------------------+
| ``value`` | int | 16-bit Analog value, unit-less |
+-----------------------+-----------------------+-------------------------------------------------------------------------+
+| ``weight`` | float | grams (g) |
++-----------------------+-----------------------+-------------------------------------------------------------------------+
+| ``sound_level`` | float | non-unit-specific sound level (monotonic but not actual decibels) |
++-----------------------+-----------------------+-------------------------------------------------------------------------+
Adding native modules
--------------------------------------------------------------------------------
diff --git a/docs/drivers.rst b/docs/drivers.rst
index 119706d33..241415cc1 100644
--- a/docs/drivers.rst
+++ b/docs/drivers.rst
@@ -1,16 +1,13 @@
-.. _adafruit-libndrivers:
-
-Additional Adafruit Libraries and Drivers on GitHub
-===================================================
+Additional CircuitPython Libraries and Drivers on GitHub
+=========================================================
These are libraries and drivers available in separate GitHub repos. They are
designed for use with CircuitPython and may or may not work with
`MicroPython <https://micropython.org>`_.
-.. _bundle_installation:
-Bundle
-------
+Adafruit CircuitPython Library Bundle
+--------------------------------------
We provide a bundle of all our libraries to ease installation of drivers and
their dependencies. The bundle is primarily geared to the Adafruit Express line
@@ -18,233 +15,19 @@ of boards which feature a relatively large external flash. With Express boards,
its easy to copy them all onto the filesystem. However, if you don't have
enough space simply copy things over as they are needed.
-The bundles are available `on GitHub <https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases>`_.
-
-To install them:
-
-#. `Download <https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases>`_
- and unzip the latest zip that's not a source zip.
-#. Copy the ``lib`` folder to the ``CIRCUITPY`` or ``MICROPYTHON``.
-
-Foundational
-------------
-
-These libraries provide critical functionality to many of the drivers below. It
-is recommended to always have them installed onto the CircuitPython file system in
-the ``lib/`` directory. Some drivers may not work without them.
-
-.. toctree::
-
- Register Library <https://circuitpython.readthedocs.io/projects/register/en/latest/>
- BusDevice Library <https://circuitpython.readthedocs.io/projects/busdevice/en/latest/>
-
-Board-specific Helpers
-----------------------
-
-These libraries tie lower-level libraries together to provide an easy, out-of-box experience for
-specific boards.
-
-.. toctree::
-
- Adafruit CircuitPlayground Express <https://circuitpython.readthedocs.io/projects/circuitplayground/en/latest/>
- Adafruit FeatherWings <https://circuitpython.readthedocs.io/projects/featherwing/en/latest/>
-
-Helper Libraries
------------------
-
-These libraries build on top of the low level APIs to simplify common tasks.
-
-.. toctree::
-
- USB Human Interface Device (Keyboard and Mouse) <https://circuitpython.readthedocs.io/projects/hid/en/latest/>
- Waveform Generation <https://circuitpython.readthedocs.io/projects/waveform/en/latest/>
- OneWire <https://circuitpython.readthedocs.io/projects/onewire/en/latest/>
- Ring Tone Text Transfer Language (RTTTL) <https://circuitpython.readthedocs.io/projects/rtttl/en/latest/>
- InfraRed Remote <https://circuitpython.readthedocs.io/projects/irremote/en/latest/>
- Fancy LED (similar to FastLED) <https://circuitpython.readthedocs.io/projects/fancyled/en/latest/>
- SimpleIO <https://circuitpython.readthedocs.io/projects/simpleio/en/latest/>
- AVR programming <https://circuitpython.readthedocs.io/projects/avrprog/en/latest/>
- DC Motor and Servo <https://circuitpython.readthedocs.io/projects/motor/en/latest/>
- SD Card <https://circuitpython.readthedocs.io/projects/sd/en/latest/>
- Image Load <https://circuitpython.readthedocs.io/projects/imageload/en/latest/>
- miniQR Non-hardware QR code generator <https://circuitpython.readthedocs.io/projects/miniqr/en/latest/>
- Slideshow <https://circuitpython.readthedocs.io/projects/slideshow/en/latest/>
- LED Animation <https://circuitpython.readthedocs.io/projects/led-animation/en/latest/>
-
-Blinky
---------
-
-Multi-color led drivers.
-
-.. toctree::
-
- NeoPixel <https://circuitpython.readthedocs.io/projects/neopixel/en/latest/>
- DotStar <https://circuitpython.readthedocs.io/projects/dotstar/en/latest/>
- WS2801 <https://circuitpython.readthedocs.io/projects/ws2801/en/latest/>
- Pixie <https://circuitpython.readthedocs.io/projects/pixie/en/latest/>
-
-Displays
--------------
-
-Drivers used to display information. Either pixel or segment based.
-
-.. toctree::
-
- RGB Displays <https://circuitpython.readthedocs.io/projects/rgb_display/en/latest/>
- Character LCD <https://circuitpython.readthedocs.io/projects/charlcd/en/latest/>
- HT16K33 LED Matrices and Segment Displays <https://circuitpython.readthedocs.io/projects/ht16k33/en/latest/>
- IS31FL3731 Charlieplexed LED Matrix <https://circuitpython.readthedocs.io/projects/is31fl3731/en/latest/>
- MAX7219 LED Matrix <https://circuitpython.readthedocs.io/projects/max7219/en/latest/>
- SSD1306 OLED Driver <https://circuitpython.readthedocs.io/projects/ssd1306/en/latest/>
- E-Paper Display <https://circuitpython.readthedocs.io/projects/epd/en/latest/>
-
-Real-time clocks
------------------
-
-Chips that keep current calendar time with a backup battery. The current date and time is available
-through ``datetime``.
-
-.. toctree::
-
- DS1307 Real-time Clock (5V RTC Breakout) <https://circuitpython.readthedocs.io/projects/ds1307/en/latest/>
- DS3231 Real-time Clock (Precision RTC) <https://circuitpython.readthedocs.io/projects/ds3231/en/latest/>
- PCF8523 Real-time Clock (Adalogger RTC) <https://circuitpython.readthedocs.io/projects/pcf8523/en/latest/>
-
-Motion Sensors
-----------------
-
-Motion relating sensing including ``acceleration``, ``magnetic``, ``gyro``, and ``orientation``.
-
-.. toctree::
-
- ADXL34x 3 Axis Accelerometer <https://circuitpython.readthedocs.io/projects/adxl34x/en/latest/>
- BNO055 Accelerometer, Magnetometer, Gyroscope and Absolution Orientation <https://circuitpython.readthedocs.io/projects/bno055/en/latest/>
- FXAS21002C Gyroscope <https://circuitpython.readthedocs.io/projects/fxas21002c/en/latest/>
- FXOS8700 Accelerometer <https://circuitpython.readthedocs.io/projects/fxos8700/en/latest/>
- GPS Global Position <https://circuitpython.readthedocs.io/projects/gps/en/latest/>
- L3GD20 Gyroscope <https://circuitpython.readthedocs.io/projects/l3gd20/latest/>
- LIS3DH Accelerometer <https://circuitpython.readthedocs.io/projects/lis3dh/en/latest/>
- LSM303 Accelerometer and Magnetometer <https://circuitpython.readthedocs.io/projects/lsm303/en/latest/>
- LSM9DS0 Accelerometer, Magnetometer, Gyroscope and Temperature <https://circuitpython.readthedocs.io/projects/lsm9ds0/en/latest/>
- LSM9DS1 Accelerometer, Magnetometer, Gyroscope and Temperature <https://circuitpython.readthedocs.io/projects/lsm9ds1/en/latest/>
- MLX90390 3 Axis Mangetometer <https://circuitpython.readthedocs.io/projects/mlx90393/en/latest/>
- MMA8451 3 axis accelerometer <https://circuitpython.readthedocs.io/projects/mma8451/en/latest/>
-
-Environmental Sensors
-----------------------
-
-Sense attributes of the environment including ``temperature``, ``relative_humidity``, ``pressure``,
-equivalent carbon dioxide (``eco2`` / ``eCO2``), and total volatile organic compounds (``tvoc`` /
-``TVOC``).
-
-.. toctree::
-
- AM2320 Temperature and Humidity <https://circuitpython.readthedocs.io/projects/am2320/en/latest/>
- BME280 Temperature, Humidity and Pressure <https://circuitpython.readthedocs.io/projects/bme280/en/latest/>
- BME680 Temperature, Humidity, Pressure and Gas <https://circuitpython.readthedocs.io/projects/bme680/en/latest/>
- BMP280 Barometric Pressure and Altitude <https://circuitpython.readthedocs.io/projects/bmp280/en/latest/>
- BMP3xx Barometric Pressure and Altimeter <https://circuitpython.readthedocs.io/projects/bmp3xx/en/latest/>
- CCS811 Air Quality <https://circuitpython.readthedocs.io/projects/ccs811/en/latest/>
- DHT Temperature and Humidity <https://circuitpython.readthedocs.io/projects/dht/en/latest/>
- DS18x20 Temperature <https://circuitpython.readthedocs.io/projects/ds18x20/en/latest/>
- HTU21D Temperature and Humidity <https://circuitpython.readthedocs.io/projects/htu21d/en/latest/>
- MAX31865 Thermocouple Amplifier, Temperature <https://circuitpython.readthedocs.io/projects/max31865/en/latest/>
- MAX31855 Thermocouple Amplifier, Temperature <https://circuitpython.readthedocs.io/projects/max31855/en/latest/>
- MAX31856 Thermocouple Amplifier, Temperature <https://circuitpython.readthedocs.io/projects/max31856/en/latest/>
- MCP9808 Temperature <https://circuitpython.readthedocs.io/projects/mcp9808/en/latest/>
- MP115A2 Barometric Pressure, Temperature <https://circuitpython.readthedocs.io/projects/mpl115a2/en/latest/>
- MPL3115A2 Barometric Pressure, Altitude and Temperature Sensor <https://circuitpython.readthedocs.io/projects/mpl3115a2/en/latest/>
- MPRLS Ported Absolute Pressure <https://circuitpython.readthedocs.io/projects/mprls/en/latest/>
- SGP30 Air Quality <https://circuitpython.readthedocs.io/projects/sgp30/en/latest/>
- SHT31-D Temperature and Humidity <https://circuitpython.readthedocs.io/projects/sht31d/en/latest/>
- Si7021 Temperature and Humidity <https://circuitpython.readthedocs.io/projects/si7021/en/latest/>
- Thermistor Temperature <https://circuitpython.readthedocs.io/projects/thermistor/en/latest/>
- TMP007 Contactless Temperature <https://circuitpython.readthedocs.io/projects/tmp007/en/latest/>
- MLX90614 Contactless Temperature <https://circuitpython.readthedocs.io/projects/mlx90614/en/latest/>
-
-Light Sensors
----------------
-
-These sensors detect light related attributes such as ``color``, ``light`` (unit-less), and
-``lux`` (light in SI lux).
-
-.. toctree::
-
- APDS9960 Proximity, Light, RGB, and Gesture <https://circuitpython.readthedocs.io/projects/apds9960/en/latest/>
- AS726x Color Spectrum Sensor <https://circuitpython.readthedocs.io/projects/as726x/en/latest/>
- TCS34725 Color Sensor <https://circuitpython.readthedocs.io/projects/tcs34725/en/latest/>
- TSL2561 Light Sensor <https://circuitpython.readthedocs.io/projects/tsl2561/en/latest/>
- TSL2591 High Dynamic Range Light Sensor <https://circuitpython.readthedocs.io/projects/tsl2591/en/latest/>
- VCNL4010 Proximity and Light <https://circuitpython.readthedocs.io/projects/vcnl4010/en/latest/>
- VEML6070 UV Index <https://circuitpython.readthedocs.io/projects/veml6070/en/latest/>
- VEML6075 UV Index <https://circuitpython.readthedocs.io/projects/veml6075/en/latest/>
-
-Distance Sensors
-------------------
-
-These sensors measure the ``distance`` to another object and may also measure light level (``light`` and ``lux``).
-
-.. toctree::
-
- Garmin LIDARLite I2C <https://circuitpython.readthedocs.io/projects/lidarlite/en/latest/>
- TFmini IR Time of Flight ~30cm - 12m <https://circuitpython.readthedocs.io/projects/tfmini/en/latest/>
- VL6180x 5 - 100 mm <https://circuitpython.readthedocs.io/projects/vl6180x/en/latest/>
- VL53L0x ~30 - 1000 mm <https://circuitpython.readthedocs.io/projects/vl53l0x/en/latest/>
- HC-SR04 Ultrasonic Range Sensors <https://circuitpython.readthedocs.io/projects/hcsr04/en/latest/>
-
-Radio
---------
-
-These chips communicate to other's over radio.
-
-.. toctree::
-
- Adafruit Bluefruit LE SPI Friend <https://circuitpython.readthedocs.io/projects/bluefruitspi/en/latest/>
- RFM9x LoRa <https://circuitpython.readthedocs.io/projects/rfm9x/en/latest/>
- RFM69 Packet Radio <https://circuitpython.readthedocs.io/projects/rfm69/en/latest/>
- PN532 NFC/RFID <https://circuitpython.readthedocs.io/projects/pn532/en/latest/>
-
-IO Expansion
---------------
+- The Adafruit bundles are available on GitHub: <https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases>.
-These provide functionality similar to `analogio`, `digitalio`, `pulseio`, and `touchio`.
+- Documentation for the bundle, which includes links to documentation for all
+ libraries, is available here: <https://circuitpython.readthedocs.io/projects/bundle/en/latest/>.
-.. toctree::
- Adafruit SeeSaw <https://circuitpython.readthedocs.io/projects/seesaw/en/latest/>
- ADS1x15 Analog-to-Digital Converter <https://circuitpython.readthedocs.io/projects/ads1x15/en/latest/>
- Crickit Robotics Boards <<https://circuitpython.readthedocs.io/projects/crickit/en/latest/>
- DS2413 OneWire GPIO Expander <https://circuitpython.readthedocs.io/projects/ds2413/en/latest/>
- FocalTech Capacitive Touch <https://circuitpython.readthedocs.io/projects/focaltouch/en/latest/>
- MCP230xx GPIO Expander <https://circuitpython.readthedocs.io/projects/mcp230xx/en/latest/>
- MCP4725 Digital-to-Analog Converter <https://circuitpython.readthedocs.io/projects/mcp4725/en/latest/>
- PCA9685 16 x 12-bit PWM Driver <https://circuitpython.readthedocs.io/projects/pca9685/en/latest/>
- TLC5947 24 x 12-bit PWM Driver <https://circuitpython.readthedocs.io/projects/tlc5947/en/latest/>
- TLC59711 12 x 16-bit PWM Driver <https://circuitpython.readthedocs.io/projects/tlc59711/en/latest/>
- MPR121 Capacitive Touch Sensor <https://circuitpython.readthedocs.io/projects/mpr121/en/latest/>
- TCA9548 I2C Multiplexer <https://circuitpython.readthedocs.io/projects/tca9548a/en/latest/>
- MCP3xxx SPI ADC <https://circuitpython.readthedocs.io/projects/mcp3xxx/en/latest/>
+CircuitPython Community Library Bundle
+---------------------------------------
-Miscellaneous
-----------------
+This bundle contains non-Adafruit sponsored libraries, that are written and submitted
+by members of the community.
-.. toctree::
+- The Community bundles are available on GitHub: <https://github.com/adafruit/CircuitPython_Community_Bundle/releases>.
- CAP1188 8-Key Capacitive Touch <https://circuitpython.readthedocs.io/projects/cap1188/en/latest/>
- Si4713 Stereo FM Transmitter <https://circuitpython.readthedocs.io/projects/si4713/en/latest/>
- AMG88xx Grid-Eye IR Camera <https://circuitpython.readthedocs.io/projects/amg88xx/en/latest/>
- Trellis 4x4 Keypad <https://circuitpython.readthedocs.io/projects/trellis/en/latest/>
- NeoTrellis 4x4 Keypad <https://circuitpython.readthedocs.io/projects/neotrellis/en/latest/>
- NeoTrellis M4 4x8 Keypad <https://circuitpython.readthedocs.io/projects/trellism4/en/latest/>
- DRV2605 Haptic Motor Controller <https://circuitpython.readthedocs.io/projects/drv2605/en/latest/>
- MAX9744 Audio Amplifier <https://circuitpython.readthedocs.io/projects/max9744/en/latest/>
- Si5351 Clock Generator <https://circuitpython.readthedocs.io/projects/si5351/en/latest/>
- Thermal Printer <https://circuitpython.readthedocs.io/projects/thermal_printer/en/latest/>
- VC0706 TTL Camera <https://circuitpython.readthedocs.io/projects/vc0706/en/latest/>
- INA219 High Side Current <https://circuitpython.readthedocs.io/projects/ina219/en/latest/>
- Fingerprint <https://circuitpython.readthedocs.io/projects/fingerprint/en/latest/>
- STMPE610 Resistive Touchscreen <https://circuitpython.readthedocs.io/projects/stmpe610/en/latest/>
- Matrix Keypad <https://circuitpython.readthedocs.io/projects/matrixkeypad/en/latest/>
- VS1053 Audio Codec <https://circuitpython.readthedocs.io/projects/vs1053/en/latest/>
- FRAM Non-Volatile Memory <https://circuitpython.readthedocs.io/projects/fram/en/latest/>
- 74HC595 Shift Register <https://circuitpython.readthedocs.io/projects/74hc595/en/latest/>
+- Documentation is not available on ReadTheDocs at this time. See each library for any
+ included documentation.
diff --git a/docs/index.rst b/docs/index.rst
index a85772fdc..6dadddfc1 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -43,6 +43,7 @@ Full Table of Contents
../README
../CONTRIBUTING
+ ../BUILDING
../CODE_OF_CONDUCT
../license.rst
diff --git a/docs/library/builtins.rst b/docs/library/builtins.rst
index 36a84bc0c..6cbf95d53 100644
--- a/docs/library/builtins.rst
+++ b/docs/library/builtins.rst
@@ -78,12 +78,12 @@ Not all of these functions and types are turned on in all CircuitPython ports, f
.. classmethod:: from_bytes(bytes, byteorder)
- In CircuitPython, `byteorder` parameter must be positional (this is
+ In CircuitPython, ``byteorder`` parameter must be positional (this is
compatible with CPython).
.. method:: to_bytes(size, byteorder)
- In CircuitPython, `byteorder` parameter must be positional (this is
+ In CircuitPython, ``byteorder`` parameter must be positional (this is
compatible with CPython).
.. function:: isinstance()
@@ -182,7 +182,7 @@ Exceptions
.. exception:: OSError
- |see_cpython| `OSError`. CircuitPython doesn't implement the ``errno``
+ |see_cpython| :py:class:`cpython:OSError`. CircuitPython doesn't implement the ``errno``
attribute, instead use the standard way to access exception arguments:
``exc.args[0]``.
@@ -198,11 +198,11 @@ Exceptions
.. exception:: SystemExit
- |see_cpython| :py:class:`python:SystemExit`.
+ |see_cpython| :py:class:`cpython:SystemExit`.
.. exception:: TypeError
- |see_cpython| :py:class:`python:TypeError`.
+ |see_cpython| :py:class:`cpython:TypeError`.
.. exception:: ValueError
diff --git a/docs/library/network.rst b/docs/library/network.rst
index d25f9f388..bd32267fe 100644
--- a/docs/library/network.rst
+++ b/docs/library/network.rst
@@ -5,6 +5,7 @@
.. include:: ../templates/unsupported_in_circuitpython.inc
.. module:: network
+ :noindex:
:synopsis: network configuration
This module provides network drivers and routing configuration. To use this
@@ -246,7 +247,7 @@ Methods
nic.ifconfig(('192.168.0.4', '255.255.255.0', '192.168.0.1', '8.8.8.8'))
.. method:: wlan.config('param')
-.. method:: wlan.config(param=value, ...)
+ wlan.config(param=value, ...)
Get or set general network interface parameters. These methods allow to work
with additional parameters beyond standard IP configuration (as dealt with by
diff --git a/docs/porting.rst b/docs/porting.rst
index 6bb514458..d28f56f47 100644
--- a/docs/porting.rst
+++ b/docs/porting.rst
@@ -1,5 +1,5 @@
We love CircuitPython and would love to see it come to more microcontroller
-platforms. With 3.0 we've reworked CircuitPython to make it easier than ever to
+platforms. Since 3.0 we've reworked CircuitPython to make it easier than ever to
add support. While there are some major differences between ports, this page
covers the similarities that make CircuitPython what it is and how that core
fits into a variety of microcontrollers.
@@ -19,7 +19,7 @@ prepping file systems and automatically running user code on boot. In
CircuitPython we've dubbed this component the supervisor because it monitors
and facilitates the VMs which run user Python code. Porting involves the
supervisor because many of the tasks it does while interfacing with the
-hardware. Once its going though, the REPL works and debugging can migrate to a
+hardware. Once complete, the REPL works and debugging can migrate to a
Python based approach rather than C.
The third core piece is the plethora of low level APIs that CircuitPython
@@ -42,6 +42,44 @@ to the port's directory (in the top level until the ``ports`` directory is
present). This includes the Makefile and any C library resources. Make sure
these resources are compatible with the MIT License of the rest of the code!
+Circuitpython has a number of modules enabled by default in
+``py/circuitpy_mpconfig.mk``. Most of these modules will need to be disabled in
+``mpconfigboard.mk`` during the early stages of a port in order for it to
+compile. As the port progresses in module support, this list can be pruned down
+as a natural "TODO" list. An example minimal build list is shown below:
+
+.. code-block:: makefile
+
+ # These modules are implemented in ports/<port>/common-hal:
+ CIRCUITPY_MICROCONTROLLER = 0 # Typically the first module to create
+ CIRCUITPY_DIGITALIO = 0 # Typically the second module to create
+ CIRCUITPY_ANALOGIO = 0
+ CIRCUITPY_BUSIO = 0
+ CIRCUITPY_NEOPIXEL_WRITE = 0
+ CIRCUITPY_PULSEIO = 0
+ CIRCUITPY_OS = 0
+ CIRCUITPY_NVM = 0
+ CIRCUITPY_AUDIOBUSIO = 0
+ CIRCUITPY_AUDIOIO = 0
+ CIRCUITPY_ROTARYIO = 0
+ CIRCUITPY_RTC = 0
+ CIRCUITPY_FREQUENCYIO = 0
+ CIRCUITPY_I2CSLAVE = 0
+ CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO (stub ok)
+
+ # These modules are implemented in shared-module/ - they can be included in
+ # any port once their prerequisites in common-hal are complete.
+ CIRCUITPY_BITBANGIO = 0 # Requires DigitalIO
+ CIRCUITPY_GAMEPAD = 0 # Requires DigitalIO
+ CIRCUITPY_PIXELBUF = 0 # Requires neopixel_write or SPI (dotstar)
+ CIRCUITPY_RANDOM = 0 # Requires OS
+ CIRCUITPY_STORAGE = 0 # Requires OS, filesystem
+ CIRCUITPY_TOUCHIO = 0 # Requires Microcontroller
+ CIRCUITPY_USB_HID = 0 # Requires USB
+ CIRCUITPY_USB_MIDI = 0 # Requires USB
+ CIRCUITPY_REQUIRE_I2C_PULLUPS = 0 # Does nothing without I2C
+ CIRCUITPY_ULAB = 0 # No requirements, but takes extra flash
+
Step 2: Init
--------------
Once your build is setup, the next step should be to get your clocks going as
diff --git a/docs/requirements.txt b/docs/requirements.txt
new file mode 100644
index 000000000..51029bcba
--- /dev/null
+++ b/docs/requirements.txt
@@ -0,0 +1,5 @@
+sphinx<3
+recommonmark==0.6.0
+sphinxcontrib-svg2pdfconverter==0.1.0
+astroid
+sphinx-autoapi
diff --git a/docs/rstjinja.py b/docs/rstjinja.py
new file mode 100644
index 000000000..3a08b2599
--- /dev/null
+++ b/docs/rstjinja.py
@@ -0,0 +1,24 @@
+# Derived from code on Eric Holscher's blog, found at:
+# https://www.ericholscher.com/blog/2016/jul/25/integrating-jinja-rst-sphinx/
+
+def rstjinja(app, docname, source):
+ """
+ Render our pages as a jinja template for fancy templating goodness.
+ """
+ # Make sure we're outputting HTML
+ if app.builder.format != 'html':
+ return
+
+ # we only want our one jinja template to run through this func
+ if "shared-bindings/support_matrix" not in docname:
+ return
+
+ src = source[0]
+ print(docname)
+ rendered = app.builder.templates.render_string(
+ src, app.config.html_context
+ )
+ source[0] = rendered
+
+def setup(app):
+ app.connect("source-read", rstjinja)
diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py
new file mode 100644
index 000000000..02ef68349
--- /dev/null
+++ b/docs/shared_bindings_matrix.py
@@ -0,0 +1,158 @@
+# The MIT License (MIT)
+#
+# Copyright (c) 2019 Michael Schroeder
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+
+import json
+import os
+import re
+import subprocess
+import sys
+
+
+SUPPORTED_PORTS = ['atmel-samd', 'esp32s2', 'litex', 'mimxrt10xx', 'nrf', 'stm']
+
+def get_shared_bindings():
+ """ Get a list of modules in shared-bindings based on folder names
+ """
+ return [item for item in os.listdir("./shared-bindings")]
+
+
+def read_mpconfig():
+ """ Open 'circuitpy_mpconfig.mk' and return the contents.
+ """
+ configs = []
+ with open("py/circuitpy_mpconfig.mk") as mpconfig:
+ configs = mpconfig.read()
+
+ return configs
+
+
+def build_module_map():
+ """ Establish the base of the JSON file, based on the contents from
+ `configs`. Base will contain module names, if they're part of
+ the `FULL_BUILD`, or their default value (0, 1, or a list of
+ modules that determine default [see audiocore, audiomixer, etc.]).
+
+ """
+ base = dict()
+ modules = get_shared_bindings()
+ configs = read_mpconfig()
+ full_build = False
+ for module in modules:
+ full_name = module
+ search_name = module.lstrip("_")
+ re_pattern = "CIRCUITPY_{}\s*\??=\s*(.+)".format(search_name.upper())
+ find_config = re.findall(re_pattern, configs)
+ if not find_config:
+ continue
+ find_config = ", ".join([x.strip("$()") for x in find_config])
+
+ full_build = int("CIRCUITPY_FULL_BUILD" in find_config)
+ if not full_build:
+ default_val = find_config
+ else:
+ default_val = "None"
+
+ base[search_name] = {
+ "name": full_name,
+ "full_build": str(full_build),
+ "default_value": default_val,
+ "excluded": {}
+ }
+
+ return base
+
+def get_settings_from_makefile(port_dir, board_name):
+ """ Invoke make in a mode which prints the database, then parse it for
+ settings.
+
+ This means that the effect of all Makefile directives is taken
+ into account, without having to re-encode the logic that sets them
+ in this script, something that has proved error-prone
+ """
+ contents = subprocess.run(
+ ["make", "-C", port_dir, f"BOARD={board_name}", "-qp", "print-CC"],
+ encoding="utf-8",
+ errors="replace",
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE
+ )
+ # Make signals errors with exit status 2; 0 and 1 are "non-error" statuses
+ if contents.returncode not in (0, 1):
+ error_msg = (
+ f"Invoking '{' '.join(contents.args)}' exited with "
+ f"{contents.returncode}: {contents.stderr}"
+ )
+ raise RuntimeError(error_msg)
+
+ settings = {}
+ for line in contents.stdout.split('\n'):
+ m = re.match(r'^([A-Z][A-Z0-9_]*) = (.*)$', line)
+ if m:
+ settings[m.group(1)] = m.group(2)
+
+ return settings
+
+def lookup_setting(settings, key, default=''):
+ while True:
+ value = settings.get(key, default)
+ if not value.startswith('$'):
+ break
+ key = value[2:-1]
+ return value
+
+def support_matrix_by_board():
+ """ Compiles a list of the available core modules available for each
+ board.
+ """
+ base = build_module_map()
+
+ boards = dict()
+ for port in SUPPORTED_PORTS:
+
+ port_dir = "ports/{}/boards".format(port)
+ for entry in os.scandir(port_dir):
+ if not entry.is_dir():
+ continue
+ board_modules = []
+
+ settings = get_settings_from_makefile(f'ports/{port}', entry.name)
+
+ with open(os.path.join(entry.path, "mpconfigboard.h")) as get_name:
+ board_contents = get_name.read()
+ board_name_re = re.search("(?<=MICROPY_HW_BOARD_NAME)\s+(.+)",
+ board_contents)
+ if board_name_re:
+ board_name = board_name_re.group(1).strip('"')
+
+ board_modules = []
+ for module in base:
+ key = f'CIRCUITPY_{module.upper()}'
+ if int(lookup_setting(settings, key, '0')):
+ board_modules.append(base[module]['name'])
+ boards[board_name] = sorted(board_modules)
+
+ #print(json.dumps(boards, indent=2))
+ return boards
+
+if __name__ == '__main__':
+ print(json.dumps(support_matrix_by_board(), indent=2))
diff --git a/docs/supported_ports.rst b/docs/supported_ports.rst
index 039ddea68..09571afb6 100644
--- a/docs/supported_ports.rst
+++ b/docs/supported_ports.rst
@@ -1,12 +1,19 @@
Supported Ports
==============================
-Adafruit's CircuitPython currently has limited support with a focus on supporting the Atmel SAMD
-and ESP8266.
+CircuitPython supports a number of microcontroller families. Support quality for each varies
+depending on the active contributors for each port.
+
+Adafruit sponsored developers are actively contributing to atmel-samd, mimxrt10xx, nrf and stm
+ports. They also maintain the other ports in order to ensure the boards build. Additional testing
+is limited.
.. toctree::
:maxdepth: 2
../ports/atmel-samd/README
- ../ports/esp8266/README
+ ../ports/cxd56/README
+ ../ports/litex/README
+ ../ports/mimxrt10xx/README
../ports/nrf/README
+ ../ports/stm/README