Repository navigation
Add LPC845 UART DMA clockless default - #3612
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (23)
📝 WalkthroughWalkthroughThis PR adds an LPC845 UART DMA clockless channel driver, making it the default AUTO clockless path when FASTLED_LPC_UART_DMA is enabled. It wires bus traits/routing, adds a UART DMA channel engine and runtime, an AutoResearch --uart loopback bench, RpcBench call_flat/reset_and_drain APIs, a firmware test harness, and docs. ChangesLPC845 UART DMA clockless path
Estimated code review effort: 4 (Complex) | ~75 minutes Sequence Diagram(s)sequenceDiagram
participant ClocklessController
participant ChannelEngineLpcUartDma
participant LpcUartDmaRuntime
ClocklessController->>ChannelEngineLpcUartDma: enqueue(channelData)
ClocklessController->>ChannelEngineLpcUartDma: show()
ChannelEngineLpcUartDma->>ChannelEngineLpcUartDma: beginTransmission (encode LUT bytes)
ChannelEngineLpcUartDma->>LpcUartDmaRuntime: kickDmaStreamAsync(pin, baud)
LpcUartDmaRuntime-->>ChannelEngineLpcUartDma: DMA chunk armed/chained via ISR
ChannelEngineLpcUartDma->>ChannelEngineLpcUartDma: poll() checks streamDone
ChannelEngineLpcUartDma-->>ClocklessController: DriverState READY
sequenceDiagram
participant CLI as autoresearch --uart
participant phases as phases.py
participant bench as test_lpc_uart_clockless.py
participant RpcBench
participant Firmware as LPC845 firmware
CLI->>phases: parse --uart, --tx-pin, --rx-pin
phases->>phases: inject FASTLED_LPC_UART_DMA defines
phases->>bench: uv run ci.autoresearch.test_lpc_uart_clockless
bench->>RpcBench: call/call_flat(uartDmaClocklessProbe)
RpcBench->>Firmware: JSON-RPC over serial
Firmware-->>RpcBench: probe/loopback CSV result
RpcBench-->>bench: parsed result
bench-->>phases: exit code 0/1
Possibly related issues
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Summary
Bus::UARTclockless channel engine that encodes WS2812 bytes to UART symbols and streams them through USART TX DMA.FASTLED_LPC_UART_DMA=1, including the legacyFastLED.addLeds<WS2812, PIN, GRB>()adapter.--uartcoverage that drives through the normal FastLED API and verifies the encoded bytes with USART RX-DMA on the configured RX pin.Bus::UART; USART instance selection remains hidden in the LPC driver.Closes #3611.
Datasheet / docs used
Datasheet facts applied from UM11029: USART1 RX/TX use fixed DMA channels 2/3, USART2 RX/TX use fixed channels 4/5, SWM PINASSIGN routes USART TXD/RXD, USART CFG provides LOOP/RXPOL/TXPOL, and initial DMA descriptor word 0 is reserved while live transfer config is
CHANNEL[n].XFERCFG.Hardware verification
bash test --cppbash autoresearch lpc845 --uart --upload-port COM10 --no-auto-discover-pins --tx-pin 13 --rx-pin 11 --timeout 120s --skip-lint0xFF0000,0x00FF00,0x55AA33; each returned24 bytes match expected patternFASTLED_LPC_UART_DMA=1,FASTLED_LPC_DMA_ISR=1,FL_LPC_UART_DMA_CLOCKLESS_TEST=1,FL_LPC_UART_DMA_LOOPBACK_TEST=1,FL_LPC_UART_DMA_CLOCKLESS_TX_PIN=13,FL_LPC_UART_DMA_CLOCKLESS_RX_PIN=11bash autoresearch lpc845 --dma-uart --upload-port COM10 --no-auto-discover-pins --timeout 60s --skip-lintuartDmaStreamOnce(2048, 0xA5)total 20508 us for 2048 bytesuartDmaStreamOverlap(2048, 0x5A)total 20510 us, toggles=8455Both AutoResearch runs emitted the existing PlatformIO
pio platform showwarning after the successful fbuild deploy/test path; exit code was 0.Summary by CodeRabbit
New Features
Bug Fixes
Documentation