add qfn-44 for ATmega32U4
[hw/altusmetrum] / packages / hvqfn33.5c
1 /*
2  * Copyright © 2013 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 process_clearance = 0.26;
22
23 real package_width = 5;
24 real package_height = 5;
25 real pad_spacing = 0.5;         /* P */
26 real pad_height = 0.85;         /* C */
27 real pad_width = 0.27;          /* D */
28 real pad_center_x = 5.25 / 2;   /* Gx/2 */
29 real pad_center_y = 5.25 / 2;   /* Gy/2 */
30
31 real center_width = 3.75;       /* SLx */
32 real center_height = 3.75;      /* SLy */
33
34 real center_drill = process_drill;
35 real center_copper = process_ring;
36 real center_mask = 0.60 / 2;
37
38 real center_space = 1.1;
39
40 int num_pad = 8;        /* per side */
41
42 real pad_off(int n) {
43         return pad_spacing * (n - (num_pad - 1) / 2);
44 }
45
46 element_start("hvqfn33");
47
48 for (int pad = 0; pad < num_pad; pad++) {
49         /* left side (1-8) */
50
51         pad_mm(-pad_center_x,
52                pad_off(pad),
53                pad_height,
54                pad_width,
55                sprintf("%d", pad + 1),
56                sprintf("%d", pad + 1));
57
58         /* bottom (9-16) */
59
60         pad_mm(pad_off(pad),
61                pad_center_y,
62                pad_width,
63                pad_height,
64                sprintf("%d", pad + 9),
65                sprintf("%d", pad + 9));
66
67         /* right (17-24) */
68
69         pad_mm(pad_center_x,
70                -pad_off(pad),
71                pad_height,
72                pad_width,
73                sprintf("%d", pad + 17),
74                sprintf("%d", pad + 17));
75
76         /* top (25-32) */
77
78         pad_mm(-pad_off(pad),
79                -pad_center_y,
80                pad_width,
81                pad_height,
82                sprintf("%d", pad + 25),
83                sprintf("%d", pad + 25));
84 }
85
86 /* center */
87
88 center_pad((center_t) {
89                 .x = 0,
90                         .y = 0,
91                         .width = center_width,
92                         .height = center_height,
93                         .name = "33",
94                         .via_cols = 3,
95                         .via_rows = 3});
96
97 /* outline */
98
99 rect(-package_width/2, -package_height/2, package_width, package_height);
100
101 dot_off = 0.3;
102 dot_x = -package_width/2 - dot_off;
103 dot_y = -package_height/2 - dot_off;
104
105 line(dot_x, dot_y, dot_x, dot_y);
106
107 element_end();