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?
Asked
Active
Viewed 2,002 times
3

Alex Hoppus
- 3,821
- 4
- 28
- 47
-
1Check the state of the pin? E.G. a rising edge results in a state of `on`. – sawdust Oct 18 '17 at 23:31
-
Bingo, the question is really dumb. You can post it as an answer if you would like to. Thank you. – Alex Hoppus Oct 19 '17 at 08:40
1 Answers
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