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

Add support for configuring all gpio pin modes #35

Conversation

antoinevg
Copy link
Member

Adds a new function to firmware gpio drivers to make it possible to enable setting of pin modes for a given GPIO:

/**
 * Configures the system's pinmux to route the given GPIO pin to a physical pin
 * and apply the given pin configuration.
 */
int gpio_configure_pinmux_and_pin(gpio_pin_t pin, gpio_pin_configuration_t pin_configuration);

I did consider removing the - IMO now redundant -- gpio_configure_pinmux_and_resistors() infrastructure but there may be someone out there making use of it?

@antoinevg antoinevg changed the title firmware: add support for configuring all gpio pin modes Add support for configuring all gpio pin modes Oct 18, 2023
@antoinevg antoinevg force-pushed the antoinevg/more-flexible-scu-gpio-configuration branch from e347346 to e03e2c9 Compare October 19, 2023 06:06
Copy link
Member

@martinling martinling left a comment

Choose a reason for hiding this comment

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

This looks good to me.

Regarding gpio_configure_pinmux_and_resistors: I agree it would be cleaner to remove this. It appears in the platform_gpio.h API, but that's only public in the very limited context of someone writing their own libgreat platform.

I only found one public project that does so: https://github.com/bm16ton/greatfet-lpc4370, and they did so by just forking the whole GreatFET project.

So I think it could probably be done safely, but I also don't see a need to do that in this PR.

So I think this is good to go.

@antoinevg antoinevg merged commit 26e1059 into greatscottgadgets:master Oct 19, 2023
@antoinevg antoinevg deleted the antoinevg/more-flexible-scu-gpio-configuration branch October 19, 2023 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants