--- /dev/null
+/*
+ * Copyright © 2012 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+load "footprint.5c"
+import Footprint;
+
+real pad_width = 0.55;
+real pad_height = 0.30;
+real pad_spacing = 0.50;
+real pad_clearance = 10 / 1000 * 25.4;
+
+real pad_x_off = 6.20 / 2;
+real pad_y_off = 6.20 / 2;
+
+real center_width = 5.6;
+real center_height = 5.6;
+
+real package_width = 7;
+real package_height = 7;
+
+real num_pad = 12; /* per side */
+
+element_start("ufqfpn-48");
+
+real pad_off(int n) {
+ return pad_spacing * (n - (num_pad - 1) / 2);
+}
+
+real corner(int dx, int dy) {
+ real x = dx * package_width / 2;
+ real y = dy * package_height / 2;
+ real len = 0.4;
+
+ line(x, y, x - dx * len, y);
+ line(x, y, x, y - dy * len);
+}
+
+corner(-1, -1);
+corner(1, -1);
+corner(-1, 1);
+corner(1, 1);
+
+real dot_off = .3;
+
+line(-package_width/2 + dot_off, -package_height/2 + dot_off,
+ -package_width/2 + dot_off, -package_height/2 + dot_off);
+
+for (pad = 0; pad < num_pad; pad++) {
+ /* left side (1-12) */
+
+ pad_mm_clear(-pad_x_off - pad_width / 2,
+ pad_off(pad),
+ pad_width,
+ pad_height,
+ pad_clearance,
+ sprintf("%d", pad + 1),
+ sprintf("%d", pad + 1));
+
+ /* bottom (13-24) */
+
+ pad_mm_clear(pad_off(pad),
+ pad_y_off + pad_width / 2,
+ pad_height,
+ pad_width,
+ pad_clearance,
+ sprintf("%d", pad + 13),
+ sprintf("%d", pad + 13));
+
+ /* right side (25-36) */
+
+ pad_mm_clear(pad_x_off + pad_width / 2,
+ -pad_off(pad),
+ pad_width,
+ pad_height,
+ pad_clearance,
+ sprintf("%d", pad + 25),
+ sprintf("%d", pad + 25));
+
+ /* top (37-48) */
+
+ pad_mm_clear(-pad_off(pad),
+ -pad_y_off - pad_width / 2,
+ pad_height,
+ pad_width,
+ pad_clearance,
+ sprintf("%d", pad + 37),
+ sprintf("%d", pad + 37));
+
+}
+
+int pad_blocks = 3;
+
+real block_width = center_width / pad_blocks;
+real block_height = center_height / pad_blocks;
+
+real block_x(int x) = (x - (pad_blocks - 1)/2) * block_width;
+real block_y(int y) = (y - (pad_blocks - 1)/2) * block_height;
+
+bool via_block(int x, int y) {
+ return (x & 1) == 0 && (y & 1) == 0;
+}
+
+real via_hole = 15/1000 * 25.4; /* 15 mil drill */
+real via_copper = 3.5/1000 * 25.4; /* 7 mil anulus */
+
+for (int pad_y = 0; pad_y < pad_blocks; pad_y++) {
+ for (int pad_x = 0; pad_x < pad_blocks; pad_x++)
+ if (via_block(pad_x, pad_y)) {
+ pin_mm_clear_mask(block_x(pad_x), block_y(pad_y),
+ via_hole, via_copper * 2, pad_clearance, 0,
+ "GND", "GND");
+ pad_mm_clear_mask_options(block_x(pad_x), block_y(pad_y),
+ block_width, block_height,
+ pad_clearance, 0,
+ "GND", "GND","nopaste");
+ } else {
+ /* full square of metal */
+ pad_mm_clear_options(block_x(pad_x), block_y(pad_y),
+ block_width, block_height,
+ 0,
+ "GND", "GND","nopaste");
+ /* 1/4 full of solder paste */
+ pad_mm_clear_options(block_x(pad_x), block_y(pad_y),
+ block_width/2, block_height/2,
+ 0,
+ "GND", "GND","");
+ }
+}
+
+element_end();
--- /dev/null
+# author: Keith Packard
+# email: keithp@keithp.com
+# dist-license: GPL 2
+# use-license: unlimited
+Element ["" "ufqfpn-48" "" "" 0 0 0 0 0 100 ""]
+(
+ ElementLine[ -13780 -13780 -12205 -13780 1000]
+ ElementLine[ -13780 -13780 -13780 -12205 1000]
+ ElementLine[ 13780 -13780 12205 -13780 1000]
+ ElementLine[ 13780 -13780 13780 -12205 1000]
+ ElementLine[ -13780 13780 -12205 13780 1000]
+ ElementLine[ -13780 13780 -13780 12205 1000]
+ ElementLine[ 13780 13780 12205 13780 1000]
+ ElementLine[ 13780 13780 13780 12205 1000]
+ ElementLine[ -12598 -12598 -12598 -12598 1000]
+ Pad[ -13780 -10827 -12795 -10827 1181 1000 1681 "1" "1" "square"]
+ Pad[ -10827 12795 -10827 13780 1181 1000 1681 "13" "13" "square"]
+ Pad[ 12795 10827 13780 10827 1181 1000 1681 "25" "25" "square"]
+ Pad[ 10827 -13780 10827 -12795 1181 1000 1681 "37" "37" "square"]
+ Pad[ -13780 -8858 -12795 -8858 1181 1000 1681 "2" "2" "square"]
+ Pad[ -8858 12795 -8858 13780 1181 1000 1681 "14" "14" "square"]
+ Pad[ 12795 8858 13780 8858 1181 1000 1681 "26" "26" "square"]
+ Pad[ 8858 -13780 8858 -12795 1181 1000 1681 "38" "38" "square"]
+ Pad[ -13780 -6890 -12795 -6890 1181 1000 1681 "3" "3" "square"]
+ Pad[ -6890 12795 -6890 13780 1181 1000 1681 "15" "15" "square"]
+ Pad[ 12795 6890 13780 6890 1181 1000 1681 "27" "27" "square"]
+ Pad[ 6890 -13780 6890 -12795 1181 1000 1681 "39" "39" "square"]
+ Pad[ -13780 -4921 -12795 -4921 1181 1000 1681 "4" "4" "square"]
+ Pad[ -4921 12795 -4921 13780 1181 1000 1681 "16" "16" "square"]
+ Pad[ 12795 4921 13780 4921 1181 1000 1681 "28" "28" "square"]
+ Pad[ 4921 -13780 4921 -12795 1181 1000 1681 "40" "40" "square"]
+ Pad[ -13780 -2953 -12795 -2953 1181 1000 1681 "5" "5" "square"]
+ Pad[ -2953 12795 -2953 13780 1181 1000 1681 "17" "17" "square"]
+ Pad[ 12795 2953 13780 2953 1181 1000 1681 "29" "29" "square"]
+ Pad[ 2953 -13780 2953 -12795 1181 1000 1681 "41" "41" "square"]
+ Pad[ -13780 -984 -12795 -984 1181 1000 1681 "6" "6" "square"]
+ Pad[ -984 12795 -984 13780 1181 1000 1681 "18" "18" "square"]
+ Pad[ 12795 984 13780 984 1181 1000 1681 "30" "30" "square"]
+ Pad[ 984 -13780 984 -12795 1181 1000 1681 "42" "42" "square"]
+ Pad[ -13780 984 -12795 984 1181 1000 1681 "7" "7" "square"]
+ Pad[ 984 12795 984 13780 1181 1000 1681 "19" "19" "square"]
+ Pad[ 12795 -984 13780 -984 1181 1000 1681 "31" "31" "square"]
+ Pad[ -984 -13780 -984 -12795 1181 1000 1681 "43" "43" "square"]
+ Pad[ -13780 2953 -12795 2953 1181 1000 1681 "8" "8" "square"]
+ Pad[ 2953 12795 2953 13780 1181 1000 1681 "20" "20" "square"]
+ Pad[ 12795 -2953 13780 -2953 1181 1000 1681 "32" "32" "square"]
+ Pad[ -2953 -13780 -2953 -12795 1181 1000 1681 "44" "44" "square"]
+ Pad[ -13780 4921 -12795 4921 1181 1000 1681 "9" "9" "square"]
+ Pad[ 4921 12795 4921 13780 1181 1000 1681 "21" "21" "square"]
+ Pad[ 12795 -4921 13780 -4921 1181 1000 1681 "33" "33" "square"]
+ Pad[ -4921 -13780 -4921 -12795 1181 1000 1681 "45" "45" "square"]
+ Pad[ -13780 6890 -12795 6890 1181 1000 1681 "10" "10" "square"]
+ Pad[ 6890 12795 6890 13780 1181 1000 1681 "22" "22" "square"]
+ Pad[ 12795 -6890 13780 -6890 1181 1000 1681 "34" "34" "square"]
+ Pad[ -6890 -13780 -6890 -12795 1181 1000 1681 "46" "46" "square"]
+ Pad[ -13780 8858 -12795 8858 1181 1000 1681 "11" "11" "square"]
+ Pad[ 8858 12795 8858 13780 1181 1000 1681 "23" "23" "square"]
+ Pad[ 12795 -8858 13780 -8858 1181 1000 1681 "35" "35" "square"]
+ Pad[ -8858 -13780 -8858 -12795 1181 1000 1681 "47" "47" "square"]
+ Pad[ -13780 10827 -12795 10827 1181 1000 1681 "12" "12" "square"]
+ Pad[ 10827 12795 10827 13780 1181 1000 1681 "24" "24" "square"]
+ Pad[ 12795 -10827 13780 -10827 1181 1000 1681 "36" "36" "square"]
+ Pad[ -10827 -13780 -10827 -12795 1181 1000 1681 "48" "48" "square"]
+ Pin[ -7349 -7349 2900 1000 0 1500 "GND" "GND" ""]
+ Pad[ -7349 -7349 -7349 -7349 7349 1000 0 "GND" "GND" "square,nopaste"]
+ Pad[ 0 -7349 0 -7349 7349 0 7349 "GND" "GND" "square,nopaste"]
+ Pad[ 0 -7349 0 -7349 3675 0 3675 "GND" "GND" "square"]
+ Pin[ 7349 -7349 2900 1000 0 1500 "GND" "GND" ""]
+ Pad[ 7349 -7349 7349 -7349 7349 1000 0 "GND" "GND" "square,nopaste"]
+ Pad[ -7349 0 -7349 0 7349 0 7349 "GND" "GND" "square,nopaste"]
+ Pad[ -7349 0 -7349 0 3675 0 3675 "GND" "GND" "square"]
+ Pad[ 0 0 0 0 7349 0 7349 "GND" "GND" "square,nopaste"]
+ Pad[ 0 0 0 0 3675 0 3675 "GND" "GND" "square"]
+ Pad[ 7349 0 7349 0 7349 0 7349 "GND" "GND" "square,nopaste"]
+ Pad[ 7349 0 7349 0 3675 0 3675 "GND" "GND" "square"]
+ Pin[ -7349 7349 2900 1000 0 1500 "GND" "GND" ""]
+ Pad[ -7349 7349 -7349 7349 7349 1000 0 "GND" "GND" "square,nopaste"]
+ Pad[ 0 7349 0 7349 7349 0 7349 "GND" "GND" "square,nopaste"]
+ Pad[ 0 7349 0 7349 3675 0 3675 "GND" "GND" "square"]
+ Pin[ 7349 7349 2900 1000 0 1500 "GND" "GND" ""]
+ Pad[ 7349 7349 7349 7349 7349 1000 0 "GND" "GND" "square,nopaste"]
+)