add clearance on pads so that microSD connector works right with gnd plane
[hw/altusmetrum] / packages / miniso8.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, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  */
14
15 load "footprint.5c"
16 import Footprint;
17
18 element_args();
19
20 /* from the datasheet */
21 real pad_x_space = 0.65;        /* C */
22 real pad_width = 0.48;          /* X */
23 real footprint_width = 2.43;    /* X2 */
24 real pad_height = 1.13;         /* Y */
25 real footprint_height = 5.67;   /* Y2 */
26
27 real package_width = 3.00;
28 real package_height = 3.00;
29
30 /* computed */
31
32 int x_pads = 4;
33
34 real pad_y_space = footprint_height - pad_height;
35 real pad_y_off = pad_y_space / 2.0;
36 real pad_x_off = (x_pads - 1) / 2 * pad_x_space;
37
38 element_start("miniso8");
39
40 for (int i = 0; i < x_pads; i++) {
41         int pad_low = i + 1;
42         int pad_high = x_pads * 2 - i;
43         string pad_low_name = sprintf("%d", pad_low);
44         string pad_high_name = sprintf("%d", pad_high);
45         pad_mm(-pad_x_off + i * pad_x_space, pad_y_off, pad_width, pad_height, pad_low_name, pad_low_name);
46         pad_mm(-pad_x_off + i * pad_x_space, -pad_y_off, pad_width, pad_height, pad_high_name, pad_high_name);
47 }
48
49 real dot_off = .3;
50
51 line(-package_width/2 - dot_off, package_height/2 + dot_off,
52      -package_width/2 - dot_off, package_height/2 + dot_off);
53
54 rect(-package_width/2, -package_height/2, package_width, package_height);
55
56 element_end();