How jerry20091103/vibration-tuner works
Project Type and Purpose
• This is an embedded-firmware project targeting an Arduino-compatible microcontroller (managed via PlatformIO/VSCode).
• It implements three core user-facing features—Metronome, Prompter, and Tuner—each with its own UI “Page.”
• It uses real-time signal processing (Butterworth filter, controls) and a hardware abstraction layer to drive on-device peripherals (display, audio, buttons).
File Structure
• Top-level:
• code/ – the main firmware project managed by PlatformIO.
• local_test/ – PC‐based LVGL port for local UI development.
• teleprompter.py – host‐side script (likely for generating or uploading prompts).
• Inside code/:
• conf/ – LVGL configuration headers.
• / – public headers: pages (MetronomePage.h, TunerPage.h, etc.), hardware abstraction, filters, GUI utilities, controls.
• src/ – implementation files mirroring include/, plus main.cpp as the entry point.
• lib/, test/ – third-party libraries and unit tests.
• platformio.ini – build configuration.
README.md
• Confirms PlatformIO + Arduino framework.
• Naming conventions and setup steps—no direct architectural guidance.
Main Components & Their Interactions
a. Hardware Platform (bottom layer)
• MCU (Arduino) – CPU running firmware.
• Peripherals: display (LVGL), speaker/buzzer, sensor(s) for tuner, buttons/encoder.
b. Hardware Abstraction Layer (HAL)
• code/include/hardware.h + hardware.cpp
• guiUtility, controls – wrappers around LVGL and input devices.
c. Real-Time Signal Processing
• butterworth filter, realtime_filter, controls – DSP routines to filter input for tuner.
d. Application Modules (“Pages”)
• MetronomePage, TunerPage, PrompterPage – each encapsulates:
– OptionsPage (UI controls)
– Core logic (Metronome.cpp, Tuner.cpp, Prompter.cpp)
e. System Orchestrator
• main.cpp – initializes LVGL, HAL, modules, and dispatches events / updates pages in the main loop.
f. Build, Test & Host Integration
• PlatformIO build (VSCode) → firmware binary → flash to device.
• local_test for PC-side LVGL dev.
• teleprompter.py for host-to-device communication or prompt file prep.
Architectural Patterns & Design Principles
• Layered architecture: Hardware → HAL → DSP → Application.
• Modular UI pages: clear separation of feature logic vs. options vs. rendering.
• Dependency injection via “include” interfaces.
• Test harness under code/test for unit tests.