diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/library/index.rst | 1 | ||||
-rw-r--r-- | docs/library/network.rst | 45 | ||||
-rw-r--r-- | docs/library/wipy.rst | 15 | ||||
-rw-r--r-- | docs/wipy/general.rst | 5 | ||||
-rw-r--r-- | docs/wipy/quickref.rst | 30 |
5 files changed, 81 insertions, 15 deletions
diff --git a/docs/library/index.rst b/docs/library/index.rst index b53a67ed1c..81a9824efd 100644 --- a/docs/library/index.rst +++ b/docs/library/index.rst @@ -105,6 +105,7 @@ it will fallback to loading the built-in ``ujson`` module. machine.rst network.rst + wipy.rst .. only:: port_esp8266 diff --git a/docs/library/network.rst b/docs/library/network.rst index cee65491c6..4485ff7e1b 100644 --- a/docs/library/network.rst +++ b/docs/library/network.rst @@ -27,6 +27,40 @@ For example:: data = s.recv(1000) s.close() +.. only:: port_wipy + + .. _network.server: + + class server + ============ + + Constructors + ------------ + + .. class:: server(id, ...) + + Create a server instance, see ``init`` for parameters of initialization. + + Methods + ------- + + .. method:: server.init(\*, login=('micro', 'python'), timeout=300) + + Init (and effectively start the server). Optionally a new ``user``, ``password`` + and ``timeout`` (in seconds) can be passed. + + .. method:: server.deinit() + + Stop the server + + .. method:: server.timeout([timeout_in_seconds]) + + Get or set the server timeout. + + .. method:: server.isrunning() + + Returns ``True`` is the server is running, ``False`` otherwise. + .. only:: port_pyboard class CC3K @@ -178,13 +212,13 @@ For example:: Dump the WIZnet5x00 registers. Useful for debugging. -class WLAN -========== - .. _network.WLAN: .. only:: port_esp8266 + class WLAN + ========== + This class provides a driver for WiFi network processor in the ESP8266. Example usage:: import network @@ -258,6 +292,9 @@ class WLAN .. only:: port_wipy + class WLAN + ========== + This class provides a driver for WiFi network processor in the WiPy. Example usage:: import network @@ -282,7 +319,7 @@ class WLAN Methods ------- - .. method:: init(mode, \*, ssid, security, key, channel, antenna) + .. method:: wlan.init(mode, \*, ssid, security, key, channel, antenna) Set or get the WiFi network processor configuration. diff --git a/docs/library/wipy.rst b/docs/library/wipy.rst new file mode 100644 index 0000000000..66aecd0530 --- /dev/null +++ b/docs/library/wipy.rst @@ -0,0 +1,15 @@ +:mod:`wipy` -- WiPy specific features +===================================== + +.. module:: wipy + :synopsis: WiPy specific features + +The ``wipy`` module contains functions to control specific features of the +WiPy, such as the heartbeat LED. + +Functions +--------- + +.. function:: heartbeat([enable]) + + Get or set the state (enabled or disabled) of the heartbeat LED. diff --git a/docs/wipy/general.rst b/docs/wipy/general.rst index b1f78da529..528dd4c196 100644 --- a/docs/wipy/general.rst +++ b/docs/wipy/general.rst @@ -119,9 +119,10 @@ The heart beat LED ------------------ By default the heart beat LED flashes once every 4s to signal that the system is -alive. This can be overridden through the HeartBeat class: +alive. This can be overridden through the :mod:`wipy` module:: -``machine.HeartBeat().disable()`` + import wipy + wipy.heartbeat(False) There are currently 2 kinds of errors that you might see: diff --git a/docs/wipy/quickref.rst b/docs/wipy/quickref.rst index c99671752d..4ecffffe38 100644 --- a/docs/wipy/quickref.rst +++ b/docs/wipy/quickref.rst @@ -10,7 +10,7 @@ Quick reference for the WiPy General board control (including sleep modes) --------------------------------------------- -See :mod:`machine`. :: +See the :mod:`machine` module:: import machine @@ -198,14 +198,26 @@ See :ref:`network.WLAN <network.WLAN>` and :mod:`machine`. :: machine.sleep() # now, connect to the FTP or the Telnet server and the WiPy will wake-up -Heart beat LED --------------- +Telnet and FTP server +--------------------- + +See :ref:`network.server <network.server>` :: + + from network import network + + # init with new user, pass word and seconds timeout + server = server.init(login=('user', 'password'), timeout=60) + server.timeout(300) # change the timeout + server.timeout() # get the timeout + server.isrunning() # check wether the server is running or not + +HeartBeat LED +------------- -See :ref:`machine.HeartBeat <machine.HeartBeat>`. :: +See :mod:`wipy`. :: - from machine import HeartBeat + import wipy - # disable the heart beat indication (you are free to use this LED connected to GP25) - HeartBeat().disable() - # enable the heart beat again - HeartBeat().enable() + wipy.heartbeat(False) # disable the heartbeat LED + wipy.heartbeat(True) # enable the heartbeat LED + wipy.heartbeat() # get the heartbeat state |