26#include <Adafruit_PN532.h>
159 bool begin()
override;
181 bool sendAPDU(
const uint8_t* apdu, uint8_t apduLen,
182 uint8_t* response, uint8_t& responseLen)
override;
202 uint8_t* response, uint16_t& responseLen)
override;
Shared constants, error codes, and session state for the SDK.
Abstract logging interface.
Abstract NFC transport interface.
Abstract interface for serial/debug output.
Abstract interface for NFC transport operations.
PN532Interface _interface
Wiring variant the active constructor selected.
void resetReader() override
Reset the PN532 into a clean idle state.
bool printFirmwareVersion() override
Pretty-print the PN532 firmware version + supported features.
bool sendAPDU(const uint8_t *apdu, uint8_t apduLen, uint8_t *response, uint8_t &responseLen) override
Exchange one ISO-DEP APDU with the currently selected card.
PN532Adapter & operator=(const PN532Adapter &)=delete
Adafruit_PN532 * _nfc
Owned Adafruit_PN532 driver instance.
PN532Adapter(CW_Logger &logger, uint8_t ssPin, SPIClass *theSPI=&SPI)
Construct an adapter wired over hardware SPI.
bool inListPassiveTarget() override
Poll for a card in the field.
bool begin() override
Initialise the PN532 and probe its firmware version.
~PN532Adapter() override
Release the heap-allocated Adafruit_PN532 instance.
PN532Adapter(const PN532Adapter &)=delete
CW_Logger * _logger
Logger reference (non-owning).
bool sendAPDULarge(const uint8_t *apdu, uint8_t apduLen, uint8_t *response, uint16_t &responseLen) override
APDU exchange that can return more than 255 bytes.
PN532Interface
Physical wiring used to reach the PN532 reader.
@ SPI_HARDWARE
Hardware SPI via an SPIClass instance.
@ SPI_SOFTWARE
Bit-banged SPI on four arbitrary GPIOs.
@ UART
UART via a HardwareSerial instance.
@ I2C
I2C via a TwoWire instance.