TsctlAIOGetDesc

From embeddedTS Manuals

Only valid if AIO is an ADC. If the AIO is a DAC, simply returns the current value being output, e.g. via the last Puts call.

If the specified channel is currently active, waits for it to become inactive, then returns the value just sampled for that channel.

If a different channel is active, either waits for it to become inactive or immediately de-activates it (depending on what the hardware is capable of), then makes the specified channel active, waits for it to become inactive, then returns the value just sampled for that channel.

If the specified channel was the last channel active but has now finished, returns the value sampled for that channel.

If no channel is currently active, makes the specified channel active, waits for it to become inactive, then returns the value just sampled for that channel.

A channel goes through the following states:

  1. When a channel is first made active, it waits for its trigger to occur. If its trigger is "on demand" then not wait is done at this step.
  2. The channel remains active while conversion begins and proceed.
  3. When conversion is finished, the channel becomes inactive as well as the last channel active.

Hardware capabilities differ; to ensure maximum conversion rates across platforms, call Configure() before each Get() or Ready() call to only enable the next channel to converted.

The value returned can be converted to the voltage on the input by the following relationship between the precision (p) in bits and input voltage range (IV) of the channel (max input voltage - minimum input voltage) and the actual voltage (V) as follows:

V = IV / 2^p