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

camera-fpc-parts.tsx

SchematicSchematic preview for camera-fpc-parts.tsx
import React from "react"
import type { ChipProps, ConnectorProps } from "@tscircuit/props"
import { FH12_24S_0_5SH_55_ as CatalogFpc } from "./imports/FH12_24S_0_5SH_55_"
import { TLV75528PDBVR } from "./imports/TLV75528PDBVR"
import { TLV75515PDBVR } from "./imports/TLV75515PDBVR"
import { SN74LVC244APWR } from "./imports/SN74LVC244APWR"
import { SN74LVC125APWR } from "./imports/SN74LVC125APWR"
import { TXS0102DCTR } from "./imports/TXS0102DCTR"

// Exact KLT-PAA40-OV5640-1B V1.0 ESP32 drawing, dated 2023-10-14, page 7.
// https://kailaptech.com/product.aspx?id=3122&l1=712
// Do not substitute an arbitrary 24-pin OV5640: AF power pinouts vary.
export const cameraFpcPinLabels = {
 pin1:["STROBE"],pin2:["DGND1"],pin3:["SIO_D"],pin4:["AVDD_2V8"],
 pin5:["SIO_C"],pin6:["RESET_N"],pin7:["VSYNC"],pin8:["PWDN"],
 pin9:["HREF"],pin10:["DVDD_1V5"],pin11:["DOVDD_2V8"],pin12:["D9"],
 pin13:["XCLK"],pin14:["D8"],pin15:["DGND2"],pin16:["D7"],
 pin17:["PCLK"],pin18:["D6"],pin19:["D2"],pin20:["D5"],
 pin21:["D3"],pin22:["D4"],pin23:["NC"],pin24:["AFVDD_2V8"],
 pin25:["HOLD1"],pin26:["HOLD2"],
} as const

export const CameraFpcConnector = (props: ConnectorProps) => {
 const imported = CatalogFpc({name:props.name})
 // Preserve the exact JLCSearch land pattern and model. Replace only its
 // generic schematic with pin names from the selected camera's drawing.
 return <connector {...imported.props} symbol={undefined} {...props}
  footprint={React.cloneElement(imported.props.footprint, {insertionDirection:"from_top"})}
  pinLabels={cameraFpcPinLabels} noConnect={["pin1","pin23"]}
  pinAttributes={{pin2:{requiresGround:true},pin15:{requiresGround:true},
   pin4:{requiresPower:true},pin10:{requiresPower:true},pin11:{requiresPower:true},
   pin24:{requiresPower:true},pin23:{doNotConnect:true}}}/>
}
export const Camera2V8 = (props:ChipProps) => <chip {...TLV75528PDBVR({name:props.name}).props} {...props} noConnect={["pin4"]}/>
export const Camera1V5 = (props:ChipProps) => <chip {...TLV75515PDBVR({name:props.name}).props} {...props} noConnect={["pin4"]}/>
// LVC inputs accept 2.0 V HIGH at 3.3 V VCC; camera's 2.8 V outputs are
// buffered to full ESP32 3.3 V levels. 125 inputs tolerate the MCU's 3.3 V
// while powered at 2.8 V. Do not replace these with 74HC parts.
export const CameraInputBuffer = (props:ChipProps) => <chip {...SN74LVC244APWR({name:props.name}).props} {...props}/>
export const CameraOutputBuffer = (props:ChipProps) => <chip {...SN74LVC125APWR({name:props.name}).props} {...props}/>
export const CameraControlTranslator = (props:ChipProps) => <chip {...TXS0102DCTR({name:props.name}).props} {...props}
 pinAttributes={{pin2:{requiresGround:true},pin3:{requiresPower:true},pin7:{requiresPower:true}}}/>