diff options
author | Daniel Campora <daniel@wipy.io> | 2015-08-11 11:18:02 +0200 |
---|---|---|
committer | Daniel Campora <daniel@wipy.io> | 2015-08-16 20:17:52 +0200 |
commit | ea5061e409449118ed45ce2956800780631bcf9e (patch) | |
tree | 107417699e361857372ec07670ae68770cf75832 /docs | |
parent | 4c5bfe2d10cd8397e970c4c23f6c15b97133fcc0 (diff) | |
download | micropython-ea5061e409449118ed45ce2956800780631bcf9e.tar.gz micropython-ea5061e409449118ed45ce2956800780631bcf9e.zip |
cc3200: Improve callback API.
Rename "wakes" param to "wake_from" and make "value" an object
instead of an integer.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/library/network.rst | 4 | ||||
-rw-r--r-- | docs/library/pyb.Pin.rst | 8 | ||||
-rw-r--r-- | docs/library/pyb.RTC.rst | 4 | ||||
-rw-r--r-- | docs/wipy/quickref.rst | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/docs/library/network.rst b/docs/library/network.rst index 99a300dbec..1b00c4f0d0 100644 --- a/docs/library/network.rst +++ b/docs/library/network.rst @@ -336,12 +336,12 @@ class WLAN Returns a list of the devices currently connected. Each item in the list is a tuple of ``(ssid, mac)``. - .. method:: wlan.callback(wakes) + .. method:: wlan.callback(wake_from) Create a callback to be triggered when a WLAN event occurs during ``pyb.Sleep.SUSPENDED`` mode. Events are triggered by socket activity or by WLAN connection/disconnection. - - ``wakes`` can only be ``pyb.Sleep.SUSPENDED``. + - ``wake_from`` must be ``pyb.Sleep.SUSPENDED``. Returns a callback object. diff --git a/docs/library/pyb.Pin.rst b/docs/library/pyb.Pin.rst index 00a65126d9..90de1f6f81 100644 --- a/docs/library/pyb.Pin.rst +++ b/docs/library/pyb.Pin.rst @@ -284,15 +284,15 @@ Methods - ``priority`` level of the interrupt. Can take values in the range 1-7. Higher values represent higher priorities. - ``handler`` is an optional function to be called when new characters arrive. - - ``wakes`` selects the power mode in which this interrupt can wake up the + - ``wake_from`` selects the power mode in which this interrupt can wake up the board. Please note: - - If ``wakes=pyb.Sleep.ACTIVE`` any pin can wake the board. - - If ``wakes=pyb.Sleep.SUSPENDED`` pins ``GP2``, ``GP4``, ``GP10``, + - If ``wake_from=pyb.Sleep.ACTIVE`` any pin can wake the board. + - If ``wake_from=pyb.Sleep.SUSPENDED`` pins ``GP2``, ``GP4``, ``GP10``, ``GP11``, GP17`` or ``GP24`` can wake the board. Note that only 1 of this pins can be enabled as a wake source at the same time, so, only the last enabled pin as a ``pyb.Sleep.SUSPENDED`` wake source will have effect. - - If ``wakes=pyb.Sleep.SUSPENDED`` pins ``GP2``, ``GP4``, ``GP10``, + - If ``wake_from=pyb.Sleep.SUSPENDED`` pins ``GP2``, ``GP4``, ``GP10``, ``GP11``, ``GP17`` and ``GP24`` can wake the board. In this case all of the 6 pins can be enabled as a ``pyb.Sleep.HIBERNATE`` wake source at the same time. - Values can be ORed to make a pin generate interrupts in more than one power diff --git a/docs/library/pyb.RTC.rst b/docs/library/pyb.RTC.rst index 478731247a..4b5f4e6b40 100644 --- a/docs/library/pyb.RTC.rst +++ b/docs/library/pyb.RTC.rst @@ -90,12 +90,12 @@ Methods .. only:: port_wipy - .. method:: rtc.callback(\*, value, handler=None, wakes=pyb.Sleep.ACTIVE) + .. method:: rtc.callback(\*, value, handler=None, wake_from=pyb.Sleep.ACTIVE) Create a callback object triggered by a real time clock alarm. - ``value`` is the alarm timeout in milliseconds. This parameter is required. - ``handler`` is the function to be called when the callback is triggered. - - ``wakes`` specifies the power mode from where this interrupt can wake + - ``wake_from`` specifies the power mode from where this interrupt can wake up the system. diff --git a/docs/wipy/quickref.rst b/docs/wipy/quickref.rst index 3dc12a111e..2acbaa5413 100644 --- a/docs/wipy/quickref.rst +++ b/docs/wipy/quickref.rst @@ -160,7 +160,7 @@ See :ref:`pyb.RTC <pyb.RTC>` and ``pyb.Sleep``. :: rtc_obj.callback(value=30000, handler=some_handler) # create a RTC alarm that expires in 30s - rtc.callback(value=30000, handler=some_handler, wakes=Sleep.SUSPENDED) + rtc.callback(value=30000, handler=some_handler, wake_from=Sleep.SUSPENDED) # go into suspended mode waiting for the RTC alarm to expire and wake us up Sleep.suspend() @@ -195,7 +195,7 @@ See :ref:`network.WLAN <network.WLAN>` and ``pyb.Sleep``. :: pass print(wifi.ifconfig()) # enable wake on WLAN - wifi.callback(wakes=Sleep.SUSPENDED) + wifi.callback(wake_from=Sleep.SUSPENDED) # go to sleep Sleep.suspend() # now, connect to the FTP or the Telnet server and the WiPy will wake-up |