Using kcomedilib, am I on the right track?

 Documentation and examples for using kcomedilib seem pretty sparse at best.  Let me outline what I guess from reading the various sources of what comedilib functions my modified video module would call.

#include <comedilib.h>  would be added to the module code.

(1) modified v4l2 init_module function would:
   create the comedi_t device structure
   call comedi_open()
   create the async structure
   init_async_buf()
   create the comedi_cmd structure
   initialize the comedi_cmd structure fields
   call comedi_command_test()

(2) in the v4l2 stream on ioctrl the modified vfl2 module would:
   call comedi_command() to start the data capture

(3) modified v4l2 module  Vsync interrupt service routine would:
    call comedi_get_buffer contents() to retrieve A/D data captured since start of capture or previous Vsync interrupt

(4) in the modified v4l2 stream off ioctrl to stop video capture:
   call comedi_cancel() to stop the acquisition

(5) modified module remove_module function would:
   free allocated comedi structures
   call comdei_close()


Is this a viable starting flow?  Am I missing any essential steps?
Where does the buffer used for the async A/D get allocated?   do I do it? or is it done auto magically when I setup for the command?

I've no idea at present of how  comedi_lock() and comedi-unlock() are to be used.  I assume this is will be real important as I'm using a dual core CPU.

A sample/demo module using kcomedilib would be even more helpful.

--wally.

Received on 2007-07-24Z20:32:49