Skip to content

Layer 0: Hardware Layer

Responsibility

Underlying physical hardware that the engine runs on.


Components

Microcontrollers

  • ESP32/ESP32-S3: Main target microcontrollers

    • Dual-core Xtensa LX6 processors
    • Wi-Fi and Bluetooth connectivity
    • Various memory configurations (520KB SRAM on classic ESP32, 512KB on S3)
  • ESP32-C3: RISC-V variant

    • Single-core RISC-V processor
    • No FPU (uses Fixed16 math)
    • 400KB SRAM

Displays

DisplayTypeResolutionInterfaceUse Case
ST7789TFT LCD240x240, 320x240SPIColor games, high resolution
ST7735TFT LCD128x128, 160x128SPISmaller color displays
SSD1306OLED128x64, 128x32I2C/SPIMonochrome, low power
SH1106OLED128x64I2C/SPIAlternative monochrome

Audio Hardware

ComponentTypeDescription
Internal DAC8-bitESP32 GPIO 25/26, PAM8302A amplifier
I2S + MAX98357ADigitalHigh-quality audio, class D amp
I2S + PCM5102DigitalDAC for headphones/line out

Input

  • Physical Buttons: Connected to GPIOs

    • Typical configurations: 4-directional + 2 action buttons
    • Direct GPIO polling with debouncing
  • Touch Controllers:

    • XPT2046: Resistive touch (SPI)
    • GT911: Capacitive touch (I2C)

PC/Native Platform

  • Simulation: SDL2 on Windows/Linux/macOS
  • Purpose: Rapid development without hardware
  • Features: Full API compatibility, faster iteration

Hardware Capabilities Detection

The engine uses PlatformCapabilities structure to detect hardware at runtime:

cpp
struct PlatformCapabilities {
    bool hasDualCore;      // Multi-core support
    int audioCoreId;       // Recommended core for audio
    int mainCoreId;        // Recommended core for game loop
    bool hasFPU;           // Floating-point unit available
    size_t totalSRAM;      // Total SRAM available
};

Memory Layout (ESP32)


Released under the MIT License.