EX data handling by PN5180

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

EX data handling by PN5180

1,416 次查看
smiwa
Contributor III

Hi Christian san,

I got another question. I would like to make sure how to get the received data in PN5180.

(1) For example, When the host command REQA to the card by using exchange function, can the host retrieve RX data: ATQA by its exchange function? 

(2) And, if it takes times that PN5180 gets the response data from the card, does BasicLoop its receive completion?

Best regards,

   S. Miwa 

0 项奖励
回复
4 回复数

1,055 次查看
smiwa
Contributor III

Hi Christian san,

Thank you for the detail explanation! Understood.

Best regards,

   S. Miwa

0 项奖励
回复

1,055 次查看
smiwa
Contributor III

Hi Christian san,

Thank you for quick answer!!

Why I asked this question is that I found there is  phhalHw_Pn5180_Receive_Int()  function after phhalHw_Pn5180_BalExchange() function  in phhalHw_Pn5180_Exchange() . phhalHw_Pn5180_Receive_Int() works watching IRQ.

Could you please tell me what job phhalHw_Pn5180_Receive_Int() , in this case?

Best regards,

   S. Miwa

0 项奖励
回复

1,055 次查看
christianeisend
NXP Employee
NXP Employee

Hi,

sorry, I didn't think about phhalHw_Pn5180_BalExchange. This function is called every time a SPI frame is sent to PN5180. 

What I wrote above (if send buffer contains REQA, then receiver buffer contains ATQA in case of SUCCESS) refers to phhalHw_Pn5180_Exchange. 

phhalHw_Pn5180_Exchange uses multiple calls to phhalHw_Pn5180_BalExchange, because typical send/receiver sequence requires several PN5180 commands to be executed.

phhalHw_Pn5180_Receive_Int() is just an internal function used to receive data after data has been sent out. So phhalHw_Pn5180_Exchange first sends out the data ('send out' means it sends the data over SPI to PN5180 and PN5180 then sends the data asynchronously via the CLIF to the card) and then phhalHw_Pn5180_Exchange calls phhalHw_Pn5180_Receive_Int to receive the card response. Also here, the card response is received by PN5180 full autonomously and is stored in a buffer within PN5180. Once data is received over the CLIF and stored in that internal buffer, PN5180 informs the host controller about that (via RxIRQ) and host controller can then read out this buffer via SPI. All this (wait for Rx IRQ and read out the buffer) is done within phhalHw_Pn5180_Receive_Int

Christian.

0 项奖励
回复

1,055 次查看
christianeisend
NXP Employee
NXP Employee

Hi,

the Exchange API call used to send out REQA will contain the ATQA in its receive buffer if, and only if, the status code is SUCCESS. (0x0). If this API returns with an timeout error (0x201) it means card didn't respond to ATQA (or card was not in proximity). In this case another call to Exchange() with REQA as transmit buffer is then required.

Christian.

0 项奖励
回复