Commit graph

5 commits

Author SHA1 Message Date
lucavanstraaten
a618cb238f LED: show encoder position as hue after each read
- Add setPositionColor(): maps SSI value to HSV hue (0=red, 120=green, 240=blue)
- LED takes the position hue as its resting colour between reads
- Blue during active read unchanged
- All error paths now flash red before printing ERR
2026-04-28 21:16:59 +02:00
lucavanstraaten
a8633962f2 Reimplement SSI read using RP2040 PIO state machine
Replace dual-core FIFO bit-bang approach with a dedicated PIO program:
- Add ssi.pio: PIO assembly for SSI master (side-set CLK, sample DATA)
- Add ssi.pio.h: pioasm-generated C header
- ssi_pio_init(): load program, wire CLK/DATA pins, set clock divider
- ssi_pio_reconfigure_speed(): live clock-divider update between reads
- ssi_pio_read(): push bit-count to TX FIFO, block on RX result word
- Remove dual-core headers, FIFO structs, setup1/loop1, requestSsiRead
- Bit limit reduced to 1..32 (single PIO ISR word)
- TX_DI pin ownership transferred to PIO (no pinMode/digitalWrite)
2026-04-28 21:12:54 +02:00
lucavanstraaten
58a2d37b38 Move SSI timing-critical read to core 1 via FIFO
- Replace hardware/sync.h with pico/multicore.h
- Implement ssi_read_core1(), setup1(), loop1() on core 1
- Core 1 owns the SSI bit-bang loop; no USB/timer IRQs interfere
- Core 0 sends packed request word over FIFO, receives lo32/hi32/duration
- Add requestSsiRead() helper on core 0 side
- Remove noInterrupts / save_and_disable_interrupts (no longer needed)
- Update startup banner to reflect dual-core architecture
2026-04-28 21:03:59 +02:00
lucavanstraaten
d547ee0548 Improve jitter: direct GPIO access and noInterrupts instead of digitalRead/Write 2026-04-28 20:56:52 +02:00
Luca van Straaten
074d7c8114 Initial commit 2026-04-28 20:48:26 +02:00