90 likes | 295 Views
AT91SAM Linux Driver Hands-on Introduction. Helloworld driver Just print debug information when loaded Helloworld character driver Create a character driver when loaded Support file open, close, IOCTL operaiton. Hellokeys platform driver In board file, register a hellokeys platform device
E N D
Helloworld driver Just print debug information when loaded Helloworld character driver Create a character driver when loaded Support file open, close, IOCTL operaiton. Hellokeys platform driver In board file, register a hellokeys platform device In driver, register a hellokeys platform driver When hellokeys platform device and driver is loaded, .probe() will be called In .probe() the a character driver is created Add Interrupt handling for platform driver Sam9m10g45-EK GPIO key Sam9x5-EK I2C for Qtouch button Overview
Helloworld driver HelloWorld Driver Module (.ko) print Hello World! insmod Running Kernel
Register a character device driver Open Close IOCTL Helloworld character driver Hello world Character Driver Module (.ko) insmod /dev/mydev Application Open Close IOCTL Created it by commands: mknod /dev/mydev c MAJOR MINOR Running Kernel
Register character device driver Open Close IOCTL Hellokeys platform driver In Kernel board file, Register “hellokeys” platform device Hello keys Platform Driver Module (.ko) insmod Register “hellokeys” Platform driver Call platform driver’s .probe() function /dev/mydev Application Open Close IOCTL Created it by commands: mknod /dev/mydev c MAJOR MINOR Running Kernel
Register character device driver Open Close IOCTL Hellokeys platform driver In Kernel board file, Register “hellokeys” platform device Hello keys Platform Driver Module (.ko) insmod Register “hellokeys” Platform driver Call platform driver’s .probe() function /dev/mydev Application Open Close IOCTL Created it by commands: mknod /dev/mydev c MAJOR MINOR Running Kernel
Add Interrupt handling 9m10g45: GPIO interrupt Driver read() is called 9x5: QTouch interrupt ISR Check flag: wait_for_key Wake up the wait queue Set flag: wait_for_key Wait for a wait queue Driver read() return Copy key_name to User data Shared data Hello_keys_drvdata * my_data
More information about AT91SAM OS Ecosystem AT91SAM Linux Ecosystem http://www.linux4sam.org AT91SAM Android Ecosystem http://www.at91.com/android4sam AT91SAM WinCE Ecosystem http://www.at91.com/windows4sam AT91SAM community forum http://www.at91.com