Expand description
§neurosky
Rust library and terminal UI for the NeuroSky MindWave EEG headset via the ThinkGear serial protocol. Pure Rust — works on all OS.
§Quick start
ⓘ
use neurosky::prelude::*;
let ports = MindWaveDevice::find()?;
let mut device = MindWaveDevice::open(&ports[0])?;
device.auto_connect()?;
loop {
for packet in device.read()? {
match packet {
Packet::Attention(v) => println!("Attention: {v}"),
Packet::RawValue(v) => { /* feed dsp::BandPowerExtractor */ }
_ => {}
}
}
}§Module overview
| Module | Purpose |
|---|---|
types | ThinkGear protocol constants, packet codes, data types |
parser | Stateful binary protocol parser (sync → length → payload → checksum) |
device | High-level MindWaveDevice API |
dsp | Real-time EEG DSP pipeline — notch filter, bandpass filters, band power extraction |
verify | Pure-Rust SHA-256 and ThinkGear packet checksum validation |
sandbox | OS-level network sandboxing (serial-only device; no network needed) |
error | Error types |
prelude | Convenience re-exports |
Modules§
- device
- High-level MindWave device API.
- dsp
- Digital signal processing pipeline for raw EEG.
- error
- Error types for the NeuroSky ThinkGear API wrapper.
- parser
- ThinkGear binary protocol parser.
- prelude
- Convenience re-exports.
- sandbox
- Process-level network sandboxing.
- types
- ThinkGear protocol types and constants.
- verify
- SHA-256 integrity verification and ThinkGear packet validation.