TecellaAmp.h File Reference


Data Structures

struct  tecella_lib_props
struct  tecella_hw_props
struct  tecella_reg_props
struct  tecella_stimulus_segment

Defines

#define TECELLA_ALLCHAN   0x8000
#define TECELLA_SOURCE_NONE   0
#define TECELLA_SOURCE_HEAD   1
#define TECELLA_SOURCE_MODEL1   2
#define TECELLA_SOURCE_MODEL2   3
#define TECELLA_GAIN_A   0
#define TECELLA_GAIN_B   1
#define TECELLA_GAIN_C   2
#define TECELLA_GAIN_D   3
#define CALL   __cdecl

Typedefs

typedef int TECELLA_HNDL
typedef struct tecella_lib_props TECELLA_LIB_PROPS
typedef struct tecella_hw_props TECELLA_HW_PROPS
typedef struct tecella_reg_props TECELLA_REG_PROPS
typedef struct
tecella_stimulus_segment 
TECELLA_STIMULUS_SEGMENT
typedef void(CALL * TECELLA_ERR_CB )(TECELLA_HNDL h, TECELLA_ERRNUM e, const wchar_t *msg)
typedef void(CALL * TECELLA_ACQUIRE_CB )(TECELLA_HNDL h, int channel, unsigned int samples_available)
typedef void(CALL * TECELLA_STIMULUS_CB )(TECELLA_HNDL h, int stimulus_index, unsigned long long timestamp)

Enumerations

enum  TECELLA_HW_MODEL {
  TECELLA_HW_MODEL_AUTO_DETECT, TECELLA_HW_MODEL_TRITON, TECELLA_HW_MODEL_TRITON_PLUS, TECELLA_HW_MODEL_JET,
  TECELLA_HW_MODEL_RICHMOND, TECELLA_HW_MODEL_PROTEUS, TECELLA_HW_MODEL_APOLLO, TECELLA_HW_MODEL_WALL_E
}
enum  TECELLA_REGISTER {
  TECELLA_REG_CFAST, TECELLA_REG_CSLOW_A, TECELLA_REG_CSLOW_B, TECELLA_REG_CSLOW_C,
  TECELLA_REG_CSLOW_D, TECELLA_REG_RSERIES, TECELLA_REG_LEAK, TECELLA_REG_JP
}
enum  TECELLA_STIMULUS_MODE { TECELLA_STIMULUS_MODE_VCMD, TECELLA_STIMULUS_MODE_ICMD, TECELLA_STIMULUS_MODE_OSCOPE }
enum  TECELLA_ERRNUM {
  TECELLA_ERR_OK = 0x000, TECELLA_ERR_NOT_IMPLEMENTED = 0x001, TECELLA_ERR_NOT_SUPPORTED = 0x002, TECELLA_ERR_BAD_HANDLE = 0x003,
  TECELLA_ERR_INVALID_CHANNEL = 0x004, TECELLA_ERR_INVALID_STIMULUS = 0x005, TECELLA_ERR_INVALID_CHOICE = 0x006, TECELLA_ERR_ALLCHAN_NOT_ALLOWED = 0x007,
  TECELLA_ERR_RETURN_POINTER_NULL = 0x008, TECELLA_ERR_ARGUMENT_POINTER_NULL = 0x009, TECELLA_ERR_VALUE_OUTSIDE_OF_RANGE = 0x00A, TECELLA_ERR_OKLIB_NOT_FOUND = 0x100,
  TECELLA_ERR_DEVICE_OPEN_FAILED = 0x101, TECELLA_ERR_DEVICE_INIT_FAILED = 0x102, TECELLA_ERR_STIMULUS_INVALID_SEGMENT_COUNT = 0x200, TECELLA_ERR_STIMULUS_INVALID_DURATION = 0x201,
  TECELLA_ERR_STIMULUS_INVALID_VALUE = 0x202, TECELLA_ERR_STIMULUS_INVALID_DURATION_DELTA = 0x203, TECELLA_ERR_STIMULUS_INVALID_VALUE_DELTA = 0x204, TECELLA_ERR_STIMULUS_INVALID_RAMP_STEP_COUNT = 0x205,
  TECELLA_ERR_STIMULUS_INVALID_RAMP_END_VALUE = 0x206, TECELLA_ERR_STIMULUS_INVALID_DELTA_COUNT = 0x207, TECELLA_ERR_STIMULUS_INVALID_REPEAT_COUNT = 0x208, TECELLA_ERR_STIMULUS_INVALID_SEGMENT_SEQUENCE = 0x209,
  TECELLA_ERR_INVALID_SAMPLE_PERIOD = 0x300, TECELLA_ERR_HW_BUFFER_OVERFLOW = 0x301, TECELLA_ERR_SW_BUFFER_OVERFLOW = 0x302, TECELLA_ERR_ACQ_CRC_FAILED = 0x303,
  TECELLA_ERR_CHANNEL_BUFFER_OVERFLOW = 0x304
}
enum  TECELLA_STIMULUS_SEGMENT_TYPE { TECELLA_STIMULUS_SEGMENT_SET, TECELLA_STIMULUS_SEGMENT_DELTA, TECELLA_STIMULUS_SEGMENT_RAMP }

Functions

