#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_HW_PROPS_ACQUISITION_UNITS_SIZE 32 |
tecella_hw_props_ex_01 subject to change Properties of the connected device. For use with tecella_get_hw_props_ex_01().
#define TECELLA_HW_PROPS_DEVICE_NAME_SIZE 32 |
tecella_hw_props Properties of the connected device. For use with tecella_get_hw_props().
#define TECELLA_HW_PROPS_SERIAL_NUMBER_SIZE 32 |
#define TECELLA_HW_PROPS_USER_CONFIG_NAME_SIZE 32 |
#define TECELLA_REG_PROPS_LABEL_SIZE 32 |
tecella_reg_props Provides useful information about a register for a specific device. For use with tecella_get_reg_props().
#define TECELLA_REG_PROPS_UNITS_SIZE 32 |
#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
#define TECELLA_SYSTEM_MONITOR_RESULT_LABEL_SIZE 32 |
tecella_system_monitor_result Contains information about results returned by tecella_system_monitor_get_result().
#define TECELLA_SYSTEM_MONITOR_UNITS_LABEL_SIZE 32 |
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.
typedef struct tecella_hw_props TECELLA_HW_PROPS |
typedef struct tecella_hw_props_ex_01 TECELLA_HW_PROPS_EX_01 |
typedef struct tecella_lib_props TECELLA_LIB_PROPS |
tecella_lib_props Represents the version of the DLL being used. For use with tecella_get_lib_props().
typedef struct tecella_reg_props TECELLA_REG_PROPS |
typedef void(CALL * TECELLA_STIMULUS_CB)(TECELLA_HNDL h, int stimulus_index, unsigned long long timestamp) |
typedef struct tecella_stimulus_segment TECELLA_STIMULUS_SEGMENT |
tecella_stimulus_segment Create an array of these and pass it to tecella_vcmd_set().
typedef struct tecella_stimulus_segment_ex TECELLA_STIMULUS_SEGMENT_EX |
tecella_stimulus_segment_ex Create an array of these and pass it to tecella_vcmd_set_ex(). This version adds new features compared to the non "ex" version, but is more likely to change between versions
typedef struct tecella_system_monitor_result TECELLA_SYSTEM_MONITOR_RESULT |
enum TECELLA_ERRNUM |
TECELLA_ERRNUM All functions in this API return one of these error values.
enum TECELLA_HW_MODEL |
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().
TECELLA_OFFSET_ADJUST_MODE Used by tecella_auto_comp_offset_adjust_mode_set() to indicate if new offsets detected by tecella_auto_comp should be adjusted by offseting the stimulus using jp or by offseting the measured response
enum TECELLA_REGISTER |
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().
TECELLA_STIMULUS_SEGMENT_TYPE Specifies the segment type in tecella_stimulus_segment.
DLLEXPORT TECELLA_ERRNUM CALL tecella_acquire_enable_auto_zero | ( | TECELLA_HNDL | h, | |
int | channel, | |||
bool | enable, | |||
int | window_size | |||
) |
Enables or disables auto-zero for a channel. A window of initial samples is averaged to offset the entire acquisition, such that the window of samples average out to zero.
h | A handle to an initialized device. | |
channel | The channel to enable or disable. | |
enable | If true, enable auto zero. | |
window_size | The number of initial samples to average for the new zero level. |
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.
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.
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.
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. |
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_f | ( | TECELLA_HNDL | h, | |
int | chan, | |||
int | requested_samples, | |||
float * | data, | |||
unsigned int * | actual_samples, | |||
unsigned long long * | first_sample_timestamp, | |||
bool * | last_sample_flag | |||
) |
Reads samples from the queue as single-precision floats whose units are in Amps. Same as tecella_acquire_read_d, but for single-precision floats.
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.
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. |
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.
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.
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.
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, | |
int | sample_period_multiplier, | |||
bool | continuous = false , |
|||
bool | start_stimuli = true , |
|||
bool | continuous_stimuli = false , |
|||
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.
h | A handle to an initialized device. | |
sample_period_multiplier | The actual sample period used will be sample_period_min times sample_peiriod_multiplier. | |
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 | 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_stimuli(): Mode0) If start=false and continuous=false, tecella_acquire_start_stimuli 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.
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_stimulus 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.
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.
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.
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_decay_start | ( | TECELLA_HNDL | h, | |
double | time_fraction | |||
) |
Lets the user indicate when artifact removal should start to linearly decay. Decaying earlier results in a smoother transition, but may not compensate faster capacitances as well.
h | A handle to an initialized device. | |
time_fraction | Must be within the range [0,1]. Represents a fraction of t_step in tecella_auto_artifact_update() at which artifact removal should start decaying. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_artifact_enable | ( | TECELLA_HNDL | h, | |
bool | enable = true , |
|||
int | stimulus_index = 0 | |||
) |
Enables/disables the application artifact removal. Does nothing if tecella_auto_artifact() hasn't been called. Note: tecella_auto_comp() automatically disables artifact removal is any of the use_cfast or use_cslows are true and use_artifact is false.
h | A handle to an initialized device. | |
enable | Indicates if artifact removal should be turned on or off. | |
stimulus_index | For which stimulus to turn off artifact removal. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_artifact_get | ( | TECELLA_HNDL | h, | |
int | channel, | |||
double * | artifact, | |||
int | max_size, | |||
int * | actual_size | |||
) |
Gets the current artifact data for a given channel. The units for each sample in the artifact is Amps/Volts. If you scale each sample by the step size of a voltage pulse, you will get the artifact in Amps that will be removed from the response. Note: the artifact is always applied to the max sample rate available.
h | A handle to an initialized device. | |
channel | The channel you want the get the artifact removal of. | |
artifact | A pointer to an array of doubles where the API can store the values for artifact removal. | |
max_size | The maximum size of the artifact array. | |
actual_size | Returns the number of elements stored into artifact. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_artifact_get_capacitance | ( | TECELLA_HNDL | h, | |
int | channel, | |||
double * | capacitance | |||
) |
Returns the equivalent capacitance compensation of the artifact removal in Farads.
h | A handle to an initialized device. | |
channel | The channel you want the capacitance compensation of. | |
capacitance | The equivalent capacitance compensation of artifact removal for the given channel. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_artifact_get_size | ( | TECELLA_HNDL | h, | |
int | channel, | |||
int * | size | |||
) |
Gets the number of samples in the artifact for the given channel.
h | A handle to an initialized device. | |
channel | The channel you want the get the artifact removal size of. | |
size | Upon return, will contain the size of the artifact data. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_artifact_set | ( | TECELLA_HNDL | h, | |
int | channel, | |||
double * | artifact, | |||
int | size | |||
) |
Sets the artifact to be removed for a given channel. See tecella_auto_artifact_get() for a description of units used.
h | A handle to an initialized device. | |
channel | The channel you want set the artifact removal of. | |
capacitance | The equivalent capacitance compensation of artifact removal for the given channel. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_artifact_update | ( | TECELLA_HNDL | h, | |
double | v_hold = 0 , |
|||
double | t_hold = 19e-3 , |
|||
double | v_step = 10e-3 , |
|||
double | t_step = 19e-3 , |
|||
int | iterations = 10 , |
|||
int | unused_stimulus_index = 0 | |||
) |
Records artifacts that remain after capacitance compensation so that they can be removed automatically. This function automatically enables artifact removal, so you must call tecella_auto_artifact_enable() with enable=false if you don't want the artifact removal to be applied immediately after calling this function. Artifacts should be updated whenever there's a change in gain,compensations,or bessel filter. Note: tecella_auto_comp() automatically disables artifact removal.
h | A handle to an initialized device. | |
v_hold | The holding voltage used by the auto comp algorithm. | |
t_hold | Number of seconds to hold the holding voltage. Tip: Use a combined value for t_hold+t_step that does not resonate with any environmental noise, such as 50Hz or 60Hz noise. | |
v_step | The amplitude of the test pulse used by the auto compensation algorithm. | |
t_step | Number of seconds to hold the pulse. Also becomes the amount of time after an edge artifact removal will work in the future. Tip: Use a combined value for t_hold+t_step that does not resonate with any environmental noise, such as 50Hz or 60Hz noise. | |
iterations | How many vcmd pulses to average together when measuring the artifact. Fewer iterations are faster, but more iterations reduces noise. | |
unused_stimulus_index | An unused stimulus the algorithm can use for calibration. Only associated channels are calibrated. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_calibrate | ( | TECELLA_HNDL | h, | |
bool | enable, | |||
int | unused_stimulus_index = 0 | |||
) |
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.
h | A handle to an initialized device. | |
enable | Indicates whether we are enabling/disabling the offset. | |
unused_stimulus_index | An unused stimulus that tecella_auto_calibrate can use. Only associated channels are calibrated. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_calibrate_get | ( | TECELLA_HNDL | h, | |
int | channel, | |||
int * | offset | |||
) |
Returns the current offset added to the incomming waveform. To get the actual units of the offset multiply by the scale returned by tecella_acquire_i2d_scale().
h | A handle to an initialized device. | |
channel | The channel for which to get the calibration of. | |
offset | A pointer for the returned offset. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_calibrate_set | ( | TECELLA_HNDL | h, | |
int | channel, | |||
int | offset | |||
) |
Manually sets the offsets added to the incomming waveform. To get the actual units of the offset multiply by the scale returned by tecella_acquire_i2d_scale().
h | A handle to an initialized device. | |
channel | The channel for which to get the calibration of. | |
offset | A pointer for the returned offset. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_comp | ( | TECELLA_HNDL | h, | |
double | v_hold = 0 , |
|||
double | t_hold = 20e-3 , |
|||
double | v_step = 10e-3 , |
|||
double | t_step = 20e-3 , |
|||
bool | use_leak = true , |
|||
bool | use_digital_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 , |
|||
bool | use_artifact = true , |
|||
double | under_comp_coefficient = 0.0 , |
|||
int | acq_iterations = 10 , |
|||
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. If cfast or a cslow is used, artifact removal will automatically be disabled in order to get the best capacitance compensation. Note: tecella_auto_comp() automatically disables artifact removal.
h | A handle to an initialized device. | |
v_hold | The holding voltage used by the auto comp algorithm. | |
t_hold | Number of seconds to hold the holding voltage. | |
v_step | The amplitude of the test pulse used by the auto compensation algorithm. | |
t_step | Number of seconds to hold the pulse | |
use_leak | If true, algorithm will compensate for leak if supported by the hardware. | |
use_digital_leak | If true, auto comp digitally compensates for any leak not compensated by analog leak compensation. Use tecella_chan_get_digital_leak() to retreive the resulting compensation. | |
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. | |
use_artifact | If true, artifact removal will automatically be updated. Not as accurate as running it separatly | |
under_comp_coefficient | Indicates the how much you prefer under-compensation to over-compensation. 0 indicates no preference. + indicates preference for under-compensation. - indicates preference for over-compensation. Magnitude indicates strengh of that preference. If positive, the max error over:under should be close to 1:(1+under_comp_coefficient). If negative, the max error under:over should be close to 1:(1-under_comp_coefficient). | |
acq_iterations | Indicates how many vcmd pulses to average before calculating compensations. Less iterations are faster, but more iterations are more accurate. | |
unused_stimulus_index | An unused stimulus the algorithm can use for calibration. Only associated channels are calibrated. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_comp_offset_adjust_mode_get | ( | TECELLA_HNDL | h, | |
int | channel, | |||
TECELLA_OFFSET_ADJUST_MODE * | mode | |||
) |
Gets the offset adjust mode to use when tecella_auto_comp is called
h | A handle to an initialized device. | |
channel | The channel. TECELLA_ALLCHAN is not allowed. | |
mode | A return pointer for mode of the given channel. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_comp_offset_adjust_mode_set | ( | TECELLA_HNDL | h, | |
int | channel, | |||
TECELLA_OFFSET_ADJUST_MODE | mode | |||
) |
Selects the offset adjust mode to use when tecella_auto_comp is called. Note: the resulting offset adjust after tecella_auto_comp() is only valid for the gain at which tecella_auto_comp() was run. If you change the gain, you should turn off the offset adjust mode.
h | A handle to an initialized device. | |
channel | The channel. TECELLA_ALLCHAN is allowed. | |
mode | The offset mode to use for the given channel. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_auto_frequency_boost_filter | ( | TECELLA_HNDL | h, | |
int | lpf_width, | |||
int | stimulus = 0 | |||
) |
Automatically applies a frequency boost filter for the current gain and bessel settings. Overwrites any filters set by tecella_sw_filter_set(). Not implemented yet...
h | A handle to an initialized device. | |
lpf_width | Short for low pass filter width. Allows you to apply a low pass/decimation filter in parallel with the frequency boost. | |
stimulus | A stimulus the function can use to acquire from. |
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 remove any internal interference. All channels associated with the unused_stimulus_index will be compensated.
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, | |||
int | unused_stimulus_index = 0 | |||
) |
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.
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 correct. | |
unused_stimulus_index | An unused stimulus that tecella_auto_scale can use. Only associated channels are calibrated. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_bessel_freq2value | ( | TECELLA_HNDL | h, | |
double | kHz, | |||
int * | value | |||
) |
Depricated. Use lpf type functions instead. Returns the best choice for a bessel filter cuttoff frequency.
DLLEXPORT TECELLA_ERRNUM CALL tecella_bessel_value2freq | ( | TECELLA_HNDL | h, | |
int | value, | |||
double * | kHz | |||
) |
Depricated. Use lpf type functions instead. 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.
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 | |||
) |
Depricated. Use tecella_chan_get_lpf() instead. 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.
h | A handle to an initialized device. | |
channel | A channel. | |
value | Which cuttoff frequency is selected. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_get_digital_leak | ( | TECELLA_HNDL | h, | |
int | channel, | |||
double * | digital_leak | |||
) |
Returns the equivalent digital leak compensation in Ohms^-1. To calculate the total leak compensation applied, you may add digital_leak to the analog leak register value and invert the combined value. Note: as of 10/19/2009 this function uses Ohms whereas the analog register uses MOhms.
h | A handle to an initialized device. | |
channel | The channel you want the leak compensation of. | |
digital_leak | The amount of digital leak applied in Ohms^-1. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_get_digital_leak_enable | ( | TECELLA_HNDL | h, | |
int | channel, | |||
bool * | enabled | |||
) |
Gets whether digital leak is enabled or disabled.
h | A handle to an initialized device. | |
channel | The channel you want the leak compensation of. | |
enabled | Returns whether digital leak is enabled or not. |
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.
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.
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_hpf | ( | TECELLA_HNDL | h, | |
int | channel, | |||
int * | value | |||
) |
Gets the cuttoff frequency choice for the high pass filter.
h | A handle to an initialized device. | |
channel | A channel. | |
value | Which cuttoff frequency is selected. |
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.
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()].
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.
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 | |||
) |
Depricated. Use tecella_chan_set_lpf() instead. 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.
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_digital_leak | ( | TECELLA_HNDL | h, | |
int | channel, | |||
double | digital_leak | |||
) |
Sets digital leak compensation in Ohms^-1. To calculate the total leak compensation applied, you may add digital_leak to the analog leak register value and invert the combined value. Note: as of 10/19/2009 this function uses Ohms whereas the analog register uses MOhms.
h | A handle to an initialized device. | |
channel | The channel you want the leak compensation of. | |
digital_leak | The amount of digital leak to apply in Ohms^-1. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_set_digital_leak_enable | ( | TECELLA_HNDL | h, | |
int | channel, | |||
bool | enable | |||
) |
Sets whether digital leak is enabled or disabled.
h | A handle to an initialized device. | |
channel | The channel you want the leak compensation of. | |
enable | Set to false if you wish to disable digital leak, true if you wish to enable digital leak. |
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.
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.
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_hpf | ( | TECELLA_HNDL | h, | |
int | channel, | |||
int | value | |||
) |
Chosses the cuttoff frequency for the high pass filter. Note that an integer value is taken in to re-enforce the fact that the cuttoff frequency is a non-linear function of the value being passed in. To see what frequency a choice corresponds to, use tecella_hpf_value2freq() / tecella_hpf_freq2value(). See tecella_get_hw_props(), to determine if a high pass filter is supported and to see how many cuttoff frequency choices there are.
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_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.
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'.
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
logfile | The filename of the debug log. An empty filename "" turns debug off. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_debug_default | ( | ) |
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().
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().
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().
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 TECELLA_ERRNUM CALL tecella_enumerate | ( | int * | device_count | ) |
Enumerates all Tecella amplifiers currently connected to the computer. Any subsequent calls to tecella_enumerate_descriptions() and tecella_initialize() will use the devices enumerated at the time of the last call to tecella_enumerate(). If a device has been connected after calling tecella_enumerate(), it will not affect initialization of the other amplifiers but will not have a corresponding device_index with which to initialize. If a device has been disconnected after calling tecella_enumerate(), it will not affect initialization of the other amplifiers but will fail to initialize.
device_count | A return pointer to hold the number of devices enumerated. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_enumerate_get | ( | int | device_index, | |
TECELLA_HW_PROPS * | description | |||
) |
Returns the description of an amplifier as enumerated by the most recent call to tecella_enumerate().
device_index | A number >= 0 and < device_count as returned by tecella_enumerate(). | |
description | A return pointer to a TECELLA_HW_PROPS structure that describes the device as indexed by device_index. |
DLLEXPORT const wchar_t* CALL tecella_error_message | ( | TECELLA_ERRNUM | errnum | ) |
Retreives the message string associated with an error value.
errnum | The error returned by any of the API functions. |
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.
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.
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.
h | A handle to an initialized device. | |
gain_index | The gain choice. | |
label | A return argument for the label string. |
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.
h | A handle to an initialized device. | |
props | A pointer to the hardware/firmware properties. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_get_hw_props_ex_01 | ( | TECELLA_HNDL | h, | |
TECELLA_HW_PROPS_EX_01 * | props | |||
) |
DLLEXPORT TECELLA_ERRNUM CALL tecella_get_lib_props | ( | TECELLA_LIB_PROPS * | props | ) |
Retreives the current version of the DLL being used.
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.
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_slew_label | ( | TECELLA_HNDL | h, | |
int | slew_index, | |||
const wchar_t ** | label | |||
) |
Retreives a label for the specified slew choice. This will provide more useful information to the user about which slew is selected specific to their device.
h | A handle to an initialized device. | |
source_index | The slew choice. | |
label | A return argument for the label string. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_get_source_label | ( | TECELLA_HNDL | h, | |
int | source_index, | |||
const wchar_t ** | label | |||
) |
Retreives a label 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.
h | A handle to an initialized device. | |
source_index | The gain choice. | |
label | A return argument for the label string. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_hpf_freq2value | ( | TECELLA_HNDL | h, | |
double | Hz, | |||
int * | choice | |||
) |
Returns the best choice for a high pass filter cuttoff frequency.
DLLEXPORT TECELLA_ERRNUM CALL tecella_hpf_value2freq | ( | TECELLA_HNDL | h, | |
int | choice, | |||
double * | Hz | |||
) |
Returns the frequency of a high pass filter cuttoff choice.
DLLEXPORT TECELLA_ERRNUM CALL tecella_initialize | ( | TECELLA_HNDL * | h, | |
int | device_index = 0 | |||
) |
Initializes the specified device and returns a handle for it. tecella_initialize() will automatically call tecella_enumerate() if it hasn't already been called by ther user. The default user configuration is used. After initialization you may change the user configuration via tecella_user_config_get() and tecella_user_config_set().
h | Pointer to a handle | |
device_index | The device index corresponding to the most recent call to tecella_enumerate(). |
DLLEXPORT TECELLA_ERRNUM CALL tecella_initialize_pair | ( | TECELLA_HNDL * | h, | |
TECELLA_HNDL | hA, | |||
TECELLA_HNDL | hB | |||
) |
Takes two handles of already initilaized amplifiers and makes it look like a single one. This is only supported if both amplifiers are the same.
h | Pointer to a handle | |
hA | A handle previously returned by tecella_initialize() | |
hB | A handle previously returned by tecella_initialize(). Must be different than h1. |
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().
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 TECELLA_ERRNUM CALL tecella_stimulus_get_ex | ( | TECELLA_HNDL | h, | |
TECELLA_STIMULUS_SEGMENT_EX * | segments, | |||
int | segments_max, | |||
int * | segments_in_stimulus, | |||
int * | delta_count, | |||
int * | repeat_count, | |||
int | index = 0 | |||
) |
Retreives the currently programed stimulus. Note: This function has more functionality than the "non ex" version, but is more subject to change in future versions of the API. 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().
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.
h | A handle to an initialized device. | |
index | A stimulus index. | |
sample_period | The sample period in seconds. |
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.
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 long long CALL tecella_stimulus_sample_count_ex | ( | TECELLA_HNDL | h, | |
TECELLA_STIMULUS_SEGMENT_EX * | 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. Note: This function has more functionality than the "non ex" version, but is more subject to change in future versions of the API.
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.
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 unsigned int CALL tecella_stimulus_sample_count_partial_ex | ( | TECELLA_HNDL | h, | |
TECELLA_STIMULUS_SEGMENT_EX * | 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. Note: This function has more functionality than the "non ex" version, but is more subject to change in future versions of the API.
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.
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.
h | A handle to an initialized device. | |
f | The stimulus callback function. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_stimulus_set_ex | ( | TECELLA_HNDL | h, | |
TECELLA_STIMULUS_SEGMENT_EX * | segments, | |||
int | segment_count, | |||
int | delta_count = 1 , |
|||
int | repeat_count = 1 , |
|||
int | index = 0 | |||
) |
Programs a stimulus into the hardware. This function has more functionality than the "non ex" version, but is more subject to change in future versions of the API. 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.
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_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.
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_set_slew | ( | TECELLA_HNDL | h, | |
int | choice, | |||
int | index = 0 | |||
) |
DEPCRICATED This function is no longer supported and will be removed in the next majof version of the API. Use ex versions of the stimulus functions instead. Sets the slew rate of the stimulus / how fast the edges rise and fall.
h | A handle to an initialized device. | |
choice | 0 is the fastest, then it gets slower as the choice increases. The max value for this parameter depends on the connected hardware. Each increment may also not be linear. | |
index | The stimulus index to change the slew rate of. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_stimulus_steer | ( | TECELLA_HNDL | h, | |
int | stimulus_index, | |||
int | destination_index, | |||
bool | enable | |||
) |
steers the stimulus to the specified distination. In most cases, the destination is a single channel.
h | A handle to an initialized device. | |
stimulus_index | The stimulus to steer. | |
destination_index | In most cases, this is the channel to which we want to steer the stimulus. | |
enable | If false, steers the stimulus to nothing. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_stimulus_zap | ( | TECELLA_HNDL | h, | |
double | duration, | |||
double | amplitude, | |||
int * | channels = 0 , |
|||
int | channel_count = 0 | |||
) |
Applies a voltage pulse of a specified duration.
h | A handle to an initialized device. | |
duration | The duration of the zap in seconds. If duration is 0, zap will be held at the specified amplitude until the next call to this function. | |
amplitude | The amplitude of the zap in Volts. | |
channels | An array of channels to zap. | |
channel_count | The number of channels in channel_array. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_sw_filter_enable | ( | TECELLA_HNDL | h, | |
bool | enable, | |||
int | channel = TECELLA_ALLCHAN | |||
) |
Enables/Disables filtering.
h | A handle to an initialized device. | |
enable | If true, filtering is enabled. If false, filtering is disabled. | |
channel | The channel on which to enable/disable filtering. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_sw_filter_set | ( | TECELLA_HNDL | h, | |
double * | kernel, | |||
int | kernel_size, | |||
int | channel = TECELLA_ALLCHAN | |||
) |
Sets a kernel to be convolved with incoming samples at the native sampling frequency. Note: The kernel will be normalized before it is stored in the API to prevent unwanted scaling.
h | A handle to an initialized device. | |
kernel | An array of doubles that define the kernel. | |
kernel_size | The number of elements in the kernel array. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_sw_filter_set_box | ( | TECELLA_HNDL | h, | |
int | width, | |||
int | channel = TECELLA_ALLCHAN | |||
) |
Sets a simple nearest-neighbor averaging filter. This acts as a low pass filter that doesn't have much ringing, but will not preserve peaks as well as a Lanczos filter.
h | A handle to an initialized device. | |
width | The number of samples to average together. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_sw_filter_set_lanczos | ( | TECELLA_HNDL | h, | |
double | width, | |||
int | quality = 3 , |
|||
int | channel = TECELLA_ALLCHAN | |||
) |
Sets a Lanczos filter kernel, which approximates the ideal low pass filter. It preserves peaks well, however it may result in ringing near sharp edges. For an explanation of Lanczos filters, see: http://en.wikipedia.org/wiki/Lanczos_resampling
h | A handle to an initialized device. | |
width | 1/width is the effective cutoff frequency of the Lanczos filter. If downsampling, set width equal to the number of samples being decimated. Using a width that is not a whole number will prevent the zeroes from falling exactly on a sample. | |
quality | Must be 1 or greater. There are deminishing returns after 3. Corresponds to the "a" coefficient usually used in texts when describing a Lanczos filter. Note: The final size of the Lanczos filter will be width*quality. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_system_monitor_dynamic_set | ( | TECELLA_HNDL | h, | |
int | monitor_index | |||
) |
Tells the dynamic monitor which point to monitor. Dynamic monitor is when one of the channels records a monitor point at the same sampling rate as all the other channels during acquisition.
h | A handle to an initialized device. | |
monitor_index | Indicates which point to monitor. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_system_monitor_get | ( | TECELLA_HNDL | h, | |
int | result_index, | |||
TECELLA_SYSTEM_MONITOR_RESULT * | result | |||
) |
Retreives results from the most recent call to tecella_system_monitor_run(). Cannot be used during acquisition.
h | A handle to an initialized device. | |
result_index | An index to a result between 0 and result_count as returned by tecella_system_monitor_run. | |
result | A pointer to a TECELLA_SYSTEM_MONITOR_RESULT structure that will contain the result on return. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_system_monitor_run | ( | TECELLA_HNDL | h, | |
int * | result_count, | |||
int * | results_per_controller, | |||
int * | results_per_slot | |||
) |
Runs a quick tests on the system, such as system voltage and power measurments. Retreive results by using tecella_system_monitor_get(). Cannot be used during acquisition.
h | A handle to an initialized device. | |
result_count | A pointer to an int that will hold how many results can be retreived by calling tecella_system_monitor_get(). |
DLLEXPORT TECELLA_ERRNUM CALL tecella_user_config_get | ( | TECELLA_HNDL | h, | |
int | user_config, | |||
TECELLA_HW_PROPS * | description | |||
) |
Returns details of available configurations. Replaces tecella_get_stimulus_mode() in a more generic manner.
h | A handle to an initialized device. | |
user_config | A valid user configuration index. Must be greater than or equal to 0 and less than the user_config_count field returned by tecella_get_hw_props() or tecella_enumerate_get(). | |
description | A return pointer to a TECELLA_HW_PROPS structure that describes the device if it were configured with user_config. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_user_config_get_current | ( | TECELLA_HNDL | h, | |
int * | user_config | |||
) |
If the amplifier supports a user selectable configuration, you may use this function to determine which configuration is currently used.
h | A handle to an initialized device. | |
user_config | A return pointer to hold the current user configuration index. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_user_config_set | ( | TECELLA_HNDL | h, | |
int | user_config | |||
) |
If the amplifier supports a user selectable configuration, it may be set here. The configuration may only be set when not acquiring. Replaces tecella_set_stimulus_mode() in a more generic manner.
h | A handle to an initialized device. | |
user_config | A valid user configuration index. Must be greater than or equal to 0 and less than the user_config_count field returned by tecella_get_hw_props() or tecella_enumerate_get(). |
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 index for stimulus-only outputs.
DLLEXPORT TECELLA_ERRNUM CALL tecella_utility_trigger_out | ( | TECELLA_HNDL | h, | |
int | index | |||
) |
Sets the utility trigger out.