I have a pin on the LPC54102 configured as a capture input for one of the standard counter/timers (CT32Bx). Further, I have things configured such that the Capture Register is loaded - and an interrupt is generated - on both a rising edge and a falling edge for the pin.
When an interrupt is generated for a capture event, how can I determine whether or not the event was a 'rising edge' event or a 'falling edge' event?
Solved! Go to Solution.
Hi,
Assume that you use the PIO1_5 pin as FUNC 3, which functions as CT32B1_CAP0, in the ISR of capture event of CT32B1, you can read the GPIO->PIN[1] and check bit 5 for example
bool flag;
flag=GPIO->PIN[1]&0x20;
Even if you configure the PIO1_5 as FUNC 3 with IOCON->PIO[1][5]|=3; I still think you can read the GPIO input register to get the pin current logic.
Hope it can help you
BR
XiangJun Rong
Even if you configure the PIO1_5 as FUNC 3 with IOCON->PIO[1][5]|=3; I still think you can read the GPIO input register to get the pin current logic.
That is precisely what I hoped was the case. Thank you.
Hi,
Assume that you use the PIO1_5 pin as FUNC 3, which functions as CT32B1_CAP0, in the ISR of capture event of CT32B1, you can read the GPIO->PIN[1] and check bit 5 for example
bool flag;
flag=GPIO->PIN[1]&0x20;
Even if you configure the PIO1_5 as FUNC 3 with IOCON->PIO[1][5]|=3; I still think you can read the GPIO input register to get the pin current logic.
Hope it can help you
BR
XiangJun Rong