简体   繁体   中英

16*2 LCD interfacing with Beagleboard xM using kernel module

I am trying to interface a 16x2 LCD with Beagleboard xM using GPIO. I have done this by using a shell script and it's working very good. Now I want to achieve the same functionality by writing a kernel module. I know little bit about kernel programming as I'm in the learning phase. Need some guidance. Thanks in advance!

Writing a kernel module is different then shell scripting. You must write your own code in C++, declaring the kernel mode, and then compile it. I found one example, but don't have time to check it, so I am leaving that to you. Here is one example of writing kernel modules, and here is one tutorial for interfacing 16x02 lcd.

If you have a script you can load it like a module in linux ,

In /etc/rcS.d folder you will find a lot of scripts like S13 -some_name. sh . These scripts will be automatically run by the kernel while booting up. So you can just add your scipt here to make it as a module

So one thing have to do is find the last number used in these list of scripts and rename your driver script by prepending the next number to the last in the list

for eg: if the last script in /etc/rcS.d is S53logger.sh

Rename your scipt as S54-name-.sh ( don't forget to change attributes by chmod +x )

If the /etc/rcS.d is not present there might be a file rc.local file you just add the driver script to it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM