diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 00000000..8b77f690 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,2 @@ +python: + version: 3 diff --git a/.travis.yml b/.travis.yml index 8a3ce6a5..1bac5f86 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,4 +19,6 @@ deploy: on: tags: true -script: circuitpython-build-bundles --filename_prefix adafruit-circuitpython-bundle --library_location libraries --library_depth 2 +script: +- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-bundle --library_location libraries --library_depth 2 +- cd docs && sphinx-build -E -W -b html . _build/html && cd .. diff --git a/README.md b/README.md deleted file mode 100644 index 0ec3f6ec..00000000 --- a/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# Adafruit CircuitPython Library Bundle - -[![Doc Status](https://readthedocs.org/projects/circuitpython/badge/?version=latest)](https://circuitpython.readthedocs.io/en/latest/docs/drivers.html) -[![Discord](https://img.shields.io/discord/327254708534116352.svg)](https://discord.gg/nBQh6qu) - -This repo bundles a bunch of useful CircuitPython libraries into an easy to -download zip file. CircuitPython boards can ship with the contents of the zip to -make it easy to provide a lot of libraries by default. - -# Use -To use the bundle download the zip (not source zip) from the -[latest release](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/latest), -unzip it and copy over the subfolders, such as `lib`, into the root of your -CircuitPython device. Make sure to indicate that it should be merged with the -existing folder when it exists. - -## CPython -**DO NOT** use this to install libraries on a Linux computer, such as the Raspberry Pi, with regular Python (aka CPython). Instead, use the python3 version of `pip` to install the libraries you want to use. It will automatically install dependencies for you. For example: - -`pip3 install adafruit-circuitpython-lis3dh` - -# Development - -After you clone this repository you must run `git submodule init` -and then `git submodule update`. - -## Updating libraries -To update the libraries run `update-submodules.sh`. The script will fetch the -latest code and update to the newest tag (not master). - -To find libraries with commits that haven't been included in a release do: - - git submodule foreach "git log --oneline HEAD...origin/master" - -## Adding a library -Determine the best location within `libraries` (`libraries/drivers/` or -`libraries/helpers/`)for the new library and then run: - - git submodule add libraries/ - -The target directory should omit any CircuitPython specific prefixes such as -`adafruit-circuitpython` to simplify the listing. - -## Removing a library -Only do this if you are replacing the module with an equivalent: - - git submodule deinit libraries/ - git rm libraries/ - -## Building the bundle -To build this bundle locally you'll need to install the -`circuitpython-build-tools `_ package. - - python3 -m venv .env - source .env/bin/activate - pip install circuitpython-build-tools - -Once installed, make sure you are in the virtual environment: - - source .env/bin/activate - -Then run the build: - - circuitpython-build-bundles --filename_prefix adafruit-circuitpython-bundle --library_location libraries --library_depth 2 diff --git a/README.rst b/README.rst new file mode 100644 index 00000000..5270d18e --- /dev/null +++ b/README.rst @@ -0,0 +1,97 @@ +Adafruit CircuitPython Library Bundle +======================================= + +.. image:: https://readthedocs.org/projects/adafruit-circuitpython-bundle/badge/?version=latest + :target: https://circuitpython.readthedocs.io/projects/bundle/en/latest/ + :alt: Documentation Status + +.. image:: https://img.shields.io/discord/327254708534116352.svg + :target: https://discord.gg/nBQh6qu + :alt: Discord + +.. image:: https://travis-ci.com/adafruit/Adafruit_CircuitPython_Bundle.svg?branch=master + :target: https://travis-ci.com/adafruit/Adafruit_CircuitPython_Bundle + :alt: Build Status + +This repo bundles a bunch of useful CircuitPython libraries into an easy to +download zip file. CircuitPython boards can ship with the contents of the zip to +make it easy to provide a lot of libraries by default. + +Use +===== +To use the bundle download the zip (not source zip) from the +`latest release `_, +unzip it and copy over the subfolders, such as ``lib``, into the root of your +CircuitPython device. Make sure to indicate that it should be merged with the +existing folder when it exists. + +CPython +-------- +**DO NOT** use this to install libraries on a Linux computer, such as the Raspberry Pi, +with regular Python (aka CPython). Instead, use the python3 version of ``pip`` to install +the libraries you want to use. It will automatically install dependencies for you. For example: + +.. code:: + + pip3 install adafruit-circuitpython-lis3dh + +Development +============ + +After you clone this repository you must run ``git submodule init`` +and then ``git submodule update``. + +Updating libraries +------------------- +To update the libraries run ``update-submodules.sh``. The script will fetch the +latest code and update to the newest tag (not master). + +To find libraries with commits that haven't been included in a release do: + +.. code:: + + git submodule foreach "git log --oneline HEAD...origin/master" + +Adding a library +----------------- +Determine the best location within ``libraries`` (``libraries/drivers/`` or +``libraries/helpers/``)for the new library and then run: + +.. code:: + + git submodule add libraries/ + +The target directory should omit any CircuitPython specific prefixes such as +``adafruit-circuitpython`` to simplify the listing. + +Removing a library +------------------- +Only do this if you are replacing the module with an equivalent: + +.. code:: + + git submodule deinit libraries/ + git rm libraries/ + +Building the bundle +-------------------- +To build this bundle locally you'll need to install the +`circuitpython-build-tools `_ package. + +.. code:: + + python3 -m venv .env + source .env/bin/activate + pip install circuitpython-build-tools + +Once installed, make sure you are in the virtual environment: + +.. code:: + + source .env/bin/activate + +Then run the build: + +.. code:: + + circuitpython-build-bundles --filename_prefix adafruit-circuitpython-bundle --library_location libraries --library_depth 2 diff --git a/docs/_static/favicon.ico b/docs/_static/favicon.ico new file mode 100644 index 00000000..5aca9837 Binary files /dev/null and b/docs/_static/favicon.ico differ diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 00000000..c5d33677 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,160 @@ +# -*- coding: utf-8 -*- + +import os +import sys +sys.path.insert(0, os.path.abspath('..')) + +# -- General configuration ------------------------------------------------ + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.intersphinx', + 'sphinx.ext.napoleon', + 'sphinx.ext.todo', +] + +# TODO: Please Read! +# 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"] + + +intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None)} + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'Adafruit CircuitPython Bundle' +copyright = u'2019 Adafruit' +author = u'Adabot' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = u'1.0' +# The full version, including alpha/beta/rc tags. +release = u'1.0' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This patterns also effect to html_static_path and html_extra_path +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.env', 'CODE_OF_CONDUCT.md'] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +# +default_role = "any" + +# If true, '()' will be appended to :func: etc. cross-reference text. +# +add_function_parentheses = True + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = False + +# If this is True, todo emits a warning for each TODO entries. The default is False. +todo_emit_warnings = True + +napoleon_numpy_docstring = False + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +on_rtd = os.environ.get('READTHEDOCS', None) == 'True' + +if not on_rtd: # only import and set the theme if we're building docs locally + try: + import sphinx_rtd_theme + html_theme = 'sphinx_rtd_theme' + html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.'] + except: + html_theme = 'default' + html_theme_path = ['.'] +else: + html_theme_path = ['.'] + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# The name of an image file (relative to this directory) to use as a favicon of +# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +# +html_favicon = '_static/favicon.ico' + +# Output file base name for HTML help builder. +htmlhelp_basename = 'AdafruitBundleLibrarydoc' + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'AdafruitBundleLibrary.tex', u'AdafruitBundle Documentation', + author, 'manual'), +] + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'AdafruitBundlelibrary', u'Adafruit Bundle Documentation', + [author], 1) +] + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'AdafruitBundleLibrary', u'Adafruit Bundle Documentation', + author, 'AdafruitBundleLibrary', 'One line description of project.', + 'Miscellaneous'), +] diff --git a/docs/drivers.rst b/docs/drivers.rst new file mode 100644 index 00000000..395a191e --- /dev/null +++ b/docs/drivers.rst @@ -0,0 +1,233 @@ +.. _adafruit-libndrivers: + +Adafruit Sponsored 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 `_. + +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 + BusDevice Library + +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 + Adafruit FeatherWings + +Helper Libraries +----------------- + +These libraries build on top of the low level APIs to simplify common tasks. + +.. toctree:: + + USB Human Interface Device (Keyboard and Mouse) + Waveform Generation + OneWire + Ring Tone Text Transfer Language (RTTTL) + InfraRed Remote + Fancy LED (similar to FastLED) + SimpleIO + AVR programming + DC Motor and Servo + SD Card + Image Load + miniQR Non-hardware QR code generator + Slideshow + LED Animation + Bluetooth Low Energy (BLE) + Bluefruit LE Connect App + +Blinky +-------- + +Multi-color led drivers. + +.. toctree:: + + NeoPixel + DotStar + WS2801 + Pixie + +Displays +------------- + +Drivers used to display information. Either pixel or segment based. + +.. toctree:: + + RGB Displays + Character LCD + HT16K33 LED Matrices and Segment Displays + IS31FL3731 Charlieplexed LED Matrix + MAX7219 LED Matrix + SSD1306 OLED Driver + E-Paper Display + +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) + DS3231 Real-time Clock (Precision RTC) + PCF8523 Real-time Clock (Adalogger RTC) + +Motion Sensors +---------------- + +Motion relating sensing including ``acceleration``, ``magnetic``, ``gyro``, and ``orientation``. + +.. toctree:: + + ADXL34x 3 Axis Accelerometer + BNO055 Accelerometer, Magnetometer, Gyroscope and Absolution Orientation + FXAS21002C Gyroscope + FXOS8700 Accelerometer + GPS Global Position + L3GD20 Gyroscope + LIS3DH Accelerometer + LSM303 Accelerometer and Magnetometer + LSM9DS0 Accelerometer, Magnetometer, Gyroscope and Temperature + LSM9DS1 Accelerometer, Magnetometer, Gyroscope and Temperature + MLX90390 3 Axis Mangetometer + MMA8451 3 axis accelerometer + +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 + BME280 Temperature, Humidity and Pressure + BME680 Temperature, Humidity, Pressure and Gas + BMP280 Barometric Pressure and Altitude + BMP3xx Barometric Pressure and Altimeter + CCS811 Air Quality + DHT Temperature and Humidity + DS18x20 Temperature + HTU21D Temperature and Humidity + MAX31865 Thermocouple Amplifier, Temperature + MAX31855 Thermocouple Amplifier, Temperature + MAX31856 Thermocouple Amplifier, Temperature + MCP9808 Temperature + MP115A2 Barometric Pressure, Temperature + MPL3115A2 Barometric Pressure, Altitude and Temperature Sensor + MPRLS Ported Absolute Pressure + SGP30 Air Quality + SHT31-D Temperature and Humidity + Si7021 Temperature and Humidity + Thermistor Temperature + TMP007 Contactless Temperature + MLX90614 Contactless Temperature + +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 + AS726x Color Spectrum Sensor + TCS34725 Color Sensor + TSL2561 Light Sensor + TSL2591 High Dynamic Range Light Sensor + VCNL4010 Proximity and Light + VEML6070 UV Index + VEML6075 UV Index + +Distance Sensors +------------------ + +These sensors measure the ``distance`` to another object and may also measure light level (``light`` and ``lux``). + +.. toctree:: + + Garmin LIDARLite I2C + TFmini IR Time of Flight ~30cm - 12m + VL6180x 5 - 100 mm + VL53L0x ~30 - 1000 mm + HC-SR04 Ultrasonic Range Sensors + +Radio +-------- + +These chips communicate to other's over radio. + +.. toctree:: + + Adafruit Bluefruit LE SPI Friend + RFM9x LoRa + RFM69 Packet Radio + PN532 NFC/RFID + +IO Expansion +-------------- + +These provide functionality similar to ``analogio``, ``digitalio``, ``pulseio``, and ``touchio``. + +.. toctree:: + + Adafruit SeeSaw + ADS1x15 Analog-to-Digital Converter + Crickit Robotics Boards + DS2413 OneWire GPIO Expander + FocalTech Capacitive Touch + MCP230xx GPIO Expander + MCP4725 Digital-to-Analog Converter + PCA9685 16 x 12-bit PWM Driver + TLC5947 24 x 12-bit PWM Driver + TLC59711 12 x 16-bit PWM Driver + MPR121 Capacitive Touch Sensor + TCA9548 I2C Multiplexer + MCP3xxx SPI ADC + +Miscellaneous +---------------- + +.. toctree:: + + CAP1188 8-Key Capacitive Touch + Si4713 Stereo FM Transmitter + AMG88xx Grid-Eye IR Camera + Trellis 4x4 Keypad + NeoTrellis 4x4 Keypad + NeoTrellis M4 4x8 Keypad + DRV2605 Haptic Motor Controller + MAX9744 Audio Amplifier + Si5351 Clock Generator + Thermal Printer + VC0706 TTL Camera + INA219 High Side Current + Fingerprint + STMPE610 Resistive Touchscreen + Matrix Keypad + VS1053 Audio Codec + FRAM Non-Volatile Memory + 74HC595 Shift Register diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 00000000..ed31013b --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,34 @@ +.. include:: ../README.rst + +Table of Contents +================= + +.. toctree:: + :maxdepth: 4 + :hidden: + + self + +.. toctree:: + :maxdepth: 4 + :caption: Drivers & Helpers + + drivers + +.. toctree:: + :caption: Other Links + + Download + CircuitPython Reference Documentation + CircuitPython Support Forum + Discord Chat + Adafruit Learning System + Adafruit Blog + Adafruit Store + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/requirements.txt b/requirements.txt index 5bef2946..4bef26cf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,3 @@ circuitpython-build-tools +Sphinx +sphinx-rtd-theme