|
cryptnox-sdk-esp32 1.0.0
ESP32 SDK for Cryptnox Hardware Wallet
|
Low-level PN532 NFC controller driver for ESP-IDF (SPI and I²C). More...
#include <stdint.h>#include <stdbool.h>#include "driver/spi_master.h"#include "driver/i2c_master.h"Go to the source code of this file.
Classes | |
| struct | pn532_config_t |
| Compile-time configuration passed to pn532_init. More... | |
| struct | pn532_t |
| Opaque-like runtime state for a single PN532 instance. More... | |
Macros | |
| #define | PN532_MIFARE_ISO14443A (0x00U) |
| Baud-rate selector for ISO 14443-A (Mifare) cards passed to pn532_read_passive_target_id. | |
| #define | PN532_MAX_APDU_LEN (252U) |
| Maximum APDU payload length accepted by pn532_send_apdu. | |
| #define | PN532_I2C_ADDRESS (0x24U) |
| 7-bit I²C slave address of the PN532 (fixed in hardware). | |
Enumerations | |
| enum | pn532_transport_t { PN532_TRANSPORT_SPI , PN532_TRANSPORT_I2C } |
| Physical bus used to communicate with the PN532. More... | |
Functions | |
| esp_err_t | pn532_init (pn532_t *dev, const pn532_config_t *config) |
| Initialise the PN532 and bring it to a ready state. | |
| uint32_t | pn532_get_firmware_version (pn532_t *dev) |
| Query the PN532 firmware version. | |
| bool | pn532_sam_config (pn532_t *dev) |
| Configure the PN532's Security Access Module (SAM). | |
| uint32_t | pn532_read_passive_target_id (pn532_t *dev, uint8_t cardbaudrate) |
| Scan for a passive ISO 14443-A card and return its UID. | |
| bool | pn532_send_apdu (pn532_t *dev, const uint8_t *apdu, uint8_t apdu_len, uint8_t *response, uint16_t *response_len) |
| Exchange a single ISO-DEP APDU with the currently selected card. | |
| bool | pn532_release_target (pn532_t *dev) |
| Release the currently selected NFC target. | |
Low-level PN532 NFC controller driver for ESP-IDF (SPI and I²C).
Provides a transport-agnostic C API for the NXP PN532 NFC controller. Both the ESP-IDF SPI master peripheral and the IDF v5.x I²C master API are supported; the active transport is selected at pn532_init time via pn532_config_t::transport.
Typical usage (SPI):
Definition in file pn532.h.