krishnax12/t113-minimal-linux

Allwinner T113-S3 dual-Cortex-A7 SoC with integrated 128MB DDR3, multi-rail decoupling, 24MHz and 32.768kHz oscillators, filtering, and exposed test points.

Version
0.1.1
License
unset
Stars
0

circuits/UsbSense.tsx

import { MMBT3904_RANGE_100_300_ } from "../imports/MMBT3904_RANGE_100_300_"
import { R, Silk } from "./helpers"

// USB0 VBUS-present input for board-specific Linux gadget firmware.
// An NPN avoids a direct5V path into the GPIO, including while IO power is off.
// PD22 reads LOW when USB0 VBUS is present. Remove R_USB0_COL to reuse PD22.
export function UsbSense() {
  return (
    <>
      <MMBT3904_RANGE_100_300_
        name="Q_USB0_SENSE"
        pcbX={-60}
        pcbY={-10}
        connections={{
          pin1: "net.USB0_SENSE_B",
          pin2: "net.GND",
          pin3: "net.USB0_SENSE_C",
        }}
      />
      <group
        name="vbus_bias"
        pcbX={0}
        pcbY={0}
        schLayout={{ layoutMode: "relative" }}
      >
        <resistor
          name="R_USB0_BASE"
          schX={0}
          schY={1}
          schRotation={270}
          resistance="100k"
          footprint="0603"
          pcbX={-60}
          pcbY={-15}
          connections={{ pin1: "net.USB0_VBUS", pin2: "net.USB0_SENSE_B" }}
        />
        <resistor
          name="R_USB0_BE"
          resistance="1M"
          footprint="0603"
          pcbX={-60}
          pcbY={-18}
          schX={0}
          schY={-1}
          schRotation={270}
          connections={{ pin1: "net.USB0_SENSE_B", pin2: "net.GND" }}
        />
      </group>
      <R
        name="R_USB0_COL"
        value="1k"
        a="USB0_SENSE_C"
        b="PD22"
        x={-55}
        y={-10}
      />
      <R name="R_USB0_PULLUP" value="47k" a="PD22" b="V3V3" x={-55} y={-15} />
      <Silk text="USB0 SENSE / PD22" x={-58} y={-22} size={0.75} />
    </>
  )
}