pio_claim_free_sm_and_add_program_for_gpio_range() function
Finds a PIO and statemachine and adds a program into PIO memory This variation of pio_claim_free_sm_and_add_program is useful on RP2350 QFN80 where the "GPIO Base" must be set per PIO instance to either address the 32 GPIOs (0->31) or the 32 GPIOS (16-47). No single PIO instance can interact with both pins 0->15 or 32->47 at the same time. This method takes additional information about the GPIO pins needed (via gpi_base and gpio_count), and optionally will set the GPIO base (\see pio_set_gpio_base) of an unused PIO instance if necessary
Arguments
program
PIO program to add
pio
Returns the PIO hardware instance or NULL if no PIO is available
sm
Returns the index of the PIO state machine that was claimed
offset
Returns the instruction memory offset of the start of the program
gpio_base
the lowest GPIO number required
gpio_count
the count of GPIOs required
set_gpio_base
if there is no free SM on a PIO instance with the right GPIO base, and there IS an unused PIO instance, then that PIO will be reconfigured so that this method can succeed
Return value
true on success, false otherwise \see pio_remove_program_unclaim_sm