Root/modules/dfn.fpd

Source at commit 42abcc385753e29209a98a886537a4783ac8a009 created 2 years 7 months ago.
By Alvaro Gamez Machado, modules/dfn.fpd: replace fixed '8' by 'pins' variable, so 6-pin versions of the footprints are numbered work too
1/* MACHINE-GENERATED ! */
2
3frame thermal {
4    table
5        { ?features, dx, d }
6        { "-TH", -0.4mm, 0.2mm }
7        { "-TH", 0.4mm, 0.2mm }
8
9    __0: vec @(dx, 0mm)
10    __1: vec .(d/2, d/2)
11    __2: vec __0(-d/2, -d/2)
12    hole . __1
13}
14
15frame pad {
16    set n = pins+1
17
18    __0: vec @(cx/2, cy/2)
19    __1: vec @(-cx/2, -cy/2)
20    pad "$n" . __0
21    frame thermal @
22}
23
24frame pin {
25    __0: vec @(px/2, py/2)
26    __1: vec @(-px/2, -py/2)
27    pad "$n" . __0
28}
29
30frame pins {
31    set x = e*(i-(pins/2-1)/2)
32
33    set y = (iy+oy)/4*dy
34
35    set n = a+f*i
36
37    table
38        { dy, f, a }
39        { 1, -1, pins }
40        { -1, 1, 1 }
41
42    loop i = 0, pins/2-1
43
44    __0: vec @(x, y)
45    frame pin .
46}
47
48frame outline {
49    set x = (X+gap)/2
50
51    set y = (Y+gap)/2
52
53    __0: vec @(X/2, Y/2)
54    __6: vec .(gap, gap)
55    __1: vec @(X/2, -Y/2)
56    __2: vec .(gap, -gap)
57    line __6 . w
58    __3: vec @(-X/2, Y/2)
59    __7: vec .(-gap, gap)
60    __8: vec @(-X/2, -Y/2)
61    __9: vec .(-gap, -gap)
62    line __7 . w
63    __4: vec .(-(w+r+0.1mm), r)
64    __5: vec .(0mm, r)
65    circ __4 . w
66}
67
68package "DFN-$pins$variant$features"
69unit mm
70allow holes
71
72table
73    { pins, variant, features, X, Y, e, iy, oy, px, cx, cy, gap_base }
74    { 8, "", "", 2mm, 2mm, 0.5mm, 1.4mm, 2.4mm, 0.28mm, 1.3mm, 0.7mm, 0.2mm }
75    { 8, "-0.4mm", "", 1.7mm, 1.35mm, 0.4mm, 0.8mm, 1.75mm, 0.2mm, 1mm, 0.4mm, 0.1mm }
76    { 6, "-0.65mm", "", 2.2mm, 2.3mm, 0.65mm, 1.7mm, 2.9mm, 0.25mm, 1.2mm, 0.75mm, 0mm }
77    { 6, "-0.65mm", "-TH", 2mm, 2.1mm, 0.65mm, 1.4mm, 2.8mm, 0.3mm, 1.6mm, 1mm, 0mm }
78
79set py = (oy-iy)/2
80
81set w = 5mil
82
83set gap = gap_base+w/2
84
85set r = 0.25mm
86
87frame pins @
88frame pad @
89frame outline @
90measy pin.__1 >> pin.__0 2mm
91measy pin.__0 >> pin.__1 2mm
92measy pad.__1 >> pad.__0 1.5mm
93measx pin.__1 >> pin.__0 -1mm
94measx pin.__1 -> pin.__0 -0.5mm
95measy pin.__1 -> pin.__0 2mm-px
96measx pins.__0 -> pins.__0 oy+0.5mm
97measy outline.__1 >> outline.__0 -1mm
98measx outline.__3 >> outline.__0 1.5mm
99measx pad.__1 >> pad.__0 cy/2
100measx thermal.__0 >> thermal.__0 -0.3mm
101measx thermal.__2 -> thermal.__1 0.4mm
102

Archive Download this file

Branches:
master



interactive