Open Ephys GUI
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Macros | Functions
SpikeObject.h File Reference
#include <iostream>
#include <stdint.h>
#include <math.h>

Classes

struct  SpikeObject
 Allows spikes to be transmitted between processors. More...

Macros

#define MAX_NUMBER_OF_SPIKE_CHANNELS   4
#define MAX_NUMBER_OF_SPIKE_CHANNEL_SAMPLES   60
#define CHECK_BUFFER_VALIDITY   true
#define SPIKE_EVENT_CODE   4;
#define MAX_SPIKE_BUFFER_LEN   512

Functions

int packSpike (SpikeObject *s, uint8_t *buffer, int bufferLength)
 Simple method for serializing a SpikeObject into a string of bytes, returns true is the packaged spike buffer is valid.
bool unpackSpike (SpikeObject *s, uint8_t *buffer, int bufferLength)
 Simple method for deserializing a string of bytes into a Spike object, returns true is the provided spike buffer is valid.
bool isBufferValid (uint8_t *buffer, int bufferLength)
 Checks the validity of the buffer, this should be run before unpacking the buffer.
void makeBufferValid (uint8_t *buffer, int bufferLength)
 Computes the validity value for the buffer, this should be called after packing the buffer.
void generateSimulatedSpike (SpikeObject *s, uint64_t timestamp, int noise)
 Helper function for generating fake spikes in the absence of a real spike source.
void generateEmptySpike (SpikeObject *s, int nChannels)
 Helper function for zeroing out a spike object with a specified number of channels.
void printSpike (SpikeObject *s)

Macro Definition Documentation

#define MAX_NUMBER_OF_SPIKE_CHANNELS   4
#define MAX_NUMBER_OF_SPIKE_CHANNEL_SAMPLES   60
#define CHECK_BUFFER_VALIDITY   true
#define SPIKE_EVENT_CODE   4;
#define MAX_SPIKE_BUFFER_LEN   512

Function Documentation

int packSpike ( SpikeObject s,
uint8_t *  buffer,
int  bufferLength 
)

Simple method for serializing a SpikeObject into a string of bytes, returns true is the packaged spike buffer is valid.

bool unpackSpike ( SpikeObject s,
uint8_t *  buffer,
int  bufferLength 
)

Simple method for deserializing a string of bytes into a Spike object, returns true is the provided spike buffer is valid.

bool isBufferValid ( uint8_t *  buffer,
int  bufferLength 
)

Checks the validity of the buffer, this should be run before unpacking the buffer.

void makeBufferValid ( uint8_t *  buffer,
int  bufferLength 
)

Computes the validity value for the buffer, this should be called after packing the buffer.

void generateSimulatedSpike ( SpikeObject s,
uint64_t  timestamp,
int  noise 
)

Helper function for generating fake spikes in the absence of a real spike source.

Can be used to generate a sign wave with a fixed Frequency of 1000 hz or a basic spike waveform Additionally noise can be added to the waveform for help in diagnosing projection plots

void generateEmptySpike ( SpikeObject s,
int  nChannels 
)

Helper function for zeroing out a spike object with a specified number of channels.

void printSpike ( SpikeObject s)