{
  "metadata": {
    "id": "rev-flex-dock",
    "name": "REV Flex Dock",
    "type": "motor-controller-accessory",
    "manufacturer": "REV Robotics",
    "part_number": "REV-11-2858",
    "datasheet_url": "https://docs.revrobotics.com/brushless/spark-flex/overview/dock",
    "description": "Dock accessory for the SPARK Flex motor controller that provides external motor outputs and a 6-pin JST-PH encoder port.",
    "schema_version": "1.4.0",
    "version": "0.3.0"
  },
  "domains": [
    {
      "domain": "electrical",
      "resources": [
        {
          "id": "motor_brushed_pos",
          "name": "Brushed Motor +",
          "connector_type": "flying_lead_12awg",
          "description": "Brushed DC motor positive lead. Wire length 150mm; 12AWG.",
          "functions": [
            {
              "name": "motor_pos",
              "direction": "source",
              "signal_class": "power"
            }
          ]
        },
        {
          "id": "motor_brushed_neg",
          "name": "Brushed Motor -",
          "connector_type": "flying_lead_12awg",
          "description": "Brushed DC motor negative lead. Wire length 150mm; 12AWG.",
          "functions": [
            {
              "name": "motor_neg",
              "direction": "source",
              "signal_class": "power"
            }
          ]
        },
        {
          "id": "motor_bldc_phase_1",
          "name": "Brushless Phase 1",
          "connector_type": "bullet_connector",
          "description": "Brushless motor phase output via bullet connector (exact size not specified in manufacturer documentation).",
          "functions": [
            {
              "name": "power_output",
              "direction": "source",
              "signal_class": "power"
            }
          ]
        },
        {
          "id": "motor_bldc_phase_2",
          "name": "Brushless Phase 2",
          "connector_type": "bullet_connector",
          "description": "Brushless motor phase output via bullet connector (exact size not specified in manufacturer documentation).",
          "functions": [
            {
              "name": "power_output",
              "direction": "source",
              "signal_class": "power"
            }
          ]
        },
        {
          "id": "motor_bldc_phase_3",
          "name": "Brushless Phase 3",
          "connector_type": "bullet_connector",
          "description": "Brushless motor phase output via bullet connector (exact size not specified in manufacturer documentation).",
          "functions": [
            {
              "name": "power_output",
              "direction": "source",
              "signal_class": "power"
            }
          ]
        },
        {
          "id": "enc_vcc",
          "name": "Encoder VCC",
          "connector_type": "jst_ph_6pin",
          "description": "Encoder supply output on 6-pin JST-PH port.",
          "functions": [
            {
              "name": "ENC_VCC",
              "direction": "source",
              "signal_class": "power"
            }
          ]
        },
        {
          "id": "enc_gnd",
          "name": "Encoder GND",
          "connector_type": "jst_ph_6pin",
          "description": "Encoder ground on 6-pin JST-PH port.",
          "functions": [
            {
              "name": "ENC_GND",
              "direction": "sink",
              "signal_class": "ground"
            }
          ]
        },
        {
          "id": "enc_a",
          "name": "Encoder A",
          "connector_type": "jst_ph_6pin",
          "description": "Encoder channel A input on 6-pin JST-PH port.",
          "functions": [
            {
              "name": "ENC_A",
              "direction": "sink",
              "signal_class": "data"
            }
          ]
        },
        {
          "id": "enc_b",
          "name": "Encoder B",
          "connector_type": "jst_ph_6pin",
          "description": "Encoder channel B input on 6-pin JST-PH port.",
          "functions": [
            {
              "name": "ENC_B",
              "direction": "sink",
              "signal_class": "data"
            }
          ]
        },
        {
          "id": "enc_sig_3",
          "name": "Encoder Signal 3",
          "connector_type": "jst_ph_6pin",
          "description": "Additional signal used for hall sensors (brushless) or encoder index (brushed). Pin mapping not specified.",
          "functions": [
            {
              "name": "digital_input",
              "direction": "sink",
              "signal_class": "data"
            }
          ]
        },
        {
          "id": "enc_sig_4",
          "name": "Encoder Signal 4",
          "connector_type": "jst_ph_6pin",
          "description": "Aux/reserved signal on encoder port (function not specified).",
          "functions": [
            {
              "name": "digital_input",
              "direction": "sink",
              "signal_class": "data"
            }
          ]
        }
      ],
      "interfaces": [
        {
          "id": "brushed_motor_output",
          "name": "Brushed DC Motor Output",
          "protocol": {
            "type": "power",
            "role": "output"
          },
          "description": "2-wire brushed DC motor output (M+ / M-). (Mode-dependent on SPARK Flex configuration.)",
          "requires": [
            {
              "function": "motor_pos",
              "count": 1
            },
            {
              "function": "motor_neg",
              "count": 1
            }
          ],
          "warnings": "High-current path: ensure secure connections and strain relief."
        },
        {
          "id": "brushless_motor_output",
          "name": "Brushless Motor Phase Outputs",
          "protocol": {
            "type": "custom",
            "role": "peer"
          },
          "description": "3-phase brushless motor outputs via three bullet connectors (phase order interchangeable).",
          "requires": [
            {
              "function": "power_output",
              "count": 3
            }
          ],
          "warnings": "Mode-dependent on SPARK Flex configuration. Phase order affects direction; swap any two phases to reverse motor direction."
        },
        {
          "id": "encoder_port",
          "name": "Encoder Port",
          "protocol": {
            "type": "digital",
            "role": "receiver"
          },
          "description": "6-pin JST-PH port for NEO/NEO550 hall sensors (brushless mode) or quadrature encoders (ABI) in brushed mode. Absolute duty-cycle encoders not supported on this port.",
          "requires": [
            {
              "function": "ENC_A",
              "count": 1
            },
            {
              "function": "ENC_B",
              "count": 1
            },
            {
              "function": "ENC_VCC",
              "count": 1
            },
            {
              "function": "ENC_GND",
              "count": 1
            }
          ],
          "recommendations": "If using an ABI encoder, use the additional signal pin(s) for index (I) as needed; pin mapping is not specified in the manufacturer documentation.",
          "warnings": "Does not support absolute (duty cycle) encoders on this port; use the SPARK Flex Data Port for absolute encoders."
        }
      ]
    },
    {
      "domain": "mechanical",
      "resources": [
        {
          "id": "dock_hole_1",
          "name": "Docking Hole 1",
          "connector_type": "through_hole",
          "description": "Docking screw hole for attaching to SPARK Flex using M3 hardware.",
          "functions": [
            {
              "name": "mounting_hole"
            }
          ]
        },
        {
          "id": "dock_hole_2",
          "name": "Docking Hole 2",
          "connector_type": "through_hole",
          "description": "Docking screw hole for attaching to SPARK Flex using M3 hardware.",
          "functions": [
            {
              "name": "mounting_hole"
            }
          ]
        },
        {
          "id": "dock_hole_3",
          "name": "Docking Hole 3",
          "connector_type": "through_hole",
          "description": "Docking screw hole for attaching to SPARK Flex using M3 hardware.",
          "functions": [
            {
              "name": "mounting_hole"
            }
          ]
        },
        {
          "id": "dock_hole_4",
          "name": "Docking Hole 4",
          "connector_type": "through_hole",
          "description": "Docking screw hole for attaching to SPARK Flex using M3 hardware.",
          "functions": [
            {
              "name": "mounting_hole"
            }
          ]
        },
        {
          "id": "mount_hole_1",
          "name": "Mounting Hole 1",
          "connector_type": "threaded_hole",
          "description": "#10-32 threaded mounting hole on 0.5in grid; max thread depth 0.25in.",
          "functions": [
            {
              "name": "mounting_hole"
            }
          ]
        },
        {
          "id": "mount_hole_2",
          "name": "Mounting Hole 2",
          "connector_type": "threaded_hole",
          "description": "#10-32 threaded mounting hole on 0.5in grid; max thread depth 0.25in.",
          "functions": [
            {
              "name": "mounting_hole"
            }
          ]
        },
        {
          "id": "mount_hole_3",
          "name": "Mounting Hole 3",
          "connector_type": "threaded_hole",
          "description": "#10-32 threaded mounting hole on 0.5in grid; max thread depth 0.25in.",
          "functions": [
            {
              "name": "mounting_hole"
            }
          ]
        },
        {
          "id": "mount_hole_4",
          "name": "Mounting Hole 4",
          "connector_type": "threaded_hole",
          "description": "#10-32 threaded mounting hole on 0.5in grid; max thread depth 0.25in.",
          "functions": [
            {
              "name": "mounting_hole"
            }
          ]
        },
        {
          "id": "mount_hole_5",
          "name": "Mounting Hole 5",
          "connector_type": "threaded_hole",
          "description": "#10-32 threaded mounting hole on 0.5in grid; max thread depth 0.25in.",
          "functions": [
            {
              "name": "mounting_hole"
            }
          ]
        }
      ],
      "interfaces": [
        {
          "id": "dock_mount",
          "name": "Dock Mount (to SPARK Flex)",
          "protocol": {
            "type": "threaded_connection",
            "role": "mounting_point"
          },
          "description": "Docking attachment using four M3 fasteners (hardware not included).",
          "requires": [
            {
              "function": "mounting_hole",
              "count": 4
            }
          ]
        },
        {
          "id": "face_mount",
          "name": "Face Mount Pattern",
          "protocol": {
            "type": "threaded_connection",
            "role": "mounting_point"
          },
          "description": "Five #10-32 threaded mounting holes on 0.5in grid for mounting the dock/controller stack to a structure. Max thread depth 0.25in.",
          "requires": [
            {
              "function": "mounting_hole",
              "count": 5
            }
          ]
        }
      ]
    }
  ],
  "usage_notes": "Docks to a SPARK Flex motor controller (REV-11-2159) using standard M3 docking hardware (not included). Provides brushless phase outputs, brushed DC motor leads, and a 6-pin JST-PH encoder port.",
  "warnings": [
    "Absolute (duty cycle) encoders are not supported on the Flex Dock encoder port; use the SPARK Flex Data Port for absolute encoders.",
    "Motor outputs are high-current paths; use appropriately rated wire, connectors, and strain relief."
  ]
}