changeset 152:d41cdd682db5

m4-fp: support for CUI DS04-254-SMT DIP switch series
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 24 Jun 2021 05:13:16 +0000
parents b495db6e5081
children c147a730271f
files ifctf-part-lib/m4-fp/common.m4 ifctf-part-lib/m4-fp/switch.inc
diffstat 2 files changed, 59 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ifctf-part-lib/m4-fp/common.m4	Wed Jun 23 01:50:17 2021 +0000
+++ b/ifctf-part-lib/m4-fp/common.m4	Thu Jun 24 05:13:16 2021 +0000
@@ -115,6 +115,7 @@
 include(rules.inc)
 include(smt.inc)
 include(smtosc.inc)
+include(switch.inc)
 include(to.inc)
 include(zif.inc)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ifctf-part-lib/m4-fp/switch.inc	Thu Jun 24 05:13:16 2021 +0000
@@ -0,0 +1,58 @@
+# -*- m4 -*-
+#
+# Footprints for switch components
+
+# SMT DIP switch series: CUI DS04-254-SMT
+#
+# $1: canonical name
+# $2: name on PCB
+# $3: value
+# $4: number of switches in the pack
+define(`DS04_254_SMT',
+        `
+Element[0x00 "$1" "$2" "$3" 200000 100000 0 0 0 100 0x00]
+(
+	# X position preliminary computations (um units)
+	define(`dimB', eval(($4 - 1) * 2540))
+	define(`dimL', eval(dimB + 3540))
+	# pad geometry
+	define(`padwidth', 1100)
+	define(`youter', 5200)
+	define(`yinner', 3700)
+	define(`maskextra', 150)
+	# xpos variable keeps track of X position of pad-pair in um units
+	define(`xpos', eval(-dimB/2))
+	define(`CURPIN', 1)
+	forloop(i, 1, $4, `
+		Pad[xpos`um' eval(youter-padwidth/2)`um'
+			xpos`um' eval(yinner+padwidth/2)`um'
+			padwidth`um' 10mil eval(padwidth+maskextra)`um'
+			"" "CURPIN" "square"]
+		define(`CURPIN', eval(CURPIN + 1))
+		Pad[xpos`um' eval(-youter+padwidth/2)`um'
+			xpos`um' eval(-yinner-padwidth/2)`um'
+			padwidth`um' 10mil eval(padwidth+maskextra)`um'
+			"" "CURPIN" "square"]
+		define(`CURPIN', eval(CURPIN + 1))
+		define(`xpos', eval(xpos + 2540))
+	')
+	# silk outline
+	define(`silkW', 150)
+	define(`silkX', eval(dimL/2))
+	define(`silkY', eval(5200 + 150 + silkW/2))
+	ElementLine[-silkX`um' -silkY`um'  silkX`um' -silkY`um' silkW`um']
+	ElementLine[-silkX`um'  silkY`um'  silkX`um'  silkY`um' silkW`um']
+	ElementLine[-silkX`um' -silkY`um' -silkX`um'  silkY`um' silkW`um']
+	ElementLine[ silkX`um' -silkY`um'  silkX`um'  silkY`um' silkW`um']
+)')
+
+define(`PKG_DS04_254_01', `DS04_254_SMT(`$1',`$2',`$3', 1)')
+define(`PKG_DS04_254_02', `DS04_254_SMT(`$1',`$2',`$3', 2)')
+define(`PKG_DS04_254_03', `DS04_254_SMT(`$1',`$2',`$3', 3)')
+define(`PKG_DS04_254_04', `DS04_254_SMT(`$1',`$2',`$3', 4)')
+define(`PKG_DS04_254_05', `DS04_254_SMT(`$1',`$2',`$3', 5)')
+define(`PKG_DS04_254_06', `DS04_254_SMT(`$1',`$2',`$3', 6)')
+define(`PKG_DS04_254_07', `DS04_254_SMT(`$1',`$2',`$3', 7)')
+define(`PKG_DS04_254_08', `DS04_254_SMT(`$1',`$2',`$3', 8)')
+define(`PKG_DS04_254_10', `DS04_254_SMT(`$1',`$2',`$3', 10)')
+define(`PKG_DS04_254_12', `DS04_254_SMT(`$1',`$2',`$3', 12)')