Configuring a device#
Stream settings#
Set the channels, gain and sample rate before each
ba_eeg_manager_start_stream():
const uint8_t electrodes = ba_core_device_features_electrode_count(
ba_core_device_features_get(ba_eeg_manager_get_device_info(manager)));
for (uint8_t i = 0; i < electrodes; ++i)
{
ba_eeg_manager_set_channel_enabled(manager, BA_EEG_CHANNEL_ID_ELECTRODE_MEASUREMENT + i, true);
ba_eeg_manager_set_channel_enabled(manager, BA_EEG_CHANNEL_ID_ELECTRODE_CONTACT + i, true);
ba_eeg_manager_set_channel_gain(manager, BA_EEG_CHANNEL_ID_ELECTRODE_MEASUREMENT + i, BA_GAIN_MODE_X8);
}
ba_eeg_manager_set_channel_enabled(manager, BA_EEG_CHANNEL_ID_SAMPLE_NUMBER, true);
ba_eeg_manager_set_data_stream_rate(manager, BA_DATA_STREAM_RATE_500_HZ);
ba_error status = ba_eeg_manager_start_stream(manager, NULL, NULL);
When nothing is set, a stream measures every electrode at gain 8 and 250 Hz.
ba_eeg_manager_load_config() sends the settings without starting, to check
them before the start.
- Gain
BA_GAIN_MODE_X1,X2,X4,X6,X8(default) orX12per electrode.- Bias electrode
ba_eeg_manager_set_channel_bias_feedback(manager, BA_EEG_CHANNEL_ID_ELECTRODE_MEASUREMENT + i)uses electrode i for bias feedback.- Sample rate
ba_eeg_manager_set_data_stream_rate()accepts the rates of the connected device (see BrainAccess C API) and returnsBA_ERROR_UNSUPPORTED_DEVICEfor others.ba_eeg_manager_read_sample_frequency()reports the rate in use.
Impedance measurement#
Check electrode contact quality before a recording.
ba_eeg_manager_set_impedance_mode() switches the stream to impedance
measurement: each BA_EEG_CHANNEL_ID_ELECTRODE_MEASUREMENT channel then
carries its electrode’s impedance in kΩ. Configure at least one bias electrode.
Mode |
Test signal |
|---|---|
|
none: normal EEG |
|
7.8 Hz |
|
31.2 Hz |
|
a quarter of the sample rate |
Test signal#
ba_eeg_manager_set_output_mode(manager, BA_OUTPUT_MODE_SQUARE_WAVE) replaces
the electrode readings with a built-in square wave, to check the signal path
end to end. BA_OUTPUT_MODE_NORMAL switches back.
Battery and charging#
ba_eeg_manager_read_battery_info() returns the battery level and whether the
device is charging; the battery callback (ba_eeg_manager_set_callback_battery())
reports every change.
Charging settings choose whether the device can be used while it charges and after how many idle minutes it sleeps:
ba_charging_settings settings = {.enabled_on_while_charging = false, .sleep_timeout = 15};
ba_eeg_manager_set_charging_settings(manager, settings);
Firmware update#
ba_eeg_manager_start_update() sends the firmware image named by
sBACORE_Config_t::update_path to the connected device and returns
BA_ERROR_OK once the device has accepted it and restarts.