8 Commits

Author SHA1 Message Date
86a5db5b08 Optimize pin mapping for direct bitwise GPIO ops
Rewire GPIO↔HMC472A so GPIO(n) = step bit (n-1):
  GPIO1→V6(0.5dB), GPIO2→V5(1dB), ... GPIO6→V1(16dB)

This enables single-instruction GPIO updates:
  GPIO.out_w1tc = (step & 0x3F) << 1
  GPIO.out_w1ts = (~step) & 0x7E

Replaces 28-line loop with 4-line bitwise code.
2026-02-03 00:28:33 -07:00
b5794c5f8d Add hardware wiring documentation and KiCad schematic
- wiring.md: Pin mapping table, module pinout, logic levels
- wiring-diagram.svg: Visual connection diagram (S2 Mini ↔ HMC472A)
- hmc472-controller.kicad_pro/sch: KiCad project for EDA work

GPIO1-6 → V1-V6 (active-low, 16/8/4/2/1/0.5 dB)
5V VBUS → +5V, GND → GND
2026-02-03 00:04:56 -07:00
db54d05bed Makefile: use esptool directly, add LittleFS and erase targets
PlatformIO's built-in upload breaks on the S2 Mini (1200bps USB
touch reset disconnects the native USB port). All flash targets
now call esptool directly with the correct S2 partition offsets:
bootloader at 0x1000, firmware at 0x10000, LittleFS at 0x290000.

Also adds USB.begin() before Serial.begin() in main.cpp — required
for ESP32-S2 native USB-CDC to initialize properly.
2026-02-02 23:32:07 -07:00
fb835c9d5d Fix ESP32-S2 build: USB.h, WDT API, remove duplicate flags
- Add #include <USB.h> to all .cpp files (required for HWCDCSerial)
- Use ESP-IDF v5.x esp_task_wdt_config_t struct instead of removed API
- Remove duplicate ARDUINO_USB_MODE/CDC flags from platformio.ini
  (board definition already provides these)
2026-02-02 21:27:24 -07:00
613611d37a Add ESP32-S2 firmware for HMC472A attenuator control
PlatformIO/Arduino firmware for WEMOS/LOLIN S2 Mini:
- 6-bit GPIO control (GPIOs 1-6) with glitch-free register writes
- REST API: /status, /set, /config, /sweep endpoints
- Web UI with PCB green theme, slider, presets, pin visualization
- NVS persistence of attenuation setting across power cycles
- Sweep mode for automated attenuation stepping
- mDNS (attenuator.local), OTA updates, watchdog
2026-02-02 21:24:29 -07:00
bd49570ea0 Track CLAUDE.md with local resource inventory 2026-02-02 13:43:02 -07:00
713c2821f2 Add SVG vector extractions from datasheet
16 SVGs: full-page renders and isolated drawings for each
of the 8 datasheet pages.
2026-02-02 13:42:21 -07:00
a5560470ea Initial commit: HMC472A attenuator module reference materials
Datasheet extraction, module specs, marketing photos, and
project CLAUDE.md with local resource inventory.
2026-02-02 13:41:13 -07:00