Add low_power_set_pins_low_leakage function #3049
No reviewers
Labels
No labels
bazel
bluetooth
board settings
boot_stage2
bug
build
c++
can't reproduce
clang
clib-interface
cmsis
code cleanliness
code size
compiler version issues
cyw43_driver
debug
discussion
documentation
duplicate
dynamic_clock
elf2uf2
enhancement
errata
filesystem
flash layout
floating point
FreeRTOS
hardware_adc
hardware_claim
hardware_clocks
hardware_dma
hardware_exception
hardware_flash
hardware_gpio
hardware_i2c
hardware_irq
hardware_pio
hardware_pwm
hardware_rcp
hardware_rtc
hardware_spi
hardware_sync
hardware_uart
hardware_vreg
hardware_watchdog
hardware_xosc
help wanted
host
IAR
installation
invalid
linker scripts
lto
lwip
mbedtls
missing API
needs reporter detail
networking
newlib
newlib-multicore
non-c
non-cmake
non-gcc
openocd
orphan PR
OS integration
pico_async_context
pico_base
pico_binary_info
pico_flash
picolibc
pico_lwip
pico_malloc
pico_multicore
pico_printf
pico_runtime
pico_stdio
pico_stdio_usb
pico_sync
pico_time
pico_util
pioasm
port
question
review
review2
rtos interop
runtime init
static library
svd
test
tinyusb
vscode
wifi integration
wontfix
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-raspberrypi/pico-sdk!3049
Loading…
Reference in a new issue
No description provided.
Delete branch "low-power-pins"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This sets the pins to what I think is the lowest leakage state (pads_bank0 have pulls & input disabled, io_bank0 has output override set to disabled)
Naive question, but do the GPIO isolation latches on RP2350 help at all?
@ -224,6 +224,27 @@ int low_power_set_external_clock_source(uint src_hz, uint gpio_pin) {}I wonder whether that neede to be (1ull << i)
@ -224,6 +224,27 @@ int low_power_set_external_clock_source(uint src_hz, uint gpio_pin) {}Yes, it probably does
As far as I understand it, the isolation latches just isolate the pads logic from the switched core until they are configured - isolation is enabled anyway when the switched core is powered off (9.7. Pad isolation latches in the datasheet)
@ -226,1 +226,4 @@void low_power_set_pins_low_leakage_exclude_mask(uint32_t exclude_mask) {for (uint i=0; i < NUM_BANK0_GPIOS; i++) {if (exclude_mask & (1u << i)) continue;I guess you could also add
but it's probably not worth it?
@ -226,1 +226,4 @@void low_power_set_pins_low_leakage_exclude_mask(uint32_t exclude_mask) {for (uint i=0; i < NUM_BANK0_GPIOS; i++) {if (exclude_mask & (1u << i)) continue;I've removed
include_masknow anyway, so not worth adding it back in - generally I'd expect this function to be operating on lots of pins anyway, as opposed to the masked functions inhardware_gpiowhich I'd expect to be operating on a smaller set of pins@ -130,6 +130,32 @@ typedef enum {typedef void (*low_power_pstate_resume_func)(pstate_bitset_t *pstate);I guess the
GPIO_FUNC_SIOcomment here needs to be updated to reflect one of the later commits?@ -130,6 +130,32 @@ typedef enum {typedef void (*low_power_pstate_resume_func)(pstate_bitset_t *pstate);@ -130,6 +130,32 @@ typedef enum {typedef void (*low_power_pstate_resume_func)(pstate_bitset_t *pstate);(just to clarify which part of it is "64-bit"?)
@ -130,6 +130,32 @@ typedef enum {typedef void (*low_power_pstate_resume_func)(pstate_bitset_t *pstate);@ -127,6 +127,7 @@ int main() {init_powman_ext_ctrl();When reading isolated code like this (i.e. without referring to the doxygen), one might naively assume that it's the pins in
USED_PIN_MASKthat are being set to low-leakage? 🤔is maybe a bit too wordy though 😉
@ -127,6 +127,7 @@ int main() {init_powman_ext_ctrl();The function naming is up for debate, but I think that might be a bit too long - maybe
low_power_set_all_pins_low_leakageinstead?@ -127,6 +127,7 @@ int main() {init_powman_ext_ctrl();Yeah, that's probably better than
low_power_set_most_pins_low_leakage🤣@ -224,6 +224,27 @@ int low_power_set_external_clock_source(uint src_hz, uint gpio_pin) {}i think perhaps
low_power_set_pins_low_leakage_exclude_maskwhilst a mouthful is probably the most consistent with other naming@ -224,6 +224,27 @@ int low_power_set_external_clock_source(uint src_hz, uint gpio_pin) {}I will change it
@ -224,6 +224,27 @@ int low_power_set_external_clock_source(uint src_hz, uint gpio_pin) {}OTOH, it might sound like "low leakage exclude mask" is a thing, and that's what this function is setting? 😉 But I'll stop bike-shedding and just leave it as-is.