# Per-channel settings

## Functions
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_set_source (TECELLA_HNDL h, int channel, int choice)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_get_source (TECELLA_HNDL h, int channel, int *choice)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_set_gain (TECELLA_HNDL h, int channel, int choice)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_set_gain1 (TECELLA_HNDL h, int channel, int choice)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_set_gain2 (TECELLA_HNDL h, int channel, int choice)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_get_gain (TECELLA_HNDL h, int channel, int *choice)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_get_gain1 (TECELLA_HNDL h, int channel, int *choice)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_get_gain2 (TECELLA_HNDL h, int channel, int *choice)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_set_stimulus (TECELLA_HNDL h, int channel, int choice)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_get_stimulus (TECELLA_HNDL h, int channel, int *choice)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_set_boost_enable (TECELLA_HNDL h, int channel, bool enable)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_get_boost_enable (TECELLA_HNDL h, int channel, bool *enable)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_get_boost_enable_supported (TECELLA_HNDL h, bool *supported)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_set_iclamp_enable (TECELLA_HNDL h, int channel, bool enable)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_get_iclamp_enable (TECELLA_HNDL h, int channel, bool *enable)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_set_vcmd_enable (TECELLA_HNDL h, int channel, bool enable)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_get_vcmd_enable (TECELLA_HNDL h, int channel, bool *enable)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_set_Rs100_enable (TECELLA_HNDL h, int channel, bool enable)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_get_Rs100_enable (TECELLA_HNDL h, int channel, bool *enable)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_set_IclampOn (TECELLA_HNDL h, int channel, bool enable)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_get_IclampOn (TECELLA_HNDL h, int channel, bool *enable)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_set (TECELLA_HNDL h, TECELLA_REGISTER r, int channel, double value)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_get (TECELLA_HNDL h, TECELLA_REGISTER r, int channel, double *value)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_set_pct (TECELLA_HNDL h, TECELLA_REGISTER r, int channel, double pct)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_get_pct (TECELLA_HNDL h, TECELLA_REGISTER r, int channel, double *pct)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_set_enable (TECELLA_HNDL h, TECELLA_REGISTER r, int channel, bool enable)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_get_enable (TECELLA_HNDL h, TECELLA_REGISTER r, int channel, bool *enable)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_set_bessel (TECELLA_HNDL h, int channel, int value)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_get_bessel (TECELLA_HNDL h, int channel, int *value)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_bessel_value2freq (TECELLA_HNDL h, int value, double *kHz)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_bessel_freq2value (TECELLA_HNDL h, double kHz, int *value)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_set_hpf (TECELLA_HNDL h, int channel, int value)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_get_hpf (TECELLA_HNDL h, int channel, int *value)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_hpf_value2freq (TECELLA_HNDL h, int choice, double *Hz)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_hpf_freq2value (TECELLA_HNDL h, double Hz, int *choice)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_set_digital_leak (TECELLA_HNDL h, int channel, double digital_leak)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_get_digital_leak (TECELLA_HNDL h, int channel, double *digital_leak)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_set_digital_leak_enable (TECELLA_HNDL h, int channel, bool enable)
DLLEXPORT TECELLA_ERRNUM CALL | tecella_chan_get_digital_leak_enable (TECELLA_HNDL h, int channel, bool *enabled)

## Detailed Description

These functions get and set properties that are controlled independently for each channel of the amplifier.

- High level settings include: the source, gain, stimulus select, and iclamp enable.
- Analog filters include: bessel low pass filter, and a high pass filter.
- Analog compensations include: capacitance, leak, JP, and Rseries compensations.
- Digital compensations include: leak.

See tecella_get_hw_props() and tecella_get_reg_props() to see what settings are supported by the current amplifier and user configuration.

## Function Documentation

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

Returns the best choice for a bessel filter cuttoff frequency.

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

Returns the frequency of a bessel filter cuttoff choice.

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

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

Parameters:

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

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

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

Parameters:

  | h | A handle to an initialized device.
  | channel | A channel.
  | value | Which cuttoff frequency is selected.

DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_get_boost_enable | ( | TECELLA_HNDL | h,
|  | int | channel,
|  | bool * | enable |
| ) |  |  |

Returns whether frequency boost is enabled/disabled for a particular channel.

Parameters:

  | h | A handle to an initialized device.
  | channel | The channel to change. TECELLA_ALLCHAN may not be used as a shortcut here.
  | enable | Indicates whether frequency boost is enabled or disabled.

DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_get_boost_enable_supported | ( | TECELLA_HNDL | h,
|  | bool * | supported |
| ) |  |  |

Returns whether frequency boost is supported

