How abaschen/lilygo-epd47 works
Project Type and Purpose
• This is an embedded‐firmware and driver library project for the LilyGo EPD47 e-paper display, targeting the ESP32-S3 SoC.
• It provides low-level drivers, image and font handling, compression (zlib), JPEG decoding, plus Arduino/PlatformIO examples, documentation, CI workflows, schematics and mechanical shells.
Top-Level Components
A. Hardware Platform
• ESP32-S3 module (16 MB QSPI flash, 8 MB OPI PSRAM)
• EPD47 e-paper panel (SPI-like parallel bus, control signals CKV, STH, CKH)
• Touch panel sensor (via I2C + IRQ)
• User button (GPIO wakeup)
• Optional SD-card interface (SPI signals)
• GPIO breakout for free pins
B. Firmware/Software Layers
• Build system (PlatformIO / ESP-IDF via CMakeLists.txt & component.mk)
• Driver layer (src/epd_driver.*, i2s_data_bus.*, rmt_pulse.*)
• Image codec libraries (src/libjpeg, src/zlib)
• Font & waveform data (Waveform_header, src/font.c, src/firasans.h)
• Utility code (src/utilities.h)
• Touch handling (src/touch.*)
• Example applications (Arduino sketches in examples/)
C. Tooling & CI
• Image/font conversion scripts (scripts/)
• Documentation (Sphinx under docs/)
• CI workflows (.github/workflows for Arduino CI, PlatformIO CI)
D. Assets & Docs
• Schematics (schematic/)
• Mechanical shell designs (shell/)
• Datasheet (datasheet/ED047TC1.pdf)
• Metadata (library.json, library.properties)
Interactions and Data Flow
• Developer edits /examples or library code → Build system compiles via PlatformIO/ESP-IDF → Firmware image → Flashed onto ESP32-S3 → On power-up, firmware initializes hardware buses (I2S/RMT/SPI/I2C), loads waveform tables, invokes EPD driver to update display
• Script tools preprocess images/fonts into C headers → Embedded in firmware
• User interaction (button, touch) → GPIO/IRQ → touch driver → application logic → triggers screen update
• Optional SD‐card reads assets via SPI → image codec modules decompress (zlib/jpg) → pass to driver
Architectural Patterns & Principles
• Layered architecture: Hardware Abstraction → Driver Modules → Codec & Utility Libraries → Application Examples
• Component‐based build (ESP-IDF or PlatformIO components)
• Separation of concerns: low-level timing (RMT/I2S), high-level image processing, user-facing examples
• Reusability: common waveform headers, generic font conversion
Essential Elements
• Clear component names and roles
• Related files/folders under each module to convey structure
• CI workflows tied to GitHub repo