DLLEXPORT TECELLA_ERRNUM CALL tecella_debug (char *logfile)
DLLEXPORT TECELLA_ERRNUM CALL tecella_initialize (TECELLA_HNDL *h, TECELLA_HW_MODEL hw_model=TECELLA_HW_MODEL_AUTO_DETECT)
DLLEXPORT TECELLA_ERRNUM CALL tecella_finalize (TECELLA_HNDL h)
DLLEXPORT TECELLA_ERRNUM CALL tecella_set_stimulus_mode (TECELLA_HNDL h, TECELLA_STIMULUS_MODE mode)
DLLEXPORT TECELLA_ERRNUM CALL tecella_get_stimulus_mode (TECELLA_HNDL h, TECELLA_STIMULUS_MODE *mode)
DLLEXPORT TECELLA_ERRNUM CALL tecella_get_lib_props (TECELLA_LIB_PROPS *props)
DLLEXPORT TECELLA_ERRNUM CALL tecella_get_hw_props (TECELLA_HNDL h, TECELLA_HW_PROPS *props)
DLLEXPORT TECELLA_ERRNUM CALL tecella_get_reg_props (TECELLA_HNDL h, TECELLA_REGISTER r, TECELLA_REG_PROPS *props)
DLLEXPORT TECELLA_ERRNUM CALL tecella_get_gain_label (TECELLA_HNDL h, int gain_index, const wchar_t **label)
DLLEXPORT TECELLA_ERRNUM CALL tecella_get_source_label (TECELLA_HNDL h, int source_index, const wchar_t **label)
DLLEXPORT const wchar_t *CALL tecella_error_message (TECELLA_ERRNUM errnum)
DLLEXPORT TECELLA_ERRNUM CALL tecella_error_set_callback (TECELLA_HNDL h, TECELLA_ERR_CB f)
DLLEXPORT TECELLA_ERRNUM CALL tecella_diagnostics_run (TECELLA_HNDL h, int *pass_count, int *fail_count)
DLLEXPORT TECELLA_ERRNUM CALL tecella_diagnostics_get_pass (TECELLA_HNDL h, int pass_index, const wchar_t **msg)
DLLEXPORT TECELLA_ERRNUM CALL tecella_diagnostics_get_failure (TECELLA_HNDL h, int fail_index, const wchar_t **msg)
DLLEXPORT TECELLA_ERRNUM CALL tecella_utility_dac_set (TECELLA_HNDL h, double value, int index=0)
DLLEXPORT TECELLA_ERRNUM CALL tecella_utility_trigger_out (TECELLA_HNDL h, int index)
DLLEXPORT TECELLA_ERRNUM CALL tecella_utility_set_stimulus (TECELLA_HNDL h, int channel, int stimulus_index)
DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_set_source (TECELLA_HNDL h, int channel, int choice)
DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_get_source (TECELLA_HNDL h, int channel, int *choice)
DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_set_gain (TECELLA_HNDL h, int channel, int choice)
DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_get_gain (TECELLA_HNDL h, int channel, int *choice)
DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_set_stimulus (TECELLA_HNDL h, int channel, int choice)
DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_get_stimulus (TECELLA_HNDL h, int channel, int *choice)
DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_set (TECELLA_HNDL h, TECELLA_REGISTER r, int channel, double value)
DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_get (TECELLA_HNDL h, TECELLA_REGISTER r, int channel, double *value)
DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_set_pct (TECELLA_HNDL h, TECELLA_REGISTER r, int channel, double pct)
DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_get_pct (TECELLA_HNDL h, TECELLA_REGISTER r, int channel, double *pct)
DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_set_enable (TECELLA_HNDL h, TECELLA_REGISTER r, int channel, bool enable)
DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_get_enable (TECELLA_HNDL h, TECELLA_REGISTER r, int channel, bool *enable)
DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_set_bessel (TECELLA_HNDL h, int channel, int value)
DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_get_bessel (TECELLA_HNDL h, int channel, int *value)
DLLEXPORT TECELLA_ERRNUM CALL tecella_bessel_value2freq (TECELLA_HNDL h, int value, double *kHz)
DLLEXPORT TECELLA_ERRNUM CALL tecella_bessel_freq2value (TECELLA_HNDL h, double kHz, int *choice)
DLLEXPORT TECELLA_ERRNUM CALL tecella_stimulus_set_hold (TECELLA_HNDL h, double value, int index=0)
DLLEXPORT TECELLA_ERRNUM CALL tecella_stimulus_set (TECELLA_HNDL h, TECELLA_STIMULUS_SEGMENT *segments, int segment_count, int delta_count=1, int repeat_count=1, int index=0)
DLLEXPORT TECELLA_ERRNUM CALL tecella_stimulus_get (TECELLA_HNDL h, TECELLA_STIMULUS_SEGMENT *segments, int segments_max, int *segments_in_stimulus, int *delta_count, int *repeat_count, int index=0)
DLLEXPORT TECELLA_ERRNUM CALL tecella_stimulus_set_callback (TECELLA_HNDL h, TECELLA_STIMULUS_CB f)
DLLEXPORT unsigned long long CALL tecella_stimulus_index_sample_count (TECELLA_HNDL h, int index, double sample_period)
DLLEXPORT unsigned long long CALL tecella_stimulus_sample_count (TECELLA_HNDL h, TECELLA_STIMULUS_SEGMENT *segments, int segment_count, int delta_count, int repeat_count, double sample_period)
DLLEXPORT unsigned int CALL tecella_stimulus_sample_count_partial (TECELLA_HNDL h, TECELLA_STIMULUS_SEGMENT *segments, int segment_count, int delta_iteration, double sample_period)
DLLEXPORT TECELLA_ERRNUM CALL tecella_stimulus_zap (TECELLA_HNDL h, double duration, double amplitude, int *channels=0, int channel_count=0)
DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_scale (TECELLA_HNDL h, bool enable)
DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_calibrate (TECELLA_HNDL h, bool enable)
DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_offset (TECELLA_HNDL h, double jp_delta=0, int unused_stimulus_index=0)
DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_comp (TECELLA_HNDL h, double v_hold=0, double v_amplitude=10e-3, bool use_leak=true, bool use_cfast=true, bool use_cslow_a=true, bool use_cslow_b=true, bool use_cslow_c=true, bool use_cslow_d=true, int unused_stimulus_index=0)
DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_artifact_update (TECELLA_HNDL h, double v_hold=0, double v_step=10e-3, int iterations=10, int unused_stimulus_index=0)
DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_artifact_enable (TECELLA_HNDL h, bool enable=true, int stimulus_index=0)
DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_set_callback (TECELLA_HNDL h, TECELLA_ACQUIRE_CB f, unsigned int period=1024)
DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_enable_channel (TECELLA_HNDL h, int channel, bool enable)
DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_set_buffer_size (TECELLA_HNDL h, unsigned int samples_per_chan)
DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_start (TECELLA_HNDL h, double sample_period, bool continuous=false, bool start_stimuli=true, bool continuous_stimuli=true, bool start_on_trigger=false)
DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_start_stimulus (TECELLA_HNDL h, int stimulus_index, bool start=true, bool continuous=false, int sample_period_multiplier=1)
DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_start_stimuli (TECELLA_HNDL h, int *stimulus_indexes, int stimulus_count, bool start=true, bool continuous=false, int sample_period_multiplier=1)
DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_stop_stimulus (TECELLA_HNDL h, int stimulus_index, bool continuous=false)
DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_stop (TECELLA_HNDL h)
DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_samples_available (TECELLA_HNDL h, int chan, unsigned int *samples_available)
DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_read_d (TECELLA_HNDL h, int chan, int requested_samples, double *data, unsigned int *actual_samples, unsigned long long *first_sample_timestamp, bool *last_sample_flag)
DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_read_i (TECELLA_HNDL h, int chan, int requested_samples, short *data, unsigned int *actual_samples, unsigned long long *first_sample_timestamp, bool *last_sample_flag)
DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_i2d_scale (TECELLA_HNDL h, int chan, double *scale)

