Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/fn/tqfp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export const tqfp = (
if (!raw_params.p) {
switch (raw_params.num_pins) {
case 32:
case 44:
raw_params.p = 0.8
break
case 44:
case 48:
raw_params.p = 0.5
break
Expand Down Expand Up @@ -54,9 +54,9 @@ export const tqfp = (
if (!raw_params.pw) {
switch (raw_params.num_pins) {
case 32:
case 44:
raw_params.pw = 0.55
break
case 44:
case 48:
case 64:
case 80:
Expand Down
22 changes: 22 additions & 0 deletions tests/tqfp44-pitch.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { test, expect } from "bun:test"
import { fp } from "../src/index"

test("tqfp44 defaults to standard 0.8mm pitch and 0.55mm pad width (#792)", () => {
const elements = fp.string("tqfp44").circuitJson()
const smtpads = elements.filter(
(e: any) => e.type === "pcb_smtpad",
) as Array<any>

expect(smtpads.length).toBe(44)

const pin1 = smtpads.find((p) => p.port_hints?.includes("1"))!
const pin2 = smtpads.find((p) => p.port_hints?.includes("2"))!

expect(pin1).toBeDefined()
expect(pin2).toBeDefined()

const pitch = Math.abs(pin1.y - pin2.y)
expect(pitch).toBeCloseTo(0.8, 2)
expect(pin1.height).toBeCloseTo(0.55, 2)
expect(pin1.width).toBeCloseTo(1.475, 2)
})
Loading