⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 comedi0.c

📁 最新rtlinux内核源码
💻 C
字号:
/* * Written by Der Herr Hofrat, der.herr@hofr.at * (C) 2002,2007 Wind River Systems, Inc. * License: GPL Version 2 *//* * Trivial check if comedi compiles properly - this does nothing but  * open /dev/comedi0 and dump the infos it finds (if any) */#include <linux/module.h>#include <linux/kernel.h>#include <linux/version.h>#include <linux/types.h>#include <linux/errno.h>#include <linux/bitops.h>#include <asm/semaphore.h> /* for synchronizing the exported functions */#include <asm/bitops.h>    /* for set/clear bit                        */#include <linux/malloc.h>#include <linux/string.h> /* some memory copyage */#include <linux/fs.h> /* for the determine_minor() functionality */#include <rtl.h>#include <rtl_fifo.h>#include <rtl_sched.h>#include <rtl_sync.h>#include <mbuff.h>#include <linux/comedilib.h>unsigned int subdevice;unsigned int channel;sampl_t *data;unsigned int mask;comedi_t *dev;int init_module(void) {	dev=comedi_open("/dev/comedi0");	/* open /dev/comedi0 - assigened iwth comedi_config first */	if(!dev){		printk("/dev/comedi0 not available\n");		return 1;	}		/* get the devices available */	printk("Comedi Version: %x\n",comedi_get_version_code(dev));	printk("Driver assigned to comedi0: %s\n",comedi_get_driver_name(dev));	printk("  Subdevices found: %d\n",comedi_get_n_subdevices(dev));	/+ add anything else of interest here... */	return 0;}void cleanup_module(void) {	comedi_close(dev);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -