| nRF5 SDK v12.0.0 |

Choose documentation: | nRF5 SDK | S130 SoftDevice API | S132 SoftDevice API | S212 SoftDevice API | S332 SoftDevice API

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Adafruit NFC Shield library

The Adafruit NFC Shield library is a port of the Arduino library for nRF51 and nRF52 microcontrollers. The library provides functions to read and write data in ISO/IEC 14443 A compatible NFC tags, creating an NFC polling device. The library is intended to be used with the Adafruit PN532 NFC Shield.

The API for the library is available here: Adafruit PN532 NFC Shield library

The Adafruit Tag Reader Example example shows how to use the library in an application.

# Adafruit PN532 NFC/RFID Controller Shield

The Adafruit NFC Shield is an Arduino Shield that uses the PN532 chipset for communicating through NFC. It can generate its own field to read and write NFC tags and behave like a tag itself. To communicate with a host microcontroller, the PN532 chip provides a communication protocol for TWI and SPI. See the PN532 User Manual for documentation of the protocol. More information about the shield is available on the product page: Adafruit PN532 NFC/RFID Controller Shield

The shield can cooperate with the nRF51 and nRF52 development boards (PCA10028 and PCA10040). These boards are Arduino-compatible. Therefore, no additional adaptation is needed to connect the shield to the board. A tutorial about how to connect the shield to an Arduino board is available here: Shield Wiring

# Functionality of the library

The Adafruit NFC Shield library is a port of the library for Arduino, adapted to work with nRF51 and nRF52, with some improvements and bugfixes. The source code of the original library is available in the Adafruit GitHub repository.

The library provides the following functionality:

- Detecting ISO/IEC 14443 A targets and reading their UID
- Reading individual pages from a tag
- Writing individual pages to a tag (if the tag supports this feature)
- Writing a URL address to a tag in compliance with the URI Record Type Definition

The library was tested with the nRF51 and nRF52 development boards. At the moment, the library supports communication with the shield via TWI only. The following pins are used to communicate between the NFC Shield and the development board:

Function | Adafruit NFC Shield | PCA10028 | PCA10040
--- | --- | --- | ---
TWI SDA | SDA | P.30 | P.26
TWI SCL | SCL | P.07 | P.27
IRQ | Digital 2 | P.14 | P.13
RESET indicator | Digital 3 | P.15 | P.14

Make sure to connect the correct pin to the IRQ line that is specified in `adafruit_pn532_config.h`. This file contains the default configuration, so in most cases, you do not need to update it.