3

I try to create bare metal application for TI am335x soc based board. One thing I need to do is to invoke callback1 on rising edge and callback2 on falling edge. From the datasheet I figured out, that simultaneous detection for rising and falling edge could be enabled by writing 1 << pin to RISINGDETECT and FALLINGDETECT GPIO registers. However, I can't understand (see no signs of it in datasheet), how could I determine if the currently appeared interrupt was caused by RISING edge on GPIO or by FALLING edge?

Alex Hoppus
  • 3,821
  • 4
  • 28
  • 47

1 Answers1

5

how could I determine if the currently appeared interrupt was caused by RISING edge on GPIO or by FALLING edge?

Try checking the state of the pin.
A rising edge results in a on state, whereas a falling edge results in a off state.
So the current state of the pin implies the direction of the most-recent interrupt.

sawdust
  • 16,103
  • 3
  • 40
  • 50