#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 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 |
tecella_hw_props Properties of the connected device. For use with tecella_get_hw_props().
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 |
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) |
typedef struct tecella_stimulus_segment TECELLA_STIMULUS_SEGMENT |
tecella_stimulus_segment Create an array of these and pass it to tecella_vcmd_set().
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().
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_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.
TECELLA_STIMULUS_SEGMENT_TYPE Specifies the segment type in tecella_stimulus_segment. RAMP is not currently supported.
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_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, | |
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.
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.
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.
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. Note: not implemented as of release 0.101.1.
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.
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.
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().
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.
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.
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.
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.
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_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 | |||
) |
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_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_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_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 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 (eg TECELLA_GAIN_A). | |
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_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_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.
h | A handle to an initialized device. | |
source_index | The gain choice (eg TECELLA_SOURCE_MODEL1). | |
label | A return argument for the label string. |
DLLEXPORT TECELLA_ERRNUM CALL tecella_get_stimulus_mode | ( | TECELLA_HNDL | h, | |
TECELLA_STIMULUS_MODE * | mode | |||
) |
Gets the current stimulus+acquisition mode.
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.
h | Pointer to a handle | |
hw_model | Indicates which type of device we are initializing. |
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.
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().
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 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 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_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_zap | ( | TECELLA_HNDL | h, | |
double | duration, | |||
double | amplitude, | |||
int * | channels = 0 , |
|||
int | channel_count = 0 | |||
) |
Zap is not implemented yet.
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.