Commit graph

46 commits

Author SHA1 Message Date
Ian Abbott
aff4937e03 Added some more buffer position functions for use with mmap
Added comedi_get_buffer_read_offset(), comedi_get_buffer_write_offset(),
comedi_get_buffer_read_count(), and comedi_get_buffer_write_count().

comedi_get_buffer_read_offset() is the same as
comedi_get_buffer_offset(), which has now been documented as deprecated,
but is currently still declared in "comedilib.h" by default.  It gets
the read position within the buffer as an offset from the start of the
buffer (modulo the buffer size).

comedi_get_buffer_write_offset() gets the write position within the
buffer as an offset from the start of the buffer (modulo the buffer
size).

comedi_get_buffer_read_count() gets the number of bytes read from the
buffer, modulo UINT_MAX+1.

comedi_get_buffer_write_count() gets the number of bytes written to the
buffer, modulo UINT_MAX+1.
2016-05-13 15:14:47 +01:00
Ian Abbott
43a3ae9a27 comedilib.h: Don't mark 'data' parameter of comedi_data_read_n for SWIG
The 'data' parameter (of type lsampl_t*) for
comedi_data_read_n(it,subd,chan,range,aref,data,n) is currently marked
as an OUTPUT parameter for SWIG, but we can only do that for single
objects, and this one points to an array of objects.
2016-05-12 18:52:35 +01:00
Ian Abbott
66070c6af6 Add comedi_set_read_subdevice() and comedi_set_write_subdevice()
These functions allow the current read or write subdevice to be changed
to another subdevice that supports streaming input (for read), or
streaming output (for write) asynchronous commands.

They return 0 on success, in which case the comedi_get_read_subdevice()
or comedi_get_write_subdevice() functions will get the updated read or
write subdevice.

Changes are local to the "open file description" that was created by
comedi_open() (actually, by open()), and have no effect on other open
file descriptions created by other calls to comedi_open() (or open())
for the same underlying Comedi device node.

Changes to the read or write subdevice is not currently supported by the
comedi.org version of the Comedi drivers, but is supported by the Linux
"in-tree" Comedi drivers since kernel version 3.19.
2016-05-12 18:10:59 +01:00
Ian Abbott
27509ba9c9 Add digital trigger configuration functions
Add wrapper functions for the INSN_CONFIG_DIGITAL_TRIG configuration
instruction.  These are comedi_digital_trigger_disable(),
comedi_digital_trigger_enable_edges(), and
comedi_digital_trigger_enable_levels().
2016-03-21 11:28:29 +00:00
Ian Abbott
c85d380b93 comedilib.h: fix a typo in a comment 2016-03-21 11:28:29 +00:00
Ian Abbott
ac2ce44520 Add channel-specific arm, disarm, and reset wrappers.
The comedi_arm(), comedi_disarm(), and comedi_reset() functions always
set the channel number in the corresponding configuration instructions
to 0, as they assume the channel number will be ignored by the driver.
Some drivers do in fact use the channel number in these configuration
instructions.  Add additional wrapper functions comedi_arm_channel(),
comedi_disarm_channel(), and comedi_reset_channel() to allow the channel
number to be specified.
2016-03-21 11:28:29 +00:00
Ian Abbott
2062d615ff Add comedi_disarm() and bump to 0.11.0
Add the comedi_disarm() function to send the INSN_CONFIG_DISARM
configuration instruction to a subdevice.

