State & events
Typed product state, logical actions, settings, persistence contracts and runtime coordination without board-specific dependencies.
SOFTWARE
ENKU keeps its product logic independent from the board. Parsing, pagination, Library state, reading progress and runtime transitions can be built and tested on a host; ESP-IDF is the hardware layer that connects the same model to storage, buttons, power, Wi-Fi and the e-paper panel.
ARCHITECTURE
The project is split by responsibility rather than by screen. Application state never owns GPIO numbers, parser DOMs or display handles; platform details remain below narrow service interfaces so the reader core stays testable and portable.
Typed product state, logical actions, settings, persistence contracts and runtime coordination without board-specific dependencies.
Normalized documents, semantic positions, pagination, Reader Engine and deterministic ReaderSession navigation.
Storage, refresh, network and power are capabilities consumed by the application rather than hardware APIs reached from UI code.
ESP-IDF owns SDMMC, SSD1677 display transport, physical buttons, AXP2101, Wi-Fi and board-specific composition.
RUNTIME
Visible changes follow an explicit event-driven path. The authoritative state changes first; layout and rendering follow; only then is a refresh request sent to the e-paper layer. This keeps reading position independent from framebuffer state.
The current device runtime uses the same graph for Library focus, opening a book, page turns, sleep/wake and power-off persistence.
IMPLEMENTATION
The repository distinguishes implemented software from planned format support. Host-testable logic is already substantial, while physical behavior remains subject to on-device validation.
TXT, EPUB and FB2 parsing, bounded/ranged source access, semantic pagination, DocumentReaderEngine, ReaderSession and open / page / back / finished lifecycle are implemented and exercised by host tests. Parser memory ceilings are centralized in one contract: 32 KiB streaming chunks, 512 KiB FB2 metadata, 4 MiB text resources and bounded ZIP directory/entry counts.
Filtering, sorting, search, focus, import/delete flows and versioned A/B CBOR state with CRC recovery cover Library, settings, checkpoints, app context and boot-loop protection. Reader-state flushing is centralized so Back, Sleep and Power Off follow the same persistence rules, while long reading sessions save lightweight progress checkpoints every eight successful page turns.
A 1-bit framebuffer separates UI rendering from panel transport. Noto Sans Regular is now embedded in the firmware image and FreeType uses that same face for pagination metrics and monochrome glyph rasterization; an SD copy remains only an optional override.
The board target includes storage, SSD1677 refresh paths, button polling and logical dispatch, power, Wi-Fi and a persistent DeviceRuntime loop. BoardProfile/BoardCapabilities separate board features from the reader core. SD mount/setup failures remain recoverable, the reader font is firmware-owned, and Wi-Fi now degrades independently: network-driver failure marks connectivity as Error without blocking Library or Reading.
Panel quality, refresh timing, power draw, wake behavior and real-device interaction still require measurement on physical hardware. The refresh service now includes a vendor-driven anti-ghosting policy that forces a clean full refresh after five fast/partial updates.
BOOK FORMATS
Reader v1 now opens TXT, EPUB and FB2 through the same normalized Book Loader path. EPUB and FB2 use bounded/ranged reads and memory-aware parsing, while stale semantic checkpoints fall back safely instead of turning a changed book into an open failure.
Concrete parser, loader path, pagination and ReaderSession flow exist now.
ZIP-backed parser, manifest/spine/navigation handling, ranged source reads, bounded memory guards and mixed-case metadata regressions are implemented.
Streaming/ranged parsing, section navigation, metadata extraction, mixed-case XML handling and stale-position recovery are implemented.
Explicitly outside the first reader revision so the initial architecture can stay focused.
SOURCE
The website is the readable snapshot. Architecture decisions, runtime contracts, platform bring-up notes and tests stay versioned in the repository.