1EGD_ACQ_SETUP(3)             EEGDEV library manual            EGD_ACQ_SETUP(3)
2
3
4

NAME

6       egd_acq_setup - specify which and how channel data should be obtained
7

SYNOPSIS

9       #include <eegdev.h>
10
11       int egd_acq_setup(struct eegdev* dev,
12                         unsigned int narr, const size_t *strides,
13                         unsigned int ngrp, const struct grpconf *grp);
14

DESCRIPTION

16       egd_acq_setup()  configures the way data is provided by the device ref‐
17       erenced by dev for the next calls to egd_get_data(3).
18
19       The narr argument specifies the number of buffers that will be supplied
20       in  the  argument  list of egd_get_data(3). strides should points to an
21       array of narr values  specifying  respectively  for  each  buffers  its
22       stride,  i.e. the size in bytes between the data of two successive sam‐
23       ples in this buffer.
24
25       The channels data that must be returns in those buffers are defined  by
26       ngrp  groups  of consecutive channels. The groups definition are passed
27       by grp which points to an array of ngrp structures, defined as follows:
28
29           struct grpconf {
30               unsigned int sensortype;    /* type of channel */
31               unsigned int index;         /* index of the first channel */
32               unsigned int nch;           /* number of channels */
33               unsigned int iarray;        /* index of the array */
34               unsigned int arr_offset;    /* offset in the array */
35               unsigned int datatype;      /* type in the array */
36           };
37
38       The different fields in the structure defines  the  properties  of  the
39       group:
40
41        * sensortype specifies the type of channel. it must one of the follow‐
42          ing values returned by egd_sensor_type(3).
43
44        * index indicates the index of the first channel in  the  group.  Note
45          that  channel  index i refers the i-th channel of the type specified
46          previously, i.e. the channel index i refers to two differents  chan‐
47          nels if sensortype differs.
48
49        * nch  specifies  the number of consecutive channels that should be in
50          the group.
51
52        * iarray indicates which buffer the data of the channel group must  be
53          written to.
54
55        * arr_offset  defines the offset of the memory location of the data in
56          the buffers relatively to the beginning of each sample.
57
58        * datatype specifies the type of data that must be written to the buf‐
59          fer.  It must be one of the following value: EGD_INT32, EGD_FLOAT or
60          EGD_DOUBLE
61

RETURN VALUE

63       The function returns 0 in case of succes. Otherwise, -1 is returned and
64       errno is set accordingly.
65

ERRORS

67       egd_acq_setup() will fail if:
68
69       EINVAL dev is NULL.
70
71       EPERM  The acquisition is running
72

THREAD SAFETY

74       egd_acq_setup() is thread-safe.
75

EXAMPLE

77       See egd_get_data(3) for a example
78

SEE ALSO

80       egd_get_data(3), egd_start(3), egd_sensor_type(3)
81
82
83
84
85
86EPFL                                 2010                     EGD_ACQ_SETUP(3)
Impressum