imrishabh18/pedometer
This code defines and assembles a simple radio receiver hardware circuit using specific imported capacitors, inductors, RF connectors, and oscillator components with precise footprints and schematic attributes.
- Version
- 1.1.3
- License
- unset
- Stars
- 0
bare-radio.tsx
import { CL05B104KO5NNNC } from "./imports/CL05B104KO5NNNC";
import { GRM033R61A104KE15D } from "./imports/GRM033R61A104KE15D";
import { GRM188Z71A106KA73D } from "./imports/GRM188Z71A106KA73D";
import { CL05A105KA5NQNC } from "./imports/CL05A105KA5NQNC";
import { GJM0335C1H1R5BB01D } from "./imports/GJM0335C1H1R5BB01D";
import { GJM1555C1H1R0BB01D } from "./imports/GJM1555C1H1R0BB01D";
import { LQM18DN100M70L } from "./imports/LQM18DN100M70L";
import { LQP03TN2N8B02D } from "./imports/LQP03TN2N8B02D";
import { LQG15HS2N7S02D } from "./imports/LQG15HS2N7S02D";
import { LQG15HS3N9S02D } from "./imports/LQG15HS3N9S02D";
import { A_0402WGF1003TCE } from "./imports/A_0402WGF1003TCE";
// These components were imported with tsci import --jlcpcb --use-exact-footprint.
// Use their complete supplier footprint; do not substitute nominal-size pads.
const importedCapacitors = { C1525:CL05B104KO5NNNC, C76934:GRM033R61A104KE15D,
C2959727:GRM188Z71A106KA73D, C52923:CL05A105KA5NQNC,
C237515:GJM0335C1H1R5BB01D, C76898:GJM1555C1H1R0BB01D };
const importedInductors = { C713281:LQM18DN100M70L, C206433:LQP03TN2N8B02D,
C77108:LQG15HS2N7S02D, C77109:LQG15HS3N9S02D };
import { schematic } from "./schematic-layout";
import { A_2450AT18A100E } from "./imports/A_2450AT18A100E";
import { ABM11W_48_0000MHZ_8_D1X_T3 } from "./imports/ABM11W_48_0000MHZ_8_D1X_T3";
/** RF and oscillator connections are autorouted on top copper before digital nets. */
export const phaseForNet = (name: string) => name.startsWith("RF_") ? 0 : ({HF_P:1,HF_N:2,LF_P:3,LF_N:4,SWCLK:5} as Record<string,number>)[name] ?? 6;
// Values follow TI SWRR189A. The Johanson tee match is a starting point for tuning,
// not a claim that the vendor evaluation-board impedance transfers to this PCB.
const caps = [
["C19","100nF","0402",-7.5,9.4,0,"CL05B104KO5NNNC","C1525",16], // VDDS pin18
["C20","100nF","0201",-12.45,11.75,0,"GRM033R61A104KE15D","C76934",10], // VDDS pin24, beside RF supply
["C21","10uF","0603",-6.8,14,180,"GRM188Z71A106KA73D","C2959727",10], // VDDR bulk
["C22","100nF","0402",-7.9,11.4,90,"CL05B104KO5NNNC","C1525",16], // VDDR pin20
["C23","1uF","0402",-4.9,9.6,0,"CL05A105KA5NQNC","C52923",25], // VDDD
["C24","100nF","0402",-10.15,5.05,180,"CL05B104KO5NNNC","C1525",16], // RESET
["C25","100nF","0402",-15.1,7.15,180,"CL05B104KO5NNNC","C1525",16], // VDDR pin2
["C26","1.5pF","0201",-14.7,8.85,270,"GJM0335C1H1R5BB01D","C237515",50],
["C27","1.5pF","0201",-18.1,8.85,270,"GJM0335C1H1R5BB01D","C237515",50],
["C28","1pF","0402",-17.4,11.3,90,"GJM1555C1H1R0BB01D","C76898",50],
] as const;
const inductors = [
["L1","10uH","0603",-5.2,11.7,0,"LQM18DN100M70L","C713281",0.1],
["L2","2.8nH","0201",-16.35,8.85,0,"LQP03TN2N8B02D","C206433",0.5],
["L3","2.7nH","0402",-14.65,11.15,270,"LQG15HS2N7S02D","C77108",0.8],
["L4","3.9nH","0402",-15.6,13.85,90,"LQG15HS3N9S02D","C77109",0.75],
] as const;
export function BareRadioParts() { return <>
<A_2450AT18A100E name="ANT1" {...schematic.ANT1} pcbX={-18} pcbY={16.15} pcbRotation={90} noConnect={["pin2"]} pinAttributes={{pin1:{mustBeConnected:true},ANT:{mustBeConnected:true},pin2:{doNotConnect:true},NC:{doNotConnect:true}}} />
<ABM11W_48_0000MHZ_8_D1X_T3 name="Y2" {...schematic.Y2} pcbX={-10.45} pcbY={13.8} pcbRotation={180} />
{caps.map(([name,value,footprint,x,y,rotation,mpn,code,voltage])=>{
const Part=importedCapacitors[code];
return <Part key={name} name={name} pcbX={x} pcbY={y} pcbRotation={rotation}
{...schematic[name]} schRotation={name==="C28"?0:270} maxVoltageRating={voltage} />;
})}
{inductors.map(([name,value,footprint,x,y,rotation,mpn,code,current])=>{
const Part=importedInductors[code];
// The importer represents inductors as generic chips. Keep their exact
// footprint/model while retaining the circuit's inductor semantics/value.
const imported=Part({name}).props;
return <inductor key={name} name={name} inductance={value}
footprint={imported.footprint} cadModel={imported.cadModel}
manufacturerPartNumber={imported.manufacturerPartNumber} supplierPartNumbers={imported.supplierPartNumbers}
pcbX={x} pcbY={y} pcbRotation={rotation}
{...schematic[name]} schRotation={name==="L3"?270:name==="L2"?180:0} maxCurrentRating={current} />;
})}
<A_0402WGF1003TCE name="R14" tolerance="1%"
pcbX={-9.54} pcbY={2.7} pcbRotation={90} {...schematic.R14} schRotation={270} />
</>; }