esp32: Allow I2S pins to be None - #19716
Open
jonathanhogg wants to merge 1 commit into
Open
jonathanhogg wants to merge 1 commit into
jonathanhogg wants to merge 1 commit into
Conversation
This allows disabling specific signals of the I2S peripheral, which is useful if you are abusing it for other purposes. Also add the `mck` pin argument on esp32 since the peripheral support that signal.
jonathanhogg
force-pushed
the
esp32_i2s_pins
branch
from
September 18, 2026 09:32
9e4adbf to
9998806
Compare
|
Code size report: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This allows disabling specific signals of the I2S peripheral, which is useful if you are abusing it for other purposes. Also add the
mckpin argument on esp32 since the peripheral supports that signal.Note that the
MP_OBJ_NULLcheck is changed tomp_const_none. The NULL check was always unnecessary as the arguments were marked as required. The, now enabled,mckargument is not marked as required but hasNoneas its default anyway.Generally, you'd only want to set the pins to
Noneif you're misusing the I2S peripheral. In my case, I'm using it to generate a WS2812 bitstream. One can also do this with an SPI peripheral, which already supports disabling the unused signal and was the inspiration for this patch. The advantage of using the I2S peripheral is that it supports asynchronous usage and cleanly chains DMA buffers for uninterrupted output.Testing
I've tested this on a UM_TINY_S3 device.
Trade-offs and Alternatives
It's a pretty minor patch, all things considered.
Generative AI
I did not use generative AI tools when creating this PR.