Commit graph

12 commits

Author SHA1 Message Date
Ian Abbott
8c31fb88c1 lib: don't change read or write subdevice unnecessarily
Change comedi_set_read_subdevice() and comedi_set_write_subdevice() to
do nothing if the requested subdevice is already set as the current read
or write subdevice, respectively.

The functions now return success even if the Comedi drivers do not
support changes to the read or write subdevice as long as the specified
subdevice is the default one.
2016-05-13 16:18:02 +01:00
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
fad46b9b16 doc: tweak some of the documentation for streaming acquisition functions 2016-05-13 14:30:19 +01:00
Ian Abbott
22caa42aee doc: command_funcref.txt: fix DocBook tag
Change '<em>' to '<emphasis>'.
2016-05-13 14:19:58 +01:00
Ian Abbott
aec40a79aa doc: refer to device file descriptors rather than device files 2016-05-12 18:18:08 +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
09106917de doc/command_funcref.txt: Some DocBook mark-up changes. 2012-05-08 17:08:16 +01:00
Bernd Porr
0d8c6e9661 Comedilib.pdf can now be generated with
dblatex -t pdf ./comedilib.xml

There were two major issues in the comedilb.xml:
1) there were too many nested sections so that
   latex ran out of sub-sub-sub-sub-sections.
2) A section needs a title and can no longer
   exist without one. The first line
   of the textfiles contains now the title
   and will be inserted by mkref into the xml file.

todo: switch from xmlto to dblatex for the pdf generation
and re-enable it in the makefile.
2012-04-23 00:23:03 +01:00
Frank Mori Hess
2d4cc8f6d0 Updated and added some links to reference for asynchronous command
functions.
2008-02-12 17:01:43 +00:00
Frank Mori Hess
a7ece13dbd Added a link and remove some wrong (obsolete?) bits in the description
of comedi_cancel().
2008-02-11 16:25:15 +00:00
Frank Mori Hess
db048dfa6f Fixed some spelling errors "sucess"->"success". 2008-02-08 19:02:18 +00:00
Frank Mori Hess
8e610500f3 Split function references into subsections. Always build docs in
$(srcdir).
2008-01-14 22:15:07 +00:00