From 9471eccc9a88377be873543bc2e2b9082e8b6681 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sun, 4 Mar 2018 21:41:58 -0600 Subject: [PATCH 1/6] setup docs folder --- docs/_static/favicon.ico | Bin 0 -> 4414 bytes api.rst => docs/api.rst | 0 conf.py => docs/conf.py | 15 ++++++++++--- docs/examples.rst | 20 +++++++++++++++++ docs/index.rst | 45 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 docs/_static/favicon.ico rename api.rst => docs/api.rst (100%) rename conf.py => docs/conf.py (90%) create mode 100644 docs/examples.rst create mode 100644 docs/index.rst diff --git a/docs/_static/favicon.ico b/docs/_static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..5aca98376a1f7e593ebd9cf41a808512c2135635 GIT binary patch literal 4414 zcmd^BX;4#F6n=SG-XmlONeGrD5E6J{RVh+e928U#MG!$jWvO+UsvWh`x&VqGNx*en zx=qox7Dqv{kPwo%fZC$dDwVpRtz{HzTkSs8QhG0)%Y=-3@Kt!4ag|JcIo?$-F|?bXVS9UDUyev>MVZQ(H8K4#;BQW-t2CPorj8^KJrMX}QK zp+e<;4ldpXz~=)2GxNy811&)gt-}Q*yVQpsxr@VMoA##{)$1~=bZ1MmjeFw?uT(`8 z^g=09<=zW%r%buwN%iHtuKSg|+r7HkT0PYN*_u9k1;^Ss-Z!RBfJ?Un4w(awqp2b3 z%+myoFis_lTlCrGx2z$0BQdh+7?!JK#9K9@Z!VrG zNj6gK5r(b4?YDOLw|DPRoN7bdP{(>GEG41YcN~4r_SUHU2hgVtUwZG@s%edC;k7Sn zC)RvEnlq~raE2mY2ko64^m1KQL}3riixh?#J{o)IT+K-RdHae2eRX91-+g!y`8^># z-zI0ir>P%Xon)!@xp-BK2bDYUB9k613NRrY6%lVjbFcQc*pRqiK~8xtkNPLxt}e?&QsTB}^!39t_%Qb)~Ukn0O%iC;zt z<&A-y;3h++)>c1br`5VFM~5(83!HKx$L+my8sW_c#@x*|*vB1yU)_dt3vH;2hqPWx zAl^6@?ipx&U7pf`a*>Yq6C85nb+B=Fnn+(id$W#WB^uHAcZVG`qg;rWB}ubvi(Y>D z$ei>REw$#xp0SHAd^|1hq&9HJ=jKK8^zTH~nk)G?yUcmTh9vUM6Y0LMw4(gYVY$D$ zGl&WY&H<)BbJ&3sYbKjx1j^=3-0Q#f^}(aP1?8^`&FUWMp|rmtpK)bLQ1Zo?^s4jqK=Lfg*9&geMGVQ z#^-*!V`fG@;H&{M9S8%+;|h&Qrxym0Ar>WT4BCVLR8cGXF=JmEYN(sNT(9vl+S|%g z8r7nXQ(95i^`=+XHo|){$vf2$?=`F$^&wFlYXyXg$B{a>$-Fp+V}+D;9k=~Xl~?C4 zAB-;RKXdUzBJE{V&d&%R>aEfFe;vxqI$0@hwVM}gFeQR@j}a>DDxR+n+-*6|_)k%% z*mSpDV|=5I9!&VC&9tD%fcVygWZV!iIo2qFtm#!*(s|@ZT33*Ad;+<|3^+yrp*;oH zBSYLV(H1zTU?2WjrCQoQW)Z>J2a=dTriuvezBmu16`tM2fm7Q@d4^iqII-xFpwHGI zn9CL}QE*1vdj2PX{PIuqOe5dracsciH6OlAZATvE8rj6ykqdIjal2 z0S0S~PwHb-5?OQ-tU-^KTG@XNrEVSvo|HIP?H;7ZhYeZkhSqh-{reE!5di;1zk$#Y zCe7rOnlzFYJ6Z#Hm$GoidKB=2HBCwm`BbZVeZY4ukmG%1uz7p2URs6c9j-Gjj^oQV zsdDb3@k2e`C$1I5ML5U0Qs0C1GAp^?!*`=|Nm(vWz3j*j*8ucum2;r0^-6Aca=Gv) zc%}&;!+_*S2tlnnJnz0EKeRmw-Y!@9ob!XQBwiv}^u9MkaXHvM=!<3YX;+2#5Cj5pp?FEK750S3BgeSDtaE^ zXUM@xoV6yBFKfzvY20V&Lr0yC + CircuitPython Reference Documentation + CircuitPython Support Forum + Discord Chat + Adafruit Learning System + Adafruit Blog + Adafruit Store + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` From ce99288afa6141b2062c9c4f62df744127aed47c Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sun, 4 Mar 2018 21:49:57 -0600 Subject: [PATCH 2/6] updated .travis & .readthedocs yml --- readthedocs.yml => .readthedocs.yml | 0 .travis.yml | 5 +++-- 2 files changed, 3 insertions(+), 2 deletions(-) rename readthedocs.yml => .readthedocs.yml (100%) 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 4d7b20e..c5e95b6 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_avrprog.py - ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/*.py) - circuitpython-build-bundles --filename_prefix adafruit-circuitpython-avrprog --library_location . + - cd docs && sphinx-build -E -W -b html . _build/html \ No newline at end of file From a7ae977ffd44c18cd9347ad81f79b3264be26a4c Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sun, 4 Mar 2018 21:51:10 -0600 Subject: [PATCH 3/6] updated README --- README.rst | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index 9bd3bd1..963c5c5 100644 --- a/README.rst +++ b/README.rst @@ -10,6 +10,10 @@ Introduction :target: https://discord.gg/nBQh6qu :alt: Discord +.. image:: https://travis-ci.org/adafruit/Adafruit_CircuitPython_AVRprog.svg?branch=master + :target: https://travis-ci.org/adafruit/Adafruit_CircuitPython_AVRprog + :alt: Build Status + Program your favorite AVR chips directly from CircuitPython with this handy helper class that will let you make stand-alone programmers right from your REPL. Should work with any/all AVR chips, via SPI programming. Tested with ATmega328, ATtiny85 and ATmega2560 Dependencies @@ -27,14 +31,6 @@ Usage Example See examples folder for full examples that progam various bootloaders onto chips. -API Reference -============= - -.. toctree:: - :maxdepth: 2 - - api - Contributing ============ @@ -65,3 +61,26 @@ Then run the build: .. code-block:: shell circuitpython-build-bundles --filename_prefix adafruit-circuitpython-avrprog --library_location . + +Sphinx documentation +----------------------- + +Sphinx is used to build the documentation based on rST files and comments in the code. First, +install dependencies (feel free to reuse the virtual environment from above): + +.. code-block:: shell + + python3 -m venv .env + source .env/bin/activate + pip install Sphinx sphinx-rtd-theme + +Now, once you have the virtual environment activated: + +.. code-block:: shell + + cd docs + sphinx-build -E -W -b html . _build/html + +This will output the documentation to ``docs/_build/html``. Open the index.html in your browser to +view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to +locally verify it will pass. From 2cdee4a24373da79cd54cdbed701427b868053b9 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sun, 4 Mar 2018 21:57:19 -0600 Subject: [PATCH 4/6] updated info docstring --- adafruit_avrprog.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/adafruit_avrprog.py b/adafruit_avrprog.py index d471ce5..3416923 100644 --- a/adafruit_avrprog.py +++ b/adafruit_avrprog.py @@ -20,12 +20,28 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. """ -`adafruit_AVRprog` +`adafruit_avrprog` ==================================================== -TODO(description) +Program your favorite AVR chips directly from CircuitPython with this +handy helper class that will let you make stand-alone programmers right +from your REPL * Author(s): ladyada + +Implementation Notes +-------------------- + +**Hardware:** + +* See Learn Guide for supported hardware: `Stand-alone programming AVRs using CircuitPython + `_ + +**Software and Dependencies:** + +* Adafruit CircuitPython firmware for the ESP8622 and M0-based boards: + https://github.com/adafruit/circuitpython/releases + """ # imports @@ -39,11 +55,6 @@ _FAST_CLOCK = 1000000 class AVRprog: - """ - Program your favorite AVR chips directly from CircuitPython with this - handy helper class that will let you make stand-alone programmers right - from your REPL - """ _spi = None _rst = None From 598f180e5cbdd0048e81b45a6d2f1bf22826a504 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sun, 4 Mar 2018 22:00:38 -0600 Subject: [PATCH 5/6] sphinx fix --- adafruit_avrprog.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/adafruit_avrprog.py b/adafruit_avrprog.py index 3416923..8f3a953 100644 --- a/adafruit_avrprog.py +++ b/adafruit_avrprog.py @@ -55,15 +55,15 @@ _FAST_CLOCK = 1000000 class AVRprog: + """ + Initialize the programmer with an SPI port that will be used to + communicate with the chip. Make sure your SPI supports 'write_readinto' + Also pass in a reset pin that will be used to get into programming mode + """ _spi = None _rst = None def init(self, spi_bus, rst_pin): - """ - Initialize the programmer with an SPI port that will be used to - communicate with the chip. Make sure your SPI supports 'write_readinto' - Also pass in a reset pin that will be used to get into programming mode - """ self._spi = spi_bus self._rst = DigitalInOut(rst_pin) self._rst.direction = Direction.OUTPUT From 0a13d608ee4824ec382aa2021b05338c39c0ea95 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Mon, 5 Mar 2018 17:20:38 -0600 Subject: [PATCH 6/6] pylint fix; realigned docstrings to appropriate positions --- adafruit_avrprog.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/adafruit_avrprog.py b/adafruit_avrprog.py index 8f3a953..7d71679 100644 --- a/adafruit_avrprog.py +++ b/adafruit_avrprog.py @@ -56,14 +56,17 @@ class AVRprog: """ - Initialize the programmer with an SPI port that will be used to - communicate with the chip. Make sure your SPI supports 'write_readinto' - Also pass in a reset pin that will be used to get into programming mode + Helper class used to program AVR chips from CircuitPython. """ _spi = None _rst = None def init(self, spi_bus, rst_pin): + """ + Initialize the programmer with an SPI port that will be used to + communicate with the chip. Make sure your SPI supports 'write_readinto' + Also pass in a reset pin that will be used to get into programming mode + """ self._spi = spi_bus self._rst = DigitalInOut(rst_pin) self._rst.direction = Direction.OUTPUT