- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 << CTRL_WR); CTRL_PORT = CTRL_PORT & ~(1 << CTRL_ALE); Where # define CTRL_CS 0# define CTRL_RST 1# define CTRL_RDE 2# define CTRL_WR 3# define CTRL_ALE 4Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When 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.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you give me an example based on the code that I posted before?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Find it thanks.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page