Hardware IO Buffer¶
Defines
-
SIGNAL_MAX_AMPLITUDE the maximal signal amplitude of the EEG slave
-
SIGNAL_RESOLUTION the signal resolution of the EEG slave
-
SAMPLING_RATE the sampling rate of the EEG slave
Functions
-
int32_t
read32BitFromBuffer(unsigned char *bufferIN) reads a 32bit float from the buffer received from the hardware
- Parameters
bufferIN – the buffer to read from
- Returns
data the variable to fill with data from the buffer
-
void
write32BitToBuffer(unsigned char *bufferOUT, unsigned int data) submits a 32bit float to the buffer to be sent to the hardware
- Parameters
bufferOUT – the buffer to write into
data – the data to write into the buffer
-
void
read_eegchannels_from_buffer(int32_t *eeg_sample, unsigned char *bufferIN) read all eeg channels from the buffer received from the hardware
- Parameters
bufferIN – the buffer used for reading
eeg_sample – will be written to: the array storing the values of the current EEG samples
-
void
get_trigger_states(int32_t *trigger_states, unsigned char *bufferIN) read the current state of all triggers from the buffer received from the hardware
- Parameters
trigger_states – the array to fill with the current states
bufferIN – the buffer used for reading*
-
int
start_buffering() start the IPC creates a client to an IPC process which will be used with
exchange_buffersto exchange the inward and outward bound buffers- Returns
client the IPC client managing the IObuffers
-
int
exchange_buffers(int client, unsigned char *bufferIN, unsigned char *bufferOUT) exchange the buffers
- Parameters
client – the IPC client managing the IObuffers
bufferIN – the buffer received from the hardware, used for reading
bufferOUT – the buffer sent to the hardware used for writing
Variables
-
const int
channeladdress[EEG_CHANNEL_COUNT] the memory address for the eeg channels in the iobuffer
EEG_CHANNEL_COUNT and actual addresses are defined in ecat_config.h