Define Documentation

#define CALL   __cdecl

#define TECELLA_ALLCHAN   0x8000

Use this in place of a channel number to indicate all channels.

#define TECELLA_GAIN_A   0

#define TECELLA_GAIN_B   1

#define TECELLA_GAIN_C   2

#define TECELLA_GAIN_D   3

#define TECELLA_SOURCE_HEAD   1

Tells tecella_chan_set_source() to use the regular head inputs. (Default)

#define TECELLA_SOURCE_MODEL1   2

Tells tecella_chan_set_source() to use the internal model cell. May or may not be supported, see tecella_get_hw_props().

#define TECELLA_SOURCE_MODEL2   3

Tells tecella_chan_set_source() to use no input. May or may not be supported, see tecella_get_hw_props().

#define TECELLA_SOURCE_NONE   0

Tells tecella_chan_set_source() to use no input


Typedef Documentation

typedef void(CALL * TECELLA_ACQUIRE_CB)(TECELLA_HNDL h, int channel, unsigned int samples_available)

typedef void(CALL * TECELLA_ERR_CB)(TECELLA_HNDL h, TECELLA_ERRNUM e, const wchar_t *msg)

typedef int TECELLA_HNDL

A device handle to let the API know which device you're addressing.

tecella_hw_props Properties of the connected device. For use with tecella_get_hw_props().

tecella_lib_props Represents the version of the DLL being used. For use with tecella_get_lib_props().

tecella_reg_props Provides useful information about a register for a specific device. For use with tecella_get_reg_props().

typedef void(CALL * TECELLA_STIMULUS_CB)(TECELLA_HNDL h, int stimulus_index, unsigned long long timestamp)

tecella_stimulus_segment Create an array of these and pass it to tecella_vcmd_set().


Enumeration Type Documentation

TECELLA_ERRNUM All functions in this API return one of these error values.

Enumerator:
TECELLA_ERR_OK 
TECELLA_ERR_NOT_IMPLEMENTED 
TECELLA_ERR_NOT_SUPPORTED 
TECELLA_ERR_BAD_HANDLE 
TECELLA_ERR_INVALID_CHANNEL 
TECELLA_ERR_INVALID_STIMULUS 
TECELLA_ERR_INVALID_CHOICE 
TECELLA_ERR_ALLCHAN_NOT_ALLOWED 
TECELLA_ERR_RETURN_POINTER_NULL 
TECELLA_ERR_ARGUMENT_POINTER_NULL 
TECELLA_ERR_VALUE_OUTSIDE_OF_RANGE 
TECELLA_ERR_OKLIB_NOT_FOUND 
TECELLA_ERR_DEVICE_OPEN_FAILED 
TECELLA_ERR_DEVICE_INIT_FAILED 
TECELLA_ERR_STIMULUS_INVALID_SEGMENT_COUNT 
TECELLA_ERR_STIMULUS_INVALID_DURATION 
TECELLA_ERR_STIMULUS_INVALID_VALUE 
TECELLA_ERR_STIMULUS_INVALID_DURATION_DELTA 
TECELLA_ERR_STIMULUS_INVALID_VALUE_DELTA 
TECELLA_ERR_STIMULUS_INVALID_RAMP_STEP_COUNT 
TECELLA_ERR_STIMULUS_INVALID_RAMP_END_VALUE 
TECELLA_ERR_STIMULUS_INVALID_DELTA_COUNT 
TECELLA_ERR_STIMULUS_INVALID_REPEAT_COUNT 
TECELLA_ERR_STIMULUS_INVALID_SEGMENT_SEQUENCE 
TECELLA_ERR_INVALID_SAMPLE_PERIOD 
TECELLA_ERR_HW_BUFFER_OVERFLOW 
TECELLA_ERR_SW_BUFFER_OVERFLOW 
TECELLA_ERR_ACQ_CRC_FAILED 
TECELLA_ERR_CHANNEL_BUFFER_OVERFLOW 

TECELLA_HW_MODEL Specifies the type of device we're connected to or want to connect to. Use in conjunction with tecella_initialize() and tecella_get_hw_props().

Enumerator:
TECELLA_HW_MODEL_AUTO_DETECT 
TECELLA_HW_MODEL_TRITON 
TECELLA_HW_MODEL_TRITON_PLUS 
TECELLA_HW_MODEL_JET 
TECELLA_HW_MODEL_RICHMOND 
TECELLA_HW_MODEL_PROTEUS 
TECELLA_HW_MODEL_APOLLO 
TECELLA_HW_MODEL_WALL_E 

TECELLA_REGISTER An enumeration of all per-channel settings that may exist on a device. To see if a setting is supported by the device, use tecella_get_reg_props().

Enumerator:
TECELLA_REG_CFAST 
TECELLA_REG_CSLOW_A 
TECELLA_REG_CSLOW_B 
TECELLA_REG_CSLOW_C 
TECELLA_REG_CSLOW_D 
TECELLA_REG_RSERIES 
TECELLA_REG_LEAK 
TECELLA_REG_JP 

TECELLA_STIMULUS_MODE An enumeration of all stimulus+recording modes that may exist for a device. See tecella_hw_props to determine what modes are actually supported by a device.

Enumerator:
TECELLA_STIMULUS_MODE_VCMD  A voltage stimulus is applied and the current response is acquired.
TECELLA_STIMULUS_MODE_ICMD  A current stimulus is applied and voltage response is acquired.
TECELLA_STIMULUS_MODE_OSCOPE  No stimulus is applied and voltage is acquired.

TECELLA_STIMULUS_SEGMENT_TYPE Specifies the segment type in tecella_stimulus_segment. RAMP is not currently supported.

