The previous out-of-range behavior is returned.
-Function: comedi_apply_calibration -- set calibration
+Function: comedi_apply_calibration -- set calibration from file
Retval: int
-Param: comedi_t * device
+Param: comedi_t *device
Param: unsigned int subdevice
Param: unsigned int channel
Param: unsigned int range
calibration settings used may or may not depend on the channel,
range, or aref. The file_path parameter can be used
to specify the file which contains the calibration information.
- If file_path is NULL, then comedilib will use its the default
+ If <parameter>file_path</parameter> is NULL, then comedilib
+ will use a default
file location. The calibration information used by this function
is generated by the comedi_calibrate program (see its man page).
+
+ The functions comedi_parse_calibration_file(),
+ comedi_apply_parsed_calibration(), and comedi_cleanup_calibration()
+ provide the same functionality at a slightly lower level.
+Returns:
+ Zero on success, a negative number on failure.
+
+Function: comedi_apply_parsed_calibration -- set calibration from memory
+Retval: int
+Param: comedi_t * device
+Param: unsigned int subdevice
+Param: unsigned int channel
+Param: unsigned int range
+Param: unsigned int aref
+Param: const comedi_calibration_t *calibration
+Status: alpha
+Description:
+ This function is similar to comedi_apply_calibration()
+ except the calibration information is read from memory
+ instead of a file. This function can be more
+ efficient than comedi_apply_calibration() since the
+ calibration file does not need to be reparsed with
+ every call. The <parameter>calibration</parameter> is
+ obtained by a call to comedi_parse_calibration_file().
+
Returns:
Zero on success, a negative number on failure.
+Function: comedi_cleanup_calibration_file -- free calibration resources
+Retval: void
+Param: comedi_calibration_t *calibration
+Status: alpha
+Description:
+ This function frees the resources associated with a
+ <parameter>calibration</parameter> obtained from
+ comedi_parse_calibration_file(). <parameter>calibration</parameter>
+ can not be used again after calling this function.
+
+Function: comedi_get_default_calibration_path -- get default calibration file path
+Retval: char*
+Param: comedi_t *dev
+Status: alpha
+Description:
+ This function returns a string containing a default calibration file
+ path appropriate for <parameter>dev</parameter>. Memory for the
+ string is allocated by the function, and should be freed when
+ the string is no longer needed.
+Returns:
+ A string which contains a file path useable by
+ comedi_parse_calibration_file(). On error, NULL is returned.
+
+Function: comedi_parse_calibration_file -- set calibration
+Retval: comedi_calibration_t*
+Param: const char *file_path
+Status: alpha
+Description:
+ This function parses a calibration file (produced by the
+ comedi_calibrate program) and returns a pointer to a
+ comedi_calibration_t which can be passed to the
+ comedi_apply_parsed_calibration() function. When you are
+ finished using the comedi_calibration_t, you should
+ call comedi_cleanup_calibration() to free the resources
+ associated with the comedi_calibration_t.
+
+ The comedi_get_default_calibration_path() function may
+ be useful in conjunction with this function.
+Returns:
+ A pointer to parsed calibration information on success, or NULL on failure.