Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12747 Discussions

How can i wakeup program thread with button PIO

Altera_Forum
Honored Contributor II
1,145 Views

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.
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
425 Views

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.
0 Kudos
Altera_Forum
Honored Contributor II
425 Views

 

--- 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) ?
0 Kudos
Altera_Forum
Honored Contributor II
425 Views

 

--- 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&#39;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=#)
0 Kudos
Reply