{
  "meta": {
    "title": "ESP32 Audio Path"
  },
  "symbols": {
    "esp32_s3_supermini": {
      "symbol_id": "esp32_s3_supermini",
      "category": "microcontroller",
      "body": { "width": 160, "height": 240 },
      "pins": [
        { "name": "3V3", "number": "1", "side": "left", "offset": 30, "type": "power_in" },
        { "name": "GND", "number": "2", "side": "left", "offset": 60, "type": "ground" },
        { "name": "GPIO5", "number": "10", "side": "right", "offset": 40, "type": "output" },
        { "name": "GPIO6", "number": "11", "side": "right", "offset": 70, "type": "output" },
        { "name": "GPIO7", "number": "12", "side": "right", "offset": 100, "type": "output" }
      ],
      "graphics": {
        "primitives": [{ "type": "rect", "x": 0, "y": 0, "w": 160, "h": 240 }]
      }
    },
    "dac_i2s": {
      "symbol_id": "dac_i2s",
      "category": "audio",
      "body": { "width": 140, "height": 180 },
      "pins": [
        { "name": "3V3", "number": "1", "side": "left", "offset": 20, "type": "power_in" },
        { "name": "GND", "number": "2", "side": "left", "offset": 50, "type": "ground" },
        { "name": "BCLK", "number": "3", "side": "left", "offset": 80, "type": "input" },
        { "name": "LRCLK", "number": "4", "side": "left", "offset": 110, "type": "input" },
        { "name": "DIN", "number": "5", "side": "left", "offset": 140, "type": "input" },
        { "name": "AOUT", "number": "6", "side": "right", "offset": 90, "type": "analog" }
      ],
      "graphics": {
        "primitives": [{ "type": "rect", "x": 0, "y": 0, "w": 140, "h": 180 }]
      }
    },
    "amp": {
      "symbol_id": "amp",
      "category": "output",
      "body": { "width": 120, "height": 120 },
      "pins": [
        { "name": "5V", "number": "1", "side": "left", "offset": 20, "type": "power_in" },
        { "name": "GND", "number": "2", "side": "left", "offset": 50, "type": "ground" },
        { "name": "IN", "number": "3", "side": "left", "offset": 80, "type": "input" },
        { "name": "SPK", "number": "4", "side": "right", "offset": 70, "type": "output" }
      ],
      "graphics": {
        "primitives": [{ "type": "rect", "x": 0, "y": 0, "w": 120, "h": 120 }]
      }
    },
    "psu": {
      "symbol_id": "psu",
      "category": "power",
      "body": { "width": 120, "height": 120 },
      "pins": [
        { "name": "5V_OUT", "number": "1", "side": "right", "offset": 30, "type": "power_out" },
        { "name": "3V3_OUT", "number": "2", "side": "right", "offset": 60, "type": "power_out" },
        { "name": "GND", "number": "3", "side": "right", "offset": 90, "type": "ground" }
      ],
      "graphics": {
        "primitives": [{ "type": "rect", "x": 0, "y": 0, "w": 120, "h": 120 }]
      }
    }
  },
  "instances": [
    { "ref": "U1", "symbol": "esp32_s3_supermini", "properties": { "value": "ESP32-S3" }, "placement": { "x": null, "y": null, "rotation": 0, "locked": false } },
    { "ref": "U2", "symbol": "dac_i2s", "properties": { "value": "DAC" }, "placement": { "x": null, "y": null, "rotation": 0, "locked": false } },
    { "ref": "U3", "symbol": "amp", "properties": { "value": "Amp" }, "placement": { "x": null, "y": null, "rotation": 0, "locked": false } },
    { "ref": "U4", "symbol": "psu", "properties": { "value": "Power" }, "placement": { "x": null, "y": null, "rotation": 0, "locked": false } }
  ],
  "nets": [
    { "name": "3V3", "class": "power", "nodes": [{ "ref": "U4", "pin": "3V3_OUT" }, { "ref": "U1", "pin": "3V3" }, { "ref": "U2", "pin": "3V3" }] },
    { "name": "5V", "class": "power", "nodes": [{ "ref": "U4", "pin": "5V_OUT" }, { "ref": "U3", "pin": "5V" }] },
    { "name": "GND", "class": "ground", "nodes": [{ "ref": "U4", "pin": "GND" }, { "ref": "U1", "pin": "GND" }, { "ref": "U2", "pin": "GND" }, { "ref": "U3", "pin": "GND" }] },
    { "name": "I2S_BCLK", "class": "clock", "nodes": [{ "ref": "U1", "pin": "GPIO5" }, { "ref": "U2", "pin": "BCLK" }] },
    { "name": "I2S_LRCLK", "class": "clock", "nodes": [{ "ref": "U1", "pin": "GPIO6" }, { "ref": "U2", "pin": "LRCLK" }] },
    { "name": "I2S_DOUT", "class": "signal", "nodes": [{ "ref": "U1", "pin": "GPIO7" }, { "ref": "U2", "pin": "DIN" }] },
    { "name": "AUDIO_ANALOG", "class": "analog", "nodes": [{ "ref": "U2", "pin": "AOUT" }, { "ref": "U3", "pin": "IN" }] }
  ],
  "constraints": {
    "groups": [
      { "name": "power_stage", "members": ["U4"], "layout": "cluster" },
      { "name": "compute", "members": ["U1"], "layout": "cluster" },
      { "name": "audio_out", "members": ["U2", "U3"], "layout": "cluster" }
    ],
    "alignment": [
      { "left_of": "U4", "right_of": "U1" },
      { "left_of": "U1", "right_of": "U2" },
      { "left_of": "U2", "right_of": "U3" }
    ],
    "near": []
  },
  "annotations": [
    { "text": "I2S audio chain" }
  ]
}
