@@ -18,23 +18,25 @@ Reset related functions
18
18
19
19
Get the reset cause. See :ref: `constants <machine_constants >` for the possible return values.
20
20
21
- Interrupt related functions
22
- ---------------------------
21
+ .. only :: port_wipy
23
22
24
- .. function :: disable_irq()
23
+ Interrupt related functions
24
+ ---------------------------
25
25
26
- Disable interrupt requests.
27
- Returns the previous IRQ state: ``False ``/``True `` for disabled/enabled IRQs
28
- respectively. This return value can be passed to enable_irq to restore
29
- the IRQ to its original state.
26
+ .. function :: disable_irq()
30
27
31
- .. function :: enable_irq(state=True)
28
+ Disable interrupt requests.
29
+ Returns the previous IRQ state: ``False ``/``True `` for disabled/enabled IRQs
30
+ respectively. This return value can be passed to enable_irq to restore
31
+ the IRQ to its original state.
32
32
33
- Enable interrupt requests.
34
- If ``state `` is ``True `` (the default value) then IRQs are enabled.
35
- If ``state `` is ``False `` then IRQs are disabled. The most common use of
36
- this function is to pass it the value returned by ``disable_irq `` to
37
- exit a critical section.
33
+ .. function :: enable_irq(state=True)
34
+
35
+ Enable interrupt requests.
36
+ If ``state `` is ``True `` (the default value) then IRQs are enabled.
37
+ If ``state `` is ``False `` then IRQs are disabled. The most common use of
38
+ this function is to pass it the value returned by ``disable_irq `` to
39
+ exit a critical section.
38
40
39
41
Power related functions
40
42
-----------------------
@@ -69,31 +71,37 @@ Power related functions
69
71
70
72
Stops the CPU and all peripherals including WLAN. Execution is resumed from main, just
71
73
as with a reset. The reset cause can be checked to know that we are coming from
72
- from ``machine.DEEPSLEEP ``. Wake sources are ``Pin `` and ``RTC ``. Current consumption
74
+ ``machine.DEEPSLEEP ``. Wake sources are ``Pin `` and ``RTC ``. Current consumption
73
75
is reduced to ~5uA.
74
76
75
- .. function :: wake_reason()
77
+ .. only :: port_wipy
78
+
79
+ .. function :: wake_reason()
76
80
77
- Get the wake reason. See :ref: `constants <machine_constants >` for the possible return values.
81
+ Get the wake reason. See :ref: `constants <machine_constants >` for the possible return values.
78
82
79
83
Miscellaneous functions
80
84
-----------------------
81
85
82
- .. function :: main(filename)
86
+ .. only :: port_wipy
87
+
88
+ .. function :: main(filename)
83
89
84
- Set the filename of the main script to run after boot.py is finished. If
85
- this function is not called then the default file main.py will be executed.
90
+ Set the filename of the main script to run after boot.py is finished. If
91
+ this function is not called then the default file main.py will be executed.
86
92
87
- It only makes sense to call this function from within boot.py.
93
+ It only makes sense to call this function from within boot.py.
88
94
89
- .. function :: rng()
95
+ .. function :: rng()
90
96
91
- Return a 24-bit software generated random number.
97
+ Return a 24-bit software generated random number.
92
98
93
99
.. function :: unique_id()
94
100
95
- Returns a string of 6 bytes (48 bits), which is the unique ID of the MCU.
96
- This also corresponds to the network ``MAC address ``.
101
+ Returns a byte string with a unique idenifier of a board/SoC. It will vary
102
+ from a board/SoC instance to another, if underlying hardware allows. Length
103
+ varies by hardware (so use substring of a full value if you expect a short
104
+ ID). In some MicroPython ports, ID corresponds to the network MAC address.
97
105
98
106
.. _machine_constants :
99
107
0 commit comments