24 #ifndef SPIKEOBJECT_H_
25 #define SPIKEOBJECT_H_
30 #define MAX_NUMBER_OF_SPIKE_CHANNELS 4
31 #define MAX_NUMBER_OF_SPIKE_CHANNEL_SAMPLES 256
32 #define CHECK_BUFFER_VALIDITY true
33 #define SPIKE_EVENT_CODE 4;
42 uint16_t data[MAX_NUMBER_OF_SPIKE_CHANNELS * MAX_NUMBER_OF_SPIKE_CHANNEL_SAMPLES];
43 uint16_t gain[MAX_NUMBER_OF_SPIKE_CHANNELS];
44 uint16_t threshold[MAX_NUMBER_OF_SPIKE_CHANNELS];
64 int packSpike(
SpikeObject *s, uint8_t* buffer,
int bufferLength);
67 bool unpackSpike(
SpikeObject *s, uint8_t* buffer,
int bufferLength);
70 bool isBufferValid(uint8_t *buffer,
int bufferLength);
73 void makeBufferValid(uint8_t *buffer,
int bufferLength);
78 void generateSimulatedSpike(
SpikeObject *s, uint64_t timestamp,
int noise);
84 void generateEmptySpike(
SpikeObject *s,
int nChannels);
87 #endif //SPIKEOBJECT_H_