Closed anecdata closed 2 years ago
WL_GPIO1 OP controls the on-board SMPS power save pin (Section 3.4) This is not exposed to user directly. I suspect it's used in the driver via cyw43.set_power_management()
As far as I understand it, that's incorrect.
{ MP_ROM_QSTR(MP_QSTR_SMPS_MODE), MP_ROM_PTR(&pin_CYW1) },
{ MP_ROM_QSTR(MP_QSTR_GP23), MP_ROM_PTR(&pin_CYW1) },
SMPS mode should be referring to CYW GPIO 1 already. I think this was a part of #6960.
It would be good to fix up the remaining items you mention. I would be happy to see someone else take it on, micropython should have good code to study.
As far as I understand it, that's incorrect.
You're absolutely right, sorry, I completely missed it this time around. It's right there in board and it's a settable digitalio
output.
...but I think the second line:
{ MP_ROM_QSTR(MP_QSTR_GP23), MP_ROM_PTR(&pin_CYW1) },
should be:
{ MP_ROM_QSTR(MP_QSTR_CYW1), MP_ROM_PTR(&pin_CYW1) },
like CYW0
, to free up GP23
for its other function
Gp23 is not for use of CP code. But old code that used this name to refer to the function will work if this name is provided. If it's better to remove this name that's fine by me.
I'm not sure, the docs say GPIO23 OP wireless power on signal
. If that lets me toggle the wifi chip power from user code cleanly, then awesome! But if it's a read-only or has some more complex behavior, then we probably want non-W Pico code to break if they try to use it on a W? It doesn't seem like it's the same function as SMPS_MODE
.
Non-W Pico code that references special pins by number, (e.g., GP23
, GP24
) may collide with different special functions on a W board. GP23
is SMPS_MODE
on a non-W, and GP24
is VBUS_SENSE
on a non-W, but it's all jumbled around for the W.
No, you'd just crash things if you could externally reset the wifi chip.
That's unfortunate. So we probably want to enforce using these special pins by name only on both boards, so code for one runs on the other? Use the named aliases for the pins, and they will (in future) map to the correct non-W pin number, or W pin number or CywPin number.
I've created a separate issue for the vsys measurement (board.VOLTAGE_MONITOR) aspect: https://github.com/adafruit/circuitpython/issues/7020
CircuitPython version
Code/REPL
Behavior
Pin names and functions from p.8: https://datasheets.raspberrypi.com/picow/pico-w-datasheet.pdf
GPIO23 OP wireless power on signal
Not inmicrocontroller
. Not sure if it's intended to be read-only, or if it could be used to hard-reset the wifi module from user code.GPIO24 IP wireless SPI data/IRQ
microcontroller.pin.GPIO24
board.GP24 board.VBUS_SENSE
This doesn't seem right.ValueError: VBUS_SENSE in use
. It isn'tVBUS_SENSE
. Also, user code probably shouldn't have access to this pin?GPIO25 OP wireless SPI CS- when high also enables GPIO29 ADC pin to read VSYS OP
Not inmicrocontroller
. Not sure how to use this to readVSYS
since we don't want to mess upwireless SPI
.GPIO29 OP/IP wireless SPI CLK/ADC mode (ADC3) to measure VSYS/3
microcontroller.pin.GPIO29
board.A3 board.VOLTAGE_MONITOR
Yes, but "ValueError: A3 in use" and we can't read it directly w/o prior use ofGPIO25
edit: (p.12)
Then, we also have these pins exposed (to the SDK) from the wifi processor:
WL_GPIO0 OP connected to user LED
Exposed to user and works great!WL_GPIO1 OP controls the on-board SMPS power save pin (Section 3.4)
This is not exposed to user directly. I suspect it's used in the driver viacyw43.set_power_management()
WL_GPIO2 IP VBUS sense - high if VBUS is present, else low
This seems to be ourVBUS_SENSE
, but it's not exposed to user code.Description
Additional information
WL_GPIO1
also potentially useful for ADC:I didn't spot this in
analogio
common-hal
, perhaps as a later enhancement, if needed.