• 0

Arty Z7 - interrupting only on a single GPIO pin in DP0-DP13


Hello All,

Me again, with a basic "getting started" question.  In the Arty Z7 and Zybo examples, there are interrupt examples that use the external buttons on the AXI GPIO (pressing any of these buttons on either board can cause an interrupt). 

I want to use all of the GPIO pins on the GPIO0 port of the Arty Z7 board (which are labeled DP0-DP13), but let's say I only want to attach an interrupt to one of them.  Example: DP0 - DP6 are inputs, DP7 - DP13 are outputs.  Attach a positive edge triggered interrupt to DP6 ONLY.

Is there an example that shows how to do this?

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi @rt54321

AXI GPIO only supports enabling/disabling interrupts per channel.

I'd suggest, in software, tracking the state of the channel containing your GPIO, and only performing the interrupt action when the bit corresponding to DP6 goes high. You can place your XGpio instance and a u32 inside of a struct, and pass the pointer to that struct to your interrupt handler (or just use global variables). The interrupt handler would read out the new state, compare to the old value, potentially perform its action, and store the new value in the struct before returning.

Alternatively, you can dedicate an AXI GPIO channel entirely to DP6, but this requires changes to the hardware design.




Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now