반응형
Raspberry Pi 2에서 character device driver 예제 테스트
Raspberry Pi/Raspberry Pi 활용2015. 10. 17. 22:51Raspberry Pi 2에서 character device driver 예제 테스트

simple_dev.c #include #include #include #include #include #include #include dev_t id; struct cdev cdev; struct class *class; struct device *dev; char temp[100]; #define DEVICE_NAME "simple" int simple_open (struct inode *inode, struct file *filp) { printk( "open\n" ); memset( temp, 0, 0 ); return 0; } int simple_close (struct inode *inode, struct file *filp) { printk( "close\n" ); return 0; } ss..

Raspberry Pi/Raspberry Pi 활용2015. 2. 22. 18:01리눅스 문자 디바이스 드라이버 예제

실행결과 응용 프로그램 simpleApp.c디바이스 드라이버 simple_dev.cdevice file open[13895.005913] openApp : write something life is good 12bytes[13895.009107] simple_write [13895.013561] DEV : read something [13895.018762] life is good 12bytesApp : read something life is good 12bytes[13895.023354] simple_read [13895.027854] DEV : write something [13895.033086] life is good 12bytesioctl function call ret = 0[13895.03..

반응형
image