9 Commits

Author SHA1 Message Date
ce5f63b35b Move project into color_switcher/ subfolder
Restructure repo so the root contains project folders. This allows
adding more Pico projects (e.g., another_project/) alongside
color_switcher/ in the same repository. All internal paths are
relative and unchanged — cd into color_switcher/ to build/flash.
2026-04-13 03:39:56 +02:00
f3ac2bca9f Merge initIal_demo: complete firmware stack with USB/UART/PIO/LED 2026-04-13 03:33:20 +02:00
b49c7f60bb Add WS2812B LED support via PIO with rainbow and color commands
MCU_PIO: generic PIO driver with config-driven program loading,
function-pointer init callbacks, blocking put, and DMA async put.
ws2812.pio written from scratch — 800 kHz, 10 cycles/bit, side-set.

HAL_LED: pixel buffer with intensity scaling, RGB byte order for
RP2040-Zero WS2812 variant. SetColor immediately pushes the strip.

APP_CLSW: rainbow HSV hue rotation on startup (auto-mode). Color
commands (red/green/blue/off/rainbow) stop the rainbow and set the
LED to a static color. Integer-only HSV-to-RGB conversion.

CMake: added hardware_pio link and pico_generate_pio_header for
ws2812.pio compilation. SYS_ECU init sequence updated.
2026-04-13 03:32:18 +02:00
3d5e63c790 Redesign RX to non-blocking ring buffer model
UART/USB now receive in the background and store into ring buffers.
Callers read from the buffer via non-blocking ReadByte/ReadBuffer.
Removed blocking ReceiveByte, async ReceiveBuffer with request
state and callbacks. MCU_USB uses lazy drain from SDK stdio into
its own ring buffer. MCU_UART ring buffer unchanged (ISR/DMA).
HAL_COM updated with ReadByte/ReadBuffer function pointer dispatch.
APP_CLSW updated to use new ReadByte API.
2026-04-13 01:50:58 +02:00
863da8f75c Add RX support and interactive color-switcher command demo
MCU_UART: full RX with ISR and DMA modes, ring buffer, blocking
ReceiveByte, async ReceiveBuffer with request fulfillment, blocking
ReceiveBufferBlocking. Per-byte RX callback (ISR mode).

MCU_USB: blocking ReceiveByte via getchar_timeout_us, cached-byte
peek for bIsRxDataAvailable.

HAL_COM: RX function pointer types + dispatch (ReceiveByte,
bIsRxDataAvailable) with USB wrappers in cfg.

APP_CLSW: interactive command parser. Accumulates input into a
buffer, parses on delimiter. Supports red/green/blue/help commands
with echo and response. SYS_ECU tick reduced to 10ms for responsive
input.
2026-04-13 01:29:20 +02:00
77152a0718 Implement HAL_COM with function-pointer transport dispatch
Multi-channel communication abstraction where each channel is wired
to an MCU driver via function pointers in the config array. Adding
a new transport (SPI, I2C, etc.) requires only a config entry — zero
changes to HAL_COM_prg.c. Channel 0 defaults to USB-CDC via thin
wrappers that normalize MCU_USB's signature. HAL_COM.h includes
HAL_COM_cfg.h so callers can reference channel names. APP_CLSW
updated to pass channel parameter.
2026-04-12 23:26:21 +02:00
f50e877ffc Implement MCU_UART driver with blocking and non-blocking TX
Full hardware UART driver with config-driven per-instance setup.
Non-blocking SendBuffer supports DMA (zero-CPU) and ISR (FIFO-fill)
modes selectable per instance in MCU_UART_cfg.h. Both modes and
blocking SendBufferBlocking invoke a configurable TX-complete
callback (STD_NULL to ignore). All public functions take a u8
instance parameter. Config uses struct-of-arrays pattern for
runtime state, designated-initializer array for per-instance
settings, and value enums in the public header for parity/data
bits/stop bits/async mode. Added hardware_dma to CMake link list.
2026-04-12 19:36:41 +02:00
3687e48684 Add complete firmware stack with USB-CDC proof of life
Dockerized build system (Dockerfile, docker-compose, build.sh) with
Pico SDK cross-compilation. Modular CMake split into project_config,
mcu_config, and sources_config under cmake/. Component architecture
following inc/prg/cfg convention: STD_TYPES, MCU_USB, HAL_COM,
APP_CLSW, SYS_ECU. Full call chain SYS_ECU -> APP_CLSW -> HAL_COM
-> MCU_USB verified end-to-end on RP2040-Zero hardware over USB-CDC.
Includes flash.sh for automated .uf2 flashing on macOS and
devcontainer config for VS Code.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 18:23:24 +02:00
aabcb77641 Add CLAUDE.md and README.md for project documentation 2026-04-10 20:05:19 +02:00