Skip to main content

Crate Architecture

The firmware is a Rust workspace split into five crates with strict layering. No circular dependencies. The daemon is the only binary crate. Everything else is a library.

Plugin System

Plugins are event-driven and run in parallel across CPU cores. Each plugin is a separate Rust crate in the plugins/ directory.

Writing a Plugin

Every plugin implements the EegPlugin trait:
Plugins can optionally declare an event_filter to subscribe only to relevant event types, avoiding unnecessary wake-ups.

Included Plugins


WebSocket API

The daemon exposes a centralized WebSocket endpoint for real-time data streaming with a topic-based pub/sub model. Endpoint: ws://localhost:9000/ws/data

Subscribe to a Topic

Unsubscribe

Data frames are binary (RtPacket format) for high-performance streaming. A single client can hold multiple topic subscriptions simultaneously.

Control Plane (REST + SSE)

In addition to the WebSocket data plane, the daemon provides HTTP endpoints on the same port:

Board Configurations

V1: Single ADS1299

One ADS1299 EVM connected directly to the Pi 5 via SPI. Provides 8 channels with buffered reference (SRB1) and fixed internal bias drive.

V2: Four Synchronized ADS1299 Boards

Star topology with one master board and three secondaries sharing clock, MOSI, SCLK, and MISO. Each board has a dedicated chip-select and DRDY line. Only the master board (Board 0) drives the bias electrode.

Next

EEG Overview

Hardware BOM and quickstart

SDK: EEG Web

Connect to EEG headbands over Web Bluetooth