DeviceConfig

data class DeviceConfig(val model: DeviceModel, val channels: List<String>, val gain: List<Int>, val bias: List<Boolean>, val active: List<Boolean>, val srate: Int, val impedanceMode: ImpedanceMode)

Immutable device configuration.

Fields:

  • gain per-channel ADS1299 gain, one of VALID_GAINS; an inactive channel may also carry 0. Only active channels' gain is transmitted.

  • bias per-channel bias enable; packed LSB-first, one byte per 8 channels (channel 0 = bit 0 of the first byte, channel 8 = bit 0 of the second).

  • active per-channel enable mask.

  • srate sample rate in Hz; one of SUPPORTED_SRATES (the rates with a wire code) — anything else is rejected at construction instead of being sent as an unknown code. Which of them a headset streams is its board's DeviceHardware.supportedSrates.

  • impedanceMode wire code byte 0 of the config blob; any non-OFF mode selects the impedance packet layout (24-bit absolute) vs the normal layout (24-bit first sample

    • 12-bit deltas).

The four lists MUST all be length DeviceModel.channelCount.

Constructors

Link copied to clipboard
constructor(model: DeviceModel, channels: List<String>, gain: List<Int>, bias: List<Boolean>, active: List<Boolean>, srate: Int, impedanceMode: ImpedanceMode)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Number of active (transmitting) electrodes.

Link copied to clipboard
Link copied to clipboard

Total channels in the montage.

Link copied to clipboard
Link copied to clipboard

The rate the device is sent, and so streams at: srate, except in an impedance mode the firmware cannot measure at that rate, which streams at 250 Hz instead. The firmware takes each electrode's impedance as max − min over a fixed 20 samples, which spans a flip of the square test wave only while half the wave's period is longer: ImpedanceMode.HZ_7_8 up to 250 Hz, ImpedanceMode.HZ_31_2 up to 1 kHz. Faster, a lifted electrode can read close to 0 kΩ. ImpedanceMode.DR_DIV4's wave follows the rate, so it is never capped. srate itself is kept, so turning impedance off gives the set rate back.

Link copied to clipboard
val gain: List<Int>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val srate: Int