cryptnox-sdk-esp32 1.0.0
ESP32 SDK for Cryptnox Hardware Wallet
Loading...
Searching...
No Matches
Pn532NfcTransport.h File Reference

CW_NfcTransport adapter wrapping the ESP-IDF PN532 NFC driver. More...

#include "CW_NfcTransport.h"
#include "CW_Logger.h"
#include "pn532.h"
Include dependency graph for Pn532NfcTransport.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Pn532NfcTransport
 CW_NfcTransport implementation backed by the ESP-IDF PN532 driver. More...

Detailed Description

CW_NfcTransport adapter wrapping the ESP-IDF PN532 NFC driver.

Pn532NfcTransport bridges the C-level PN532 NFC driver with the C++ CW_NfcTransport interface consumed by CW_SecureChannel and CryptnoxWallet. Callers construct the PN532 handle independently (via pn532_init) and inject the pointer at construction time.

Typical usage
pn532_t nfc;
pn532_config_t cfg = {};
cfg.spi_host = SPI2_HOST;
cfg.pin_cs = 10;
cfg.skip_bus_init = true;
ESP_ERROR_CHECK(pn532_init(&nfc, &cfg));
ESP32Logger logger;
Pn532NfcTransport transport(&nfc, logger);
ESP32Platform platform;
CryptnoxWallet wallet(transport, logger, crypto, platform);
CW_CryptoProvider backed by mbedTLS and the ESP32 hardware TRNG.
CW_Logger backed by ESP32 UART0.
Definition ESP32Logger.h:48
CW_Platform backed by FreeRTOS vTaskDelay.
CW_NfcTransport implementation backed by the ESP-IDF PN532 driver.
esp_err_t pn532_init(pn532_t *dev, const pn532_config_t *config)
Initialise the PN532 and bring it to a ready state.
Definition pn532.c:657
@ PN532_TRANSPORT_SPI
Definition pn532.h:77
Compile-time configuration passed to pn532_init.
Definition pn532.h:111
spi_host_device_t spi_host
Definition pn532.h:115
pn532_transport_t transport
Definition pn532.h:112
bool skip_bus_init
Definition pn532.h:120
Opaque-like runtime state for a single PN532 instance.
Definition pn532.h:141

Definition in file Pn532NfcTransport.h.