NXP discovery loop on Interrupt

cancel
Showing results for 
Search instead for 
Did you mean: 

NXP discovery loop on Interrupt

116 Views
sandip_sathvara
Contributor I

Hi Team,

We are using AM335x based custom board. We have connected the CLRC663 RFID card reader to the I2C lines. and we have integrated RFID NFC Reader Library in our application. everything works fine. We are able to read/write the Mifare Classic RFID card's memory. We have used the Discovery loop to detect the RFID card. below is the code snippet for that.

---------------------------------------------------------------------------------------------------------------

do
{
    /* Field OFF */
   status = phhalHw_FieldOff(pHal);
   CHECK_STATUS(status);

   /* Polling interval for the card detection */
   sleep(1);

   /* Configure Discovery loop for Poll Mode */
   status = phacDiscLoop_SetConfig(pDiscLoop,
                PHAC_DISCLOOP_CONFIG_NEXT_POLL_STATE,
                PHAC_DISCLOOP_POLL_STATE_DETECTION);
    CHECK_STATUS(status);

    /* Run Discovery loop */
    status = phacDiscLoop_Run(pDiscLoop,
    PHAC_DISCLOOP_ENTRY_POINT_POLL);

    /* Exit on Card detection */
} while ((status & PH_ERR_MASK) != PHAC_DISCLOOP_DEVICE_ACTIVATED);

---------------------------------------------------------------------------------------------------------------

As you can see, Here we are polling for the RFID card using the Discovery loop, which uses a high CPU bandwidth.

So, I want to know that, Is there any event type mechanism is there in the NXP RFID library so that I don't want to continuously poll the RFID card. or Do we have any provision in the discovery loop? by using that we can implement it on the event/interrupt based? Please guide us with any example If it is there.

It is also ok for us If phacDiscLoop_Run() API blocks until the card gets detect event received. that also solves our CPU Usage issue. 

I search a lot over the internet also read lots of NXPLib related documents, but I haven't found any clue.

Please provide your guidance to resolve the issue. 

Thanks,

Sandip

0 Kudos
1 Reply

73 Views
sandip_sathvara
Contributor I

Hello NXP Team,

Please help us to resolve the issue. 

Thanks,

Sandip

0 Kudos