diff --git a/readthedocs.yml b/.readthedocs.yml similarity index 100% rename from readthedocs.yml rename to .readthedocs.yml diff --git a/.travis.yml b/.travis.yml index 91d4215..13429b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,16 +16,17 @@ deploy: provider: releases api_key: $GITHUB_TOKEN file_glob: true - file: bundles/* + file: $TRAVIS_BUILD_DIR/bundles/* skip_cleanup: true overwrite: true on: tags: true install: - - pip install pylint circuitpython-build-tools + - pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme script: - pylint adafruit_drv2605.py - ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/*.py) - circuitpython-build-bundles --filename_prefix adafruit-circuitpython-drv2605 --library_location . + - cd docs && sphinx-build -E -W -b html . _build/html diff --git a/README.rst b/README.rst index 192272e..5326f40 100644 --- a/README.rst +++ b/README.rst @@ -26,15 +26,7 @@ This is easily achieved by downloading Usage Example ============= -See examples/simpletest.py for a demo of the usage. - -API Reference -============= - -.. toctree:: - :maxdepth: 2 - - api +See examples/drv2605_simpletest.py for a demo of the usage. Contributing ============ diff --git a/adafruit_drv2605.py b/adafruit_drv2605.py index e5a285e..4d95796 100644 --- a/adafruit_drv2605.py +++ b/adafruit_drv2605.py @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. """ -`Adafruit_DRV2605` +`adafruit_drv2605` ==================================================== CircuitPython module for the DRV2605 haptic feedback motor driver. See @@ -148,7 +148,9 @@ def stop(self): @property def mode(self): - """Get and set the mode of the chip. Should be a value of: + """ + The mode of the chip. Should be a value of: + - MODE_INTTRIG: Internal triggering, vibrates as soon as you call play(). Default mode. - MODE_EXTTRIGEDGE: External triggering, edge mode. @@ -158,6 +160,7 @@ def mode(self): - MODE_REALTIME: Real-time playback mode. - MODE_DIAGNOS: Diagnostics mode. - MODE_AUTOCAL: Auto-calibration mode. + See the datasheet for the meaning of modes beyond MODE_INTTRIG. """ return self._read_u8(_DRV2605_REG_MODE) @@ -169,8 +172,10 @@ def mode(self, val): @property def library(self): - """Get and set the library selected for waveform playback. Should be + """ + The library selected for waveform playback. Should be a value of: + - LIBRARY_EMPTY: Empty - LIBRARY_TS2200A: TS2200 library A (the default) - LIBRARY_TS2200B: TS2200 library B @@ -178,6 +183,7 @@ def library(self): - LIBRARY_TS2200D: TS2200 library D - LIBRARY_TS2200E: TS2200 library E - LIBRARY_LRA: LRA library + See the datasheet for the meaning and description of effects in each library. """ diff --git a/docs/_static/favicon.ico b/docs/_static/favicon.ico new file mode 100644 index 0000000..5aca983 Binary files /dev/null and b/docs/_static/favicon.ico differ diff --git a/api.rst b/docs/api.rst similarity index 100% rename from api.rst rename to docs/api.rst diff --git a/conf.py b/docs/conf.py similarity index 90% rename from conf.py rename to docs/conf.py index a45d9aa..0656187 100644 --- a/conf.py +++ b/docs/conf.py @@ -2,7 +2,7 @@ import os import sys -sys.path.insert(0, os.path.abspath('.')) +sys.path.insert(0, os.path.abspath('..')) # -- General configuration ------------------------------------------------ @@ -28,7 +28,7 @@ source_suffix = '.rst' # The master toctree document. -master_doc = 'README' +master_doc = 'index' # General information about the project. project = u'Adafruit DRV2605 Library' @@ -54,7 +54,7 @@ # 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'] +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. @@ -71,6 +71,9 @@ # 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 + # -- Options for HTML output ---------------------------------------------- @@ -95,6 +98,12 @@ # 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 = 'AdafruitDrv2605Librarydoc' diff --git a/docs/examples.rst b/docs/examples.rst new file mode 100644 index 0000000..d27d8c3 --- /dev/null +++ b/docs/examples.rst @@ -0,0 +1,8 @@ +Simple test +------------ + +Ensure your device works with this simple test. + +.. literalinclude:: ../examples/drv2605_simpletest.py + :caption: examples/drv2605_simpletest.py + :linenos: diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..1e31ca5 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,47 @@ +.. include:: ../README.rst + +Table of Contents +================= + +.. toctree:: + :maxdepth: 4 + :hidden: + + self + +.. toctree:: + :caption: Examples + + examples + +.. toctree:: + :caption: API Reference + :maxdepth: 3 + + api + +.. toctree:: + :caption: Tutorials + +.. toctree:: + :caption: Related Products + + Adafruit DRV2605L Haptic Motor Controller + +.. 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/examples/simpletest.py b/examples/drv2605_simpletest.py similarity index 100% rename from examples/simpletest.py rename to examples/drv2605_simpletest.py