Enumerator:
TECELLA_STIMULUS_SEGMENT_SET  A flat segment.
TECELLA_STIMULUS_SEGMENT_DELTA  A flat segment that changes its amplitude and/or duration after each iteration.
TECELLA_STIMULUS_SEGMENT_RAMP  A segment that interpolates from one amplitude to another over a fixed duration.


Function Documentation

DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_enable_channel ( TECELLA_HNDL  h,
int  channel,
bool  enable 
)

Enables or disables acquisition for a channel. All channels are enabled by default.

Parameters:
h A handle to an initialized device.
channel The channel to enable or disable.
enable If true, capture. If false, don't.

DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_i2d_scale ( TECELLA_HNDL  h,
int  chan,
double *  scale 
)

Gets the current multiplier used to convert a 16 bit short sample to Amps.

Parameters:
h A handle to an initialized device.
chan The specified channel. TECELLA_ALLCHAN cannot be used with this function.
scale The return argument for the Amp multiplier.

DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_read_d ( TECELLA_HNDL  h,
int  chan,
int  requested_samples,
double *  data,
unsigned int *  actual_samples,
unsigned long long *  first_sample_timestamp,
bool *  last_sample_flag 
)

Reads samples from the queue as double-precision floats whose units are in Amps. Once the requested data has been returned, it no longer resides in the queue and cannot be retrieved again. All samples returned by a single call are continuous. A call to this function will block until the number of requested_samples are available or until acqusition is complete. To ensure this function is a non-blocking request use the number of samples returned by tecella_acquire_samples_available(). To recover from any acquisition error, call tecella_acquire_stop() and tecella_acquire_start() again. It is not necessary to re-initialize the entire hardware.

Parameters:
h A handle to an initialized device.
chan The specified channel. TECELLA_ALLCHAN cannot be used with this function.
requested_samples The number of samples the user would like to have copied to data.
data A pointer to an array of doubles, at least of size requested_samples.
actual_samples Used to return how many samples were actually acquired, in the case acquisition is complete.
first_sample_timestamp Timestamp of the first sample. The timestamp increments by 1 for each sample period after the last call to tecella_acquire_start(). (To be implemented.)
last_sample_flag Indicates breaks in acquisition (samples after the last sample returned will not be captured). To be implemented.
Returns:
TECELLA_ERR_OK If the read completed successfully.

TECELLA_ERR_SW_BUFFER_OVERFLOW If the software buffers have been filled.

TECELLA_ERR_HW_BUFFER_OVERFLOW If the hardware buffers have overflowed.

TECELLA_ERR_ACQ_CRC_FAILED If the data stream was corrupted. (Not implemented yet)

DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_read_i ( TECELLA_HNDL  h,
int  chan,
int  requested_samples,
short *  data,
unsigned int *  actual_samples,
unsigned long long *  first_sample_timestamp,
bool *  last_sample_flag 
)

Reads samples from the queue as 16 bit integers whose units can be retrieved using tecella_acquire_i2d_scale(). Once the requested data has been returned, it no longer resides in the queue and cannot be retrieved again. A call to this function will block until the number of requested_samples are available or until acqusition is complete. To ensure this function is a non-blocking request use the number of samples returned by tecella_acquire_samples_available(). To recover from any acquisition error, call tecella_acquire_stop() and tecella_acquire_start() again. It is not necessary to re-initialize the entire hardware.

Parameters:
h A handle to an initialized device.
chan The specified channel. TECELLA_ALLCHAN cannot be used with this function.
requested_samples The number of samples the user would like to have copied to data.
data A pointer to an array of shorts, at least of size requested_samples.
actual_samples Used to return how many samples were actually acquired, in the case acquisition is complete.
first_sample_timestamp Timestamp of the first sample. The timestamp increments by 1 for each sample period after the last call to tecella_acquire_start(). (To be implemented.)
last_sample_flag Indicates breaks in acquisition (samples after the last sample returned will not be captured). To be implemented.
Returns:
TECELLA_ERR_OK If the read completed successfully.

TECELLA_ERR_SW_BUFFER_OVERFLOW If the software buffers have been filled.

TECELLA_ERR_HW_BUFFER_OVERFLOW If the hardware buffers have overflowed.

TECELLA_ERR_ACQ_CRC_FAILED If the data stream was corrupted. (Not implemented yet)

DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_samples_available ( TECELLA_HNDL  h,
int  chan,
unsigned int *  samples_available 
)

Gets the current number of samples in the queue for the given channel.

Parameters:
h A handle to an initialized device.
chan The specified channel. If TECELLA_ALLCHAN is specified, this function returns the minimum samples available across all channels.
samples_available The number of samples available are returned in this variable.

DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_set_buffer_size ( TECELLA_HNDL  h,
unsigned int  samples_per_chan 
)

Pre-allocates an internal per-channel software queue for acquisition.

Parameters:
h A handle to an initialized device.
samples_per_chan Maximum number of samples per channel to allow in the queue.

DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_set_callback ( TECELLA_HNDL  h,
TECELLA_ACQUIRE_CB  f,
unsigned int  period = 1024 
)

Sets a callback function to be called whenever there is new data for any channel.

Parameters:
h A handle to an initialized device.
f The acquire callback function.
period The number of samples received in a channel before a notification is sent. The number of samples notified may be less if any stimulus starts before the period has been reached or if acquisition has stopped for a particular channel.

DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_start ( TECELLA_HNDL  h,
double  sample_period,
bool  continuous = false,
bool  start_stimuli = true,
bool  continuous_stimuli = true,
bool  start_on_trigger = false 
)

Sets up an acquisition and returns once the acquisition has begun. When the function returns, an internal thread runs asynchronously that constantly pulls data from the device and pushes it into the internal queue.

Parameters:
h A handle to an initialized device.
sample_period The requested sample period in seconds. See tecella_get_hw_props() for valid ranges.
continuous If true, acquisition continues until tecella_acquire_stop() is called. If false, acquisition continues for as long as the longest programmed stimulus or until tecella_acquire_stop() is called.
start_stimuli Valid only if continuous is true. If true, all stimuli start playing at the start of acquisition and also capture continuously if continuous_stimuli is ture. To use different options for different stimuli set both continuous_stimuli and start_stimuli to false and call tecella_acquire_start_stimulus() for each stimulus before calling tecella_acquire_start().
continuous_stimuli Valid only if continuous is true. If true, all stimuli will capture continuously and also start playing if start_stimuli is true. To use different options for different stimuli set both continuous_stimuli and start_stimuli to false and call tecella_acquire_start_stimulus() for each stimulus before calling tecella_acquire_start().
start_on_trigger If true, acquisition will not start until an external hardware trigger is detected.

DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_start_stimuli ( TECELLA_HNDL  h,
int *  stimulus_indexes,
int  stimulus_count,
bool  start = true,
bool  continuous = false,
int  sample_period_multiplier = 1 
)

Starts one or more stimuli and starts acquiring data for the associated channels that are also enabled. tecella_acquire_start() must be called first, with continuous=true. There are three modes available when calling tecella_acquire_start_stimulus(): Mode0) If start=false and continuous=false, tecella_acquire_start does nothing. Mode1) If start=false and continuous=true, you can acquire data continuously without starting the stimulus. Mode2) If start=true and continuous=false, only the samples that are part of the stimulus will be acquired. Mode3) If start=true and continuous=true, acquisition will start when the stimulus starts but then continue acquiring after the stimulus has ended, until tecella_acquire_stop_stimulus() is called.

Parameters:
h A handle to an initialized device.
stimulus_indexes A pointer to an array of stimulus indexes to start acquiring for.
stimulus_count The size of the array pointed to by stimulus_indexes.
start If true, the vcmd plays at the start of acquisition.
continuous If true, acquisition starts and continues until tecella_acquire_stop_stimulus() is called. If false, acquisition only occurs while the stimlus is playing or until tecella_acquire_stop() is called.
sample_period_multiplier Multiplies the base sample period (specified in tecella_acquire_start()) by this number.

DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_start_stimulus ( TECELLA_HNDL  h,
int  stimulus_index,
bool  start = true,
bool  continuous = false,
int  sample_period_multiplier = 1 
)

Starts a stimulus and starts acquiring data for the associated channels that are also enabled. tecella_acquire_start() must be called first, with continuous=true. There are three modes available when calling tecella_acquire_start_stimulus(): Mode0) If start=false and continuous=false, tecella_acquire_start does nothing. Mode1) If start=false and continuous=true, you can acquire data continuously without starting the stimulus. Mode2) If start=true and continuous=false, only the samples that are part of the stimulus will be acquired. Mode3) If start=true and continuous=true, acquisition will start when the stimulus starts but then continue acquiring after the stimulus has ended, until tecella_acquire_stop_stimulus() is called.

Parameters:
h A handle to an initialized device.
stimulus_index The stimulus to start acquiring for.
start If true, the vcmd plays at the start of acquisition.
continuous If true, acquisition starts and continues until tecella_acquire_stop_stimulus() is called. If false, acquisition only occurs while the stimlus is playing or until tecella_acquire_stop() is called.
sample_period_multiplier Multiplies the base sample period (specified in tecella_acquire_start()) by this number.

DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_stop ( TECELLA_HNDL  h  ) 

Stops the current acquistion and all stimuli. Sends a message to the acquisition thread to stop and returns immediately.

Parameters:
h A handle to an initialized device.

DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_stop_stimulus ( TECELLA_HNDL  h,
int  stimulus_index,
bool  continuous = false 
)

Stops a stimulus and stops acquiring data for the associated channels that are also enabled. Valid only in asynchronous stimulus mode. Note: not implemented as of release 0.101.1.

Parameters:
h A handle to an initialized device.
stimulus_index The stimulus to stop.
continuous If true, associated channels will continue acquiring even after stimulus has stopped.

DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_artifact_enable ( TECELLA_HNDL  h,
bool  enable = true,
int  stimulus_index = 0 
)

Enables/disables artifact removal. Does nothing if tecella_auto_artifact() hasn't been called.

DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_artifact_update ( TECELLA_HNDL  h,
double  v_hold = 0,
double  v_step = 10e-3,
int  iterations = 10,
int  unused_stimulus_index = 0 
)

Records artifacts that remain after auto compensation so that they can be removed automatically. Artifacts must be updated whenever there's a change in gain or the compensations.

DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_calibrate ( TECELLA_HNDL  h,
bool  enable 
)

This calibrates any input offsets due to component tolerances WITHIN the amplifier. Make sure source is set to OPEN to isolate any external interference. You should only need need to run this once after initialization. A 0mV stimulus is played to establish a "tare" value for acquisitions on a per-channel basis. Subsequent acquisitions are adjusted by these per-channel tare values. Only channels that are enabled by tecella_acquire_enable_channel() will be affected by a call to this function. This function may not be used while acquiring.

Parameters:
h A handle to an initialized device.
enable Indicates whether we are enabling/disabling the offset.

DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_comp ( TECELLA_HNDL  h,
double  v_hold = 0,
double  v_amplitude = 10e-3,
bool  use_leak = true,
bool  use_cfast = true,
bool  use_cslow_a = true,
bool  use_cslow_b = true,
bool  use_cslow_c = true,
bool  use_cslow_d = true,
int  unused_stimulus_index = 0 
)

Sets values for leak, cfast, and all the cslows that will compensate for parasitics in the response. All channels associated with the stimulus will be calibrated unless disabled using the function tecella_acquire_enable_channel(). If there's only 1 stimulus, this function cannot be used while acquiring. If there is more than 1 stimulus, this function may be used while acquiring in continuous mode as long as the unused_stimulus_index is not acquiring.

Parameters:
h A handle to an initialized device.
v_hold The holding voltage used by the auto comp algorithm.
v_amplitude The amplitude of the test pulse used by the auto compensation algorithm.
use_leak If true, algorithm will compensate for leak if supported by the hardware.
use_cfast If true, algorithm will compensate using cfast if supported by the hardware. If false, cfast will remain untouched.
use_cslow_a If true, algorithm will compensate using cslowa if supported by the hardware. If false, cslowa will remain untouched.
use_cslow_b If true, algorithm will compensate using cslowb if supported by the hardware. If false, cslowb will remain untouched.
use_cslow_c If true, algorithm will compensate using cslowc if supported by the hardware. If false, cslowc will remain untouched.
use_cslow_d If true, algorithm will compensate using cslowd if supported by the hardware. If false, cslowd will remain untouched.
unused_stimulus_index An unused stimulus the algorithm can use for calibration.

DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_offset ( TECELLA_HNDL  h,
double  jp_delta = 0,
int  unused_stimulus_index = 0 
)

