Skip to content

Commit e7dc3c4

Browse files
committed
updated README
1 parent c7de215 commit e7dc3c4

File tree

1 file changed

+63
-6
lines changed

1 file changed

+63
-6
lines changed

README.rst

+63-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ Adafruit CircuitPython BusDevice
99
:target: https://adafru.it/discord
1010
:alt: Discord
1111
12-
The `I2CDevice` and `SPIDevice` helper classes make managing transaction state
12+
.. image:: https://travis-ci.org/adafruit/Adafruit_CircuitPython_BusDevice.svg?branch=master
13+
:target: https://travis-ci.org/adafruit/Adafruit_CircuitPython_BusDevice
14+
:alt: Build Status
15+
16+
The ``I2CDevice`` and ``SPIDevice`` helper classes make managing transaction state
1317
on a bus easy. For example, they manage locking the bus to prevent other
1418
concurrent access. For SPI devices, it manages the chip select and protocol
1519
changes such as mode. For I2C, it manages the device address.
@@ -28,9 +32,62 @@ To install:
2832
#. Download and unzip the `latest release zip <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice/releases>`_.
2933
#. Copy the unzipped ``adafruit_bus_device`` to the ``lib`` directory on the ``CIRCUITPY`` drive.
3034

31-
API
32-
---
33-
.. toctree::
34-
:maxdepth: 3
35+
Usage Example
36+
=============
37+
38+
See examples/read_register_i2c.py and examples/read_register_spi.py for examples of the module's usage.
39+
40+
Contributing
41+
============
42+
43+
Contributions are welcome! Please read our `Code of Conduct
44+
<https://github.com/adafruit/Adafruit_CircuitPython_BusDevice/blob/master/CODE_OF_CONDUCT.md>`_
45+
before contributing to help this project stay welcoming.
46+
47+
Building locally
48+
================
49+
50+
To build this library locally you'll need to install the
51+
`circuitpython-build-tools <https://github.com/adafruit/circuitpython-build-tools>`_ package.
52+
53+
.. code-block:: shell
54+
55+
python3 -m venv .env
56+
source .env/bin/activate
57+
pip install circuitpython-build-tools
58+
59+
Once installed, make sure you are in the virtual environment:
60+
61+
.. code-block:: shell
62+
63+
source .env/bin/activate
64+
65+
Then run the build:
66+
67+
.. code-block:: shell
68+
69+
circuitpython-build-bundles --filename_prefix adafruit-circuitpython-busdevice --library_location .
70+
71+
Sphinx documentation
72+
-----------------------
73+
74+
Sphinx is used to build the documentation based on rST files and comments in the code. First,
75+
install dependencies (feel free to reuse the virtual environment from above):
76+
77+
.. code-block:: shell
78+
79+
python3 -m venv .env
80+
source .env/bin/activate
81+
pip install Sphinx sphinx-rtd-theme
82+
83+
Now, once you have the virtual environment activated:
84+
85+
.. code-block:: shell
86+
87+
cd docs
88+
sphinx-build -E -W -b html . _build/html
89+
90+
This will output the documentation to ``docs/_build/html``. Open the index.html in your browser to
91+
view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
92+
locally verify it will pass.
3593

36-
adafruit_bus_device/index

0 commit comments

Comments
 (0)