Linux 2.4.18 s3c2440 led driver
使用DEV-C++撰寫,需要linux 2.4.18 kernel include,編譯完成後產生led module。
insmod main.o //安裝模組
mknod /DEV/leds c 221 0
使用方法:
int main(int argc, char *argv[])
{
int testDEV
//led test...
testDEV = open("/DEV/QuickMarkLed",O_RDWR)
ioctl(testDEV, 2, 1) //ioctl(DEVice, led number, open/close) open=1
ioctl(testDEV, argv[1][0]- 0 , argv[2][0]- 0 ) //ioctl(DEVice, led number, open/close) open=1
close(testDEV)
return 0
}
標簽:
s3c2440
driver
Linux
DEV-C
上傳時間:
2014-01-01
上傳用戶:qlpqlq