summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-05-03 12:15:29 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-05-03 12:15:29 +0300
commit06ec96b47b3777dbad0c76291b1bc128036cf3e5 (patch)
tree21ea4ba68f1a87354f4c76fccd986ccf1d1bf091
parentcfc94bec9ffdb774a6e33d10ad71ef7c69efc957 (diff)
downloadmicropython-06ec96b47b3777dbad0c76291b1bc128036cf3e5.tar.gz
micropython-06ec96b47b3777dbad0c76291b1bc128036cf3e5.zip
docs/machine: Generalize docs from just WiPy to other ports.
-rw-r--r--docs/library/machine.rst56
1 files changed, 32 insertions, 24 deletions
diff --git a/docs/library/machine.rst b/docs/library/machine.rst
index 05927e5b42..3af86db819 100644
--- a/docs/library/machine.rst
+++ b/docs/library/machine.rst
@@ -18,23 +18,25 @@ Reset related functions
Get the reset cause. See :ref:`constants <machine_constants>` for the possible return values.
-Interrupt related functions
----------------------------
+.. only:: port_wipy
-.. function:: disable_irq()
+ Interrupt related functions
+ ---------------------------
- Disable interrupt requests.
- Returns the previous IRQ state: ``False``/``True`` for disabled/enabled IRQs
- respectively. This return value can be passed to enable_irq to restore
- the IRQ to its original state.
+ .. function:: disable_irq()
-.. function:: enable_irq(state=True)
+ Disable interrupt requests.
+ Returns the previous IRQ state: ``False``/``True`` for disabled/enabled IRQs
+ respectively. This return value can be passed to enable_irq to restore
+ the IRQ to its original state.
- Enable interrupt requests.
- If ``state`` is ``True`` (the default value) then IRQs are enabled.
- If ``state`` is ``False`` then IRQs are disabled. The most common use of
- this function is to pass it the value returned by ``disable_irq`` to
- exit a critical section.
+ .. function:: enable_irq(state=True)
+
+ Enable interrupt requests.
+ If ``state`` is ``True`` (the default value) then IRQs are enabled.
+ If ``state`` is ``False`` then IRQs are disabled. The most common use of
+ this function is to pass it the value returned by ``disable_irq`` to
+ exit a critical section.
Power related functions
-----------------------
@@ -69,31 +71,37 @@ Power related functions
Stops the CPU and all peripherals including WLAN. Execution is resumed from main, just
as with a reset. The reset cause can be checked to know that we are coming from
- from ``machine.DEEPSLEEP``. Wake sources are ``Pin`` and ``RTC``. Current consumption
+ ``machine.DEEPSLEEP``. Wake sources are ``Pin`` and ``RTC``. Current consumption
is reduced to ~5uA.
-.. function:: wake_reason()
+.. only:: port_wipy
+
+ .. function:: wake_reason()
- Get the wake reason. See :ref:`constants <machine_constants>` for the possible return values.
+ Get the wake reason. See :ref:`constants <machine_constants>` for the possible return values.
Miscellaneous functions
-----------------------
-.. function:: main(filename)
+.. only:: port_wipy
+
+ .. function:: main(filename)
- Set the filename of the main script to run after boot.py is finished. If
- this function is not called then the default file main.py will be executed.
+ Set the filename of the main script to run after boot.py is finished. If
+ this function is not called then the default file main.py will be executed.
- It only makes sense to call this function from within boot.py.
+ It only makes sense to call this function from within boot.py.
-.. function:: rng()
+ .. function:: rng()
- Return a 24-bit software generated random number.
+ Return a 24-bit software generated random number.
.. function:: unique_id()
- Returns a string of 6 bytes (48 bits), which is the unique ID of the MCU.
- This also corresponds to the network ``MAC address``.
+ Returns a byte string with a unique idenifier of a board/SoC. It will vary
+ from a board/SoC instance to another, if underlying hardware allows. Length
+ varies by hardware (so use substring of a full value if you expect a short
+ ID). In some MicroPython ports, ID corresponds to the network MAC address.
.. _machine_constants: