From 2138802b59a98420eafd7ac1f549ae39d867de34 Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Fri, 3 Apr 2015 19:41:52 +0100 Subject: [PATCH] docs: Improve python docs This commit adds a bunch of includes from the C/C++ doxygen doc into the sphinx/python doc to make it more useful. It also splits out the doc of the classes using autoclass instead of autodoc to make it nicer to navigate. Signed-off-by: Brendan Le Foll --- docs/index.md | 2 +- src/python/docs/example.rst | 6 +++--- src/python/docs/index.rst | 32 ++++++++++++++++++++++++++-- src/python/docs/mraa.rst | 51 ++++++++++++++++++++++++++++++++++++++++++--- 4 files changed, 82 insertions(+), 9 deletions(-) diff --git a/docs/index.md b/docs/index.md index 0097e53..6d2306d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,4 +1,4 @@ -libmraa - Low Level Skeleton Library for Communication on Intel platforms +libmraa - Low Level Skeleton Library for Communication on GNU/Linux platforms ============== Libmraa is a C/C++ library with bindings to javascript & python to interface diff --git a/src/python/docs/example.rst b/src/python/docs/example.rst index 6063f3b..b974a28 100644 --- a/src/python/docs/example.rst +++ b/src/python/docs/example.rst @@ -44,9 +44,9 @@ The I2c module module has a number of different ways of interacting with the i2c bus, including a number of overloaded read() calls and the writeReg() helper function. -.. literalinclude:: ../../../examples/python/i2c_HMC5883.py - :prepend: x = mraa.I2c(0) - :start-after: x = mraa.I2c(0) +.. literalinclude:: ../../../examples/python/bmp85.py + :prepend: x = m.I2c(0) + :start-after: x = m.I2c(0) .. literalinclude:: ../../../docs/i2c.txt diff --git a/src/python/docs/index.rst b/src/python/docs/index.rst index b0443de..a5ad1fe 100644 --- a/src/python/docs/index.rst +++ b/src/python/docs/index.rst @@ -4,9 +4,11 @@ contain the root `toctree` directive. Welcome to mraa's documentation! -============================= +================================ -Contents: +.. include:: ../../../docs/index.md + :start-after: ============== + :end-before: ## API .. toctree:: :maxdepth: 2 @@ -14,6 +16,32 @@ Contents: mraa example +Supported Platforms +=================== + + * `Galileo Gen 1 - Rev D <../galileorevd.html>`_ + * `Galileo Gen 2 - Rev H <../galileorevh.html>`_ + * `Intel Edison <../edison.html>`_ + * `Intel(R) NUC DE3815tykhe <../de3815.html>`_ + * `Intel(R) Minnowboard Max <../minnowmax.html>`_ + * `Raspberry Pi <../rasspi.html>`_ + +Compiling & Debugging libmraa +============================= + +Libmraa is a C library and SWIG is used to generate bindings therefore to +debug, you very quickly need to use the same methods as you would for debugging +a C library. Generally attaching gdb to python works well, build mraa with +debug symbols and set breakpoints either in the SWIG _wrap functions, the C++ +method/functions or the underlying C function. More info can be found on the +C/C++ documentation: + * `Debugging <../debugging.html>`_ + * `Building from source <../building.html>`_ + +API Changelog +============= +.. include:: ../../../docs/index.md + :start-after: API Changelog Indices and tables ================== diff --git a/src/python/docs/mraa.rst b/src/python/docs/mraa.rst index 8e442e1..04e7c1e 100644 --- a/src/python/docs/mraa.rst +++ b/src/python/docs/mraa.rst @@ -1,7 +1,52 @@ -mraa module -============ +### +API +### -.. automodule:: mraa +Aio +=== +.. autoclass:: mraa.Aio + :members: + :undoc-members: + :show-inheritance: + +I2c +=== +.. autoclass:: mraa.I2c + :members: + :undoc-members: + :show-inheritance: + +Gpio +==== +.. autoclass:: mraa.Gpio + :members: + :undoc-members: + :show-inheritance: + +Pwm +=== +.. autoclass:: mraa.Pwm + :members: + :undoc-members: + :show-inheritance: + +Spi +=== +.. autoclass:: mraa.Spi + :members: + :undoc-members: + :show-inheritance: + +Uart +==== +.. autoclass:: mraa.Uart :members: :undoc-members: :show-inheritance: + +Common +====== + +.. automodule:: mraa + :members: + :exclude-members: Gpio, Aio, Uart, Spi, I2c, Pwm, uint8Array, uint8Array_frompointer -- 2.7.4