- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found Microtronix's driver for button PIO (on Altera dev. board) altera_pio_button.c
It seem to catch the IRQ from button and update value in device file. Is it possible to use this IRQ to wakeup a thread in user program? I think that IRQ is accessible only through the kernel, but maybe the driver can send a signal or the thread (in the user program) can wait in wait_queue of the driver? If it possible, please write some code because i still not friendly with Linux functions.Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use select().
Look at "man select". There is a example with timeout. Or, if you don't need timeout, just a blocked read() will do.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- originally posted by hippo@Jan 12 2007, 04:02 AM or, if you don't need timeout, just a blocked read() will do. --- Quote End --- Can anyone give me an example for using blocked read with this driver (altera_pio_button.c) ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- originally posted by motal+jan 14 2007, 11:19 pm--><div class='quotetop'>quote (motal @ jan 14 2007, 11:19 pm)</div>
--- quote start ---
<!--quotebegin-hippo@Jan 12 2007, 04:02 AM
or, if you don't need timeout, just a blocked read() will do. --- Quote End --- Can anyone give me an example for using blocked read with this driver (altera_pio_button.c) ? <div align='right'><{post_snapback}> (index.php?act=findpost&pid=20572)</div> [/b] --- Quote End --- example apps to use button pio. http://forum.niosforum.com/forum/index.php...topic=2285&hl=# (http://forum.niosforum.com/forum/index.php?showtopic=2285&hl=#)

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page