diff --git a/Bruce b/Bruce new file mode 160000 index 000000000..212241b55 --- /dev/null +++ b/Bruce @@ -0,0 +1 @@ +Subproject commit 212241b55703ab6b30e0b8b0f7e3903420739fde diff --git a/boards/ESP32S3-Viking/ESP32S3-Viking.ini b/boards/ESP32S3-Viking/ESP32S3-Viking.ini new file mode 100644 index 000000000..1a506033a --- /dev/null +++ b/boards/ESP32S3-Viking/ESP32S3-Viking.ini @@ -0,0 +1,39 @@ +[env:esp32s3_viking] +extends = env +platform = espressif32 +board = esp32-s3-devkitc-1 +framework = arduino +board_build.mcu = esp32s3 +board_build.partitions = boards/ESP32S3-Viking/partitions_16Mb.csv +; board_build.arduino.memory_type = opi_opi +build_src_filter =${env.build_src_filter} +<../boards/ESP32S3-Viking> + +build_flags = + ${env.build_flags} + -DESP32S3_VIKING + -DUSE_TFT_ESPI=1 + -DUSE_HSPI_PORT=1 + -DUSE_TFT_eSPI_TOUCH + -DHAS_TOUCH=1 + ; -DUSE_SD_MMC=1 ; SD card not used + -I$PROJECT_PACKAGES_DIR/framework-arduinoespressif32-libs/esp32s3/include/fatfs/src + -I$PROJECT_PACKAGES_DIR/framework-arduinoespressif32-libs/esp32s3/include/fatfs/vfs + -I$PROJECT_PACKAGES_DIR/framework-arduinoespressif32-libs/esp32s3/include/fatfs/diskio + -I$PROJECT_PACKAGES_DIR/framework-arduinoespressif32-libs/esp32s3/include/fatfs/** + -Iboards/ESP32S3-Viking + -Os + -DCORE_DEBUG_LEVEL=1 + -DARDUINO_USB_CDC_ON_BOOT=1 + -DDISABLE_ALL_LIBRARY_WARNINGS + -DHAS_TOUCH=1 +; -DALLOW_ALL_GPIO_FOR_IR_RF=1 + -DREDRAW_DELAY=1 + ; ESP32-S3-WROOM-1 N16R8 = 8MB OPI PSRAM + ; -DBOARD_HAS_PSRAM + +lib_deps = + ${env.lib_deps} + +lib_ignore = + SD + FFat diff --git a/boards/ESP32S3-Viking/interface.cpp b/boards/ESP32S3-Viking/interface.cpp new file mode 100644 index 000000000..5536a264b --- /dev/null +++ b/boards/ESP32S3-Viking/interface.cpp @@ -0,0 +1,204 @@ +/* + * ESP32S3-Viking - Board interface implementation for Bruce firmware + * + * Hardware: + * - ESP32-S3-WROOM-1 N16R8 (16MB Flash, 8MB OPI PSRAM) + * - ESP32-S3 GPIO Extension Board KIT B + * - ILI9341 2.8" SPI TFT 240x320 (TENSTAR ROBOT) + * - XPT2046 Resistive Touchscreen (TOUCH_CS=IO18, T_IRQ=IO8) + * handled by TFT_eSPI built-in touch support (USE_TFT_eSPI_TOUCH) + * - PN532 NFC/RFID (SPI - osobna magistrala, GPIO 9-14) + * - WS2812 RGB LED (GPIO48) + * - BOOT button (GPIO0) + * + * Wiring TFT (left side of KIT B, top to bottom, no cable crossing): + * GND -> GND, 3V3 -> VCC + * IO4 -> T_IRQ, IO5 -> T_DO/LCD_MISO, IO6 -> T_DIN/LCD_MOSI + * IO7 -> T_CS, IO15 -> T_CLK/LCD_SCK + * IO16 -> LCD_BL, IO17 -> LCD_DC + * IO18 -> LCD_RST, IO8 -> LCD_CS * + * Wiring PN532 SPI (left side of KIT B, lower block): + * IO9 -> PN532 SCK + * IO10 -> PN532 MISO + * IO11 -> PN532 MOSI + * IO12 -> PN532 SS (CS) + * IO13 -> PN532 IRQ + * IO14 -> PN532 RSTO + * + * Wiring RF 433MHz (right side of KIT B): + * IO19 -> RF TX DATA (nadajnik) + * IO20 -> RF RX DATA (odbiornik) + * + * Touch recalibration: hold BOOT button during startup to erase saved + * calibration data and run the calibration wizard again. + */ +#include "core/powerSave.h" +#include "core/utils.h" +#include +#include +#include + +/****************************************************************************** + ** Function name: _setup_gpio() + ** Description: Initial GPIO setup for the device + ******************************************************************************/ +void _setup_gpio() { + // ---- WS2812 LED off at startup ---- + rgbLedWrite(RGB_LED, 0, 0, 0); + + // ---- Touch CS pin - TFT_eSPI will handle the rest ---- + pinMode(TOUCH_CS, OUTPUT); + digitalWrite(TOUCH_CS, HIGH); + + // ---- BOOT button ---- + pinMode(BTN_PIN, INPUT); + + // ---- Default module config ---- + bruceConfigPins.rfModule = CC1101_SPI_MODULE; + bruceConfigPins.rfidModule = PN532_SPI_MODULE; + bruceConfigPins.irRx = RXLED; + bruceConfigPins.irTx = TXLED; + Serial.begin(115200); + +// ---- CC1101 GDO0 pull-down (essential for TX/emulation) ---- +#ifdef USE_CC1101_VIA_SPI + pinMode(CC1101_GDO0_PIN, INPUT_PULLDOWN); // GPIO42 pull-down +#endif +} + +/****************************************************************************** + ** Function name: _post_setup_gpio() + ** Description: Second stage GPIO setup - runs after TFT init + ******************************************************************************/ +void _post_setup_gpio() { + // ---- Touch calibration via TFT_eSPI built-in ---- + pinMode(TOUCH_CS, OUTPUT); + + uint16_t calData[5]; + bool doCalibration = false; + + // Check if BOOT button is held at startup -> force recalibration + if (digitalRead(BTN_PIN) == BTN_ACT) { + // Wait to confirm intentional press (debounce) + delay(100); + if (digitalRead(BTN_PIN) == BTN_ACT) { + // Show message on screen + tft.setRotation(ROTATION); + tft.fillScreen(TFT_BLACK); + tft.setTextColor(TFT_WHITE, TFT_BLACK); + tft.setTextSize(2); + tft.setCursor(20, 100); + tft.println("Recalibrating touch..."); + tft.setCursor(20, 130); + tft.println("Release BOOT button"); + // Wait for button release + while (digitalRead(BTN_PIN) == BTN_ACT) delay(10); + delay(500); + // Delete saved calibration data + LittleFS.remove("/calData"); + doCalibration = true; + } + } + + File caldata = LittleFS.open("/calData", "r"); + if (!caldata || doCalibration) { + if (caldata) caldata.close(); + // No calibration data (or forced) - run calibration + tft.setRotation(ROTATION); + tft.calibrateTouch(calData, TFT_WHITE, TFT_BLACK, 10); + caldata = LittleFS.open("/calData", "w"); + if (caldata) { + caldata.printf( + "%d\n%d\n%d\n%d\n%d\n", calData[0], calData[1], calData[2], calData[3], calData[4] + ); + caldata.close(); + } + } else { + // Load saved calibration data + for (int i = 0; i < 5; i++) { calData[i] = caldata.parseInt(); } + caldata.close(); + tft.setTouch(calData); + } + + // ---- Backlight on ---- + if (TFT_BL >= 0) pinMode(TFT_BL, OUTPUT); + if (TFT_BL >= 0) analogWrite(TFT_BL, 255); + + // ---- LED off ---- + rgbLedWrite(RGB_LED, 0, 0, 0); +} + +/****************************************************************************** + ** Function name: _setBrightness() + ** Description: Set TFT backlight brightness + ******************************************************************************/ +void _setBrightness(uint8_t brightness) { + int bl = map(brightness, 0, 100, MINBRIGHT, 255); + analogWrite(TFT_BL, bl); +} + +/****************************************************************************** + ** Function name: InputHandler() + ** Description: Handles touch and button input for Bruce UI + ******************************************************************************/ +void InputHandler() { + static unsigned long lastTouch = 0; + unsigned long now = millis(); + + // ---- Touch input (poll every ~200ms or on LongPress) ---- + if (now - lastTouch > 200 || LongPress) { + lastTouch = now; + uint16_t t_x = 0, t_y = 0; + bool touched = tft.getTouch(&t_x, &t_y); + if (touched) { + touchPoint.x = t_x; + touchPoint.y = t_y; + touchPoint.pressed = true; + if (wakeUpScreen()) AnyKeyPress = true; + else { + AnyKeyPress = true; + touchHeatMap(touchPoint); + } + } else { + touchPoint.pressed = false; + } + } + + // ---- BOOT Button ---- + if (digitalRead(BTN_PIN) == BTN_ACT) { + if (!wakeUpScreen()) { + AnyKeyPress = true; + SelPress = true; + } + while (digitalRead(BTN_PIN) == BTN_ACT) delay(10); + } +} + +/****************************************************************************** + ** Function name: powerOff() + ******************************************************************************/ +void powerOff() { + rgbLedWrite(RGB_LED, 0, 0, 0); + if (TFT_BL >= 0) analogWrite(TFT_BL, 0); + tft.writecommand(0x10); // SLPIN + esp_sleep_enable_ext0_wakeup((gpio_num_t)BTN_PIN, BTN_ACT); + esp_deep_sleep_start(); +} + +void goToDeepSleep() { powerOff(); } + +/****************************************************************************** + ** Function name: checkReboot() + ******************************************************************************/ +void checkReboot() { + int c = 0; + while (digitalRead(BTN_PIN) == BTN_ACT) { + delay(100); + if (++c > 20) powerOff(); + } +} + +/****************************************************************************** + ** Function name: isCharging() + ******************************************************************************/ +bool isCharging() { return false; } diff --git a/boards/ESP32S3-Viking/partitions_16Mb.csv b/boards/ESP32S3-Viking/partitions_16Mb.csv new file mode 100644 index 000000000..78b60900b --- /dev/null +++ b/boards/ESP32S3-Viking/partitions_16Mb.csv @@ -0,0 +1,5 @@ +# Name, Type, SubType, Offset, Size, Flags +nvs, data, nvs, 0x9000, 0x6000, +app0, app, factory, 0x10000, 0x470000, +spiffs, data, spiffs, 0x480000, 0xB70000, +coredump, data, coredump, 0xFF0000, 0x10000, diff --git a/boards/ESP32S3-Viking/pins_arduino.h b/boards/ESP32S3-Viking/pins_arduino.h new file mode 100644 index 000000000..d19d06b28 --- /dev/null +++ b/boards/ESP32S3-Viking/pins_arduino.h @@ -0,0 +1,258 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include "soc/soc_caps.h" +#include + +// ============================================================= +// ESP32S3-Viking: ESP32-S3 N16R8 + ILI9341 2.8" SPI + XPT2046 +// ============================================================= +// Hardware: +// - ESP32-S3-WROOM-1 N16R8 (16MB Flash, 8MB OPI PSRAM) +// - ESP32-S3 GPIO Extension Board KIT B +// - ILI9341 2.8" SPI TFT 240x320 (TENSTAR ROBOT) +// - XPT2046 Resistive Touch (shared SPI bus) +// - PN532 NFC/RFID (SPI - osobna magistrala) +// - 433MHz ASK RF TX+RX modules (prawa strona KIT B) +// - CC1101 433MHz RF (SPI - niezależna magistrala, prawa strona KIT B) +// WIRING TFT (lewa strona KIT B, od gory do dolu): +// KIT B pin | GPIO | -> | Screen pin +// ----------+-------+----+------------------ +// GND | - | -> | GND +// 3V3 | - | -> | VCC +// IO4 | 4 | -> | T_IRQ +// IO5 | 5 | -> | T_DO = LCD_MISO +// IO6 | 6 | -> | T_DIN = LCD_MOSI (SDI) +// IO7 | 7 | -> | T_CS +// IO15 | 15 | -> | T_CLK = LCD_SCK (CLK) +// IO16 | 16 | -> | LCD_BL (LED) +// IO17 | 17 | -> | LCD_DC (RS) +// IO18 | 18 | -> | LCD_RST +// IO8 | 8 | -> | LCD_CS// (shared) | 7 | -> | T_DIN = LCD_MOSI +// (shared) | 6 | -> | T_DIN = LCD_MOSI (SDI) +// (shared) | 15 | -> | T_CLK = LCD_SCK (CLK) +// (shared) | 5 | -> | T_DO = LCD_MISO (SDO)// WIRING PN532 SPI (lewa strona KIT B, dolny blok): +// IO9 | 9 | -> | PN532 SCK +// IO10 | 10 | -> | PN532 MISO +// IO11 | 11 | -> | PN532 MOSI +// IO12 | 12 | -> | PN532 SS (CS) +// IO13 | 13 | -> | PN532 IRQ +// IO14 | 14 | -> | PN532 RSTO +// +// WIRING RF 433MHz (prawa strona KIT B): +// IO19 | 19 | -> | RF TX DATA (nadajnik) +// IO20 | 20 | -> | RF RX DATA (odbiornik) + +// ============================================================= + +#ifndef DEVICE_NAME +#define DEVICE_NAME "ESP32S3-Viking" +#endif + +// ============================================= +// USB +// ============================================= +#define USB_VID 0x303a +#define USB_PID 0x1001 + +// ============================================= +// UART0 +// ============================================= +static const uint8_t TX = 43; +static const uint8_t RX = 44; + +// ============================================= +// I2C - Wire.h requires SDA/SCL to be defined +// Using free GPIO3 and GPIO46 (left side KIT B) +// ============================================= +#define GROVE_SDA 3 +#define GROVE_SCL 46 +static const uint8_t SDA = GROVE_SDA; +static const uint8_t SCL = GROVE_SCL; + +// ============================================= +// SPI Bus (shared: ILI9341 display + XPT2046 touch) +// Using sequential GPIO block on left side of KIT B +// ============================================= +#define TFT_MOSI_PIN 6 // IO7 -> LCD_MOSI / T_DIN +#define TFT_SCLK_PIN 15 // IO15 -> LCD_SCK / T_CLK +#define TFT_MISO_PIN 5 // IO5 -> LCD_MISO / T_DO +static const uint8_t SS = 5; +static const uint8_t MOSI = TFT_MOSI_PIN; +static const uint8_t SCK = TFT_SCLK_PIN; +static const uint8_t MISO = TFT_MISO_PIN; + +// ============================================= +// PN532 NFC/RFID - SPI (osobna magistrala) +// Lewa strona KIT B, dolny blok GPIO 9-14 +// ============================================= +#define PN532_SCK_PIN 9 // IO9 -> PN532 SCK +#define PN532_MISO_PIN 10 // IO10 -> PN532 MISO +#define PN532_MOSI_PIN 11 // IO11 -> PN532 MOSI +#define PN532_SS_PIN 12 // IO12 -> PN532 SS (CS) +#define PN532_IRQ_PIN 13 // IO13 -> PN532 IRQ +#define PN532_RST_PIN 14 // IO14 -> PN532 RSTO + +// ============================================= +// SD Card - not used +// ============================================= +#define SDCARD_CS -1 +#define SDCARD_SCK -1 +#define SDCARD_MISO -1 +#define SDCARD_MOSI -1 + +// ============================================= +// External SPI modules (CC1101, NRF24, W5500) +// Using right side of KIT B: IO40/IO41/IO42 +// ============================================= +#define SPI_SCK_PIN 38 // IO38 -> CC1101 SCK (prawa strona KIT B) +#define SPI_MOSI_PIN 39 // IO39 -> CC1101 MOSI +#define SPI_MISO_PIN 40 // IO40 -> CC1101 MISO +#define SPI_SS_PIN 41 // IO41 -> CC1101 CS + +#define USE_CC1101_VIA_SPI +#define CC1101_GDO0_PIN 42 // IO42 -> GDO0 +#define CC1101_SS_PIN 41 // IO41 -> CS +#define CC1101_MOSI_PIN 39 // IO39 -> MOSI +#define CC1101_SCK_PIN 38 // IO38 -> SCK +#define CC1101_MISO_PIN 40 // IO40 -> MISO + +#define USE_NRF24_VIA_SPI +#define NRF24_CE_PIN -1 +#define NRF24_SS_PIN -1 +#define NRF24_MOSI_PIN SPI_MOSI_PIN +#define NRF24_SCK_PIN SPI_SCK_PIN +#define NRF24_MISO_PIN SPI_MISO_PIN + +#define USE_W5500_VIA_SPI +#define W5500_SS_PIN -1 +#define W5500_MOSI_PIN SPI_MOSI_PIN +#define W5500_SCK_PIN SPI_SCK_PIN +#define W5500_MISO_PIN SPI_MISO_PIN +#define W5500_INT_PIN -1 + +// ============================================= +// TFT Display: ILI9341 2.8" SPI 240x320 +// Wired to left side of KIT B (sequential GPIOs) +// ============================================= +#define USER_SETUP_LOADED +#define ILI9341_2_DRIVER 1 +#define TFT_INVERSION_ON 0 +#define TFT_WIDTH 240 +#define TFT_HEIGHT 320 + +#define TFT_MISO TFT_MISO_PIN // IO16 +#define TFT_MOSI TFT_MOSI_PIN // IO7 +#define TFT_SCLK TFT_SCLK_PIN // IO15 +#define TFT_DC 17 // IO17 -> LCD_DC#define TFT_RST 4 // IO4 -> LCD_RST +#define TFT_DC 17 // IO17 -> LCD_DC +#define TFT_CS 8 // IO8 -> LCD_CS +#define TFT_RST 18 // IO18 -> LCD_RST#define TFT_BACKLIGHT_ON HIGH +#define TFT_BL 16 // IO16 -> LCD_BL (backlight) +#define SMOOTH_FONT 1 + +#define SPI_FREQUENCY 40000000 +#define SPI_READ_FREQUENCY 20000000 +#define SPI_TOUCH_FREQUENCY 2500000 + +// ============================================= +// Display Setup +// ============================================= +#define HAS_SCREEN 1 +#define ROTATION 1 // Landscape 320x240 +#define MINBRIGHT 1 +#define BACKLIGHT 17 + +// ============================================= +// Touch Screen: XPT2046 Resistive (shared SPI) +// ============================================= +#define HAS_TOUCH 1 +#define TOUCH_CS 7 // IO18 -> T_CS +#define TOUCH_IRQ 4 // IO8 -> T_IRQ + +#define XPT2046_X_MIN 200 +#define XPT2046_X_MAX 3900 +#define XPT2046_Y_MIN 200 +#define XPT2046_Y_MAX 3900 + +// ============================================= +// Font Sizes +// ============================================= +#define FP 1 +#define FM 2 +#define FG 3 + +// ============================================= +// RGB LED - WS2812 on IO48 +// ============================================= +#define HAS_RGB_LED 1 +#define RGB_LED 48 +#define LED_TYPE WS2812B +#define LED_ORDER GRB +#define LED_TYPE_IS_RGBW 0 +#define LED_COUNT 1 +#define LED_COLOR_STEP 5 + +// ============================================= +// Buttons (BOOT button = IO0) +// ============================================= +#define HAS_BTN 1 +#define BTN_ALIAS '"Boot"' +#define BTN_PIN 0 +#define BTN_ACT LOW +#define SEL_BTN 0 + +// ============================================= +// Audio - not available +// ============================================= + +// ============================================= +// Battery ADC - not available +// ============================================= +#define ANALOG_BAT_PIN -1 +#define ANALOG_BAT_MULTIPLIER 2.0f + +// ============================================= +// Infrared TX/RX (right side of KIT B) +// IO38 = TX, IO39 = RX +// ============================================= +#define TXLED 38 +#define RXLED 39 +#define LED_ON HIGH +#define LED_OFF LOW +#define IR_TX_PINS {{"GPIO38", 38}, {"GPIO39", 39}} +#define IR_RX_PINS {{"GPIO38", 38}, {"GPIO39", 39}} + +// ============================================= +// RF 433MHz ASK (prawa strona KIT B) +// IO19 = TX DATA -> nadajnik +// IO20 = RX DATA -> odbiornik +// Zasilanie modulow: VCC -> 5V (lub 3.3V), GND -> GND +// ============================================= +#define RF_TX_PINS {{"GPIO19", 19}, {"GPIO20", 20}} +#define RF_RX_PINS {{"GPIO19", 19}, {"GPIO20", 20}} +#define RF_TX_DEFAULT_PIN 19 // IO19 = TX DATA (nadajnik) +#define RF_RX_DEFAULT_PIN 20 // IO20 = RX DATA (odbiornik) + +// ============================================= +// Serial / GPS +// ============================================= +#define SERIAL_TX 43 +#define SERIAL_RX 44 +#define GPS_SERIAL_TX SERIAL_TX +#define GPS_SERIAL_RX SERIAL_RX + +// ============================================= +// BadUSB (USB HID via native USB) +// ============================================= +#define USB_as_HID 1 +#define BAD_TX 3 +#define BAD_RX 46 + +// ============================================= +// Deep Sleep wakeup on BOOT button +// ============================================= +#define DEEPSLEEP_WAKEUP_PIN 0 +#define DEEPSLEEP_PIN_ACT LOW + +#endif /* Pins_Arduino_h */ diff --git a/boards/_boards_json/ESP32S3-Viking.json b/boards/_boards_json/ESP32S3-Viking.json new file mode 100644 index 000000000..19da87804 --- /dev/null +++ b/boards/_boards_json/ESP32S3-Viking.json @@ -0,0 +1,50 @@ +{ + "build": { + "arduino": { + "ldscript": "esp32s3_out.ld", + "partitions": "default_16MB.csv", + "memory_type": "qio_opi" + }, + "core": "esp32", + "extra_flags": [ + "-DDESP32S3_VIKING", + "-DBOARD_HAS_PSRAM", + "-DARDUINO_RUNNING_CORE=1", + "-DARDUINO_EVENT_RUNNING_CORE=1", + "-DARDUINO_USB_CDC_ON_BOOT", + "-DARDUINO_USB_MODE=1" + ], + "f_cpu": "240000000L", + "f_flash": "80000000L", + "flash_mode": "qio", + "hwids": [ + [ + "0X303A", + "0x1001" + ] + ], + "mcu": "esp32s3", + "variant": "ESP32S3-Viking" + }, + "connectivity": [ + "bluetooth", + "wifi" + ], + "debug": { + "openocd_target": "esp32s3-builtin.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "ESP32S3-Viking", + "upload": { + "flash_size": "16MB", + "maximum_ram_size": 327680, + "maximum_size": 16777216, + "require_upload_port": true, + "speed": 921600 + }, + "url": "https://github.com/piotrkliszka-bot/Bruce", + "vendor": "Custom ESP32-S3 N16R8 KIT B" +} diff --git a/boards/pinouts/pins_arduino.h b/boards/pinouts/pins_arduino.h index 8cc716273..76d7fb8fb 100644 --- a/boards/pinouts/pins_arduino.h +++ b/boards/pinouts/pins_arduino.h @@ -46,4 +46,6 @@ #include "../ESP32-C5-tft/pins_arduino.h" #elif ESP32C5_DEVKITC_1 #include "../ESP32-C5/pins_arduino.h" +#elif defined(ESP32S3_VIKING) +#include "../ESP32S3-Viking/pins_arduino.h" #endif diff --git a/platformio.ini b/platformio.ini index 0ae3c1bb9..0299d27bc 100644 --- a/platformio.ini +++ b/platformio.ini @@ -10,9 +10,10 @@ [platformio] default_envs = + esp32s3_viking ;m5stack-cardputer ;m5stack-sticks3 - m5stack-cplus2 + ;m5stack-cplus2 ;m5stack-cplus1_1 ;LAUNCHER_m5stack-cplus1_1 ;m5stack-core2 diff --git a/src/core/configPins.h b/src/core/configPins.h index ed4c31678..687c017a9 100644 --- a/src/core/configPins.h +++ b/src/core/configPins.h @@ -187,11 +187,19 @@ class BruceConfigPins { int irRx = RXLED; // RF + #ifdef RF_TX_DEFAULT_PIN + int rfTx = RF_TX_DEFAULT_PIN; +#else int rfTx = GROVE_SDA; +#endif +#ifdef RF_RX_DEFAULT_PIN + int rfRx = RF_RX_DEFAULT_PIN; +#else int rfRx = GROVE_SCL; - int rfModule = M5_RF_MODULE; +#endif float rfFreq = 433.92; int rfFxdFreq = 1; + int rfModule = M5_RF_MODULE; int rfScanRange = 3; // iButton Pin diff --git a/src/modules/rfid/PN532.cpp b/src/modules/rfid/PN532.cpp index 89ce4d307..0a26221ee 100644 --- a/src/modules/rfid/PN532.cpp +++ b/src/modules/rfid/PN532.cpp @@ -259,7 +259,7 @@ PN532::PN532(CONNECTION_TYPE connection_type) { #ifdef M5STICK else if (connection_type == CONNECTION_TYPE::I2C_SPI) nfc.setInterface(GPIO_NUM_26, GPIO_NUM_25); #endif - else nfc.setInterface(SPI_SCK_PIN, SPI_MISO_PIN, SPI_MOSI_PIN, SPI_SS_PIN); + else nfc.setInterface(PN532_SCK_PIN, PN532_MISO_PIN, PN532_MOSI_PIN, PN532_SS_PIN); } bool PN532::begin() {