This function adds an offset to the stimulus to compensate for junction potentials or other battery effects EXTERNAL to the amplifier. This is accomplished by adjusting the JP register for each channel such that the measured current is as close to 0 Amps as possible for a 0 Volt stimulus. Make sure tecella_auto_calibrate() has already been run to isolate any internal interference. All channels associated with the unused_stimulus_index will be calibrated unless disabled using the function tecella_acquire_enable_channel().

Parameters:
h A handle to an initialized device.
jp_delta Auto offset uses jp=0mV and jp=(jp_delta)mV to determine the best jp per channel. 0 indicates don't care. This does not limit the final jp value, it only limits the jp values used to calculate the final jp value.
unused_stimulus_index A stimulus index that is not currently playing. JP will be calculated for any channels associated with this stimulus.

DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_scale ( TECELLA_HNDL  h,
bool  enable 
)

Internally calibrates the gain settings to be within 1% tolerance. Some gain feedback resistors have greater than 1% tolerance and must be calibrated to be within specification. Only channels that are enabled by tecella_acquire_enable_channel() will be affected by a call to this function. You should only need need to run this once after initialization. This function may not be used while acquiring.

Parameters:
h A handle to an initialized device.
enable Indicates whether we are enabling/disabling the auto scale. If disabled, the ideal scales will be used, whether or not they are off.

DLLEXPORT TECELLA_ERRNUM CALL tecella_bessel_freq2value ( TECELLA_HNDL  h,
double  kHz,
int *  choice 
)

Returns the best choice for a bessel filter cuttoff frequency.

DLLEXPORT TECELLA_ERRNUM CALL tecella_bessel_value2freq ( TECELLA_HNDL  h,
int  value,
double *  kHz 
)

Returns the frequency of a bessel filter cuttoff choice.

DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_get ( TECELLA_HNDL  h,
TECELLA_REGISTER  r,
int  channel,
double *  value 
)

Gets a register (property) of a channel. See tecella_reg_props(), to determine if a particular register is supported by the current hardware and to retreive other properties such as valid value ranges and precision.

Parameters:
h A handle to an initialized device.
r Which register to get.
channel A channel. TECELLA_ALLCHAN may not be used as a shortcut here.
value Returns the value of the register..

DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_get_bessel ( TECELLA_HNDL  h,
int  channel,
int *  value 
)

Gets the cuttoff frequency choice for the bessel filter. Note that an integer value is taken in to re-enforce the fact that the bessel filter cuttoff frequency is a non-linear function of the value being passed in. To see what frequency a choice corresponds to, use tecella_bessel_value2freq() / tecella_bessel_freq2value(). See tecella_get_hw_props(), to determine if bessel is supported and to see how many cuttoff frequency choices there are.

Parameters:
h A handle to an initialized device.
channel A channel. TECELLA_ALLCHAN may be used as a shortcut here.
value Which cuttoff frequency is selected select.

DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_get_enable ( TECELLA_HNDL  h,
TECELLA_REGISTER  r,
int  channel,
bool *  enable 
)

Gets if a register (property) of a channel is enabled. See tecella_reg_props(), to determine if a particular register can be enabled/disabled.

Parameters:
h A handle to an initialized device.
r Which register to determine is enabled or not.
channel A channel. TECELLA_ALLCHAN may not be used as a shortcut here.
enable Returns if the register is enabled or not.

DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_get_gain ( TECELLA_HNDL  h,
int  channel,
int *  choice 
)

Get the currently selected gain for a given channel.

Parameters:
h A handle to an initialized device.
channel A channel. TECELLA_ALLCHAN may not be used as a shortcut here.
choice Returns which gain is selected. See tecella_get_hw_props() for valid values. See tecella_get_source_label() for what a value means.

DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_get_pct ( TECELLA_HNDL  h,
TECELLA_REGISTER  r,
int  channel,
double *  pct 
)

A convenience function for tecella_chan_get() that returns a percent instead of an actual value.

DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_get_source ( TECELLA_HNDL  h,
int  channel,
int *  choice 
)

Get the currently selected source for a given channel.

Parameters:
h A handle to an initialized device.
channel A channel. TECELLA_ALLCHAN may not be used as a shortcut here.
choice Returns which source is selected. See tecella_get_hw_props() for valid values. See tecella_get_source_label() for what a value means.

DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_get_stimulus ( TECELLA_HNDL  h,
int  channel,
int *  choice 
)

Get the currently selected stimulus for a given channel. Applicable only for devices that support multiple stimuli [see tecella_get_hw_props()].

Parameters:
h A handle to an initialized device.
channel A channel. TECELLA_ALLCHAN may not be used as a shortcut here.
choice Returns which gain is selected. See tecella_get_hw_props() for valid values. See tecella_get_source_label() for what a value means.

DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_set ( TECELLA_HNDL  h,
TECELLA_REGISTER  r,
int  channel,
double  value 
)

Sets a register (property) of a channel. See tecella_reg_props(), to determine if a particular register is supported by the current hardware and to retreive other properties such as valid value ranges and precision.

Parameters:
h A handle to an initialized device.
r Which register to change.
channel A channel. TECELLA_ALLCHAN can be used as a shortcut here.
value The value to change the register to.

DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_set_bessel ( TECELLA_HNDL  h,
int  channel,
int  value 
)

Chooses a cuttoff frequency for the bessel filter. Note that an integer value is taken in to re-enforce the fact that the bessel filter cuttoff frequency is a non-linear function of the value being passed in. To see what frequency a choice corresponds to, use tecella_bessel_value2freq() / tecella_bessel_freq2value(). See tecella_get_hw_props(), to determine if bessel is supported and to see how many cuttoff frequency choices there are.

Parameters:
h A handle to an initialized device.
channel A channel. TECELLA_ALLCHAN may be used as a shortcut here.
value Which cuttoff frequency to select.

DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_set_enable ( TECELLA_HNDL  h,
TECELLA_REGISTER  r,
int  channel,
bool  enable 
)

Enables/disables a register (property) of a channel. See tecella_reg_props(), to determine if a particular register can be enabled/disabled.

Parameters:
h A handle to an initialized device.
r Which register to determine enable/disable.
channel A channel. TECELLA_ALLCHAN may be used as a shortcut here.
enable If true, enables the register. Disables if false.

DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_set_gain ( TECELLA_HNDL  h,
int  channel,
int  choice 
)

