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

leds: Add support for setup/active mode GPIO outputs #94

Merged
merged 6 commits into from
Dec 11, 2024

Conversation

SpComb
Copy link
Member

@SpComb SpComb commented Dec 4, 2024

If the leds GPIO pins are used to drive output-enable pins that leave the LED interface data line in a high-impedance state, then the data line will be sensitive to electrical interference while the interface is idle, which may lead to spurious glitches on the first few connected LEDs.

Add support for ACTIVE vs SETUP gpio mode, whereby the SETUP mode will leave the GPIO pin active once it has been setup (first leds update after boot), and the ACTIVE mode acts as before (de-asserts the GPIO pin when the interface is idle).

Also tweak the i2s_out pin setup/teardown to leave the data/clock pin outputs enabled (GPIO low state), rather than relying on the output pull-down. This should reduce any susceptibility to interference on the output driver inputs.

Add support for config enum aliases, used to map the old config LOW / HIGH values -> ACTIVE_LOW / ACTIVE_HIGH for backwards-compatibility.

TODO

  • SETUP mode doesn't behave as intended if multiple leds share the same output interface - only the gpio pins for the last active output will remain active? Perhaps fix this when refactoring the i2s interface to setup at boot?

@SpComb SpComb merged commit 68cf9d7 into master Dec 11, 2024
3 checks passed
@SpComb SpComb deleted the leds-i2s-out-gpio-setup branch December 11, 2024 19:46
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.

1 participant