Root/modules/lga.fpd

Source at commit 97e92c854c08f91b35a4cdd71b5bc1255d340e4a created 3 years 10 months ago.
By Werner Almesberger, modules/components/lga.fpd: add clockwise pin assignment, for BME280 et al.
1/* MACHINE-GENERATED ! */
2
3frame piny {
4    table
5        { ?cw, name }
6        { 0, i*f+a }
7        { 1, pins-a-i*f-nx+1 }
8
9    __0: vec @(dx*(py/2+pe), px/2)
10    __1: vec @(-dx*py/2, -px/2)
11    pad "$name" . __0
12}
13
14frame pinsy {
15    set y = e*(i-(ny-1)/2)
16
17    set x = sx/2-py/2-b
18
19    table
20        { dx, f, a }
21        { -1, -1, ny }
22        { 1, 1, pins-ny-nx+1 }
23
24    loop i = 0, ny-1
25
26    __0: vec @(x*dx, y)
27    frame piny .
28}
29
30frame pinx {
31    table
32        { ?cw, name }
33        { 0, i*f+a }
34        { 1, a+(nx-i-1)*f }
35
36    __0: vec @(px/2, -dy*py/2)
37    __1: vec @(-px/2, dy*py/2)
38    __2: vec .(0mm, dy*pe)
39    pad "$name" . __0
40}
41
42frame outline {
43    set corner = gap*2-(w+0.2mm)/sqrt(2)
44
45    __0: vec @(sx/2, sy/2)
46    __1: vec .(gap, gap)
47    __2: vec @(-sx/2, -sy/2)
48    __3: vec .(-gap, -gap)
49    rect . __1 w
50    __4: vec @(-sx/2, sy/2)
51    __5: vec .(-gap, gap)
52    __6: vec .(corner, 0mm)
53    __7: vec __5(0mm, -corner)
54    line . __6 w
55}
56
57frame pinsx {
58    set x = e*(i-(nx-1)/2)
59
60    set y = sy/2-py/2-b
61
62    table
63        { dy, f, a }
64        { -1, 1, ny+1 }
65        { 1, -1, pins }
66
67    loop i = 0, nx-1
68
69    __0: vec @(x, y*dy)
70    frame pinx .
71}
72
73package "LGA-$pins-${sizex}x${sizey}${variant}"
74unit mm
75
76table
77    { variant, nx, ny, sx, sy, e, b, px, py, pe, cw }
78    { "", 3, 5, 3mm, 3mm, 0.5mm, 0.1mm, 0.25mm, 0.35mm, 0.2mm, 0 }
79    { "-BME280", 0, 4, 2.5mm, 2.5mm, 0.65mm, 0.125mm, 0.35mm, 0.35mm, 0.15mm, 1 }
80
81set pins = 2*(nx+ny)
82
83set sizex = sx/1mm
84
85set sizey = sy/1mm
86
87set w = 5mil
88
89set gap = 0.2mm+w/2+0.1mm
90
91frame pinsx @
92frame pinsy @
93frame outline @
94measx outline.__2 >> outline.__0 -1.5mm
95measy outline.__2 >> outline.__0 1.5mm
96measx pinsx.__0 -> pinsx.__0 -1.5mm
97measx pinx.__2 -> pinx.__0 py+0.5mm
98measy pinx.__1 -> pinx.__0 0.2mm
99measy pinx.__2 -> pinx.__1 0.2mm
100measy outline.__3 >> outline.__5 1.5mm
101measx outline.__3 >> outline.__1 -1.5mm
102measy pinx.__1 >> outline.__2 -0.5mm
103measx piny.__0 -> piny.__1
104measx piny.__1 -> piny.__1 0.8mm
105measx piny.__0 -> piny.__0 1mm
106measy pinsy.__0 -> pinsy.__0 1mm
107

Archive Download this file

Branches:
master



interactive