In configure.ac, bump the comedilib libtool version code to 11:0:11, so
the comedilib version becomes 0.11.0.  Also bump the comedilib manual
version to 0.11.0 in doc/comedilib.ent.
2016-03-21 11:28:29 +00:00
Ian Abbott
91a3504623 Add comedilib_version.h header, produced by ./configure,
included by comedilib.h, containing COMEDILIB_VERSION_MAJOR,
COMEDILIB_VERSION_MINOR, COMEDILIB_VERSION_MICRO, and
COMEDILIB_CHECK_VERSION(major,minor,micro).  This can be used to perform
C pre-processor checks for API changes in comedilib.
2011-01-26 16:29:34 +00:00
Ian Abbott
eb57419204 Tag comedi_sv_measure's data as a swig output in comedilib.h.
Patch from W. Trevor King.
2010-12-16 11:29:10 +00:00
Ian Abbott
b8a4f1a265 Added channel parameter to comedi_set_clock_source() and
comedi_get_clock_source().  Bumped library version to 0.10.0.
2010-03-19 13:44:56 +00:00
Ian Abbott
24147c08a4 Allow swig to include comedi.h and comedilib.h from comedi.i to avoid
duplication.
2009-01-30 14:51:38 +00:00
Frank Mori Hess
d0956ca8b5 Added comedi_get_hardware_buffer_size() wrapper function, and made
comedi_strerror return a const char*.
2008-03-28 15:56:35 +00:00
Frank Mori Hess
a06bba542a Added more INSN_CONFIG wrappers: comedi_get_clock_source(),
comedi_get_gate_source(), and comedi_get_routing().  Added "channel"
parameter to some of the INSN_CONFIG wrappers.
2008-01-23 18:56:52 +00:00
Frank Mori Hess
76791bfeed Added comedi_set_filter() and comedi_set_routing() configuration
instruction wrappers.
2008-01-18 16:37:32 +00:00
Frank Mori Hess
b3627840ac Added reference entries for new configuration instruction wrappers. 2008-01-17 17:03:01 +00:00
Frank Mori Hess
4d07ce9969 Moved some wrappers for INSN_CONFIG instructions into comedilib.
Will add some reference documentation for the new functions soon.
2008-01-15 21:01:40 +00:00
Frank Mori Hess
c1082cee65 Fixed comedi_get_cmd_generic_timed() by adding a chanlist_len
parameter.  Old version is still available in library, thanks to the
magic of the version_script.
2007-08-02 19:46:44 +00:00
Frank Mori Hess
2d7d5f9bf3 Took comedi_dio_bitfield out of _COMEDILIB_DEPRECATED for release,
until bindings are updated.
2007-07-31 14:27:21 +00:00
Frank Mori Hess
34b9800e40 Added const qualifiers to some char* return values. Added new
experimental comedi_dio_bitfield2() function which works with
> 32 channels.  Only works properly with ni_65xx currently.
Will post a request for review by any interested
parties to list before I bother making the rest of the drivers
work with it.
2006-10-17 18:19:29 +00:00
Frank Mori Hess
1421d0919e Added some primative support for using software calibration in a way
that can be integrated with boards that don't use software calibrations.
2006-09-07 19:09:04 +00:00
Frank Mori Hess
d686d1278f First pass at parsing additional calibration file elements which
support software calibration.
2006-08-22 18:14:22 +00:00
Frank Mori Hess
2a720182e4 added comedi_dio_get_config() 2005-03-06 17:42:56 +00:00
Frank Mori Hess
cd07b7217b fix license headers, and prevent multiple includes of comedilib_scxi.h 2005-02-06 16:22:41 +00:00
Frank Mori Hess
9f6b16e004 added comedi_mark_buffer_written() (untested) 2005-01-10 00:46:28 +00:00
Frank Mori Hess
8a9e9861f1 made default comedi_calibrate behaviour a little smarter, shared more
code between comedilib and comedi_calibrate
2003-05-06 23:37:45 +00:00
Frank Mori Hess
0d0bfe17b9 exposed some lower-level calibration functions for more flexibility 2003-05-06 18:26:21 +00:00
Frank Mori Hess
4db55f5044 moved COMEDI_VERSION_CODE() macro to comedilib.h, added some version
checks to comedi_calibrate so it complains if it's using a driver
with known bugs.  Converted 6071 calibration to ad8804 addressing.
2003-05-03 14:59:26 +00:00
Frank Mori Hess
fb2bf948b2 Changed comedi_set_calibration() to comedi_apply_calibration(), and
made it much faster, it takes <100msec to run instead of >1sec.
It requires linking to libperl now (hope that's
okay).  Renamed DEBUG() and _() in libinternal.h to COMEDILIB_DEBUG()
and GETTEXT() in order to avoid conflicts with perl headers.
2003-03-04 00:41:10 +00:00
Frank Mori Hess
e36d2e5b3a finished implementing comedi_set_calibration() (untested) 2003-02-26 19:19:57 +00:00
David Schleef
2631bc9012 rearrangement 2002-07-04 03:29:41 +00:00
David Schleef
b4fd07f2cf Add comedi_get_read/write_subdevice() 2002-05-18 22:48:19 +00:00
Frank Mori Hess
e73c24b951 added comedi_data_read_n() 2002-04-29 21:13:13 +00:00
Frank Mori Hess
bf5d20bb9f added comedi_data_read_hint() and fixed comedi_data_read_n() 2002-04-29 19:50:32 +00:00
Frank Mori Hess
f31cfa6335 oops arg is really nanoseconds 2002-04-29 18:58:36 +00:00
Frank Mori Hess
4a9dd8e9d3 added comedi_data_read_delayed() 2002-04-29 18:22:41 +00:00
David Schleef
62088df124 Change email addresses and host names. 2002-03-09 01:22:30 +00:00
David Schleef
7973a0f2ad Change prototype of comedi_get_cmd_generic_timed 2001-07-15 22:39:54 +00:00
David Schleef
405f044ad9 Cleanup and rearrangement 2001-06-27 22:16:08 +00:00
David Schleef
fa434c140c added get_cmd_src_mask, get_cmd_generic_timed, comedi_poll() 2001-05-28 02:34:32 +00:00
Frank Mori Hess
3436ff0452 removed buffer config functions that I accidentally duplicated, made names of alpha functions follow conventions of older functions 2001-04-24 16:37:51 +00:00
Frank Mori Hess
d99990a666 added some comments describing alpha functions 2001-04-08 22:28:25 +00:00
Frank Mori Hess
5efacde9a3 added comedi_buf_offset function that returns buf_user_ptr 2001-04-08 18:03:05 +00:00
Frank Mori Hess
fc62ecb25e added buffer info ioctl support and some alpha buffer related functions 2001-04-06 23:12:42 +00:00
David Schleef
a9105f1a8d added bufconfig support 2001-03-01 21:57:33 +00:00
David Schleef
f4420f799e addition of several functions 2000-09-03 02:20:13 +00:00
David Schleef
b4bba38d0f Initial revision 2000-02-02 05:14:23 +00:00