feat(v2): ESP32-S3 controller with Ethernet, I2S mic beat detection and ESP-NOW
New ESP-IDF project in v2/ that replaces the Pi and the UART bridge: - W5500 Ethernet, INMP441 beat/tempo detector (from esp32-eth), ESP-NOW master - LittleFS data store and a JSON API over the Pi's db/*.json collections, with /db import and export; web UI minified and gzipped at build time - Zone play/stop as 0x4C GROUP_CMD, preset push/send as CMD (binary v2 envelope, byte-identical to src/util/binary_envelope.py), sequencer and scenes, driver registration from the boot hello - Reliable bulk link: acks with retransmit, fragments, state-version digest and resync; beat frames sent twice with a lead so drivers fire together - Bench tooling: lossy-link mode, synthetic beats with echo measurement, USB and logic-analyzer latency scripts, and docs/BENCH_TEST.md Needs the matching led-driver changes (p2p branch) to receive the link and beat frames. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7336c7fb22
commit
a94d6a7de5
37 files changed
+5109
No files matched your search
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
#include "esp_err.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
|
||||
#define MIC_SAMPLE_RATE 16000
|
||||
|
||||
typedef struct {
|
||||
float rms_dbfs; // RMS level over the last block, dB relative to full scale
|
||||
float peak_dbfs; // Peak sample in the last block, dBFS
|
||||
float spl_db; // Approximate dB SPL (INMP441: -26 dBFS @ 94 dB SPL)
|
||||
} mic_level_t;
|
||||
|
||||
// Start the INMP441 I2S capture and the level-measuring task
|
||||
esp_err_t mic_start(void);
|
||||
|
||||
// Latest level reading; returns -120 dBFS until the first block arrives
|
||||
void mic_get_level(mic_level_t *out);
|
||||
|
||||
// Single-listener 16-bit mono PCM stream at MIC_SAMPLE_RATE.
|
||||
// Returns ESP_ERR_INVALID_STATE if someone is already listening.
|
||||
esp_err_t mic_stream_open(void);
|
||||
size_t mic_stream_read(void *buf, size_t len, TickType_t timeout);
|
||||
void mic_stream_close(void);
|
||||
Reference in new issue
Block a user