Forum Discussion
Altera_Forum
Honored Contributor
21 years agoLook at the sample components, included with your Nios II installation. In particular, I would start by looking at the altera_avalon_pio component.
The altera_avalon_pio_regs.h file is a pretty good starting point for anyone wanting to write "HAL"-compliant register headers. It's in the <nios2_install_dir>/components/altera_avalon_pio/inc/altera_avalon_pio_regs.h file. Also, I'd be curious to know why you didn't use the Component Editor...that is, of course, if you're using the 1.1 version of the Nios II kit. The "0" does represent an offset. 0 would be offset zero from the address, as you entered below, and "1" would be offset 0x4 from the address you entered. You'll get a good idea, of how this works, if you have a look at the _pio_regs.h file, I mentioned earlier. Cheers, - slacker