Add PN532 toolkit firmware, web UI, and embedded SPIFFS assets

Includes ESP-IDF NFC stack (deep capture, 4K Classic geometry, UL write API,
open SoftAP), React dashboard with live tag diagnostics, and docs. README
updated for APIs and lab Wi-Fi defaults.

Made-with: Cursor
This commit is contained in:
drjones
2026-03-29 09:32:55 -07:00
parent d1068d965b
commit 8968560565
73 changed files with 8802 additions and 28 deletions

View File

@@ -0,0 +1,3 @@
idf_component_register(SRCS "main.c" "board_rgb_off.c" INCLUDE_DIRS "." REQUIRES net_service nfc_engine led_strip)
spiffs_create_partition_image(storage ../data FLASH_IN_PROJECT)

View File

@@ -0,0 +1,18 @@
menu "Board indicators"
config BOARD_RGB_LED_ENABLE
bool "Turn off onboard addressable RGB at boot (WS2812/SK6812)"
default y
help
ESP32-S3-DevKitC-1 v1.x typically uses one SK6812/WS2812 on GPIO 48.
Disable if your board has no addressable LED or uses a different data pin.
config BOARD_RGB_LED_GPIO
int "Addressable LED data GPIO"
default 48
range 0 48
depends on BOARD_RGB_LED_ENABLE
help
Official DevKitC-1 v1.1: GPIO 48. Older notes sometimes cite GPIO 38 — set in menuconfig if needed.
endmenu

View File

@@ -0,0 +1,37 @@
#include "sdkconfig.h"
#include "board_rgb_off.h"
#include "esp_log.h"
#if CONFIG_BOARD_RGB_LED_ENABLE
#include "esp_err.h"
#include "led_strip.h"
#endif
void board_rgb_led_quiet(void)
{
#if CONFIG_BOARD_RGB_LED_ENABLE
led_strip_handle_t strip = NULL;
const led_strip_config_t strip_config = {
.strip_gpio_num = CONFIG_BOARD_RGB_LED_GPIO,
.max_leds = 1,
.led_pixel_format = LED_PIXEL_FORMAT_GRB,
.led_model = LED_MODEL_WS2812,
.flags = {.invert_out = false},
};
const led_strip_rmt_config_t rmt_config = {
.clk_src = RMT_CLK_SRC_DEFAULT,
.resolution_hz = 10 * 1000 * 1000,
.flags = {.with_dma = false},
};
esp_err_t err = led_strip_new_rmt_device(&strip_config, &rmt_config, &strip);
if (err != ESP_OK) {
ESP_LOGW("board_rgb", "RGB init failed (%s), leaving LED as-is", esp_err_to_name(err));
return;
}
err = led_strip_clear(strip);
if (err != ESP_OK) {
ESP_LOGW("board_rgb", "RGB clear failed (%s)", esp_err_to_name(err));
}
led_strip_del(strip);
#endif
}

View File

@@ -0,0 +1,4 @@
#pragma once
/** One-shot: drive onboard WS2812/SK6812 to black, then release RMT. */
void board_rgb_led_quiet(void);

View File

@@ -0,0 +1,3 @@
## IDF Component Manager — addressable RGB (DevKitC-1)
dependencies:
espressif/led_strip: "^2.5.5"

17
firmware/main/main.c Normal file
View File

@@ -0,0 +1,17 @@
#include "esp_log.h"
#include "board_rgb_off.h"
#include "nfc_engine/nfc_engine.h"
#include "nfc_engine/session_capture.h"
#include "net_service/app_net.h"
static const char *TAG = "main";
void app_main(void)
{
board_rgb_led_quiet();
ESP_LOGI(TAG, "PN532 NFC Toolkit starting");
ESP_ERROR_CHECK(nfc_engine_init());
session_capture_init();
ESP_ERROR_CHECK(app_net_init());
ESP_LOGI(TAG, "Open AP SSID PN532-Toolkit — http://192.168.4.1");
}