This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ds:comedi [2015/08/04 11:24] tmilosic created |
ds:comedi [2015/08/06 16:07] (current) tmilosic |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Comedi - The Linux Control and Measurement Device Interface | ====== Comedi - The Linux Control and Measurement Device Interface | ||
+ | |||
+ | [[http:// | ||
+ | typical PCI digital and analog I/O cards and is actively developed since 1998. | ||
+ | |||
+ | It consists of | ||
+ | * Linux drivers | ||
+ | * Comedilib | ||
+ | * Kcomedilib | ||
+ | |||
+ | ==== Drivers ==== | ||
+ | |||
+ | The newest sources for the Comedi and driver modules\\ | ||
+ | are available from the official Git repository. | ||
+ | |||
+ | git clone git:// | ||
+ | | ||
+ | Use // | ||
+ | |||
+ | ./ | ||
+ | | ||
+ | To display all available options | ||
+ | |||
+ | ./configure --help | ||
+ | | ||
+ | [The following assumes you're in a maintenance chroot and are\\ | ||
+ | installing the modules directly to the diskless system.\\ | ||
+ | If you want to build and install the drivers to a different \\ | ||
+ | directory, for example '/ | ||
+ | you have to specify --with-modulesdir=< | ||
+ | |||
+ | Assembling the Makefile for 64-bit Linux 3.10.82-rt89 with RT preempt patch | ||
+ | | ||
+ | ./configure --with-rtlinuxdir=/ | ||
+ | --with-kernel-release=3.10.82-rt89 --with-rpm-target=x86_64 | ||
+ | |||
+ | Compiling | ||
+ | |||
+ | make | ||
+ | | ||
+ | Installing | ||
+ | |||
+ | make install | ||
+ | |||
+ | This will install the modules to | ||
+ | |||
+ | / | ||
+ | | ||
+ | where kernel-version is 3.10.82-rt89 in this example. | ||
+ | |||
+ | |||
+ | === Linux In-Tree Comedi Support === | ||
+ | |||
+ | Comedi and available drivers are also integrated into the Linux kernel \\ | ||
+ | since 2.6.30, located in the experimental staging tree.\\ | ||
+ | |||
+ | This might be the best choice unless the kernel version of choice\\ | ||
+ | lacks required hardware support or contains bugs stopping its use.\\ | ||
+ | In that case we should use the out-of-tree Git version as described above.\\ | ||
+ | |||
+ | To enable Comedi and build the //comedi// module, setup the \\ | ||
+ | kernel configuration as follows: | ||
+ | |||
+ | Device Drivers [*] | ||
+ | Staging drivers [*] | ||
+ | Data acquisition support <M> | ||
+ | This ensures the built of the comedi module only.\\ | ||
+ | To actually make use of the supported hardware,\\ | ||
+ | the comedi // | ||
+ | |||
+ | Taking the [[ds: | ||
+ | activate the //Comedi PCI drivers// section and set the appropriate driver. | ||
+ | |||
+ | Comedi PCI drivers [*] | ||
+ | ADDI-DATA APCI_16xx support <M> | ||
+ | |||
+ | This will built the driver module addi_apci_16xx, | ||
+ | which depends on the comedi module. \\ | ||
+ | |||
+ | When loaded, lsmod shows something like: | ||
+ | |||
+ | comedi | ||
+ | |||
+ | Every device gets a separate // | ||
+ | Assuming only one card in this example | ||
+ | |||
+ | crw-rw---- 1 root root 98, 0 Aug 4 2015 / | ||
+ | | ||
+ | To access the device, use the library Comedilib for user-space applications\\ | ||
+ | or Kcomedilib for real-time kernel modules making use of Comedi hardware. | ||
+ | |||
+ | ==== Comedilib ==== | ||
+ | |||
+ | Comedilib needs to be installed manually either via \\ | ||
+ | the latest stable release tarball from the Comedi page | ||
+ | wget http:// | ||
+ | (At time of writing 0.10.2 was the latest stable release) | ||
+ | or by checking in out from the Git repository | ||
+ | git clone git:// | ||
+ | | ||
+ | The Git checkout requires to generate the // | ||
+ | using // | ||
+ | |||
+ | ./ | ||
+ | |||
+ | Hint: Depending on the autotools version, it might be required | ||
+ | to delete or comment the AM_PROG_AR macro in configure.ac! | ||
+ | |||
+ | To display all available options | ||
+ | |||
+ | ./configure --help | ||
+ | |||
+ | Afterwards compile and install it via | ||
+ | |||
+ | make | ||
+ | make install | ||
+ | | ||
+ | Once the drivers are properly loaded\\ | ||
+ | an overview of all supported Comedi devices\\ | ||
+ | can be received from | ||
+ | |||
+ | > comedi_board_info | ||
+ | |||
+ | overall info: | ||
+ | version code: 0x00074c | ||
+ | driver name: addi_apci_16xx | ||
+ | board name: apci1696 | ||
+ | number of subdevices: 3 | ||
+ | subdevice 0: | ||
+ | type: 5 (digital I/O) | ||
+ | flags: 0x00030000 | ||
+ | number of channels: 32 | ||
+ | max data value: 1 | ||
+ | ranges: | ||
+ | all chans: [0,5] | ||
+ | command: | ||
+ | not supported | ||
+ | subdevice 1: | ||
+ | type: 5 (digital I/O) | ||
+ | flags: 0x00030000 | ||
+ | number of channels: 32 | ||
+ | max data value: 1 | ||
+ | ranges: | ||
+ | all chans: [0,5] | ||
+ | command: | ||
+ | not supported | ||
+ | subdevice 2: | ||
+ | type: 5 (digital I/O) | ||
+ | flags: 0x00030000 | ||
+ | number of channels: 32 | ||
+ | max data value: 1 | ||
+ | ranges: | ||
+ | all chans: [0,5] | ||
+ | command: | ||
+ | not supported | ||
+ | | ||
+ | ==== Kcomedilib ==== | ||
+ | |||
+ | Kcomedilib provides the Comedilib interface to the kernel space.\\ | ||
+ | This is useful when writing real-time kernel modules that need\\ | ||
+ | access to Comedi devices. | ||
+ | |||
+ | The // | ||
+ | comedi package (see above). The intree version requires manual\\ | ||
+ | setting of the appropriate kernel config under " | ||
+ | |||
+ | ==== Resources ===== | ||
+ | |||
+ | === Comedi Webpage === | ||
+ | http: | ||
+ | |||
+ | === Git Targets === | ||
+ | git: | ||
+ | git: | ||