Cleanup/clarification of PIO behavior with >32 pins #2085

Merged
kilograham merged 4 commits from pio_hipins into develop 2024-11-22 13:13:15 -06:00
kilograham commented 2024-11-21 21:32:54 -06:00 (Migrated from github.com)
No description provided.
peterharperuk (Migrated from github.com) reviewed 2024-11-22 05:12:34 -06:00
@ -72,0 +80,4 @@
*
* On RP2350B, there are 48 pins but each PIO instance can only address 32 pins (the PIO
* instance either addresses pins 0-31 or 16-47 based on \ref pio_set_gpio_base). The
* `pio_sm_` methods that directly affect the hardware always take _real_ pin numbers in the full range, however:
peterharperuk (Migrated from github.com) commented 2024-11-22 05:12:34 -06:00

Is it worth saying that sm_ methods also take real pin numbers?

Is it worth saying that sm_ methods also take _real_ pin numbers?
peterharperuk (Migrated from github.com) reviewed 2024-11-22 05:14:42 -06:00
@ -72,0 +80,4 @@
*
* On RP2350B, there are 48 pins but each PIO instance can only address 32 pins (the PIO
* instance either addresses pins 0-31 or 16-47 based on \ref pio_set_gpio_base). The
* `pio_sm_` methods that directly affect the hardware always take _real_ pin numbers in the full range, however:
peterharperuk (Migrated from github.com) commented 2024-11-22 05:14:42 -06:00

ah - you've said that below - ignore

ah - you've said that below - ignore
peterharperuk (Migrated from github.com) approved these changes 2024-11-22 06:38:50 -06:00
peterharperuk (Migrated from github.com) left a comment

Looks good to me, and fixes the uart_rx example!

Looks good to me, and fixes the uart_rx example!
peterharperuk (Migrated from github.com) requested changes 2024-11-22 07:00:32 -06:00
peterharperuk (Migrated from github.com) left a comment

ah - I think pio_sm_set_pindirs_with_mask64 is shifting twice. It shifts by pio_get_gpio_base then calls pio_sm_set_pindirs_with_mask_internal which shifts again. Removing the shift from pio_sm_set_pindirs_with_mask_internal fixes this. uart_tx can be used to test this.

ah - I think pio_sm_set_pindirs_with_mask64 is shifting twice. It shifts by pio_get_gpio_base then calls pio_sm_set_pindirs_with_mask_internal which shifts again. Removing the shift from pio_sm_set_pindirs_with_mask_internal fixes this. uart_tx can be used to test this.
peterharperuk (Migrated from github.com) reviewed 2024-11-22 08:17:23 -06:00
peterharperuk (Migrated from github.com) commented 2024-11-22 08:17:22 -06:00

These lines need to be removed?

These lines need to be removed?
peterharperuk (Migrated from github.com) approved these changes 2024-11-22 12:19:57 -06:00
peterharperuk (Migrated from github.com) left a comment

Seems to work nicely

Seems to work nicely
lurch (Migrated from github.com) reviewed 2024-11-24 19:00:53 -06:00
@ -265,4 +274,4 @@
}
pio->sm[sm].pinctrl = pinctrl_saved;
pio->sm[sm].execctrl = execctrl_saved;
}
lurch (Migrated from github.com) commented 2024-11-24 19:00:53 -06:00

I'm sure this must be a stupid question, but why is line 243 doing

#ifndef pio_sm_set_pins_internal

when line 221 says

void pio_sm_set_pins_internal(PIO pio, uint sm, uint32_t pins) {

?

I'm sure this must be a stupid question, but why is line 243 doing ``` #ifndef pio_sm_set_pins_internal ``` when line 221 says ``` void pio_sm_set_pins_internal(PIO pio, uint sm, uint32_t pins) { ``` ?
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk!2085
No description provided.