How abcdaaa1111/picomp3 works
This repository is firmware for an RP2040 Hi-Fi MP3 player. The main workflow is button-driven playback: the application reads music from SD storage through FatFs, decodes MP3 audio with libmad, and sends PCM to the audio output. Separate branches cover the OLED interface, battery and input handling, status LEDs, and the documented second-core spectrum analysis. Some connections rely on README descriptions because the relevant implementation excerpts were not provided.
Main entry points: main.c Player Application · Astra_GUI.c Graphics and GUI · sound.c PCM Output · ff.c FatFs
Components 19
Playback
- Player Application
main.c - FatFs
FatFs/ff.c - MP3 Decoder
libmad/layer3.c
Device I/O
- SD Card Driver
devices/sdcard/sdcard.c - PCM Output
devices/sound/sound.c - PCM Channel
devices/sound/PCMchannel.c
Interface
- Button Input
devices/buttons/buttons.c - Graphics and GUI
Astra/graphic/2d/src/Astra_GUI.c - Bitmap Drawing
Astra/graphic/2d/src/Astra_Bitmap.c - OLED Display
devices/display/display.c - SSD1306 Driver
devices/display/ssd1306/ssd1306_spi.c - Battery Sensing
devices/battery/battery.c - ADC Scan
services/adc_scan.c - WS2812 Driver
devices/led/ws2812/ws2812.c
Audio Analysis
- Core 1 Analysis
core1_main.c - PID Algorithm
algorithms/pid/pid.c
Other components
- Listener
- SD Card
- PCM5102A DAC
Connections 18
- Listener → Button Input: presses
- Button Input → Player Application: provides input
- Player Application → FatFs: reads tracks
main.c - FatFs → SD Card Driver: accesses storage
- SD Card Driver → SD Card: reads blocks
devices/sdcard/sdcard.c - Player Application → MP3 Decoder: decodes frames
main.c - MP3 Decoder → PCM Output: outputs PCM
- PCM Output → PCM Channel: uses channels
devices/sound/sound.c - PCM Output → PCM5102A DAC: sends I2S
- Player Application → Graphics and GUI: updates interface
- Graphics and GUI → Bitmap Drawing: draws graphics
- Graphics and GUI → OLED Display: renders screen
- OLED Display → SSD1306 Driver: uses driver
devices/display/display.c - Player Application → ADC Scan: samples battery
- Battery Sensing → ADC Scan: reads voltage
- Player Application → WS2812 Driver: controls indicator
- Player Application → Core 1 Analysis: starts second core
- Core 1 Analysis → Graphics and GUI: sends spectrum