update ATmega32u4 datasheet to current version
[hw/altusmetrum] / packages / 1051330011.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 real side_pin_x = 2.8;
22 real center_pin_y = 2.15;
23 real side_pin_width = 0.70;
24 real center_pin_width = 1.10;
25 real pin_copper = 0.30;
26 real npad = 5;
27 real pad_pitch = 0.65;
28 real pad_width = 0.45;
29 real pad_height = 1.50;
30 real pad_y = 1.00 - pad_height/2;
31 real package_width = 8.00;
32 real package_height = 3.00;
33 real package_y = center_pin_y / 2 - package_height / 2;
34 real package_x = -package_width / 2;
35
36 public void slot(real x, real y, real width, real drill) {
37
38         pin_mm(x - width / 2, y, drill, pin_copper, "mnt", "mnt");
39
40         pad_mm_options(x, y, width + pin_copper*2 + drill, drill + pin_copper * 2, "mnt", "mnt", "");
41         pad_mm_options(x, y, width + pin_copper*2 + drill, drill + pin_copper * 2, "mnt", "mnt", "onsolder");
42
43         pin_mm(x + width / 2, y, drill, pin_copper, "mnt", "mnt");
44 }
45
46 public real pad_x(int pad) {
47         return pad * pad_pitch - (npad -1 ) / 2 * pad_pitch;
48 }
49
50 element_start("1051330011");
51
52 slot(-side_pin_x, 0, side_pin_width, 0.50);
53 slot(side_pin_x, 0, side_pin_width, 0.50);
54 slot(0, center_pin_y, center_pin_width, 0.50);
55
56 for (int pad = 0; pad < npad; pad++) {
57         string name = sprintf("%d", pad + 1);
58         pad_mm(pad_x(pad), pad_y, pad_width, pad_height, name, name);
59 }
60
61 rect(package_x, package_y, package_width, package_height);
62
63 element_end();