Chooses which gain to use for a given channel.

Parameters:
h A handle to an initialized device.
channel The channel to change. TECELLA_ALLCHAN can be used as a shortcut here.
choice Which gain to use. See tecella_get_hw_props() for valid values. See tecella_get_gain_label() for what a value means.

DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_set_pct ( TECELLA_HNDL  h,
TECELLA_REGISTER  r,
int  channel,
double  pct 
)

A convenience function for tecella_chan_set() that takes in a percent instead of an actual value.

DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_set_source ( TECELLA_HNDL  h,
int  channel,
int  choice 
)

Chooses which source to measure from for a given channel.

Parameters:
h A handle to an initialized device.
channel The channel to change. TECELLA_ALLCHAN can be used as a shortcut here.
choice Which source to use. See tecella_get_hw_props() for valid values. See tecella_get_source_label() for what a value means.

DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_set_stimulus ( TECELLA_HNDL  h,
int  channel,
int  choice 
)

Chooses which stimulus to use for a given channel. Applicable only for devices that support multiple stimuli [see tecella_get_hw_props()], otherwise the only choice is '0'.

Parameters:
h A handle to an initialized device.
channel The channel to change. TECELLA_ALLCHAN can be used as a shortcut here.
choice Which stimulus to use. See tecella_get_hw_props() for valid values. See tecella_get_gain_label() for what a value means.

DLLEXPORT TECELLA_ERRNUM CALL tecella_debug ( char *  logfile  ) 

Turns debug mode on/off

Parameters:
logfile The filename of the debug log. An empty filename "" turns debug off.

DLLEXPORT TECELLA_ERRNUM CALL tecella_diagnostics_get_failure ( TECELLA_HNDL  h,
int  fail_index,
const wchar_t **  msg 
)

Returns messages of failed tests after running tecella_diagnostics_run().

Parameters:
h A handle to an initialized device.
fail_index An index in the range [0,fail_count), as returned by tecella_diagnostics_run().
msg A return argument for the null-terminated text of the failure. Pointer remains valid until the next call to tecella_diagnostics_run() with the same handle.

DLLEXPORT TECELLA_ERRNUM CALL tecella_diagnostics_get_pass ( TECELLA_HNDL  h,
int  pass_index,
const wchar_t **  msg 
)

Returns messages of passing tests after running tecella_diagnostics_run().

Parameters:
h A handle to an initialized device.
pass_index An index in the range [0,pass_count), as returned by tecella_diagnostics_run().
msg A return argument for the null-terminated text describing the test. Pointer remains valid until the next call to tecella_diagnostics_run() with the same handle.

DLLEXPORT TECELLA_ERRNUM CALL tecella_diagnostics_run ( TECELLA_HNDL  h,
int *  pass_count,
int *  fail_count 
)

Performs hardware diagnostics / sanity checks to make sure hardware is functional. To get actual warning/error messages, call tecella_diagnostics_run_get_pass() or tecella_diagnostics_get_failure().

Parameters:
h A handle to an initialized device.
pass_count A return argument for the number of warnings reported.
fail_count A return argument for the number of errors reported.

DLLEXPORT const wchar_t* CALL tecella_error_message ( TECELLA_ERRNUM  errnum  ) 

Retreives the message string associated with an error value.

Parameters:
errnum The error returned by any of the API functions.
Returns:
The message string.

DLLEXPORT TECELLA_ERRNUM CALL tecella_error_set_callback ( TECELLA_HNDL  h,
TECELLA_ERR_CB  f 
)

Sets a callback function to be called upon an error.

Parameters:
h A handle to an initialized device.
f The error callback function.

DLLEXPORT TECELLA_ERRNUM CALL tecella_finalize ( TECELLA_HNDL  h  ) 

Closes a device gracefully and deallocates any memory associated with it.

Parameters:
h A handle to an initialized device.

DLLEXPORT TECELLA_ERRNUM CALL tecella_get_gain_label ( TECELLA_HNDL  h,
int  gain_index,
const wchar_t **  label 
)

Retreives a label for a specific gain choice for use in a GUI. This will provide more useful information to the user about which gain is currently selected specific to their device.

Parameters:
h A handle to an initialized device.
gain_index The gain choice (eg TECELLA_GAIN_A).
label A return argument for the label string.
Note:
Not yet implemented.

DLLEXPORT TECELLA_ERRNUM CALL tecella_get_hw_props ( TECELLA_HNDL  h,
TECELLA_HW_PROPS props 
)

Retreives properties of the current hardware and firmware being used.

Note:
Not all fields in props are set by this function yet. This will be fixed in a future release.
Parameters:
h A handle to an initialized device.
props A pointer to the hardware/firmware properties.

DLLEXPORT TECELLA_ERRNUM CALL tecella_get_lib_props ( TECELLA_LIB_PROPS props  ) 

Retreives the current version of the DLL being used.

Parameters:
props A pointer to the library properties.

DLLEXPORT TECELLA_ERRNUM CALL tecella_get_reg_props ( TECELLA_HNDL  h,
TECELLA_REGISTER  r,
TECELLA_REG_PROPS props 
)

Retreives properties of the requested register for a given device.

Parameters:
h A handle to an initialized device.
r The register we'd like the properties of.
props A pointer to the register properties.

DLLEXPORT TECELLA_ERRNUM CALL tecella_get_source_label ( TECELLA_HNDL  h,
int  source_index,
const wchar_t **  label 
)

Retreives a label for for a specific source choice for use in a GUI. This will provide more useful information to the user about which source is selected specific to their device.

Parameters:
h A handle to an initialized device.
source_index The gain choice (eg TECELLA_SOURCE_MODEL1).
label A return argument for the label string.
Note:
Not yet implemented.

DLLEXPORT TECELLA_ERRNUM CALL tecella_get_stimulus_mode ( TECELLA_HNDL  h,
TECELLA_STIMULUS_MODE mode 
)

Gets the current stimulus+acquisition mode.

Parameters:
h A handle to an initialized device.
mode Which stimulus+acquisition mode is being used.

DLLEXPORT TECELLA_ERRNUM CALL tecella_initialize ( TECELLA_HNDL h,
TECELLA_HW_MODEL  hw_model = TECELLA_HW_MODEL_AUTO_DETECT 
)

Initializes the specified device and returns a handle for it.

