Forum Discussion
Altera_Forum
Honored Contributor
14 years agoFor the PIO you don't actually need to use IORD and IOWR. There are helper macros that come with the PIO that you can use which use IORD and IOWR behind the scenes for you. If you want to see some example usage of the PIO the 'board_diag' software example uses the PIO macros to read values driven by push buttons and outputs to LEDs on the board.
To inspect the PIO macro file you can find it here (going by memory): /<Quartus install directory>/ip/sopc_builder/altera_avalon_pio/inc/<include file.h> The PIO macro file will take care of the offsets for you. You can also find the macros in the PIO user guide.