EGD_ACQ_SETUP(3)
β¨ EGD_ACQ_SETUP β¨ (that's a section 3 manual page from the EEGDEV library manual, bestie π)
okay so real talk, this is egd_acq_setup from eegdev.h and it's genuinely one of the most important lil functions you'll ever meet π«Ά
πΈ NAME πΈ
egd_acq_setup β tell the library which channel data you want and how you want it delivered π
π¦ SYNOPSIS π¦
#include <eegdev.h>
int egd_acq_setup(struct eegdev* dev,
unsigned int narr, const size_t *strides,
unsigned int ngrp, const struct grpconf *grp);
π DESCRIPTION π
egd_acq_setup() sets up how data is gonna be handed to you by the device that dev points at, and this config is what the next calls to egd_get_data(3) will use. so like, this is you telling the device "hey bestie, THIS is how I want my data served" π
The narr argument is the number of buffers you're gonna supply in the argument list of egd_get_data(3). and strides should point to an array of narr values, where each one is the stride for the corresponding buffer β meaning the size in bytes between the data of two successive samples in that buffer. it's giving "how far apart are my samples living" π
The channel data that must be returned in those buffers is defined by ngrp groups of consecutive channels. those group definitions get passed through grp, which points to an array of ngrp structures, defined like this:
struct grpconf {
unsigned int sensortype; /* type of channel */
unsigned int index; /* index of the first channel */
unsigned int nch; /* number of channels */
unsigned int iarray; /* index of the array */
unsigned int arr_offset; /* offset in the array */
unsigned int datatype; /* type in the array */
};
the different fields in that struct define the properties of the group, so let's go one by one, no skipping, periodt:
sensortypespecifies the type of channel. it must be one of the following values returned byegd_sensor_type(3).indexis the index of the first channel in the group. heads up tho: channel indexirefers to the i-th channel of the type specified previously, which means channel indexiactually refers to two different channels ifsensortypediffers. iykyk, this one trips people up πnchis the number of consecutive channels that should be in the group.iarraytells you which buffer the data of the channel group must be written to.arr_offsetdefines the offset of the memory location of the data in the buffers, relative to the beginning of each sample.datatypespecifies the type of data that must be written to the buffer. it must be one of these values:EGD_INT32,EGD_FLOATorEGD_DOUBLE. pick one, bestie, those are the options π«
β RETURN VALUE β
the function returns 0 when it's a success. otherwise, -1 is returned and errno is set accordingly. so like, check your errno, it's literally telling you what went wrong π
π ERRORS π
egd_acq_setup() will fail if:
EINVALβdevisNULL.EPERMβ the acquisition is running. (yeah, you can't reconfigure mid-run, sorry babe β)
π§ THREAD SAFETY π§
egd_acq_setup() is thread-safe. slay, go off, multiple threads can vibe with it π
πΈ EXAMPLE πΈ
See egd_get_data(3) for a example π
π SEE ALSO π
egd_get_data(3), egd_start(3), egd_sensor_type(3)
and that's the whole page fr fr π this one came from EPFL, dated 2010 β yes it's older than most of our fave fandoms but it still ate, and it's living in the EEGDEV library manual where egd_acq_setup belongs. mwah, go configure those buffers bestie πβ¨
π¦ where this page comes from
- debian bookworm: libeegdev-dev 0.2-6+b1
- debian trixie: libeegdev-dev 0.2-10
- fedora 43: eegdev-devel 0.2-33.fc43 Β· LGPL-3.0-or-later
- fedora 44: eegdev-devel 0.2-34.fc44 Β· LGPL-3.0-or-later
- ubuntu jammy: libeegdev-dev 0.2-6
- ubuntu noble: libeegdev-dev 0.2-9build2
- ubuntu questing: libeegdev-dev 0.2-10
- ubuntu resolute: libeegdev-dev 0.2-12
- ubuntu stonking: libeegdev-dev 0.2-12
- Copyright 2010 (c) EPFL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms