Here is my problem: I'm trying to implement a new function in the PN532 libraries which would give me the possibility to shut down the PN532 module in order to reduce power consumption and heat production and then waking up from my code.
Here is the power down function in PN532 I wrote :
pn532_packetbuffer = PN532_COMMAND_POWERDOWN;
pn532_packetbuffer = PN532_SPI_SOUCE; //Autorized wake up source.
DMSG("Shutting down RF module");
delay(2); //Delay to make sure the module is off.
return (0 < HAL(readResponse)(pn532_packetbuffer, sizeof(pn532_packetbuffer)));
This part seems to work (the module is not found and stop to heat).
But now to wake up... even when calling begin() (which call wakeup defined in PN532_SPI, nothing happen and I'm oblige to Hard reset (and plug out & plugin) to recover the board.
I know in SPI mode the NSS line must be LOW as already done in PN532_SPI before sending command in order to wake up:
_spi->setDataMode(SPI_MODE0); // PN532 only supports mode0
_spi->setClockDivider(SPI_CLOCK_DIV8); // set clock 2MHz(max: 5MHz)
/** DUE spi library does not support SPI_CLOCK_DIV8 macro */
_spi->setClockDivider(42); // set clock 2MHz(max: 5MHz)
Documentation : http://www.nxp.com/documents/user_manual/141520.pdf
Thanks in advance!