Commit Graph

5 Commits

Author SHA1 Message Date
Jeff Epler 09f6919c93
Add ability to read VOLTAGE_MONITOR on Pico W
Because this must be treated like an in-use pin for all other purposes,
unfortunately a special case must be added in shared-bindings.

Multiple AnalogIn objects for VOLTAGE_MONITOR can be created (because
in use tracking isn't working) but this causes no harm.

Testing performed: Read the monitor, then imported wifi. When the
pin state was insufficiently restored, the second step would fail
with debug messages about do_ioctl timeout.

```
import analogio, board
a = analogio.AnalogIn(board.VOLTAGE_MONITOR)
print(a.value)
import wifi
```

Closes: #7020
2022-11-08 09:37:15 -06:00
Jeff Epler 0c5fd55c16
picow: Turn off wifi co-processor regulator when entering deep sleep
This reduces power consumption during true deep sleep.

In my measurements with ppk2 and a program that _irrevocably_ entered
deep sleep (no time alarm or pin alarm), power usage as measured on a
ppk2 decreased from ~10mA to ~1mA.
2022-10-13 20:10:10 -05:00
Jeff Epler d3e85d165e
Set cyw43 power management as needed, default to disabled
.. the value actually needs to be enforced each time the STA or AP
is enabled, because internally there's a call to cyw43_wifi_pm with the
library's defaut power management value, not ours.

Add a getter, though it only returns our idea of what the power
management register is set to, it doesn't read out from the actual
hardware, sadly.
2022-10-01 08:20:34 -05:00
Jeff Epler 943b992bfc
Improve cyw43.set_power_management documentation
.. and provide 4 preset values
2022-10-01 07:52:08 -05:00
Jeff Epler 346fff2e7c
cyw43 basic gpio support, hwaddr in boot_out 2022-09-28 10:06:33 -05:00