From: Ian Abbott Date: Wed, 9 May 2012 17:41:51 +0000 (+0100) Subject: doc/other.xml: Add extra details about range and aref. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dbe3c77a3d692c52c2999683058e6c5eaabc117b;p=comedilib.git doc/other.xml: Add extra details about range and aref. Add extra detail to the section on acquisition functions about the range and aref parameters, and describe the comedi_range type. The whole section is still a bit higgledy-piggledy and could do with some rearrangement one day! --- diff --git a/doc/other.xml b/doc/other.xml index 9f6757d..3654f28 100644 --- a/doc/other.xml +++ b/doc/other.xml @@ -178,7 +178,32 @@ Single samples can be read from an analog channel using the function This reads one such data value from a &comedi; channel, and puts it in -the user-specified data buffer. +the user-specified data buffer. + + + +The range parameter is the zero-based +index of one of the gain ranges supported by the channel. This is a number +from 0 to N-1 where N is the number of ranges supported by the channel. +Use the function +comedi_get_n_ranges +to get the number of ranges supported by the channel, the function +comedi_find_range +to search for a suitable range, or the function +comedi_get_range +to get the details of a supported range. + + + +The aref parameter specifies an +analog reference to use: +AREF_GROUND, +AREF_COMMON, +AREF_DIFF, or +AREF_OTHER. +Use the function +comedi_get_subdevice_flags +to see which analog references are supported by the subdevice. @@ -231,7 +256,7 @@ and comedi_from_phys< -There are two data structures in these commands that are not fully +There are some data structures in these commands that are not fully self-explanatory: @@ -256,6 +281,33 @@ munging. + + +comedi_range: +this holds the minimum and maximum physical values for a gain range supported +by a channel of a subdevice, and specifies the units. This can be used in +combination with the channel's maxdata value to convert between +unsigned integer sample values (of type +lsampl_t or +sampl_t) and physical +units in a nominal (uncalibrated) way using the +comedi_to_phys +and +comedi_from_phys +functions. Use the +comedi_get_maxdata +function to get the maxdata value for the channel. + + +Most functions specify the range to be used for a channel by a zero-based +index into the list of ranges supported by the channel. Depending on the +device and subdevice, different channels on the subdevice may or may not +share the same list of ranges, that is, ranges may or may not be +channel-specific. (The SDF_RANGETYPE subdevice flag +indicates whether ranges are channel-specific.) + + +