rename symbol directory to match datasheet directory
[hw/altusmetrum] / packages / VQFN-HR-12.5c
1 /*
2  * Copyright © 2019 Keith Packard <keithp@keithp.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; version 2 of the License.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program; if not, write to the Free Software Foundation, Inc.,
15  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
16  */
17
18 load "footprint.5c"
19 import Footprint;
20
21 real small_pad_width = 0.2;
22 real small_pad_height = 0.6;
23 real small_pad_x_sep = 0.5;
24 real small_pad_center_distance = 2.3;
25 real small_pad_y_off = small_pad_center_distance / 2;
26
27 real large_pad_width = 1.05;
28 real large_pad_height = 0.4;
29 real large_pad_x_sep = 1.35;
30 real large_pad_y_sep = 0.7;
31
32 real package_width = 2.0;
33 real package_height = 2.5;
34
35 real num_pad = 4;       /* per side */
36
37 element_start("VQFN-HR-12");
38
39 real corner(int dx, int dy) {
40         real    x = dx * package_width / 2;
41         real    y = dy * package_height / 2;
42         real    len = 0.4;
43
44         line(x, y, x - dx * len, y);
45         line(x, y, x, y - dy * len);
46 }
47
48 corner(-1, -1);
49 corner(1, -1);
50 corner(-1, 1);
51 corner(1, 1);
52
53 real dot_off = .3;
54
55 line(-package_width/2 - dot_off, -package_height/2 - dot_off,
56      -package_width/2 - dot_off, -package_height/2 - dot_off);
57
58 /* small pads */
59 real small_x(int x)
60 {
61         return -1.5 * small_pad_x_sep + x * small_pad_x_sep;
62 }
63
64 real small_y(int y)
65 {
66         return -small_pad_y_off + y * 2 * small_pad_y_off;
67 }
68
69 for (int y = 0; y < 2; y++) {
70         for (int x = 0; x < 4; x++) {
71                 int pad;
72                 if (y > 0)
73                         pad = 3 + x;
74                 else
75                         pad = 12 - x;
76                 string name = sprintf("%d", pad);
77                 pad_mm(small_x(x), small_y(y),
78                        small_pad_width,
79                        small_pad_height,
80                        name,
81                        name);
82         }
83 }
84
85 /* large pads */
86 real large_x(int x)
87 {
88         return -large_pad_x_sep / 2 + large_pad_x_sep * x;
89 }
90
91 real large_y(int y)
92 {
93         return -large_pad_y_sep / 2 + large_pad_y_sep * y;
94 }
95
96 for (int y = 0; y < 2; y++) {
97         for (x = 0; x < 2; x++) {
98                 int pad;
99                 if (x > 0)
100                         pad = 8 - y;
101                 else
102                         pad = 1 + y;
103                 string name = sprintf("%d", pad);
104                 pad_mm(large_x(x), large_y(y),
105                        large_pad_width,
106                        large_pad_height,
107                        name,
108                        name);
109         }
110 }
111
112 element_end();