Skip to content

Add gpio_init_mask64 function#2907

Open
FLyrfors-MI wants to merge 3 commits intoraspberrypi:developfrom
FLyrfors-MI:gpio_init_mask64
Open

Add gpio_init_mask64 function#2907
FLyrfors-MI wants to merge 3 commits intoraspberrypi:developfrom
FLyrfors-MI:gpio_init_mask64

Conversation

@FLyrfors-MI
Copy link
Copy Markdown

Add gpio_init_mask64 function mirroring the other mask64/masked64 GPIO functions used by RP2350B with more than 32 GPIO's.

See #2643

Comment on lines +51 to 52
* The number of GPIO pins available depends on the package. There are 30 user GPIOs in bank 0 in the QFN-60 package (RP2350A), or 48 user GPIOs
* in the QFN-80 package. Bank 1 contains the 6 QSPI pins and the USB DP/DM pins.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* The number of GPIO pins available depends on the package. There are 30 user GPIOs in bank 0 in the QFN-60 package (RP2350A), or 48 user GPIOs
* in the QFN-80 package. Bank 1 contains the 6 QSPI pins and the USB DP/DM pins.
* The number of GPIO pins available depends on the package. There are 30 user GPIOs in bank 0 in the QFN-60 package (RP2350A), or 48 user GPIOs
* in the QFN-80 package (RP2350B). Bank 1 contains the 6 QSPI pins and the USB DP/DM pins.

void gpio_init_mask(uint gpio_mask) {
for(uint i=0;i<NUM_BANK0_GPIOS;i++) {
void gpio_init_mask(uint32_t gpio_mask) {
for(uint32_t i=0;i<NUM_BANK0_GPIOS;i++) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gpio_set_function_masked does

for (uint i = 0; i < MIN(NUM_BANK0_GPIOS, 32u); i++) {

Probably makes sense to do the same here?

}

void gpio_init_mask64(uint64_t gpio_mask) {
for(uint64_t i=0;i<NUM_BANK0_GPIOS;i++) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, gpio_set_function_masked64 does

for (uint i = 0; i < MIN(NUM_BANK0_GPIOS, 64u); i++) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants