Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added shutdown function #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Adafruit_PN532.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,24 @@ uint32_t Adafruit_PN532::getFirmwareVersion(void) {
return response;
}

/**************************************************************************/
/*!
@brief Puts the module into sleep mode

@returns 1 if everything is OK, 0 if unable to shutdown
*/
/**************************************************************************/

bool Adafruit_PN532::shutDown() {
pn532_packetbuffer[0] = PN532_COMMAND_POWERDOWN;
pn532_packetbuffer[1] = 0x20; //(0x20, for SPI) (0x28 for SPI and RF detectionThe wakeup source(s) you want too use
pn532_packetbuffer[2] = 0x01; // To eneable the IRQ, 0x00 if you dont want too use the IRQ


if(sendCommandCheckAck(pn532_packetbuffer, 3))
return pn532_packetbuffer[1];
}

/**************************************************************************/
/*!
@brief Sends a command and waits a specified period for the ACK
Expand Down
1 change: 1 addition & 0 deletions Adafruit_PN532.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ class Adafruit_PN532 {
bool writeGPIO(uint8_t pinstate);
uint8_t readGPIO(void);
bool setPassiveActivationRetries(uint8_t maxRetries);
bool shutDown(void);

// ISO14443A functions
bool readPassiveTargetID(
Expand Down