Parameters:

  | h | A handle to an initialized device.
  | supported | Indicates whether frequency boost is supported.

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.

Parameters:

  | 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.

Parameters:

  | 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.

Parameters:

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

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

Get the currently selected gain for a given channel.

Parameters:

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

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

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

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.

Parameters:

  | h | A handle to an initialized device.
  | channel | A channel.
  | value | Which cuttoff frequency is selected.

DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_get_iclamp_enable | ( | TECELLA_HNDL | h,
|  | int | channel,
|  | bool * | enable |
| ) |  |  |

Returns whether iclamp is enabled/disabled for a particular channel.

Parameters:

  | h | A handle to an initialized device.
  | channel | The channel to change. TECELLA_ALLCHAN may not be used as a shortcut here.
  | enable | Indicates whether the iclamp is enabled or disabled.

DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_get_IclampOn | ( | TECELLA_HNDL | h,
|  | int | channel,
|  | bool * | enable |
| ) |  |  |

Returns whether Iclamp is turned ON or OFF for a particular channel.

Parameters:

  | h | A handle to an initialized device.
  | channel | The channel to change. TECELLA_ALLCHAN can be used as a shortcut here.
  | enable | Indicates whether Iclamp is turned on or off.

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_Rs100_enable | ( | TECELLA_HNDL | h,
|  | int | channel,
|  | bool * | enable |
| ) |  |  |

Returns whether 100% Rs Copmensation is enabled/disabled for a particular channel.

Parameters:

  | h | A handle to an initialized device.
  | channel | The channel to change. TECELLA_ALLCHAN may not be used as a shortcut here.
  | enable | Indicates whether 100% Rs Compensation is enabled or disabled.

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

Get the currently selected source for a given channel.

Parameters:

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

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

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

Parameters:

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

DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_get_vcmd_enable | ( | TECELLA_HNDL | h,
|  | int | channel,
|  | bool * | enable |
| ) |  |  |

Returns whether the vcmd is enabled/disabled for a particular channel.

Parameters:

  | h | A handle to an initialized device.
  | channel | The channel to change. TECELLA_ALLCHAN may not be used as a shortcut here.
  | enable | Indicates whether the vcmd is enabled or disabled.

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

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

Parameters:

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

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

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

Parameters:

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

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

Enables/disables the frequency boost for a particular channel.

Parameters:

  | h | A handle to an initialized device.
  | channel | The channel to change. TECELLA_ALLCHAN can be used as a shortcut here.
  | enable | Indicates whether to enable or disable frequency boost.

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.

Parameters:

  | 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.

Parameters:

  | 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.

Parameters:

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

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

Chooses which gain to use for a given channel.

Parameters:

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

DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_set_gain1 | ( | TECELLA_HNDL | h,
|  | int | channel,
|  | int | choice |
| ) |  |  |

DLLEXPORT TECELLA_ERRNUM CALL tecella_chan_set_gain2 | ( | TECELLA_HNDL | h,
|  | int | channel,
|  | int | choice |
| ) |  |  |

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.

Parameters:

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

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

Enables/disables the iclamp for a particular channel. Note: Using tecella_user_config_set() can switch all channels between various modes, including VClamp and IClamp. This function is to be used within an IClamp user config when supports_iclamp_enable is true. Within an IClamp user config, this function can enable/disable IClamp on a per-channel basis. The channels with IClamp disabled will behave as voltage followers.

Parameters:

  | h | A handle to an initialized device.
  | channel | The channel to change. TECELLA_ALLCHAN can be used as a shortcut here.
  | enable | Indicates whether to enable or disable the iclamp.

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

Turns Iclamp ON or OFF for a particular channel.

Parameters:

  | h | A handle to an initialized device.
  | channel | The channel to change. TECELLA_ALLCHAN can be used as a shortcut here.
  | enable | Indicates whether to turn Iclamp on or off.

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_Rs100_enable | ( | TECELLA_HNDL | h,
|  | int | channel,
|  | bool | enable |
| ) |  |  |

Enables/disables 100% Rs Compensation for a particular channel.

Parameters:

  | h | A handle to an initialized device.
  | channel | The channel to change. TECELLA_ALLCHAN can be used as a shortcut here.
  | enable | Indicates whether to enable or disable 100% Rs Compensation.

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

Chooses which source to measure from for a given channel.

Parameters:

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

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

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

Parameters:

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

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

Enables/disables the vcmd for a particular channel. Only valid for in voltage clamp modes. When the vcmd is disabled, voltage will be clamped to 0V.

Parameters:

  | h | A handle to an initialized device.
  | channel | The channel to change. TECELLA_ALLCHAN can be used as a shortcut here.
  | enable | Indicates whether to enable or disable the vcmd.

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.