Linux Device Driver for counting keyboard strokes
For each key pressed on the keyboard, it generates two interrupts (pressed and release).
Code:
Output:
Notes:
1. IRQ line 1 is assigned for keyboard, we register our handler to be called on keyboard interrupt by calling request_irq
2. IRQF_SHARED flag is used for sharing the keyboard interrupt
3. synchronize_irq waits for the specific handler to exit.
Code:
Output:
Notes:
1. IRQ line 1 is assigned for keyboard, we register our handler to be called on keyboard interrupt by calling request_irq
2. IRQF_SHARED flag is used for sharing the keyboard interrupt
3. synchronize_irq waits for the specific handler to exit.
Comments
Post a Comment