ST25R3918 rfid irq handling
Hello,
I am trying to work with a st25r3918 rfid(should be very similar to st25r3916 and the st25r3916 driver should cover its functionality as I have understood).
I am trying to validate the interrupts(mainly the nfc for tag reading but for the moment a wake-up timer would be enough)
I have set GPIO2 on arduino uno board as INT pin as I have read that only GPIOs 2 and 3 can be set for hardware irqs
And I've found this code snippet in arduino st25r3916 lib to validate irq handling:
/*
* Check IRQ Handling:
* - use the Wake-up timer to trigger an IRQ
* - wait the Wake-up timer interrupt
* - return ERR_TIMEOUT when the Wake-up timer interrupt is not received
*/
st25r3916WriteRegister(ST25R3916_REG_WUP_TIMER_CONTROL, ST25R3916_REG_WUP_TIMER_CONTROL_wur | ST25R3916_REG_WUP_TIMER_CONTROL_wto);
st25r3916EnableInterrupts(ST25R3916_IRQ_MASK_WT);
st25r3916ExecuteCommand(ST25R3916_CMD_START_WUP_TIMER);
if (st25r3916WaitForInterruptsTimed(ST25R3916_IRQ_MASK_WT, ST25R3916_TEST_WU_TOUT) == 0U) {
return ERR_TIMEOUT;
}
st25r3916DisableInterrupts(ST25R3916_IRQ_MASK_WT);
st25r3916WriteRegister(ST25R3916_REG_WUP_TIMER_CONTROL, 0U);
but is not working for me, meaning interrupt is not triggered.
I have seen in the datasheet that there are different operational and target modes that can be set.
Any additional register configuration is necessary or immediately after power up, the code snippet above should be enough to test the irq?
I would assume no other configuration is needed when checking the wake-up timer.
Thanks,
Mihai
