Should we add pio_sm_set_pins_with_mask64 and pio_sm_set_pindirs_with_mask64? #1834
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#1834
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
If you try calling pio_sm_set_pins_with_mask or pio_sm_set_pindirs_with_mask with a gpio >= 32 you'll get a build error. You have to know to use pio_get_gpio_base when constructing the mask. Just wondering if it would be more obvious to add a 64bit version of these functions? We'd have to assert it was valid for the gpiobase?
ha, yes, and indeed the existing (non-mask) functions are just plain broken it seems
You mean pio_sm_set_pins? I hadn't noticed that. Might have to write some test code
Hmm - I've just been hit with this one on a board I constructed. If any code needs to be tested I can run it here.
Which function are you trying to use?
I was trying to get this bit of code to output, ported from a RP2040 product ->
@StijnKuipers Just looked at your code again. The code looks correct on develop.
The following functions handle pins >= 32, do not adjust your pin numbers when calling them.
sm_config_set_out_pin_base
pio_sm_set_consecutive_pindirs
sm_config_set_sideset_pins
sm_config_set_out_pins
Doxygen at https://github.com/raspberrypi/pico-sdk/blob/develop/src/rp2_common/hardware_pio/include/hardware/pio.h#L263 says
\param out_base 0-31 First pin to set as outputso I guess that might need updating to avoid confusion?Also, would you get a compile-time error if you tried doing both
sm_config_set_out_pin_base(&c, 10)andsm_config_set_in_pin_base(&c, 40)?see also #2085
merged into develop