2 * Copyright © 2013 Keith Packard <keithp@keithp.com>
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.
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.
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.
21 process_clearance = 0.26;
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 */
31 real center_width = 3.75; /* SLx */
32 real center_height = 3.75; /* SLy */
34 real center_drill = 0.015 * 25.4;
35 real center_mask = 0.60 / 2;
37 real center_space = 1.1;
39 int num_pad = 8; /* per side */
42 return pad_spacing * (n - (num_pad - 1) / 2);
45 element_start("hvqfn33");
47 for (pad = 0; pad < num_pad; pad++) {
54 sprintf("%d", pad + 1),
55 sprintf("%d", pad + 1));
63 sprintf("%d", pad + 9),
64 sprintf("%d", pad + 9));
72 sprintf("%d", pad + 17),
73 sprintf("%d", pad + 17));
81 sprintf("%d", pad + 25),
82 sprintf("%d", pad + 25));
87 pad_mm_clear_mask_options(0, 0, center_width, center_height, process_clearance, 0,
88 "33", "33", "square,nopaste");
91 real clear_top = center_space * 0.5 + center_mask;
92 real clear_bottom = center_height / 2;
93 real clear_height = clear_bottom - clear_top;
94 real clear_y = (clear_top + clear_bottom) / 2;
96 for (y = -1; y <= 1; y+= 2) {
97 pad_mm_clear_mask_options(0, y * clear_y, center_width, clear_height,
98 0, clear_height, "33", "33", "square,nopaste");
100 pad_mm_clear_mask_options(y * clear_y, 0, clear_height, center_height,
101 0, clear_height, "33", "33", "square,nopaste");
104 real hole_pos = 0.5 * center_space;
105 real strip_top = -hole_pos + center_mask;
106 real strip_bot = hole_pos - center_mask;
107 real strip_size = strip_bot - strip_top;
109 pad_mm_clear_mask_options(0, 0, center_width, strip_size,
110 0, strip_size, "33", "33", "square,nopaste");
112 pad_mm_clear_mask_options(0, 0, strip_size, center_height,
113 0, strip_size, "33", "33", "square,nopaste");
115 /* center solder spots */
117 for (y = -1; y <= 1; y += 1) {
118 for (x = -1; x <= 1; x += 1) {
119 pad_mm_clear_mask_options(x * center_space, y * center_space,
120 center_mask*2, center_mask*2, 0, center_mask * 2, "33", "33", "");
126 for (y = -0.5; y <= 0.5; y += 1) {
127 for (x = -0.5; x <= 0.5; x += 1) {
128 pin_mm_clear_mask_options(x * center_space, y * center_space,
129 center_drill, center_mask, 0.012 * 25.4, 0, "33", "33",
136 rect(-package_width/2, -package_height/2, package_width, package_height);
139 dot_x = -package_width/2 - dot_off;
140 dot_y = -package_height/2 - dot_off;
142 line(dot_x, dot_y, dot_x, dot_y);