Repository navigation
feat(esp8266): fl::RxChannel via the I2S RX hardware receiver (#4945) - #4958
Merged
Merged
Conversation
ESP8266 had no RxChannel backend -- every backend was ESP32-only and the
AutoResearch benches hand-rolled a GPIO poll instead. Add the one hardware
receiver the ESP8266 actually has: the I2S peripheral's RX path.
- rx_device_i2s_rx.{h,cpp.hpp} (new): Esp8266I2sRxDevice implements the full
RxDevice interface over the core's verified core_esp8266_i2s.h
(i2s_rxtxdrive_begin RX-only, i2s_set_rate(kI2sSlotHz), i2s_read_sample).
It captures 16-bit samples at the WS2812 slot rate (the same rate the #4943
I2S engine emits), reconstructs the slot-level bit stream, converts runs to
EdgeTime, and decodes via the shared decodeWs2812Edges path -- so the I2S
output engine can be validated by looping its output back into I2S RX.
samplesToEdges is pure math (host-testable).
- rx.cpp.hpp: an ESP8266 branch in the RxDevice factory. RxBackend::I2S_RX and
PLATFORM_DEFAULT map to the I2S RX device; ISR returns a DummyRxDevice with
an explanatory message (a per-edge GPIO ISR is not feasible: ~1 us latency
vs a ~350 ns T0H -- which is exactly why the bench used a synchronous poll).
- _build.cpp.hpp: the device TU joins the ESP8266 unity build.
Verified: bash compile esp8266 --examples Blink,Esp8266Uart both succeed; the
images are unchanged from master (264,671 / 264,199 B) -- the RX device
dead-strips when unused. On-device I2S loopback capture is the remaining
acceptance step (needs a board); the sample->edge reconstruction is host-
testable.
Refs #4945, #4949.
|
Caution Review failedThe pull request is closed. Finishing Touches
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 |
Contributor
Memory usage (this PR vs. its merge base)Change in
|
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.
Fixes #4945. Part of #4949.
Problem
ESP8266 had no
fl::RxChannelbackend — every backend (gpio_isr_rx,i2s_rx,parlio_rx,rmt_rx) lives underesp/32/drivers/, and the AutoResearch benches hand-rolled a GPIO poll instead.Design note (why I2S RX, not GPIO ISR)
The hand-rolled capture (
AutoResearchEsp8266.h::captureEdges) is a synchronous IRAMrsr ccountpoll that also feeds the UART1 TX FIFO — it's welded to the TX it measures and can't be a generic async device. A real per-edge GPIO ISR is also not feasible: ~1 µs interrupt latency ≫ the ~350 ns WS2812 T0H. So the one usable hardware receiver is the I2S RX path.Change
rx_device_i2s_rx.{h,cpp.hpp}(new) —Esp8266I2sRxDeviceimplements the fullRxDeviceinterface over the core's verifiedcore_esp8266_i2s.h(i2s_rxtxdrive_beginRX-only,i2s_set_rate(kI2sSlotHz),i2s_read_sample). It captures 16-bit samples at the WS2812 slot rate (the same rate the ESP8266: I2S output engine (clockless/parallel via the I2S peripheral) #4943 I2S engine emits), reconstructs the slot-level bit stream, converts runs toEdgeTime, and decodes via the shareddecodeWs2812Edgespath — so the I2S output engine is validated by looping its output back into I2S RX.samplesToEdgesis pure math (host-testable).rx.cpp.hpp— ESP8266 branch in theRxDevicefactory:RxBackend::I2S_RX+PLATFORM_DEFAULT→ the I2S RX device;ISR/RMT/FLEXPWM/FLEXIO/PARLIO_RX/LPC_SCT_CAPTURE→DummyRxDevicewith a clear message._build.cpp.hpp— the device TU joins the ESP8266 unity build.Test plan / evidence
bash compile esp8266 --examples Blink,Esp8266Uart→ both succeed; images unchanged frommaster(264,671 / 264,199 B) — the RX device dead-strips when unused.ci/lint.py --strictclean (SpanFromPointer/Stdint fixed).