Altera_Forum
Honored Contributor
20 years agoKey pressed?
Hello! How can I check if a key was pressed? I didn't found a appropriate function in the C which is used by Microtronix. Bye, Lothar.
Hi
There are a few choices of what you can do here. One is to use the inl() functions defined in linux/io.h or asm/io.h. You will have to include the nios system header file for the io structures you want to use and the base address of the buttons. The second and better 'Linux way' I would say is edit the existing altera_pio_buttons.c (or something like that) in drivers/char/ with adding support for ioctl() commands. Here you would place the inl() functions. There is a thread where I asked about drivers ect where you can find a link to some documentation on Linux device drivers. There are a lot of links here on drivers, makefiles ect. Good luck. Rual