Forum Discussion
Altera_Forum
Honored Contributor
10 years agoPIO Bitwise operation
Hallo, What is the best way to perform bit wise operation to clear or set specific bits on Nios II PIO port? An example CTRL_PORT = CTRL_PORT | (1 << CTRL_CS) | (1 << CTRL_RDE) | (1 <...
Altera_Forum
Honored Contributor
10 years agoWhen you instantiate a PIO in Qsys, you can optionally enable the single bit clear/set feature.
You can then use the IOWR_ALTERA_AVALON_PIO_SET_BITS / IOWR_ALTERA_AVALON_PIO_CLEAR_BITS macros. Enabling this option you spare the instructions required to read the actual pio status and masking the existing bits.