2021-06-22 12:32 AM
i am successfully write message to my type 5 tag and it get read by user.
I have seen that there is different interrupt we can get on gpo pin.
But i don't know which interrupt i need to use when message successfully read by user ?
i want to start Bluetooth advertisement on nfc tag read by user. so please let me know how to do this thing on interrupt ?
Solved! Go to Solution.
2021-07-05 11:17 PM
Yes
2021-07-06 12:12 AM
Ok, then I can imagine several ways of doing this.
The CR95HF can, for example, write a special value in a specific address in ST25DV04K memory when it has read the message. The instrument A then need to regularly read this address (polling) to check if its value has been modified.
Another method would be to use the St25DV04K's GPO pin to generate an interrupt. Once the CR95HF has read the message, it can signal it to instrument A by trigging a pulse on the GPO pin of ST25DV04K by using the ManageGPO command. The GPO pin should be connected to an interrupt pin of instrument A MCU. Please refer to the datasheet chapter about GPO feature for more details.
Best regards.
2021-07-06 06:23 AM
I have used interrupt method. so once the Cr95hf has read message it send the message over air to to instrument A .
Will this received message from cr95hf, give rf write interrupt on GPO pin of st25dv04k ?
Will this interrupt change value of ST25DV_ITSTS_DYN_REG ? i want to monitor this interrupt by this monitoring register value in interrupt handler.
I have implemented interrupt handler like below.
/* Exported macro ------------------------------------------------------------*/
#define ST25_RETRY_NB ((uint8_t) 15)
#define ST25_RETRY_DELAY ((uint8_t) 40)
/**
* @brief Iterate ST25DV command depending on the command return status.
* @param cmd A ST25DV function returning a NFCTAG_StatusTypeDef status.
*/
#define ST25_RETRY(cmd) do { \
int st25_retry = ST25_RETRY_NB; \
int st25_status = NFCTAG_ERROR; \
while(st25_status != NFCTAG_OK) \
{ \
st25_status = cmd; \
if(st25_status != NFCTAG_OK) \
usleep(ST25_RETRY_DELAY*1000); \
if(st25_retry-- <= 0) \
{ \
st25_retry = ST25_RETRY_NB; \
} \
} \
} while(0)
static int count = 0;
void gpo_handler(void)
{
uint8_t itstatus;
ST25_RETRY(BSP_NFCTAG_ReadITSTStatus_Dyn(0, &itstatus ));
if( (itstatus & ST25DV_ITSTS_DYN_RFWRITE_MASK) == ST25DV_ITSTS_DYN_RFWRITE_MASK )
{
printf("RF write");
}
}
Thanks for reply.
2021-07-06 06:32 AM
Yes, the RF_WRITE interrupt on GPO will change the corresponding bit in the IT_STS_Dyn register when triggered, so you should be able to monitor it.
Best regards.
2021-07-06 10:58 PM
Thank you.
i have got the rf write interrupt on message get.