Commit 88d3054a by Damien George

### docs: Import documentation from source-code inline comments.

```The inline docs (prefixed with /// in .c files) have been converted to
RST format and put in the docs subdirectory.```
parent 7c4445af
 ... ... @@ -60,7 +60,7 @@ copyright = '2014, Damien P. George' # The short X.Y version. version = '1.3' # The full version, including alpha/beta/rc tags. release = '1.3.1' release = '1.3.5' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. ... ...
 ... ... @@ -14,10 +14,11 @@ Software -------- .. toctree:: :maxdepth: 2 :maxdepth: 1 general.rst tutorial/index.rst library/index.rst .. .. - Reference for the [pyb module](module/pyb/ "pyb module"). ... ...
 :mod:`cmath` --- mathematical functions for complex numbers =========================================================== .. module:: cmath :synopsis: mathematical functions for complex numbers The ``cmath`` module provides some basic mathematical funtions for working with complex numbers. Functions --------- .. function:: cos(z) Return the cosine of ``z``. .. function:: exp(z) Return the exponential of ``z``. .. function:: log(z) Return the natural logarithm of ``z``. The branch cut is along the negative real axis. .. function:: log10(z) Return the base-10 logarithm of ``z``. The branch cut is along the negative real axis. .. function:: phase(z) Returns the phase of the number ``z``, in the range (-pi, +pi]. .. function:: polar(z) Returns, as a tuple, the polar form of ``z``. .. function:: rect(r, phi) Returns the complex number with modulus ``r`` and phase ``phi``. .. function:: sin(z) Return the sine of ``z``. .. function:: sqrt(z) Return the square-root of ``z``. Constants --------- .. data:: e base of the natural logarithm .. data:: pi the ratio of a circle's circumference to its diameter
 :mod:`gc` --- control the garbage collector =========================================== .. module:: gc :synopsis: control the garbage collector Functions --------- .. function:: collect() Run a garbage collection. .. function:: disable() Disable the garbage collector. .. function:: enable() Enable the garbage collector. .. function:: mem_alloc() Return the number of bytes of heap RAM that are allocated. .. function:: mem_free() Return the number of bytes of available heap RAM.
 Micro Python libraries ====================== Python standard libraries ------------------------- .. toctree:: :maxdepth: 1 cmath.rst gc.rst math.rst os.rst select.rst sys.rst time.rst Micro Python reduced libraries ------------------------------ .. toctree:: :maxdepth: 1 usocket.rst uheapq.rst ujson.rst Libraries specific to the pyboard --------------------------------- .. toctree:: :maxdepth: 2 pyb.rst network.rst
 :mod:`math` --- mathematical functions ====================================== .. module:: math :synopsis: mathematical functions The ``math`` module provides some basic mathematical funtions for working with floating-point numbers. Functions --------- .. function:: acos(x) .. function:: acosh(x) .. function:: asin(x) .. function:: asinh(x) .. function:: atan(x) .. function:: atan2(y, x) .. function:: atanh(x) .. function:: ceil(x) .. function:: copysign(x, y) .. function:: cos(x) .. function:: cosh(x) .. function:: degrees(x) .. function:: erf(x) Return the error function of ``x``. .. function:: erfc(x) Return the complementary error function of ``x``. .. function:: exp(x) .. function:: expm1(x) .. function:: fabs(x) .. function:: floor(x) .. function:: fmod(x, y) .. function:: frexp(x) Converts a floating-point number to fractional and integral components. .. function:: gamma(x) Return the gamma function of ``x``. .. function:: isfinite(x) .. function:: isinf(x) .. function:: isnan(x) .. function:: ldexp(x, exp) .. function:: lgamma(x) return the natural logarithm of the gamma function of ``x``. .. function:: log(x) .. function:: log10(x) .. function:: log2(x) .. function:: modf(x) .. function:: pow(x, y) Returns ``x`` to the power of ``y``. .. function:: radians(x) .. function:: sin(x) .. function:: sinh(x) .. function:: sqrt(x) Returns the square root of ``x``. .. function:: tan(x) .. function:: tanh(x) .. function:: trunc(x) Constants --------- .. data:: e base of the natural logarithm .. data:: pi the ratio of a circle's circumference to its diameter
 **************************************** :mod:`network` --- network configuration **************************************** .. module:: network :synopsis: network configuration This module provides network drivers and routing configuration. class CC3k ========== Constructors ------------ .. class:: CC3k(spi, pin_cs, pin_en, pin_irq) Initialise the CC3000 using the given SPI bus and pins and return a CC3k object. Methods ------- .. method:: cc3k.connect(ssid, key=None, \*, security=WPA2, bssid=None) class WIZnet5k ============== This class allows you to control WIZnet5x00 Ethernet adaptors based on the W5200 and W5500 chipsets (only W5200 tested). Example usage:: import wiznet5k w = wiznet5k.WIZnet5k() print(w.ipaddr()) w.gethostbyname('micropython.org') s = w.socket() s.connect(('192.168.0.2', 8080)) s.send('hello') print(s.recv(10)) Constructors ------------ .. class:: WIZnet5k(spi, pin_cs, pin_rst) Create and return a WIZnet5k object. Methods ------- .. method:: wiznet5k.ipaddr([(ip, subnet, gateway, dns)]) Get/set IP address, subnet mask, gateway and DNS. .. method:: wiznet5k.regs() Dump WIZnet5k registers.
 :mod:`os` --- basic "operating system" services =============================================== .. module:: os :synopsis: basic "operating system" services The ``os`` module contains functions for filesystem access and ``urandom``. The filesystem has ``/`` as the root directory, and the available physical drives are accessible from here. They are currently: /flash -- the internal flash filesystem /sd -- the SD card (if it exists) On boot up, the current directory is ``/flash`` if no SD card is inserted, otherwise it is ``/sd``. Functions --------- .. function:: chdir(path) Change current directory. .. function:: getcwd() Get the current directory. .. function:: listdir([dir]) With no argument, list the current directory. Otherwise list the given directory. .. function:: mkdir(path) Create a new directory. .. function:: remove(path) Remove a file. .. function:: rmdir(path) Remove a directory. .. function:: stat(path) Get the status of a file or directory. .. function:: sync() Sync all filesystems. .. function:: urandom(n) Return a bytes object with n random bytes, generated by the hardware random number generator. Constants --------- .. data:: sep separation character used in paths