muse/book-reading-clip-lamp

A 60‑mm ESP32‑S3 lamp-head PCB combining USB‑C battery charging/power regulation, OV5640 autofocus camera interfacing, I²S microphone and differential speaker audio, six‑LED boost-driven reading light, buttons, status indicators, and battery monitoring.

Version
0.2.5
License
unset
Stars
0

indicator-parts.tsx

SchematicSchematic preview for indicator-parts.tsx
import type { ChipProps, LedProps } from "@tscircuit/props"
import { USBLC6_2SC6 as CatalogUsbESD } from "./imports/USBLC6_2SC6"
import { XL_3216WWC as CatalogReadingLED } from "./imports/XL_3216WWC"

// XL-3216WWC / C965830: warm white, 2800–3400 K, 20 mA ABSOLUTE MAX.
// Use 15 mA nominal or less, and verify thermal derating in the enclosure.
// Datasheet p8: physical pin1 = cathode, pin2 = anode; recommended land pattern
// is 0.8 x 1.5 mm pads separated by a 1.7 mm gap. Override the much larger
// catalog lands while preserving supplier identity and package model.
// https://atta.szlcsc.com/upload/public/pdf/source/20250225/5C4852FBB913D8AF4C088570026DA85C.pdf
// This modest-output LED must pass illuminance/colour and camera-glare testing.
export const ReadingLED = (props: LedProps) => (
  <CatalogReadingLED
    {...props}
    footprint={
      <footprint>
        <smtpad portHints={["pin1", "cathode", "neg"]} pcbX={-1.25} pcbY={0} width={0.8} height={1.5} shape="rect" />
        <smtpad portHints={["pin2", "anode", "pos"]} pcbX={1.25} pcbY={0} width={0.8} height={1.5} shape="rect" />
        <silkscreenpath route={[{x: -1.7, y: 1}, {x: 1.7, y: 1}]} />
        <silkscreenpath route={[{x: -1.7, y: -1}, {x: 1.7, y: -1}]} />
        <silkscreenpath route={[{x: -1.9, y: -0.8}, {x: -1.9, y: 0.8}]} />
        <courtyardrect width={4.1} height={2.3} />
      </footprint>
    }
  />
)

// ST USBLC6-2SC6 (not a pin-compatible substitute solely by marketing name).
// Datasheet Figure 1: 1 & 6 = I/O1; 3 & 4 = I/O2; 2 = GND; 5 = VBUS.
// https://www.st.com/resource/en/datasheet/usblc6-2.pdf
// Pins within each pair are internally connected. Use the same net on 1/6 and
// on 3/4; do not model the protection array as series-resistive isolation.
export const usbEsdPinLabels = {
  pin1: ["IO1_IN"], pin2: ["GND"], pin3: ["IO2_IN"],
  pin4: ["IO2_OUT"], pin5: ["VBUS"], pin6: ["IO1_OUT"],
} as const

const CorrectedUsbESD = CatalogUsbESD as unknown as (
  props: ChipProps<typeof usbEsdPinLabels>
) => ReturnType<typeof CatalogUsbESD>

export const UsbESD = (props: ChipProps<typeof usbEsdPinLabels>) => (
  <CorrectedUsbESD
    {...props}
    symbol={undefined}
    pinLabels={usbEsdPinLabels}
    pinAttributes={{pin2: {requiresGround: true}} as NonNullable<ChipProps<typeof usbEsdPinLabels>["pinAttributes"]>}
  />
)