Forum Discussion
5 Replies
- Altera_Forum
Honored Contributor
you can use a PIO component for that.
- Altera_Forum
Honored Contributor
thanks for reply...
den is it required to keep on polling a perticular PIO pin using readh(0x40008df)memory loc..? how can i read it as an interrupt..?? - Altera_Forum
Honored Contributor
Double click on it in SOPC builder. Then you can have it trigger an interrupt on level change.
- Altera_Forum
Honored Contributor
but how will i come to know while executing my source code(in C) on processor..
i.e when i detect the signal, i should go to some routine(signal handler) in my C code.. what is the code sequence to do tat in c.. - Altera_Forum
Honored Contributor
in the code there r instructions like
main() { signal(SIGPIPE,SIG_IGN); int fp,oflags; signal(SIGIO, interrupt_handler); fp = open("/dev/interrupt1", O_NOCTTY); if(fp < 0) { printf("Error opening device node !\n"); } else { fcntl(fp, F_SETOWN, getpid()); oflags = fcntl(fp, F_GETFL); fcntl(fp, F_SETFL, oflags | FASYNC); } }///end of main function interrupt_handler() { \\control should come here when edge is detected }