P4-Nano: controller port with the C6 as ESP-NOW radio, and the simulator

The controller now builds for the Waveshare ESP32-P4-Nano only (plus the linux
sim and the desktop); the S3 stays for the USB/network bridge in bridge/.

- radio-c6/: C6 firmware, esp-hosted plus ESP-NOW over peer data. The P4 loads
  it from the slave_fw partition when the C6 runs another version (c6_update.c)
- bridge_hosted.c: the C6 as the always-on "c6" bridge, and the P4 as a network
  bridge on UDP 8766 for the desktop
- Ethernet on the P4's EMAC, ES8311 mic; default address 192.168.50.20. The
  W5500, INMP441 and direct ESP-NOW code is gone
- The simulated rig at /sim/ is built into the board image, with an always-on
  "browser" bridge. Its frames go through a queue so a slow page cannot hold up
  the radio, and frames for simulated bars are not sent over the C6. Receiver
  buffers are on the heap; a bar's flash file is only written when it changes
- HTTP server: more handlers, sockets and stack for the rig
- docs/P4_NANO.md, README and Makefile updated; graphify output

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Opus 5.5 committed 2026-11-24 21:45:25 +13:00
1 parent ba8e160aee
commit 4ab0c7c6d7
101 files changed
+3284 -971

No files matched your search

+69 -62
View File
@@ -1,65 +1,11 @@
menu "W5500 config"
config W5500_SPI_HOST
int "SPI host number (1=SPI2, 2=SPI3)"
range 1 2
default 1
config W5500_SPI_CLOCK_MHZ
int "SPI clock speed (MHz)"
range 5 80
default 10
config W5500_SCLK_GPIO
int "SCLK GPIO (XIAO D8)"
default 7
config W5500_MISO_GPIO
int "MISO GPIO (XIAO D9)"
default 8
config W5500_MOSI_GPIO
int "MOSI GPIO (XIAO D10)"
default 9
config W5500_CS_GPIO
int "CS GPIO (XIAO D1)"
default 2
config W5500_INT_GPIO
int "INT GPIO (XIAO D2), -1 to poll"
default 3
config W5500_POLL_PERIOD_MS
int "RX poll period (ms) when INT is -1"
default 10
config W5500_RST_GPIO
int "RST GPIO (XIAO D0), -1 if not wired"
default 1
endmenu
menu "INMP441 mic config"
config MIC_SCK_GPIO
int "SCK GPIO (XIAO D4)"
default 5
config MIC_WS_GPIO
int "WS GPIO (XIAO D5)"
default 6
config MIC_SD_GPIO
int "SD GPIO (XIAO D6)"
default 43
menu "Mic config"
config MIC_STREAM_GAIN
int "Digital gain for the audio stream (x)"
range 1 256
default 16
help
The INMP441 is quiet at full scale; x16 (+24 dB) makes speech
The mic is quiet at full scale; x16 (+24 dB) makes speech
audible without clipping at normal distances.
endmenu
@@ -67,8 +13,8 @@ endmenu
menu "Beat detection config"
config BEAT_LED_GPIO
int "Beat LED GPIO (XIAO user LED is 21), -1 for none"
default 21
int "Beat LED GPIO, -1 for none (the P4-Nano has no user LED)"
default -1
config BEAT_LED_ACTIVE_LOW
bool "Beat LED lights when the pin is low"
@@ -89,7 +35,7 @@ menu "Beat detection config"
range -100 -20
default -75
help
The INMP441 self-noise is about -87 dBFS. Background music in a
An INMP441's self-noise is about -87 dBFS. Background music in a
room can sit around -65 dBFS, so keep this well below that.
config BEAT_LEAD_MS
@@ -106,8 +52,8 @@ endmenu
menu "AP config"
config AP_BUTTON_GPIO
int "AP button GPIO (XIAO D3), -1 for none"
default 4
int "AP button GPIO, -1 for none (the P4-Nano has no user button)"
default -1
help
Active-low push button to ground (internal pull-up). Held while the controller boots, it turns
the Wi-Fi access point on even when the ap_enabled setting is off.
@@ -141,7 +87,7 @@ menu "ESP-NOW config"
config BEAT_TEST_GPIO
int "GPIO toggled on every beat sent (-1 = off)"
range -1 48
range -1 54
default -1
help
For latency measurement: a logic analyzer or scope on this pin and on
@@ -153,3 +99,64 @@ menu "ESP-NOW config"
default 3000
endmenu
menu "ESP32-P4-Nano board"
depends on IDF_TARGET_ESP32P4
config P4_DEFAULT_IP_A
int "Address without DHCP: first byte"
range 0 255
default 192
help
The Nano usually sits on a cable straight to a PC (192.168.50.10), with no DHCP server. After a short
DHCP wait it takes this address, /24, no gateway. Settings "static_ips" still come first.
config P4_DEFAULT_IP_B
int "Address without DHCP: second byte"
range 0 255
default 168
config P4_DEFAULT_IP_C
int "Address without DHCP: third byte"
range 0 255
default 50
config P4_DEFAULT_IP_D
int "Address without DHCP: fourth byte"
range 1 254
default 20
config P4_ETH_MDC_GPIO
int "Ethernet MDC GPIO"
default 31
config P4_ETH_MDIO_GPIO
int "Ethernet MDIO GPIO"
default 52
config P4_ETH_PHY_RST_GPIO
int "IP101 PHY reset GPIO (-1: none)"
range -1 54
default 51
config P4_CODEC_I2C_SDA_GPIO
int "ES8311 I2C SDA GPIO"
default 7
config P4_CODEC_I2C_SCL_GPIO
int "ES8311 I2C SCL GPIO"
default 8
config P4_CODEC_I2C_ADDR
hex "ES8311 I2C address (7-bit)"
default 0x18
config P4_I2S_MCLK_GPIO
int "ES8311 MCLK GPIO"
default 13
config P4_I2S_BCLK_GPIO
int "ES8311 BCLK (SCLK) GPIO"
default 12
config P4_I2S_WS_GPIO
int "ES8311 WS (LRCK) GPIO"
default 10
config P4_I2S_DIN_GPIO
int "ES8311 ADC data into the P4 (ASDOUT) GPIO"
default 11
config P4_MIC_PGA_DB
int "ES8311 microphone gain (dB, 0-30 in 3 dB steps)"
range 0 30
default 24
endmenu