circuitpython/ports
Damien George b004e7e397 rp2/modmachine: Implement lightsleep() with optional sleep period.
This gets basic machine.lightsleep([n]) behaviour working on the rp2 port.
It supports:

- Calling lightsleep without a specified period, in which case it uses xosc
  dormant mode.  There's currently no way to wake it up from this state,
  unless you write to raw registers to enable a GPIO wake up source.

- Calling lightsleep with a period n in milliseconds.  This period must be
  less than about 72 minutes and uses timer alarm3 to wake it up.

The RTC continues to run during lightsleep, but other peripherals have
their clock turned off during the sleep.

It doesn't yet support longer periods than 72 minutes, or waking up from
GPIO IRQ.

Measured current consumption from the USB port on a PICO board is about
1.5mA when doing machine.lightsleep(5000), and about 0.9mA when doing
machine.lightsleep().

Addresses issue #8770.

Signed-off-by: Damien George <damien@micropython.org>
2022-06-30 11:40:17 +10:00
..
bare-arm bare-arm/mpconfigport.h: Disable remaining optional features. 2021-11-01 14:23:06 +11:00
cc3200 extmod/extmod.mk: Separate out extmod file list from py.mk to extmod.mk. 2022-06-21 00:14:34 +10:00
esp32 esp32/network_wlan: Don't raise exception when scan returns no results. 2022-06-28 13:18:07 +10:00
esp8266 esp8266/mpconfigport: Disable MICROPY_PY_UTIMEQ. 2022-06-23 13:07:54 +10:00
javascript extmod/extmod.mk: Separate out extmod file list from py.mk to extmod.mk. 2022-06-21 00:14:34 +10:00
mimxrt mimxrt/boards: Remove conditional assignment of flash type/size. 2022-06-24 17:58:27 +10:00
minimal ports: Use default VFS config for import_stat and builtin_open. 2022-05-25 13:04:45 +10:00
nrf nrf: Enable optional support for Arduino 1200bps touch. 2022-06-23 14:33:40 +10:00
pic16bit extmod/extmod.mk: Separate out extmod file list from py.mk to extmod.mk. 2022-06-21 00:14:34 +10:00
powerpc extmod/extmod.mk: Separate out extmod file list from py.mk to extmod.mk. 2022-06-21 00:14:34 +10:00
qemu-arm extmod/extmod.mk: Separate out extmod file list from py.mk to extmod.mk. 2022-06-21 00:14:34 +10:00
renesas-ra extmod/extmod.mk: Separate out extmod file list from py.mk to extmod.mk. 2022-06-21 00:14:34 +10:00
rp2 rp2/modmachine: Implement lightsleep() with optional sleep period. 2022-06-30 11:40:17 +10:00
samd extmod/extmod.mk: Separate out extmod file list from py.mk to extmod.mk. 2022-06-21 00:14:34 +10:00
stm32 stm32/boards: Enable LTO by default on boards with smaller flash size. 2022-06-28 10:32:39 +10:00
teensy extmod/extmod.mk: Separate out extmod file list from py.mk to extmod.mk. 2022-06-21 00:14:34 +10:00
unix unix/variants/dev: Allow all config options to be overridden. 2022-06-29 12:48:33 +10:00
windows extmod/extmod.mk: Separate out extmod file list from py.mk to extmod.mk. 2022-06-21 00:14:34 +10:00
zephyr zephyr: Upgrade to Zephyr v3.1.0. 2022-06-17 16:51:34 +10:00