How bitluni/ch570composite works
CH570 Composite is embedded firmware that presents a USB CDC serial interface and turns received text into a PAL video signal. The main loop services USB, transfers received bytes into a bounded buffer, and prints them into the video text buffer; the timer/PWM renderer generates the raster output. The README also documents ^L screen clearing. Source excerpts support the main loop and rendering calls, but do not show the CDC receive-dispatch implementation, so that connection is marked unverified. The SPI video implementation is present but not selected by main.
Main entry points: main.cpp Main loop · CompositeVideoTimerPWM.cpp PAL raster renderer · cdc.cpp USB CDC · CompositeVideoSPI.cpp SPI video alternative
Components 12
Firmware workflow
- Main loop
code/src/main.cpp - USB CDC
code/src/cdc/cdc.cpp - Text input buffer
code/src/main.cpp
Video generation
- Text terminal
code/src/video/CompositeVideoTimerPWM.cpp - Character font
code/src/video/font.h - PAL raster renderer
code/src/video/CompositeVideoTimerPWM.cpp - RLE video asset
code/src/video/rick.h - SPI video alternative
code/src/video/CompositeVideoSPI.cpp
CH570 platform
- Peripheral drivers
code/lib/StdPeriphDriver/CH57x_i2c.c - CH57x definitions
code/lib/StdPeriphDriver/inc/CH57x_common.h
Other components
- Serial host
- PAL display
Connections 11
- Serial host → USB CDC: sends serial
- Main loop → USB CDC: initializes and services
code/src/main.cpp - Main loop → Text input buffer: appends received bytes
code/src/main.cpp - USB CDC → Main loop: dispatches received data
- Main loop → Text terminal: prints characters
code/src/main.cpp - Main loop → PAL raster renderer: updates video
code/src/main.cpp - Text terminal → Character font: reads glyphs
code/src/video/CompositeVideoTimerPWM.cpp - PAL raster renderer → PAL display: drives PAL signal
code/src/video/CompositeVideoTimerPWM.cpp - PAL raster renderer → RLE video asset: references animation data
code/src/video/CompositeVideoTimerPWM.cpp - SPI video alternative → PAL display: drives SPI output
code/src/video/CompositeVideoSPI.cpp - Peripheral drivers → CH57x definitions: uses definitions
code/lib/StdPeriphDriver/CH57x_i2c.c