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:
3
firmware/main/CMakeLists.txt
Normal file
3
firmware/main/CMakeLists.txt
Normal 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)
|
||||
18
firmware/main/Kconfig.projbuild
Normal file
18
firmware/main/Kconfig.projbuild
Normal 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
|
||||
37
firmware/main/board_rgb_off.c
Normal file
37
firmware/main/board_rgb_off.c
Normal 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
|
||||
}
|
||||
4
firmware/main/board_rgb_off.h
Normal file
4
firmware/main/board_rgb_off.h
Normal file
@@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
/** One-shot: drive onboard WS2812/SK6812 to black, then release RMT. */
|
||||
void board_rgb_led_quiet(void);
|
||||
3
firmware/main/idf_component.yml
Normal file
3
firmware/main/idf_component.yml
Normal 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
17
firmware/main/main.c
Normal 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");
|
||||
}
|
||||
Reference in New Issue
Block a user