Devesh36/pocket-audio-player

A portable, rechargeable microSD audio player built around an RP2040, SPI flash, USB‑C charging/power management, LCD/button controls, PCM5102A I²S DAC, and TPA6132A headphone amplifier in a 3D‑printed enclosure.

Version
1.0.12
License
unset
Stars
0

imports/JST_PH.tsx

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

// JST PH through-hole top-entry drawing: 2 mm pitch, 0.7 +0.1 mm
// drill, 4.5 mm body depth, 6 mm header height, 3.4 mm tails.
// Header + PHR housing has an 8 mm mated height above the board.
export function phHeaderPlan(count:number){
 const width=(count-1)*2+3.9
 return {type:'union',shapes:[
  {type:'colorize',color:[0.94,0.94,0.90],shape:{type:'subtract',shapes:[
   {type:'cuboid',size:[width,4.5,6],center:[0,0.55,3]},
   {type:'cuboid',size:[width-1.2,3.1,5.2],center:[0,0.55,3.9]},
  ]}},
  {type:'colorize',color:[0.65,0.67,0.68],shape:{type:'union',shapes:Array.from({length:count},(_,i)=>({type:'cuboid',size:[0.5,0.5,8.3],center:[(i-(count-1)/2)*2,0,0.75]}))}},
 ]}
}
export function PhFootprint({count}:{count:number}){
 const width=(count-1)*2+3.9
 return <footprint insertionDirection="from_above">
  {Array.from({length:count},(_,i)=><Fragment key={i}><platedhole portHints={[`pin${i+1}`]} pcbX={(i-(count-1)/2)*2} pcbY={0} shape="circle" holeDiameter={0.8} outerDiameter={1.4}/></Fragment>)}
  <silkscreenpath route={[{x:-width/2,y:-1.7},{x:width/2,y:-1.7},{x:width/2,y:2.8},{x:-width/2,y:2.8},{x:-width/2,y:-1.7}]}/>
  <silkscreentext text="1" pcbX={-(count-1)} pcbY={-2.5} fontSize={0.6}/>
  <courtyardrect width={width+0.5} height={5} pcbY={0.55}/>
 </footprint>
}
const batteryPins={pin1:['GND'],pin2:['VBAT']} as const
export function JstBattery(props:ConnectorProps){return <connector
 manufacturerPartNumber="B2B-PH-K-S(LF)(SN)" supplierPartNumbers={{jlcpcb:["C131337"]}} pinLabels={batteryPins}
 footprint={<PhFootprint count={2}/>} cadModel={{jscad:phHeaderPlan(2) as any}}
 pinAttributes={{pin1:{providesGround:true},pin2:{providesPower:true,providesVoltage:'3.7V'}}}
 {...props}/>}