A lightweight, bare-metal e-reader engine built specifically for the RP2040 microcontroller on the Pico Marble development board, an ILI9341 2.4" SPI display, and an LDR voltage divider for automatic brightness control.
- Viewport Scrolling: Smooth, sliding file catalog interface designed to handle long lists of books.
- Dynamic Multi-line Word Wrap: Automatically calculates text boundaries and shifts rows cleanly.
- 5 Adaptive UI Themes: Cycle on-the-fly (via a long-press on the UP button) between Charcoal (Dark), Green, Pastel Pink, Warm Sepia, and White Light.
- Stable PWM Backlight Control: Fluid, real-time dimming driven by ambient light levels at a rock-solid hardware frequency to completely eliminate analog flickering.
- UTF-8 Preservation: Custom multi-byte decoding loops designed to perfectly render text containing Romanian diacritics (
ș,ț,ă,â,î).
This project is built around the Pico Marble development platform, which features an onboard MicroSD slot natively routed to the SPI0 peripheral bus. No extra jumpers or manual wiring are required for the storage module!
Below is the exact schematic mapping the connections for the display, the input buttons, and the light sensor divider circuit:
| Component | Module Pin | RP2040 Pin (Pico Marble) | Function / Description |
|---|---|---|---|
| ILI9341 TFT 2.4" | GND | GND | Common Ground |
| VCC | 3V3 | Logical System Power | |
| SCL / CLK | GPIO 18 | Shared SPI Clock (SCK) | |
| SDA / MOSI | GPIO 19 | Shared SPI Master-Out Data | |
| RES / RESET | GPIO 21 | Display Hardware Reset Line | |
| DC / RS | GPIO 20 | Data / Command Selection Pin | |
| CS | GPIO 15 | Display Chip Select | |
| BLK / LED | GPIO 22 | Hardware Backlight PWM Controller | |
| SD Card (Onboard) | DAT3 / CS | GPIO 17 | SD Storage Chip Select |
| CMD / MOSI | GPIO 19 | Shared SPI Master-Out Data | |
| CLK / SCK | GPIO 18 | Shared SPI Clock (SCK) | |
| DAT0 / MISO | GPIO 16 | SPI Master-In Data Stream | |
| Buttons | DOWN Button (S1) | GPIO 7 | Menu Down / Next Page (Internal Pull-Up) |
| UP Button (S2) | GPIO 8 | Menu Up / Previous Page / Themes Toggle (Pull-Up) | |
| LDR Light Sensor | Divider Node (R1 + R2) | GPIO 26 / ADC0 | Analog ambient light intensity tracker |
This repository is an application extension based on the hardware integration layer developed by elehobica in their repository pico_fatfs.
It retains and implements their high-performance, PIO-accelerated SPI communication stack tailored for FatFs execution on the RP2040 micro-architecture, extending it into a fully interactive display-driven user interface.
- Make sure your local
PICO_SDK_PATHvariable is exported correctly. - Run
./compile.shin the terminal to build the code and generate the binaries. - Boot the Pico into mass storage mode and run
./upload.shto flash the*.uf2file.
