Add package for a soldered-in-place lipo
authorKeith Packard <keithp@keithp.com>
Sun, 16 Feb 2014 19:22:14 +0000 (11:22 -0800)
committerKeith Packard <keithp@keithp.com>
Sun, 16 Feb 2014 19:22:14 +0000 (11:22 -0800)
This provides two solder pads 4mm square to attach a lipo battery to

Signed-off-by: Keith Packard <keithp@keithp.com>
packages/Makefile
packages/lipo-pad.5c [new file with mode: 0644]

index b6212e57df50f48ab6e01b8dce83f4a475f10167..b492ce255bf12fcc296af5811932f73f2e47eb78 100644 (file)
@@ -63,7 +63,8 @@ FOOTPRINTS= \
        g6z1fe.fp \
        W3011A.fp \
        DIODE-SMA.fp \
-       2512.fp
+       2512.fp \
+       lipo-15x24.fp
 
 .5c.fp:
        nickle $*.5c > $@
@@ -96,3 +97,6 @@ clean: $(CLEANDIRS)
 
 soic-16.fp: soic.5c
        nickle soic.5c 16 > $@
+
+lipo-15x24.fp: lipo-pad.5c
+       nickle lipo-pad.5c 15 24 > $@
\ No newline at end of file
diff --git a/packages/lipo-pad.5c b/packages/lipo-pad.5c
new file mode 100644 (file)
index 0000000..fb8c143
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright © 2014 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;
+
+/* Battery geometry */
+if (dim(argv) < 3) {
+       File::fprintf(stderr, "Usage: %s <height> <width>\n", argv[0]);
+       exit(1);
+}
+
+File::sscanf(argv[1], "%f", &(real battery_width));
+File::sscanf(argv[2], "%f", &(real battery_height));
+
+/* Size of solder pad */
+real tab_height = 4.0;
+real tab_width = 4.0;
+
+/* inset from edge of battery to tab solder pad */
+real tab_off = 1.0;
+
+/* Spacing between solder pads */
+real tab_space = 7.0;
+
+element_start(sprintf("lipo-%fx%f", battery_width, battery_height));
+
+pad_mm (-tab_space/2, 0, tab_width, tab_height, "-", "2");
+pad_mm (tab_space/2, 0, tab_width, tab_height, "+", "1");
+
+rect (-battery_width/2, -tab_height/2 - tab_off, battery_width, battery_height);
+
+element_end();