changeset 91:d77e95a5cc5c

M4 lib: added vertically mirrored 2-row headers
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 11 Nov 2018 01:41:30 +0000
parents d60b77b0c1ae
children e147e428b417
files ifctf-part-lib/m4-fp/connector.inc ifctf-part-lib/m4-fp/geda.inc
diffstat 2 files changed, 72 insertions(+), 46 deletions(-) [+]
line wrap: on
line diff
--- a/ifctf-part-lib/m4-fp/connector.inc	Sun Nov 11 01:25:59 2018 +0000
+++ b/ifctf-part-lib/m4-fp/connector.inc	Sun Nov 11 01:41:30 2018 +0000
@@ -31,22 +31,24 @@
 # $3: value
 # $4: number of rows
 # $5: number of columns
+# $6: 1 for normal orientation or -1 to mirror vertically
 #
 define(`PKG_CONNECTOR',
-	`define(`MAXY', eval(`$4' * 100))
-	define(`MAXX', eval(`$5' * 100))
+	`define(`MAXY', eval($4 * 100 * $6))
+	define(`MAXX', eval($5 * 100))
+	define(`cornerY', eval(100 * $6))
 Element(0x00 "$1" "$2" "$3" eval(MAXX + 60) 0 3 100 0x00)
 (
 	forloop(`row', 1, $4, `forloop(`col', 1, $5,
-		`PIN(eval(col * 100 -50), eval(row * 100 -50), 60, 38, eval((row-1)*$5+col))
+		`PIN(eval(col*100-50), eval((row*100-50)*$6), 60, 38, eval((row-1)*$5+col))
 	') ')
 	ElementLine(0 0 0 MAXY 20)
 	ElementLine(0 MAXY MAXX MAXY 20)
 	ElementLine(MAXX MAXY MAXX 0 20)
 	ElementLine(MAXX 0 0 0 20)
-	ElementLine(0 100 100 100 10)
-	ElementLine(100 100 100 0 10)
-	Mark(50 50)
+	ElementLine(0 cornerY 100 cornerY 10)
+	ElementLine(100 cornerY 100 0 10)
+	Mark(50 eval(cornerY / 2))
 )')
 
 # -------------------------------------------------------------------
--- a/ifctf-part-lib/m4-fp/geda.inc	Sun Nov 11 01:25:59 2018 +0000
+++ b/ifctf-part-lib/m4-fp/geda.inc	Sun Nov 11 01:41:30 2018 +0000
@@ -654,26 +654,26 @@
 #
 ## Jumper, i.e. single row headers
 #
-define(`PKG_JUMPER1',    `PKG_CONNECTOR(`$1', `$2', `$3',  1, 1)');
-define(`PKG_JUMPER2',    `PKG_CONNECTOR(`$1', `$2', `$3',  2, 1)');
-define(`PKG_JUMPER3',    `PKG_CONNECTOR(`$1', `$2', `$3',  3, 1)');
-define(`PKG_JUMPER4',    `PKG_CONNECTOR(`$1', `$2', `$3',  4, 1)');
-define(`PKG_JUMPER5',    `PKG_CONNECTOR(`$1', `$2', `$3',  5, 1)');
-define(`PKG_JUMPER6',    `PKG_CONNECTOR(`$1', `$2', `$3',  6, 1)');
-define(`PKG_JUMPER7',    `PKG_CONNECTOR(`$1', `$2', `$3',  7, 1)');
-define(`PKG_JUMPER8',    `PKG_CONNECTOR(`$1', `$2', `$3',  8, 1)');
-define(`PKG_JUMPER9',    `PKG_CONNECTOR(`$1', `$2', `$3',  9, 1)');
-define(`PKG_JUMPER10',   `PKG_CONNECTOR(`$1', `$2', `$3', 10, 1)');
-define(`PKG_JUMPER11',   `PKG_CONNECTOR(`$1', `$2', `$3', 11, 1)');
-define(`PKG_JUMPER12',   `PKG_CONNECTOR(`$1', `$2', `$3', 12, 1)');
-define(`PKG_JUMPER13',   `PKG_CONNECTOR(`$1', `$2', `$3', 13, 1)');
-define(`PKG_JUMPER14',   `PKG_CONNECTOR(`$1', `$2', `$3', 14, 1)');
-define(`PKG_JUMPER15',   `PKG_CONNECTOR(`$1', `$2', `$3', 15, 1)');
-define(`PKG_JUMPER16',   `PKG_CONNECTOR(`$1', `$2', `$3', 16, 1)');
-define(`PKG_JUMPER17',   `PKG_CONNECTOR(`$1', `$2', `$3', 17, 1)');
-define(`PKG_JUMPER18',   `PKG_CONNECTOR(`$1', `$2', `$3', 18, 1)');
-define(`PKG_JUMPER19',   `PKG_CONNECTOR(`$1', `$2', `$3', 19, 1)');
-define(`PKG_JUMPER20',   `PKG_CONNECTOR(`$1', `$2', `$3', 20, 1)');
+define(`PKG_JUMPER1',    `PKG_CONNECTOR(`$1', `$2', `$3',  1, 1, 1)');
+define(`PKG_JUMPER2',    `PKG_CONNECTOR(`$1', `$2', `$3',  2, 1, 1)');
+define(`PKG_JUMPER3',    `PKG_CONNECTOR(`$1', `$2', `$3',  3, 1, 1)');
+define(`PKG_JUMPER4',    `PKG_CONNECTOR(`$1', `$2', `$3',  4, 1, 1)');
+define(`PKG_JUMPER5',    `PKG_CONNECTOR(`$1', `$2', `$3',  5, 1, 1)');
+define(`PKG_JUMPER6',    `PKG_CONNECTOR(`$1', `$2', `$3',  6, 1, 1)');
+define(`PKG_JUMPER7',    `PKG_CONNECTOR(`$1', `$2', `$3',  7, 1, 1)');
+define(`PKG_JUMPER8',    `PKG_CONNECTOR(`$1', `$2', `$3',  8, 1, 1)');
+define(`PKG_JUMPER9',    `PKG_CONNECTOR(`$1', `$2', `$3',  9, 1, 1)');
+define(`PKG_JUMPER10',   `PKG_CONNECTOR(`$1', `$2', `$3', 10, 1, 1)');
+define(`PKG_JUMPER11',   `PKG_CONNECTOR(`$1', `$2', `$3', 11, 1, 1)');
+define(`PKG_JUMPER12',   `PKG_CONNECTOR(`$1', `$2', `$3', 12, 1, 1)');
+define(`PKG_JUMPER13',   `PKG_CONNECTOR(`$1', `$2', `$3', 13, 1, 1)');
+define(`PKG_JUMPER14',   `PKG_CONNECTOR(`$1', `$2', `$3', 14, 1, 1)');
+define(`PKG_JUMPER15',   `PKG_CONNECTOR(`$1', `$2', `$3', 15, 1, 1)');
+define(`PKG_JUMPER16',   `PKG_CONNECTOR(`$1', `$2', `$3', 16, 1, 1)');
+define(`PKG_JUMPER17',   `PKG_CONNECTOR(`$1', `$2', `$3', 17, 1, 1)');
+define(`PKG_JUMPER18',   `PKG_CONNECTOR(`$1', `$2', `$3', 18, 1, 1)');
+define(`PKG_JUMPER19',   `PKG_CONNECTOR(`$1', `$2', `$3', 19, 1, 1)');
+define(`PKG_JUMPER20',   `PKG_CONNECTOR(`$1', `$2', `$3', 20, 1, 1)');
 
 #
 ## MTA Connector, (0.100 inch pitch)
@@ -722,26 +722,50 @@
 ## Header connector, ribbon cable numbering
 #  corresponding to gEDA symbols header2-2 .. header64-2
 #
-define(`PKG_HEADER2_2',  `PKG_CONNECTOR(`$1', `$2', `$3',  1, 2)');
-define(`PKG_HEADER4_2',  `PKG_CONNECTOR(`$1', `$2', `$3',  2, 2)');
-define(`PKG_HEADER6_2',  `PKG_CONNECTOR(`$1', `$2', `$3',  3, 2)');
-define(`PKG_HEADER8_2',  `PKG_CONNECTOR(`$1', `$2', `$3',  4, 2)');
-define(`PKG_HEADER10_2', `PKG_CONNECTOR(`$1', `$2', `$3',  5, 2)');
-define(`PKG_HEADER12_2', `PKG_CONNECTOR(`$1', `$2', `$3',  6, 2)');
-define(`PKG_HEADER14_2', `PKG_CONNECTOR(`$1', `$2', `$3',  7, 2)');
-define(`PKG_HEADER16_2', `PKG_CONNECTOR(`$1', `$2', `$3',  8, 2)');
-define(`PKG_HEADER18_2', `PKG_CONNECTOR(`$1', `$2', `$3',  9, 2)');
-define(`PKG_HEADER20_2', `PKG_CONNECTOR(`$1', `$2', `$3', 10, 2)');
-define(`PKG_HEADER22_2', `PKG_CONNECTOR(`$1', `$2', `$3', 11, 2)');
-define(`PKG_HEADER24_2', `PKG_CONNECTOR(`$1', `$2', `$3', 12, 2)');
-define(`PKG_HEADER26_2', `PKG_CONNECTOR(`$1', `$2', `$3', 13, 2)');
-define(`PKG_HEADER28_2', `PKG_CONNECTOR(`$1', `$2', `$3', 14, 2)');
-define(`PKG_HEADER30_2', `PKG_CONNECTOR(`$1', `$2', `$3', 15, 2)');
-define(`PKG_HEADER34_2', `PKG_CONNECTOR(`$1', `$2', `$3', 17, 2)');
-define(`PKG_HEADER40_2', `PKG_CONNECTOR(`$1', `$2', `$3', 20, 2)');
-define(`PKG_HEADER50_2', `PKG_CONNECTOR(`$1', `$2', `$3', 25, 2)');
-define(`PKG_HEADER60_2', `PKG_CONNECTOR(`$1', `$2', `$3', 30, 2)');
-define(`PKG_HEADER64_2', `PKG_CONNECTOR(`$1', `$2', `$3', 32, 2)');
+define(`PKG_HEADER2_2',  `PKG_CONNECTOR(`$1', `$2', `$3',  1, 2, 1)');
+define(`PKG_HEADER4_2',  `PKG_CONNECTOR(`$1', `$2', `$3',  2, 2, 1)');
+define(`PKG_HEADER6_2',  `PKG_CONNECTOR(`$1', `$2', `$3',  3, 2, 1)');
+define(`PKG_HEADER8_2',  `PKG_CONNECTOR(`$1', `$2', `$3',  4, 2, 1)');
+define(`PKG_HEADER10_2', `PKG_CONNECTOR(`$1', `$2', `$3',  5, 2, 1)');
+define(`PKG_HEADER12_2', `PKG_CONNECTOR(`$1', `$2', `$3',  6, 2, 1)');
+define(`PKG_HEADER14_2', `PKG_CONNECTOR(`$1', `$2', `$3',  7, 2, 1)');
+define(`PKG_HEADER16_2', `PKG_CONNECTOR(`$1', `$2', `$3',  8, 2, 1)');
+define(`PKG_HEADER18_2', `PKG_CONNECTOR(`$1', `$2', `$3',  9, 2, 1)');
+define(`PKG_HEADER20_2', `PKG_CONNECTOR(`$1', `$2', `$3', 10, 2, 1)');
+define(`PKG_HEADER22_2', `PKG_CONNECTOR(`$1', `$2', `$3', 11, 2, 1)');
+define(`PKG_HEADER24_2', `PKG_CONNECTOR(`$1', `$2', `$3', 12, 2, 1)');
+define(`PKG_HEADER26_2', `PKG_CONNECTOR(`$1', `$2', `$3', 13, 2, 1)');
+define(`PKG_HEADER28_2', `PKG_CONNECTOR(`$1', `$2', `$3', 14, 2, 1)');
+define(`PKG_HEADER30_2', `PKG_CONNECTOR(`$1', `$2', `$3', 15, 2, 1)');
+define(`PKG_HEADER34_2', `PKG_CONNECTOR(`$1', `$2', `$3', 17, 2, 1)');
+define(`PKG_HEADER40_2', `PKG_CONNECTOR(`$1', `$2', `$3', 20, 2, 1)');
+define(`PKG_HEADER50_2', `PKG_CONNECTOR(`$1', `$2', `$3', 25, 2, 1)');
+define(`PKG_HEADER60_2', `PKG_CONNECTOR(`$1', `$2', `$3', 30, 2, 1)');
+define(`PKG_HEADER64_2', `PKG_CONNECTOR(`$1', `$2', `$3', 32, 2, 1)');
+
+#
+## Header connector, ribbon cable numbering, vertically mirrored
+#
+define(`PKG_HEADER2_3',  `PKG_CONNECTOR(`$1', `$2', `$3',  1, 2, -1)');
+define(`PKG_HEADER4_3',  `PKG_CONNECTOR(`$1', `$2', `$3',  2, 2, -1)');
+define(`PKG_HEADER6_3',  `PKG_CONNECTOR(`$1', `$2', `$3',  3, 2, -1)');
+define(`PKG_HEADER8_3',  `PKG_CONNECTOR(`$1', `$2', `$3',  4, 2, -1)');
+define(`PKG_HEADER10_3', `PKG_CONNECTOR(`$1', `$2', `$3',  5, 2, -1)');
+define(`PKG_HEADER12_3', `PKG_CONNECTOR(`$1', `$2', `$3',  6, 2, -1)');
+define(`PKG_HEADER14_3', `PKG_CONNECTOR(`$1', `$2', `$3',  7, 2, -1)');
+define(`PKG_HEADER16_3', `PKG_CONNECTOR(`$1', `$2', `$3',  8, 2, -1)');
+define(`PKG_HEADER18_3', `PKG_CONNECTOR(`$1', `$2', `$3',  9, 2, -1)');
+define(`PKG_HEADER20_3', `PKG_CONNECTOR(`$1', `$2', `$3', 10, 2, -1)');
+define(`PKG_HEADER22_3', `PKG_CONNECTOR(`$1', `$2', `$3', 11, 2, -1)');
+define(`PKG_HEADER24_3', `PKG_CONNECTOR(`$1', `$2', `$3', 12, 2, -1)');
+define(`PKG_HEADER26_3', `PKG_CONNECTOR(`$1', `$2', `$3', 13, 2, -1)');
+define(`PKG_HEADER28_3', `PKG_CONNECTOR(`$1', `$2', `$3', 14, 2, -1)');
+define(`PKG_HEADER30_3', `PKG_CONNECTOR(`$1', `$2', `$3', 15, 2, -1)');
+define(`PKG_HEADER34_3', `PKG_CONNECTOR(`$1', `$2', `$3', 17, 2, -1)');
+define(`PKG_HEADER40_3', `PKG_CONNECTOR(`$1', `$2', `$3', 20, 2, -1)');
+define(`PKG_HEADER50_3', `PKG_CONNECTOR(`$1', `$2', `$3', 25, 2, -1)');
+define(`PKG_HEADER60_3', `PKG_CONNECTOR(`$1', `$2', `$3', 30, 2, -1)');
+define(`PKG_HEADER64_3', `PKG_CONNECTOR(`$1', `$2', `$3', 32, 2, -1)');
 
 #
 ## Header connector with latches