Parameters:
h Pointer to a handle
hw_model Indicates which type of device we are initializing.
Postcondition:
Upon success, h will point to a valid handle for the requested device.

DLLEXPORT TECELLA_ERRNUM CALL tecella_set_stimulus_mode ( TECELLA_HNDL  h,
TECELLA_STIMULUS_MODE  mode 
)

Puts the device into a particular stimulus+acquisition mode. See tecella_get_hw_props() for supported stimulus modes.

Parameters:
h A handle to an initialized device.
mode Which stimulus+acquisition mode to use.

DLLEXPORT TECELLA_ERRNUM CALL tecella_stimulus_get ( TECELLA_HNDL  h,
TECELLA_STIMULUS_SEGMENT segments,
int  segments_max,
int *  segments_in_stimulus,
int *  delta_count,
int *  repeat_count,
int  index = 0 
)

Retreives the currently programed stimulus. Note: due to precision constraints of the hardware, the stimulus returned by tecella_stimulus_get() may not exactly match the stimulus passed into tecella_stimulus_set().

Parameters:
h A handle to an initialized device.
segments A pointer to an array of pre-allocated segments.
segments_max The maximum size of the array pointed to by segments, so the API does not write into unallocated memory.
segments_in_stimulus The actual number of segments in the stimulus.
delta_count The number of times to increment a segment by the step value. After delta_count repeats, the segment goes back to it's initial value. Must be >=1.
repeat_count The number of times the entire stimulus will repeat. Must be >=1.
index Specifies which stimulus to program if multiple stimuli are supported on the device.

DLLEXPORT unsigned long long CALL tecella_stimulus_index_sample_count ( TECELLA_HNDL  h,
int  index,
double  sample_period 
)

Returns the number of samples to expect for a given stimulus, including all delta iterations and repeat iterations.

Parameters:
h A handle to an initialized device.
index A stimulus index.
sample_period The sample period in seconds.
Returns:
The number of samples in the stimulus, including all repeat counts and delta counts.

DLLEXPORT unsigned long long CALL tecella_stimulus_sample_count ( TECELLA_HNDL  h,
TECELLA_STIMULUS_SEGMENT segments,
int  segment_count,
int  delta_count,
int  repeat_count,
double  sample_period 
)

Returns the number of samples to expect for a given stimulus, including all delta iterations and repeat iterations.

Parameters:
h A handle to an initialized device.
segments A pointer to an array of segments that define the stimulus.
segment_count The number of segments to which segments points.
delta_count The number of times to increment a segment by the step value. After delta_count repeats, the segment goes back to it's initial value. Must be >=1.
repeat_count The number of times the entire stimulus will repeat. Must be >=1.
sample_period The sample period in seconds used when acquiring. Be sure to manually include any

DLLEXPORT unsigned int CALL tecella_stimulus_sample_count_partial ( TECELLA_HNDL  h,
TECELLA_STIMULUS_SEGMENT segments,
int  segment_count,
int  delta_iteration,
double  sample_period 
)

Returns the number of samples to expect for a given stimulus, for only a single delta iteration.

Parameters:
h A handle to an initialized device.
segments A pointer to an array of segments that define the stimulus.
segment_count The number of segments to which segments points.
delta_iteration The step iteration of the stimulus used to calculate the sample count.
sample_period The sample period in seconds used when acquiring.

DLLEXPORT TECELLA_ERRNUM CALL tecella_stimulus_set ( TECELLA_HNDL  h,
TECELLA_STIMULUS_SEGMENT segments,
int  segment_count,
int  delta_count = 1,
int  repeat_count = 1,
int  index = 0 
)

Programs a stimulus into the hardware. When the stimulus is played it will iterate through all its segments. Once it finishes or is stopped, the output will go back to the holding voltage as defined by tecella_stimulus_set_hold(). Note: Currently, a stimulus must have 3 or more segments.

Parameters:
h A handle to an initialized device.
segments A pointer to an array of segments that define the stimulus.
segment_count The number of segments to which segments points. A stimulus must have 3 or more segments.
delta_count The number of times to increment a segment by the step value. After delta_count repeats, the segment goes back to it's initial value. Must be >=1.
repeat_count The number of times the entire stimulus will repeat. Must be >=1.
index Specifies which stimulus to program if multiple stimuli are supported on the device.

DLLEXPORT TECELLA_ERRNUM CALL tecella_stimulus_set_callback ( TECELLA_HNDL  h,
TECELLA_STIMULUS_CB  f 
)

Sets the stimulus callback. The stimulus callback will be called whenever a stimulus has started during acquisition. The stimulus callback is called in the same thread as the acquire callback. Notification of stimulus start is guaranteed to occur before notification of any associated samples.

Parameters:
h A handle to an initialized device.
f The stimulus callback function.

DLLEXPORT TECELLA_ERRNUM CALL tecella_stimulus_set_hold ( TECELLA_HNDL  h,
double  value,
int  index = 0 
)

Programs a simple holding voltage into the hardware. The holding voltage is defined as the voltage that is output whenever the stimulus is not playing.

Parameters:
h A handle to an initialized device.
value The requested holding voltage/current in Volts/Amps. Must be within the valid range for a stimulus segment.
index The index of the stimulus to set the value of.

DLLEXPORT TECELLA_ERRNUM CALL tecella_stimulus_zap ( TECELLA_HNDL  h,
double  duration,
double  amplitude,
int *  channels = 0,
int  channel_count = 0 
)

Zap is not implemented yet.

Parameters:
h A handle to an initialized device.
duration The duration of the zap in seconds.
amplitude The amplitude of the zap in Volts.
channels An array of channels to zap.
channel_count The number of channels in channel_array. If 0, zap all channels.

DLLEXPORT TECELLA_ERRNUM CALL tecella_utility_dac_set ( TECELLA_HNDL  h,
double  value,
int  index = 0 
)

Sets the utility DAC voltage.

DLLEXPORT TECELLA_ERRNUM CALL tecella_utility_set_stimulus ( TECELLA_HNDL  h,
int  channel,
int  stimulus_index 
)

Sets the stimulus for stimulus-only outputs.

DLLEXPORT TECELLA_ERRNUM CALL tecella_utility_trigger_out ( TECELLA_HNDL  h,
int  index 
)

Sets the utility trigger out.


Generated on Thu Jul 2 20:27:18 2009 for Tecella Amp by  doxygen 1.5.8