machine
— functions related to the board¶
The machine
module contains specific functions related to the board.
Miscellaneous functions¶
-
machine.
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.
It only makes sense to call this function from within boot.py.
-
machine.
rng
()¶ Return a 24-bit software generated random number.
-
machine.
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
.
Constants¶
-
machine.
IDLE
¶
-
machine.
SLEEP
¶
-
machine.
DEEPSLEEP
¶ irq wake values
-
machine.
POWER_ON
¶
-
machine.
HARD_RESET
¶
-
machine.
WDT_RESET
¶
-
machine.
DEEPSLEEP_RESET
¶
-
machine.
SOFT_RESET
¶ reset causes
-
machine.
WLAN_WAKE
¶
-
machine.
PIN_WAKE
¶
-
machine.
RTC_WAKE
¶ wake reasons
Classes¶
- class ADC – analog to digital conversion
- class ADCChannel — read analog values from internal or external sources
- class I2C – a two-wire serial protocol
- class Pin – control I/O pins
- class RTC – real time clock
- class SD – secure digital memory card
- class SPI – a master-driven serial protocol
- class Timer – control internal timers
- class TimerChannel — setup a channel for a timer
- class UART – duplex serial communication bus
- class WDT – watchdog timer