Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bcm283x: gpio: add bcm2711 specific alt funcs mapping #25

Merged
merged 1 commit into from
Jul 6, 2023

Conversation

knieriem
Copy link
Contributor

The BCM2711 provides more alternate pin functions than the BCM283x. An extra mapping table mapping2711 is added by this change, which gets assigned to the mapping variable conditionally during driverGPIO.Init().
The existing mapping is renamed to mapping283x, and used as default to keep tests working.

This change enables selecting alternate functions at runtime on a BCM2711 that were not supported by the existing BCM283x specific mapping, like GPIO4's UART3_TX; toggling between UART_TX and IN at runtime can be useful e.g. when sharing a single CAN transceiver between a CAN controller and a UART peripheral.

Resolves #24

The BCM2711 provides more alternate pin functions than
the BCM283x. An extra mapping table mapping2711 is
added by this change, which gets assigned to the `mapping`
variable conditionally during driverGPIO.Init().
The existing mapping is renamed to mapping283x, and used as
default to keep tests working.

This change enables selecting alternate functions at runtime
on a BCM2711 that were not supported by the existing BCM283x
specific mapping, like GPIO4's UART3_TX;
toggling between UART_TX and IN at runtime can be useful
e.g. when sharing a single CAN transceiver between
a CAN controller and a UART peripheral.

Resolves periph#24
@maruel
Copy link
Member

maruel commented Dec 19, 2022

gohci

@maruel
Copy link
Member

maruel commented Dec 19, 2022

Thanks Michael! Sadly my local lab died this weekend, so I can't test locally. This change looks good with the rename I commented on.

@xvzf
Copy link

xvzf commented Jul 5, 2023

@maruel is there a chance this gets merged anytime soon / more PRs are accepted?

@maruel
Copy link
Member

maruel commented Jul 6, 2023

Thanks for the ping. I went out for the holidays and then completely forgot about it.
The pin comments should be updated. This can be done in a follow up.

@maruel maruel merged commit f673315 into periph:main Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

bcm283x (or new pkg): support alternate functions of the bcm2711
3 participants