Altera_Forum
Honored Contributor
14 years agodefining Qsys input on DE0
Hi, I'm new to embedded processor development and a novice in C and C++ programming.
I'm working on design for a senior project, and am currently using a DE0 development board with quartus 11.0 and nios ii 11.0. After setting up my system, I am trying to figure out how to reference a GPIO input I created with Qsys in my source code. I'm doing a# include<system.h> which is the header file nios created from my sopc that defines the input. I don't know what to define the input as so my source code recognizes it, or if it is more complicated then that. Any advice, or references to a tutorial or document which describes this process would be greatly appreciated. Below is the code in system.h# define ALT_MODULE_CLASS_input_pio altera_avalon_pio# define INPUT_PIO_BASE 0x11030# define INPUT_PIO_BIT_CLEARING_EDGE_REGISTER 0# define INPUT_PIO_BIT_MODIFYING_OUTPUT_REGISTER 0# define INPUT_PIO_CAPTURE 0# define INPUT_PIO_DATA_WIDTH 4# define INPUT_PIO_DO_TEST_BENCH_WIRING 1# define INPUT_PIO_DRIVEN_SIM_VALUE 0x0# define INPUT_PIO_EDGE_TYPE "NONE"# define INPUT_PIO_FREQ 50000000u# define INPUT_PIO_HAS_IN 1# define INPUT_PIO_HAS_OUT 0# define INPUT_PIO_HAS_TRI 0# define INPUT_PIO_IRQ -1# define INPUT_PIO_IRQ_INTERRUPT_CONTROLLER_ID -1# define INPUT_PIO_IRQ_TYPE "NONE"# define INPUT_PIO_NAME "/dev/input_pio"# define INPUT_PIO_RESET_VALUE 0x0# define INPUT_PIO_SPAN 16# define INPUT_PIO_TYPE "altera_avalon_pio" I'm using the nios II application and BSP from template, THANKS!