45e4c55dfbf308057a0db3ecae960ce4fa38e525
[hw/altusmetrum] / packages / switches / cus-12.5c
1 /*
2  * Copyright © 2012 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 hole_spacing = 3;
22 real hole_diameter = 0.9;
23 real hole_x = hole_spacing / 2;
24 real hole_y = 0;
25 real pad_height = 1.5;
26 real pad_width = 0.7;
27 real hold_width = 1;
28 real hold_height = 0.8;
29 real hold_y = -1;
30 real hold_x = 6.3 / 2 + 1/2;
31 real package_width = 6.7;
32 real package_height = 2.6;
33 real outline_x = package_width / 2;
34 real outline_y = package_height / 2;
35
36 real switch_travel = 1.5;
37 real switch_width = 1.3;
38 real switch_height = 1.5;
39 real switch_x = switch_travel / 2 - switch_width / 2;
40 real switch_y = package_height / 2;
41
42 /* to center */
43 real pad_1_x = -2.25;
44 real pad_2_x = 0.75;
45 real pad_3_x = 2.25;
46
47 /* to top */
48 real pad_y = 2.5;
49
50 element_start("cus-12");
51
52 /* pad 1 */
53 pad_mm (pad_1_x, -(pad_y - pad_height / 2),
54         pad_width, pad_height,
55         "1", "1");
56
57 /* pad 2 */
58 pad_mm (pad_2_x, -(pad_y - pad_height / 2),
59         pad_width, pad_height,
60         "2", "2");
61
62 pad_mm (pad_3_x, -(pad_y - pad_height / 2),
63         pad_width, pad_height,
64         "3", "3");
65
66 pad_mm (-hold_x, -hold_y,
67         hold_width, hold_height,
68         "GND", "GND");
69
70 pad_mm (hold_x, -hold_y,
71         hold_width, hold_height,
72         "GND", "GND");
73
74 pad_mm (-hold_x, hold_y,
75         hold_width, hold_height,
76         "GND", "GND");
77
78 pad_mm (hold_x, hold_y,
79         hold_width, hold_height,
80         "GND", "GND");
81
82 pin_mm (-hole_x, hole_y, hole_diameter,
83         0.17, "GND", "GND");
84
85 pin_mm (hole_x, hole_y, hole_diameter,
86         0.17, "GND", "GND");
87
88 rect (-outline_x, -outline_y, outline_x * 2, outline_y * 2);
89 rect (switch_x, switch_y, switch_width, switch_height);
90 element_end();
91