You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/advance/downgrade.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,6 @@ aliases:
4
4
- advance/downgrade.html
5
5
- advance/downgrade.md
6
6
- chapter/advance/downgrade
7
-
8
7
---
9
8
10
9
The firmware upgrade tool usually updates your device to the latest available firmware version. If you require to downgrade your device to a previous firmware there are two methods to achieve this.
@@ -37,12 +35,10 @@ It is important to note that there are certain class methods that can only accep
37
35
An asterisk `*` in a method description \(in the docs\), denotes that the following arguments require a keyword, i.e. `pin='P16'` in the example below.
38
36
39
37
```python
40
-
41
38
adc.channel(* , pin, attn=ADC.ATTN_0DB)
42
39
```
43
40
44
41
```python
45
-
46
42
from machine importADC
47
43
48
44
adc = ADC() # create an ADC object
@@ -54,7 +50,6 @@ apin = adc.channel(pin='P16') # create an analog pin on P16
54
50
Another example shows how the `PWM` class, `pwm.channel()` requires a keyword argument for `pin` but does not for `id`.
55
51
56
52
```python
57
-
58
53
from machine importPWM
59
54
60
55
pwm = PWM(0, frequency=5000)
@@ -66,14 +61,12 @@ pwm_c = pwm.channel(0, pin='P12') # no keyword argument required for id (0) but
66
61
The documentation may refer to a method that takes an argument listed by name but does allow for a keyword to be passed. For example, the `pycom` class contains a method `rgbled`. This lists that the method accepts a value for `color`, however this may not be specified by `keyword`, only `value`. This is intentional as the `value` being passed is the only argument valid for this method
67
62
68
63
```python
69
-
70
64
pycom.rgbled(color)
71
65
```
72
66
73
67
If the argument is passed into the method with a keyword, it will return an error stating TypeError: function does not take keyword arguments.
Another example of a method that only accepts value input. In this case, the `RTC.init()` method require a value (`tuple`) input for the `datetime`. It will not accept a keyword.
The `constants` section of a library within the docs refers to specific values from that library's class. These might be used when constructing an object from that class or when utilising a method from within that class. These are generally listed by the library name followed by the specific value. See the example below:
Copy file name to clipboardExpand all lines: content/firmwareapi/pycom/machine/_index.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,17 @@ Returns CPU frequency in hertz.
46
46
47
47
Gates the clock to the CPU, useful to reduce power consumption at any time during short or long periods. Peripherals continue working and execution resumes as soon as any interrupt is triggered (on many ports this includes system timer interrupt occurring at regular intervals on the order of millisecond).
Sets the device in to light sleep mode , where in this mode digital peripherals, most of the RAM, and CPUs are clock-gated, and supply voltage is reduced. Upon exit from light sleep, peripherals and CPUs resume operation, their internal state is preserved.
52
+
53
+
*`time_ms` is the time in milliseconds that the device should wakeup after, if no time is given the device will sleep until the next reset cycle unless another wakeup source is configured.
54
+
*`resume_wifi_ble` is a boolean value that enables or disable restoring after wakeup any WiFi or BLE connection that was interrupted by light sleep.
55
+
*`True` Enable WiFi/BLE connections restoration
56
+
*`False` Disable Wifi/BLE connections restoration, default option is Disabled
57
+
58
+
_Note: in light sleep mode LoRa/Lte modems are stopped and have to be re-initialized after wakeup._
59
+
49
60
#### machine.deepsleep(\[time\_ms\])
50
61
51
62
Stops the CPU and all peripherals, including the networking interfaces (except for LTE). Execution is resumed from the main script, just as with a reset. If a value in milliseconds is given then the device will wake up after that period of time, otherwise it will remain in deep sleep until the reset button is pressed.
@@ -54,7 +65,7 @@ Products with LTE connectivity, such as the FiPy, GPy, G01, need to have the LTE
Initialise the UART bus with the given parameters:
89
89
@@ -93,6 +93,7 @@ Initialise the UART bus with the given parameters:
93
93
*`stop` is the number of stop bits, `1 or 2`.
94
94
*`timeout_chars` Rx timeout defined in number of characters. The value given here will be multiplied by the time a characters takes to be transmitted at the configured `baudrate`.
95
95
*`pins` is a 4 or 2 item list indicating the TXD, RXD, RTS and CTS pins (in that order). Any of the pins can be `None` if one wants the UART to operate with limited functionality. If the RTS pin is given the the RX pin must be given as well. The same applies to CTS. When no pins are given, then the default set of TXD (P1) and RXD (P0) pins is taken, and hardware flow control will be disabled. If `pins=None`, no pin assignment will be made.
96
+
*`rx_buffer_size` is the size of the buffer used for storing the RX packets. By default is is 512 bytes.
0 commit comments