字符设备驱动-LED实验
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
int major;
static struct class *leddrv_class;
static struct class_device *leddrv_class_dev;
volatile unsigned long *gpfcon = NULL;
volatile unsigned long *gpfdat = NULL;
static int led_drv_open(struct inode *inode, struct file *file)
{
}
static ssize_t led_drv_write(struct file *file, const char __user *buf, size_t count, loff_t * ppos)
{
}
static struct file_operations led_drv_fops = {
};
static int led_drv_init(void)
{
}
static void led_drv_exit(void)
{
}
module_init(led_drv_init);
module_exit(led_drv_exit);
MODULE_LICENSE("GPL");
==================================================================================================
测试程序:
#include
#include
#include
#include
int main(int argc, char **argv)
{
}
==================================================================================================
注:在调用write(fd,&val,4);时根据不同的val值在调用驱动程序时做出判断:关闭、打开led灯
字符设备驱动LED实 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)