Add some missing pio functions #2074
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!2074
Loading…
Reference in a new issue
No description provided.
Delete branch "pio64_funcs"
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?
Adds some 64 versions to work with rp2350b and more than 32 pins. Change cyw43 code to use the new function.
Fixes #1834
@ -1727,0 +1755,4 @@* before restoring the state machine's pin configuration to what it was.** This method is provided as a convenience to set initial pin states, and should not be used against a state machine that is enabled.* Note: This method only works for pins < 32. To use with pins >= 32 call pio_sm_set_pins_with_mask64...
or \ref pio2on an RP2350? 😉@ -1741,0 +1788,4 @@* This method is provided as a convenience to set initial pin directions, and should not be used against a state machine that is enabled.* Note: This method only works for pins < 32. To use with pins >= 32 call pio_sm_set_pindirs_with_mask64** \param pio The PIO instance; e.g. \ref pio0 or \ref pio1I suspect you meant to add this "Note:" to the doxygen for
pio_sm_set_pindirs_with_mask, not to the doxygen forpio_sm_set_pindirs_with_mask64?@ -708,6 +708,15 @@ static inline uint pio_get_gpio_base(PIO pio) {#endifIn
pio.cthe use ofpio_get_gpio_baseis always guarded by#if PICO_PIO_USE_GPIO_BASE- does something similar need to be done here too?@ -253,0 +271,4 @@pio_sm_set_pindirs_with_mask64(pio, sm, pindirs, pin_mask);}void pio_sm_set_pindirs_with_mask64(PIO pio, uint sm, uint64_t pindirs, uint64_t pin_mask) {Should it also do
check_pio_pin_mask64(pio, pinvals);?Should it also do
check_pio_pin_mask64(pio, pindirs);?@ -708,6 +708,15 @@ static inline uint pio_get_gpio_base(PIO pio) {#endifAlso, with all the nested brackets and both an
||and and&&being used here, it's very hard to tell what it's doing!I may be totally wrong (bit-manipulation isn't my strong point), but would something like this do the trick?
I created the above by starting with
and then "inlining" the various parts.
@ -1727,0 +1755,4 @@* before restoring the state machine's pin configuration to what it was.** This method is provided as a convenience to set initial pin states, and should not be used against a state machine that is enabled.* Note: This method only works for pins < 32. To use with pins >= 32 call pio_sm_set_pins_with_mask64The whole file is missing this. Can we please address in a separate PR if it's important?
@ -253,0 +271,4 @@pio_sm_set_pindirs_with_mask64(pio, sm, pindirs, pin_mask);}void pio_sm_set_pindirs_with_mask64(PIO pio, uint sm, uint64_t pindirs, uint64_t pin_mask) {no
no
@ -708,6 +708,15 @@ static inline uint pio_get_gpio_base(PIO pio) {#endifyes that does look simpler
@ -1727,0 +1755,4 @@* before restoring the state machine's pin configuration to what it was.** This method is provided as a convenience to set initial pin states, and should not be used against a state machine that is enabled.* Note: This method only works for pins < 32. To use with pins >= 32 call pio_sm_set_pins_with_mask64Sorry, I hadn't noticed that.
@ -1741,0 +1788,4 @@* This method is provided as a convenience to set initial pin directions, and should not be used against a state machine that is enabled.* Note: This method only works for pins < 32. To use with pins >= 32 call pio_sm_set_pindirs_with_mask64** \param pio The PIO instance; e.g. \ref pio0 or \ref pio1fixed
@ -708,6 +708,15 @@ static inline uint pio_get_gpio_base(PIO pio) {#endifI don't want variables in here because valid_params_if compiles to nothing by default. But I think I've more or less fixed as suggested.
merging this prior to some more PIO api cleanup I'm doing for > 32 pins, so it is possible it may change slightly
@kilograham When I do a full-build with
arm-none-eabi-gccit's complaining that:And indeed https://github.com/raspberrypi/pico-sdk/blob/develop/src/rp2_common/pico_platform_compiler/include/pico/platform/compiler.h#L63 says:
yeah, thanks, i will fix this