0hmX/arducam-mini-2mp-plus-b0067-clone

This code defines React components representing various hardware electronic components such as sensors, chips, capacitors, inductors, and memory devices, including their physical pin layouts, footprints, and 3D CAD models for PCB design integration.

Version
1.0.3
License
unset
Stars
0

components/OV2640.tsx

import type { ChipProps } from "@tscircuit/props"
import { Fragment } from "react"

const pinLabels = {
  pin1: ["A1", "DOGND"],
  pin2: ["A2", "EXPST_B"],
  pin3: ["A3", "AGND"],
  pin4: ["A4", "SGND"],
  pin5: ["A5", "VREFN"],
  pin6: ["A6", "STROBE"],
  pin7: ["B1", "DOVDD"],
  pin8: ["B2", "FREX"],
  pin9: ["B3", "AVDD"],
  pin10: ["B4", "SVDD1"],
  pin11: ["B5", "SVDD2"],
  pin12: ["B6", "PWDN"],
  pin13: ["C1", "SIO_D"],
  pin14: ["C2", "SIO_C"],
  pin15: ["C3", "HREF"],
  pin16: ["C4", "XVCLK"],
  pin17: ["C5", "VREFH"],
  pin18: ["C6", "RESETB"],
  pin19: ["D2", "VSYNC"],
  pin20: ["D6", "NC"],
  pin21: ["E1", "Y1"],
  pin22: ["E2", "Y0"],
  pin23: ["E3", "PCLK"],
  pin24: ["E4", "EGND"],
  pin25: ["E5", "Y6"],
  pin26: ["E6", "DGND1"],
  pin27: ["F1", "EVDD1"],
  pin28: ["F2", "DVDD1"],
  pin29: ["F3", "Y2"],
  pin30: ["F4", "Y4"],
  pin31: ["F5", "Y8"],
  pin32: ["F6", "DVDD2"],
  pin33: ["G1", "EVDD2"],
  pin34: ["G2", "DGND2"],
  pin35: ["G3", "Y3"],
  pin36: ["G4", "Y5"],
  pin37: ["G5", "Y7"],
  pin38: ["G6", "Y9"],
} as const

const pinAttributes = {
  pin1: { requiresGround: true },
  pin3: { requiresGround: true },
  pin4: { requiresGround: true },
  pin7: { requiresPower: true },
  pin9: { requiresPower: true },
  pin10: { requiresPower: true },
  pin11: { requiresPower: true },
  pin24: { requiresGround: true },
  pin26: { requiresGround: true },
  pin27: { requiresPower: true },
  pin28: { requiresPower: true },
  pin32: { requiresPower: true },
  pin33: { requiresPower: true },
  pin34: { requiresGround: true },
} as const

const balls = [
  [1, "A1", -2.0, 2.4], [2, "A2", -1.2, 2.4],
  [3, "A3", -0.4, 2.4], [4, "A4", 0.4, 2.4],
  [5, "A5", 1.2, 2.4], [6, "A6", 2.0, 2.4],
  [7, "B1", -2.0, 1.6], [8, "B2", -1.2, 1.6],
  [9, "B3", -0.4, 1.6], [10, "B4", 0.4, 1.6],
  [11, "B5", 1.2, 1.6], [12, "B6", 2.0, 1.6],
  [13, "C1", -2.0, 0.8], [14, "C2", -1.2, 0.8],
  [15, "C3", -0.4, 0.8], [16, "C4", 0.4, 0.8],
  [17, "C5", 1.2, 0.8], [18, "C6", 2.0, 0.8],
  [19, "D2", -1.2, 0.0], [20, "D6", 2.0, 0.0],
  [21, "E1", -2.0, -0.8], [22, "E2", -1.2, -0.8],
  [23, "E3", -0.4, -0.8], [24, "E4", 0.4, -0.8],
  [25, "E5", 1.2, -0.8], [26, "E6", 2.0, -0.8],
  [27, "F1", -2.0, -1.6], [28, "F2", -1.2, -1.6],
  [29, "F3", -0.4, -1.6], [30, "F4", 0.4, -1.6],
  [31, "F5", 1.2, -1.6], [32, "F6", 2.0, -1.6],
  [33, "G1", -2.0, -2.4], [34, "G2", -1.2, -2.4],
  [35, "G3", -0.4, -2.4], [36, "G4", 0.4, -2.4],
  [37, "G5", 1.2, -2.4], [38, "G6", 2.0, -2.4],
] as const

const OV2640CSP2Footprint = () => (
  <footprint>
    {balls.map(([pin, ball, pcbX, pcbY]) => (
      <Fragment key={ball}>
        <smtpad
          portHints={[`pin${pin}`]}
          pcbX={pcbX}
          pcbY={pcbY}
          shape="circle"
          radius="0.175mm"
        />
      </Fragment>
    ))}
    <courtyardoutline
      outline={[
        { x: -2.8625, y: 3.1425 },
        { x: 2.8625, y: 3.1425 },
        { x: 2.8625, y: -3.1425 },
        { x: -2.8625, y: -3.1425 },
        { x: -2.8625, y: 3.1425 },
      ]}
    />
    <silkscreencircle
      pcbX={0.4696}
      pcbY={0.145}
      radius="0.18mm"
      strokeWidth="0.1mm"
    />
  </footprint>
)

/**
 * OV02640-VL9A bare CSP2 sensor.
 *
 * Body, 0.8 mm pitch, nominal 0.35 mm ball diameter, sparse D row, and
 * optical-array offset are copied from OmniVision's package drawing. The PCB
 * land diameter is deliberately equal to the nominal ball diameter; mask and
 * paste must be checked with the chosen CSP assembly process before release.
 */
export const OV2640 = (props: ChipProps<typeof pinLabels>) => (
  <chip
    pinLabels={pinLabels}
    pinAttributes={pinAttributes}
    manufacturerPartNumber="OV02640-VL9A"
    footprint={<OV2640CSP2Footprint />}
    {...props}
  />
)