Update "missing" (automake) script to a later version
[geda-pcb/pcjc2.git] / lib / candk.inc
blob6ad6072683603b82e95ede2342b71619ad55aaf8
1 # -*- m4 -*-
3 #                            COPYRIGHT
5 #   PCB, interactive printed circuit board design
6 #   Copyright (C) 2007 Dan McMahill
8 #   This program is free software; you can redistribute it and/or modify
9 #   it under the terms of the GNU General Public License as published by
10 #   the Free Software Foundation; version 2 of the License.
11
12 #   This program is distributed in the hope that it will be useful,
13 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 #   GNU General Public License for more details.
16
17 #   You should have received a copy of the GNU General Public License
18 #   along with this program; if not, write to the Free Software
19 #   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
21 #   The symbols produced by this file may be used and redistributed 
22 #   without restriction as part of a PCB layout file.  Distribution 
23 #   of footprints produced by this file as part of a footprint
24 #   library is governed by the same license as this source file.
27 #  C&K Specific Footprints
30 # ES series surface mount switches
32 # $1: canonical name
33 # $2: name on PCB
34 # $3: value
36 define(`PKG_CANDK_ES_SMT_SWITCH',
37        `
38         # pad 1,2,3 width (1/100 mil)
39         define(`PADW1',  `3500')
41         # pad 1,2,3 length (1/100 mil)
42         define(`PADL1',  `8200')
44         # x value for pads 1,3 (1/100 mil)
45         define(`PADX1', `10000')
46         
47         # y value for pads 1,2,3 (1/100 mil)
48         define(`PADY1', `17500')
49         define(`PADY1A', `eval(PADY1 - (PADL1 - PADW1)/2)')
50         define(`PADY1B', `eval(PADY1 + (PADL1 - PADW1)/2)')
53         # mounting pad width (1/100 mil)
54         define(`PADW2',  `9150')
56         # mounting pad length (1/100 mil)
57         define(`PADL2',  `6000')
59         # x value for the mounting pads (1/100 mil)
60         define(`PADX2', `21175')
61         define(`PADX2A', `eval(PADX2 - (PADW2 - PADL2)/2)')
62         define(`PADX2B', `eval(PADX2 + (PADW2 - PADL2)/2)')
63         
64         # y value for the mounting pads (1/100 mil)
65         define(`PADY2', `-17500')
67         # package width (1/100 mil)
68         define(`PACKW', `39500')
70         # package height (1/100 mil)
71         define(`PACKH', `36000')
73         # component veritcal height off board (1/100 mil)
74         define(`COMPH', `eval($9*10000/254)')
76         # pad width and length
77         define(`PADW', `eval(PINW + 2000)')
78         define(`PADL', `eval(PINL + 2000)')
80         # y values for drawing the pad.  
81         # The Y center of the pad is 0.5*(PINL + PINS)
82         # we need a line segment of length PADL - PADW so we have end points:
83         # 0.5*(PINL + PINS) +/- 0.5*(PADL - PADW)
84         define(`PY1', `eval((PINL + PINS + PADL - PADW)/2)')
85         define(`PY2', `eval((PINL + PINS - PADL + PADW)/2)')
87         # width of soldermask relief (5 mil on each side)
88         define(`MASKW1', `eval(PADW1 + 1000)')
89         define(`MASKW2', `eval(PADL2 + 1000)')
91         # top edge of switch body (1/100 mil)
92         define(`SWTOP', `eval(PADY2 - 5000)')
94         # bottom edge of switch body (1/100 mil)
95         define(`SWBOT', `eval(SWTOP + PACKH)')
97         # how much the switch extends beyond the body
98         define(`SWEXT', `12100')
100         # y value for the far end of the switch
101         define(`SWYMAX', `eval(SWTOP - SWEXT)')
103         # silkscreen width (1/100 mils)
104         define(`SILKW', `1000')
106         # how much space to leave around the part before the
107         # silk screen (1/100 mils)
108         define(`SILKS', `800')
110         # X values for silk on sides and bottom of switch
111         define(`SX1', `eval( (PACKW + 2*SILKS + SILKW)/2)')
112         define(`SX2', `eval( 10000 + PADW1/2 + SILKS + SILKW/2)')
114         # bottom edge of the switch body
115         define(`SY1', `eval( SWBOT + SILKS + SILKW/2 )')
117         # bottom edge of upper pads
118         define(`SY2', `eval( PADY2 + PADL2/2 + SILKS + SILKW/2)')
120         # bottom edge of the lower pads
121         define(`SY3', `eval( PADY1 + PADL1/2 + SILKS + SILKW/2)')
123         # top edge of the switch body
124         define(`SY4', `eval( PADY2 - PADL2/2 - SILKS - SILKW/2)')
126         # top edge of the switch 
127         define(`SY5', `eval( SWTOP - SILKS - SILKW/2)')
130 # Element [SFlags "Desc" "Name" "Value" MX MY TX TY TDir TScale TSFlags]
131 Element[ "" "`$1'" "`$2'" "`$3'" 0 0 0 0 0 100 ""]
134 # Pad [rX1 rY1 rX2 rY2 Thickness Clearance Mask "Name" "Number" SFlags]
136 # the signal pads
137 Pad[ -PADX1 PADY1A -PADX1 PADY1B PADW1 1000 MASKW1 "1"  "1" "square"]
138 Pad[      0 PADY1A      0 PADY1B PADW1 1000 MASKW1 "2"  "2" "square"]
139 Pad[  PADX1 PADY1A  PADX1 PADY1B PADW1 1000 MASKW1 "3"  "3" "square"]
141 # the mounting pads
142 Pad[ -PADX2A PADY2 -PADX2B PADY2 PADL2 1000 MASKW2 "4"  "4" "square"]
143 Pad[  PADX2A PADY2  PADX2B PADY2 PADL2 1000 MASKW2 "4"  "4" "square"]
145 # Silk screen around package
146 # ElementLine[ x1 y1 x2 y2 width]
148 # bottom edge
149 ElementLine[ SX1 SY1  SX2 SY1 SILKW ]
150 ElementLine[-SX1 SY1 -SX2 SY1 SILKW ]
151 ElementLine[-SX2 SY1 -SX2 SY3 SILKW ]
152 ElementLine[ SX2 SY1  SX2 SY3 SILKW ]
153 ElementLine[-SX2 SY3  SX2 SY3 SILKW ]
155 # left/right
156 ElementLine[ SX1 SY1  SX1 SY2 SILKW ]
157 ElementLine[-SX1 SY1 -SX1 SY2 SILKW ]
159 # top edge
160 ElementLine[-SX1 SWYMAX  SX1 SWYMAX SILKW ]
161 ElementLine[-SX1 SY5     SX1 SY5    SILKW ]
162 ElementLine[-SX1 SY4    -SX1 SWYMAX SILKW ]
163 ElementLine[ SX1 SY4     SX1 SWYMAX SILKW ]
165 # cross at top where switch moves
166 ElementLine[-SX1 SWYMAX  SX1 SY5    SILKW ]
167 ElementLine[-SX1 SY5     SX1 SWYMAX SILKW ]
171 # -------------------------------------------------------------------
173 # EXTRACT_BEGIN
177 ##  C&K ES Series Switches
180 # See www.ittcannon.com.
182 define(`PKG_CANDK_ES01MSABE', `PKG_CANDK_ES_SMT_SWITCH(`$1', `$2', `$3')')
183 define(`PKG_CANDK_ES02MSABE', `PKG_CANDK_ES_SMT_SWITCH(`$1', `$2', `$3')')
184 define(`PKG_CANDK_ES03MSABE', `PKG_CANDK_ES_SMT_SWITCH(`$1', `$2', `$3')')
188 # EXTRACT_END