Files
le-mystere-professeur-zacus/PLIP_FIRMWARE/platformio.ini
T
L'électron rare 07433dfdc5 feat(plip): firmware skeleton on ES8388 dev kit
Bringup target: AI-Thinker ESP32-A1S Audio Kit V2.2
(ES8388 codec). End target: custom PLIP PCB with Si3210
SLIC + RJ9 retro handset (per
docs/superpowers/specs/2026-04-08-plip-telephone-design.md).

Three FreeRTOS tasks share state via a queue:
- phone_task (core 1): off-hook GPIO interrupt + ring
- audio_task (core 0): drains command queue, routes to
  ES8388 (dev kit) / Si3210 (PCB) via ESP32-audioI2S
- network_task (core 0): WiFi station + REST server

REST contract for the Zacus master ESP32 to drive PLIP:
- POST /ring   {duration_ms}
- POST /play   {source: "sd:/..." | "http://tower:8001/..."}
- POST /stop
- GET  /status -> {off_hook, playing}

Pin assignments live in platformio.ini build_flags so the
dev kit -> PCB swap stays mechanical (just rewire to
Si3210 SPI + INT and switch the codec init in
audio_task).

MVP scope (option b in the brainstorm):
- ring on demand
- off-hook GPIO -> notify master
- MP3 playback from SD
- WiFi REST endpoint
Out of v1 (deliberately deferred):
- Bluetooth Classic A2DP/HFP (still in the design doc)
- Si3210 driver (when PCB lands)
- OTA via desktop FirmwareManager (after bringup stable)

Files:
- platformio.ini (espressif32@6.5.0, esp32dev board with
  custom partitions + ESP32-A1S build flags)
- partitions/plip_4mb.csv (2x OTA app slots + LittleFS)
- src/main.cpp + 3 task .cpp files (skeleton, log-only)
- README.md (architecture, REST contract, pin map,
  9-step roadmap, submodule conversion)
- CLAUDE.md (nested guidance for Claude Code)
- .gitignore

Inlined for now; convert to a git submodule once a remote
URL is provisioned (procedure documented in README).
Root CLAUDE.md "Firmware" surface and "Where to Look"
table updated.

Acceptance: directory layout + build config + skeleton
sources land. No compile validation in this commit
(PlatformIO not on the workstation per the Q1=ESP32-A1S
dev kit bringup decision).
2026-05-03 13:21:43 +02:00

44 lines
1.3 KiB
INI

; PLIP firmware — bringup target: AI-Thinker ESP32-A1S Audio Kit V2.2
; Board has ES8388 codec, SD slot, dual mic, headphone + speaker out.
; Will retarget to the custom PCB (Si3210 SLIC) once it arrives.
[platformio]
default_envs = devkit_es8388
[env:devkit_es8388]
platform = espressif32@6.5.0
; AI-Thinker ESP32-A1S has no PlatformIO board entry. esp32dev is close
; enough; we override partitions and pins via build flags / source.
board = esp32dev
framework = arduino
board_build.flash_size = 4MB
board_build.partitions = partitions/plip_4mb.csv
board_build.filesystem = littlefs
monitor_speed = 115200
monitor_filters = time, esp32_exception_decoder
monitor_echo = yes
monitor_eol = LF
lib_deps =
esphome/ESP32-audioI2S@2.3.0
bblanchon/ArduinoJson@6.21.5
; ES8388 driver. Several Arduino ports exist; pick whichever the
; bringup engineer validates first.
schreibfaul1/ESP32-audioI2S@^2.0.0
build_flags =
-DCORE_DEBUG_LEVEL=3
; ES8388 I2C address on ESP32-A1S
-DES8388_ADDR=0x10
; I2S pins matching ESP32-A1S V2.2
-DIIS_BCLK=27
-DIIS_LCLK=26
-DIIS_DSIN=25
-DIIS_DOUT=35
; SD on SPI (HSPI on ESP32-A1S)
-DSD_CS=13
-DSD_MOSI=15
-DSD_MISO=2
-DSD_SCK=14
; Off-hook: dev kit board uses BOOT (KEY1, GPIO4) as a stand-in for
; the SLIC interrupt. Replace with GPIO4 from Si3210 INT on the PCB.
-DOFF_HOOK_GPIO=4