Skip to main content

Sarmadtec NeuroPort driver for Fascin8/Ultim8 neuro headstages with faker mode for offline testing.

Project description

Sarmadtec NeuroPort Driver (pip package)

Python driver for Fascin8/Ultim8 neuro headstages with optional fake signal generation for offline testing. The code is packaged as sarmadtec_neuroport so it can be installed via pip and reused outside this GUI app.

Install locally

  • From PyPI: pip install sarmadtec-neuroport
  • From source checkout (if needed): pip install . or pip install -e .
  • Requires Python 3.8+ and pyserial (pulled in automatically).

Quickstart (faker mode)

from time import sleep
from sarmadtec_neuroport import Device

def on_data(samples):
    if samples:
        first = samples[0]
        print(f"{len(samples)} samples; seq={first[0]} channels={len(first)-1}")

device = Device(
    debug_mode=True,               # print driver logs
    faker=True,                    # built-in signal generator instead of hardware
    data_ready_callback=on_data,   # called when new samples arrive
    data_chunk=0,                  # 0=flush everything each callback
)

device.sampling_rate = 500        # 250/500/1000/2000 Hz
device.gain = 24                  # ADS1299 gain setting for primary channels
device.exgain = 24                # gain for extra channels
device.leadoffMode = True         # enable lead-off detection

device.configure_settings()       # push settings to device (no-op for faker)
device.start()                    # begin streaming
sleep(3)
device.stop()
device.shutdown()                 # cleanly close worker threads/serial port

Run python examples/basic_usage.py --faker --duration 3 for a ready-made script. Drop --faker to talk to real hardware over USB/serial.

Real hardware notes

  • Plug in the Fascin8/Ultim8 so the OS exposes a CDC/serial port (Mac: /dev/tty.*, Windows: COMx).
  • The driver auto-scans for descriptors containing “USB Serial Device” or “STM32 Virtual ComPort”.
  • You can observe connection changes by registering connection_state_callback:
    Device(connection_state_callback=lambda connected, port, reason: print(connected, port, reason))
    
  • Call reset_device() to force a reconnect/re-handshake without recreating the object.

API cheat sheet

  • Device(debug_mode=False, data_ready_callback=None, settings_written_callback=None, data_chunk=0, faker=False, faker_data=None, connection_state_callback=None, connection_check_interval=1.0)
    • Instantiation starts internal I/O + watchdog threads and kicks off connect_async().
    • faker=True bypasses serial I/O and emits synthetic samples; optionally replay faker_data (list of channel-value lists).
    • data_chunk=0 flushes all buffered samples per callback; otherwise batches that many.
  • Core methods:
    • connect_async(force=False) / reset_device() — handshake with the headstage.
    • configure_settings() — send current sampling/gain/lead-off/channel flags.
    • start() / stop() — start/stop streaming; parsed samples surface via callbacks or get_data().
    • set_signal_generator_mode(enabled, faker_data=None) — toggle faker mode on an existing instance.
    • set_data_ready_callback(cb) / set_connection_state_callback(cb) — register runtime callbacks.
    • shutdown() — close serial, stop worker threads/watchdog, and reset state.

Samples are parsed as Python lists: [sequence, ch1, ch2, ...] (Fascin8 produces 21 primary + 3 extra channels; Ultim8 produces 8 primary).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sarmadtec_neuroport-0.1.1.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sarmadtec_neuroport-0.1.1-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file sarmadtec_neuroport-0.1.1.tar.gz.

File metadata

  • Download URL: sarmadtec_neuroport-0.1.1.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for sarmadtec_neuroport-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dfadec68fac359f4fcb68e699a4984e20e689b14674a9cb2d6d57d4361f46bd0
MD5 6acbad8409d0ef8af96c219b9732889a
BLAKE2b-256 6ae18d2af8cc085995352ce8527f8c6797fe113c4fb914a22356b14e70a8b93f

See more details on using hashes here.

File details

Details for the file sarmadtec_neuroport-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sarmadtec_neuroport-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 97d5670f8c2f2a31257cd70cfc93d09f174cb599a4f8b038e0255d496119ef5c
MD5 3c9e75e8365e209ff4597831acc28a71
BLAKE2b-256 c880250c25afe2a7978f6dddbf1234a6406501fe14d818668c3869dd87fa903f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page