Closed dunkmann00 closed 3 years ago
In the event that we do have _req
connected I think we are supposed to call it first, before any command is sent.
Here is another excerpt from the manual:
And the relevant text that follows:
- The PN532 is in Power Down mode (T_PD1), The host controller wants to send a frame to the PN532, and so it asserts the H_REQ line. That makes the PN532 waking up (1) and it acknowledges with P70_IRQ pin (2),
- Then before sending the command frame (3), the host controller has 2 possibilities:
- either the host controller waits for a defined delay (twup) which guarantees in that case that the PN532 will be waken up when the I2C frame will be sent,
- or the host controller monitors the P70_IRQ pin to check when the PN532 is woken up (with a maximum timeout of twup). This option can optimize the overall waiting time if the PN532 was not asleep; there is no need to wait the maximum wakeup time (tready < twup).
Closing this in favor of #41.
This fixes #39.
I tested this code on an itsybitsy m4 express and everything worked as expected. It was even returning the firmware version on the first attempt.