Repository navigation
feat(i2s): I2S0 second clockless bank — 32 parallel lanes on classic ESP32 (#3576 Phase 1) - #3577
Merged
Merged
Conversation
…ESP32 (#3576 Phase 1) Classic ESP32 has two identical I2S blocks; only I2S1 carried the modern wave8 clockless engine. This adds a second 16-lane bank on I2S0 ("I2S0", Bus::FLEX_IO instance 1) for 32 parallel clockless lanes. - createI2sEsp32DevEngine(port): per-port peripheral singletons (Singleton<T, N> tag = port); engine carries mI2sPort and passes it through init/routing; getName() is port-distinct ("I2S"/"I2S0") so affinity binding and AutoResearch's exclusive-driver selector can target each bank. - 16-lane capacity in canHandle(): the primary bank refuses the 17th distinct clockless channel of a frame, overflowing it to the second bank (priority one below), then RMT. SPI batches are uncapped (they delegate). - Cross-driver I2S port-claim registry (i2s_port_claim.{h,cpp.hpp}): I2S0 is contended between this bank and the clocked-SPI driver (I2sSpiPeripheralEsp). Both peripherals claim in initialize() and release in deinitialize()/failure paths; first mode wins, the loser fails cleanly and its channels fall through the priority list. - Registration: BusTraits<Bus::FLEX_IO, 1> on esp32dev; BusInstanceCount<FLEX_IO/SPI/UART> specializations for FL_IS_ESP_32DEV; enableAllDrivers() enrolls instance 1; default_bus_priority() is now instance-aware (secondary FLEX_IO = primary - 1, matching P4 LCD_RGB) and its `which` parameter is EXPLICIT (no default) so silent default-priority call sites can't creep in — all call sites updated. - I2S0 silicon quirk (bench-derived): in the same 32-bit mono LCD config, I2S0 presents the emitted half-word on DATA_OUT8..23 — one byte higher than I2S1's DATA_OUT0..15. routeLanePin applies the +8 signal offset on port 0. - fl/channels/README.md: engine table + 32-lane operation section. Bench (WROOM COM11, GPIO33→34): I2S0 second bank passed: true 4/4 patterns byte-exact (first wire-verified I2S0 clockless frame); regression I2S/RMT/UART/SPI 4/4 each. Host: 345/345, lint clean. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Caution Review failedAn error occurred during the review process. Please try again later. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Phase 1 of the #3576 program. Classic ESP32's second I2S block (I2S0) now hosts a second 16-lane wave8 clockless bank — 32 parallel clockless lanes total.
Design
createI2sEsp32DevEngine(port)with per-port peripheral singletons; the second bank registers asBus::FLEX_IOinstance 1 with the distinct name "I2S0" (targetable via affinity / AutoResearch's exclusive-driver selector).canHandle()enforces a 16-lane clockless capacity, so the 17th+ channel of a frame overflows to the second bank (registered one priority below), then RMT. SPI batches are uncapped (delegated).i2s_port_claim.{h,cpp.hpp}) — both peripherals claim atinitialize()and release atdeinitialize()/failure; first mode wins, the loser fails cleanly.DATA_OUT8..23(I2S1 usesDATA_OUT0..15). Register dumps viapeekMemshowed a perfect config + completed DMA with a silent pin; the +8 signal-offset inrouteLanePinfixed it.default_bus_priority(bus, which)now takeswhichexplicitly (no default) and is instance-aware — secondary FLEX_IO instances sit one below the primary (matches P4 LCD_RGB's slot). All call sites updated.fl/channels/README.mdupdated (engine table + 32-lane operation section).Verification
passed: true, 4/4 patterns byte-exact — first wire-verified I2S0 clockless frame. Regression: I2S (bank 1), RMT, UART, SPI all 4/4.Refs #3576.
🤖 Generated with Claude Code