Introduce POLYGONHOLE_MODE for creating holes in polygons
[geda-pcb/gde.git] / lib / connector.inc
blob3bd8195d01c6a0ba127fbe030f035144231b67ab
1 *# -*- m4 -*-
2 #                             COPYRIGHT
3
4 #   PCB, interactive printed circuit board design
5 #   Copyright (C) 1994,1995,1996 Thomas Nau
6
7 #   This program is free software; you can redistribute it and/or modify
8 #   it under the terms of the GNU General Public License as published by
9 #   the Free Software Foundation; either version 2 of the License, or
10 #   (at your option) any later version.
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 #   Contact addresses for paper mail and Email:
22 #   Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
23 #   Thomas.Nau@rz.uni-ulm.de
24
25 #   RCS: $Id$
27 # connector packages
29 # -------------------------------------------------------------------
30 # the definition of a single connector
31 # $1: canonical name
32 # $2: name on PCB
33 # $3: value
34 # $4: number of rows
35 # $5: number of columns
37 define(`PKG_CONNECTOR',
38         `define(`MAXY', `eval(`$4' * 100)')
39         define(`MAXX', `eval(`$5' * 100)')
40 Element(0x00 "$1" "`$2'" "$3" eval(MAXX + 60) 0 3 100 0x00)
42         forloop(`row', 1, $4, `forloop(`col', 1, $5,
43                 `PIN(eval(col * 100 -50), eval(row * 100 -50), 60, 38, eval((row-1)*$5+col))
44         ') ')
45         ElementLine(0 0 0 MAXY 10)
46         ElementLine(0 MAXY MAXX MAXY 10)
47         ElementLine(MAXX MAXY MAXX 0 10)
48         ElementLine(MAXX 0 0 0 10)
49         ElementLine(0 100 100 100 10)
50         ElementLine(100 100 100 0 10)
51         Mark(50 50)
52 )')
54 # -------------------------------------------------------------------
55 # the definition of a 2 column header connector with DIP
56 # pin numbering.  Use PKG_CONNECTOR for ribbon cable numbering
58 # $1: canonical name
59 # $2: name on PCB
60 # $3: value
61 # $4: number of rows
63 define(`PKG_CONNECTOR_DIL',
64         `define(`MAXY', `eval(`$4' * 100)')
65         define(`MAXX', `200')
66 Element(0x00 "$1" "`$2'" "$3" eval(MAXX + 60) 0 3 100 0x00)
68         forloop(`row', 1, eval(`$4'),
69                 `PIN(50, eval(row * 100 -50), 60, 38, eval(row))
70         ')
71         forloop(`row', 1, eval(`$4'),
72                 `PIN(150, eval(($4 + 1 - row) * 100 -50), 60, 38, eval($4 + row))
73         ')
74         ElementLine(0 0 0 MAXY 10)
75         ElementLine(0 MAXY MAXX MAXY 10)
76         ElementLine(MAXX MAXY MAXX 0 10)
77         ElementLine(MAXX 0 0 0 10)
78         ElementLine(0 100 100 100 10)
79         ElementLine(100 100 100 0 10)
80         Mark(50 50)
81 )')
85 # ---------------------------------------------------------------
86 # base definition (housing) for connector DIN 41.612
87 # 11/95 Volker Bosch (bosch@iema.e-technik.uni-stuttgart.de)
88 # female package added 05/96 also by Volker Bosch
90 # derived from above for 48 - Pin Connectors from the same series
91 # Holm Tiffe
93 # $1: canonical name
94 # $2: name on PCB
95 # $3: value
96 # $4: requested rows a,b,c
98 define(`PKG_DIN41_612MALE_SMALL',
99         `define(`XPOS', `eval(300 + 100 * i)')
100         define(`MINY', 300)
101 Element(0x00 "$1" "`$2'" "$3" 520 550 0 200 0x00)
103         # Reihe a
104         ifelse(index(`$4', `a'), `-1', ,
105                 forloop(`i', 1, 16, `PIN(eval(2000 - 100 *i), 300, 60, 30, i)
106         '))
108         # Reihe b
109         ifelse(index(`$4', `b'), `-1', , `define(`MINY', 200)'
110                 forloop(`i', 1, 16, `PIN(eval(2000 - 100 *i), 200, 60, 30, eval(16 + i))
111         '))
113         # Reihe c
114         ifelse(index(`$4', `c'), `-1', , `define(`MINY', 100)'
115                 forloop(`i', 1, 16, `PIN(eval(2000 - 100 *i), 100, 60, 30, eval(32 + i))
116         '))
117     # Rueckseite Kontaktstifte
118         forloop(`i', 1, 16, `ElementLine(XPOS MINY XPOS 375 40)
119         ')
121         # Befestigungsbohrung
122         Pin( 200 400 120 80 "M1" 0x01)
123         Pin(2100 400 120 80 "M2" 0x01)
125         # Begrenzung M1
126         ElementLine( 100  300  320  300 20)
127         ElementLine( 320  300  320  395 20)
128         ElementLine( 320  395  320  620 10)
129         ElementLine( 320  620  200  620 10)
130         ElementLine( 200  620  100  620 20)
131         ElementLine( 100  620  100  300 20)
133         # Begrenzung M2
134         ElementLine(1980  300 2200  300 20)
135         ElementLine(2200  300 2200  620 20)
136         ElementLine(2200  620 2100  620 20)
137         ElementLine(2100  620 1980  620 10)
138         ElementLine(1980  620 1980  395 10)
139         ElementLine(1980  395 1980  300 20)
141         # Kante Pins
142         ElementLine( 320  395 1980  395 20)
144         # Kanten Stifte
145         ElementLine( 200 620  200 800 20)
146         ElementLine( 200 800 2100 800 20)
147         ElementLine(2100 800 2100 620 20)
149         Mark(1900 300)
152 define(`PKG_DIN41_612FEMALE_SMALL',
153         `define(`MAXX', 420)
154         define(`MAXX1', `eval(MAXX -170)')
155         define(`MAXX2', `eval(MAXX -40)')
156 Element(0x00 "$1" "`$2'" "$3" 50 100 3 200 0x00)
158         # Reihe a
159         ifelse(index(`$4', `a'), `-1', ,
160                 forloop(`i', 1, 16, `PIN(200, eval(300 + 100 *i), 60, 30, i)
161         '))
163         # Reihe b
164         ifelse(index(`$4', `b'), `-1', ,
165                 forloop(`i', 1, 16, `PIN(300, eval(300 + 100 *i), 60, 30, eval(16 + i))
166         '))
168         # Reihe c
169         ifelse(index(`$4', `c'), `-1', , `define(`MAXX', 520)'
170                 forloop(`i', 1, 16, `PIN(400, eval(300 + 100 *i), 60, 30, eval(32 + i))
171         '))
173         # Befestigungsbohrung
174         Pin(290  180 120 80 "M1" 0x01)
175         Pin(290 2120 120 80 "M2" 0x01)
177         # Aeussere Begrenzung
178         ElementLine( 80  80 MAXX   80 20)
179         ElementLine(MAXX  80 MAXX 2220 20)
180         ElementLine(MAXX 2220 80 2220 20)
181         ElementLine( 80 2220 80   80 20)
183         # Innere Begrenzung
184         ElementLine(120  320 MAXX1  320 10)
185         ElementLine(MAXX1  320 MAXX1  360 10)
186         ElementLine(MAXX1  360 MAXX2  360 10)
187         ElementLine(MAXX2  360 MAXX2 1940 10)
188         ElementLine(MAXX2 1940 MAXX1 1940 10)
189         ElementLine(MAXX1 1940 MAXX1 1980 10)
190         ElementLine(MAXX1 1980 120 1980 10)
191         ElementLine(120 1980 120  320 10)
193         # Markierung: Pin 1a
194         Mark(200 400)
198 # ---------------------------------------------------------------
199 # base definition (housing) for connector DIN 41.612
200 # 11/95 Volker Bosch (bosch@iema.e-technik.uni-stuttgart.de)
201 # female package added 05/96 also by Volker Bosch
203 # $1: canonical name
204 # $2: name on PCB
205 # $3: value
206 # $4: requested rows a,b,c
208 define(`PKG_DIN41_612MALE',
209         `define(`XPOS', `eval(300 + 100 * i)')
210         define(`MINY', 300)
211 Element(0x00 "$1" "`$2'" "$3" 520 550 0 200 0x00)
213         # Reihe a
214         ifelse(index(`$4', `a'), `-1', ,
215                 forloop(`i', 1, 32, `PIN(eval(3600 - 100 *i), 300, 60, 30, i)
216         '))
218         # Reihe b
219         ifelse(index(`$4', `b'), `-1', , `define(`MINY', 200)'
220                 forloop(`i', 1, 32, `PIN(eval(3600 - 100 *i), 200, 60, 30, eval(32 + i))
221         '))
223         # Reihe c
224         ifelse(index(`$4', `c'), `-1', , `define(`MINY', 100)'
225                 forloop(`i', 1, 32, `PIN(eval(3600 - 100 *i), 100, 60, 30, eval(64 + i))
226         '))
227     # Rueckseite Kontaktstifte
228         forloop(`i', 1, 32, `ElementLine(XPOS MINY XPOS 375 40)
229         ')
231         # Befestigungsbohrung
232         Pin( 200 400 120 80 "M1" 0x01)
233         Pin(3700 400 120 80 "M2" 0x01)
235         # Begrenzung M1
236         ElementLine( 100  300  320  300 20)
237         ElementLine( 320  300  320  395 20)
238         ElementLine( 320  395  320  620 10)
239         ElementLine( 320  620  200  620 10)
240         ElementLine( 200  620  100  620 20)
241         ElementLine( 100  620  100  300 20)
243         # Begrenzung M2
244         ElementLine(3580  300 3800  300 20)
245         ElementLine(3800  300 3800  620 20)
246         ElementLine(3800  620 3700  620 20)
247         ElementLine(3700  620 3580  620 10)
248         ElementLine(3580  620 3580  395 10)
249         ElementLine(3580  395 3580  300 20)
251         # Kante Pins
252         ElementLine( 320  395 3580  395 20)
254         # Kanten Stifte
255         ElementLine( 200 620  200 800 20)
256         ElementLine( 200 800 3700 800 20)
257         ElementLine(3700 800 3700 620 20)
259         Mark(3500 300)
262 define(`PKG_DIN41_612FEMALE',
263         `define(`MAXX', 420)
264         define(`MAXX1', `eval(MAXX -170)')
265         define(`MAXX2', `eval(MAXX -40)')
266 Element(0x00 "$1" "`$2'" "$3" 50 100 3 200 0x00)
268         # Reihe a
269         ifelse(index(`$4', `a'), `-1', ,
270                 forloop(`i', 1, 32, `PIN(200, eval(300 + 100 *i), 60, 30, i)
271         '))
273         # Reihe b
274         ifelse(index(`$4', `b'), `-1', ,
275                 forloop(`i', 1, 32, `PIN(300, eval(300 + 100 *i), 60, 30, eval(32 + i))
276         '))
278         # Reihe c
279         ifelse(index(`$4', `c'), `-1', , `define(`MAXX', 520)'
280                 forloop(`i', 1, 32, `PIN(400, eval(300 + 100 *i), 60, 30, eval(64 + i))
281         '))
283         # Befestigungsbohrung
284         Pin(290  180 120 80 "M1" 0x01)
285         Pin(290 3720 120 80 "M2" 0x01)
287         # Aeussere Begrenzung
288         ElementLine( 80  80 MAXX   80 20)
289         ElementLine(MAXX  80 MAXX 3820 20)
290         ElementLine(MAXX 3820 80 3820 20)
291         ElementLine( 80 3820 80   80 20)
293         # Innere Begrenzung
294         ElementLine(120  320 MAXX1  320 10)
295         ElementLine(MAXX1  320 MAXX1  360 10)
296         ElementLine(MAXX1  360 MAXX2  360 10)
297         ElementLine(MAXX2  360 MAXX2 3540 10)
298         ElementLine(MAXX2 3540 MAXX1 3540 10)
299         ElementLine(MAXX1 3540 MAXX1 3580 10)
300         ElementLine(MAXX1 3580 120 3580 10)
301         ElementLine(120 3580 120  320 10)
303         # Markierung: Pin 1a
304         Mark(200 400)
307 # ---------------------------------------------------------------
308 # base definition (housing) for connector DIN 41.651 laying and standing
309 # 05/96 Volker Bosch (bosch@iema.e-technik.uni-stuttgart.de)
311 # Changed hole size from 20 mils to 28 mils; 07/00 LRDoolittle@lbl.gov
313 # $1: canonical name
314 # $2: name on PCB
315 # $3: value
316 # $4: number of pins
318 define(`PKG_DIN41_651LAY',
319         `define(`MAXY', `eval($4/2 *100 +400)')
320         define(`CENTERY', `eval($4/2 *50 +425)')
321 Element(0x00 "$1" "`$2'" "$3" 400 250 3 200 0x00)
323         forloop(`i', 1, eval($4 / 2),
324                 `PIN(100,  eval(100*i +400), 60, 40, eval(2*i-1))
325                 PIN(200, eval(100*i +400), 60, 40, eval(2*i))
326         ')
328         # Befestigungsbohrung
329         Pin(180  270 100 80 "M1" 0x01)
330         Pin(180 eval(MAXY+230) 100 80 "M2" 0x01)
332         # aeusserer Rahmen
333         ElementLine(80 70 335 70 20)
334         ElementLine(335 70 770 200 20)
335         ElementLine(770 200 770 300 20)
336         ElementLine(770 300 610 390 20)
337         ElementLine(610 390 610 eval(MAXY+150) 20)
338         ElementLine(610 eval(MAXY+150) 770 eval(MAXY+200) 20)
339         ElementLine(770 eval(MAXY+200) 770 eval(MAXY+300) 20)
340         ElementLine(770 eval(MAXY+300) 335 eval(MAXY+430) 20)
341         ElementLine(335 eval(MAXY+430) 80 eval(MAXY+430) 20)
342         ElementLine( 80 eval(MAXY+430) 80 70 20)
344         # Codieraussparung
345         ElementLine(610 eval(CENTERY -50) 435 eval(CENTERY -50) 5)
346         ElementLine(435 eval(CENTERY -50) 435 eval(CENTERY +100) 5)
347         ElementLine(435 eval(CENTERY +100) 610 eval(CENTERY +100) 5)
349         # Markierung Pin 1
350         ElementLine(610 450 500 500 5)
351         ElementLine(500 500 610 550 5)
353         # Plazierungsmarkierung == Pin 1
354         Mark(100 500)
357 define(`PKG_DIN41_651STAND',
358         `define(`MAXY', `eval($4/2 *100 +400)')
359         define(`CENTERY', `eval($4/2 *50 +425)')
360 Element(0x00 "$1" "`$2'" "$3" 50 100 3 200 0x00)
362         forloop(`i', 1, eval($4 / 2),
363                 `PIN(200,  eval(100*i +400), 60, 40, eval(2*i-1))
364                 PIN(300, eval(100*i +400), 60, 40, eval(2*i))
365         ')
366         # aeusserer Rahmen
367         ElementLine(90 70 410 70 20)
368         ElementLine(410 70 410 eval(MAXY +430) 20)
369         ElementLine(410 eval(MAXY +430) 90 eval(MAXY +430) 20)
370         ElementLine(90 eval(MAXY +430) 90 70 20)
372         # innerer Rahmen mit Codieraussparung
373         ElementLine(110  350 390  350 5)
374         ElementLine(390  350 390 eval(MAXY +150) 5)
375         ElementLine(390 eval(MAXY +150) 110 eval(MAXY +150) 5)
376         ElementLine(110 eval(MAXY +150) 110 eval(CENTERY +100) 5)
377         ElementLine(110 eval(CENTERY +100)  90 eval(CENTERY +100) 5)
378         ElementLine(90  eval(CENTERY -50) 110 eval(CENTERY -50) 5)
379         ElementLine(110 eval(CENTERY -50) 110  350 5)
381         # Markierung Pin 1
382         ElementLine(110 390 150 350 5)
384         # Auswurfhebel oben
385         ElementLine(200 70 200 350 5)
386         ElementLine(300 70 300 350 5)
388         # Auswurfhebel unten
389         ElementLine(200 eval(MAXY+150) 200 eval(MAXY+430) 5)
390         ElementLine(300 eval(MAXY+150) 300 eval(MAXY+430) 5)
392         # Plazierungsmarkierung == Pin 1
393         Mark(200 500)
396 # ---------------------------------------------------------------
397 # base definition (housing) for SUB-D connectors, laying
398 # 11/95 Volker Bosch (bosch@iema.e-technik.uni-stuttgart.de)
399 # female package added 05/96 also by Volker Bosch
400 # Pins reordered, 12/99 Larry Doolittle  <LRDoolittle@lbl.gov>
402 # Connector dimensions changed!  No, these stupid things don't
403 # line up neatly on a 50 mil grid.  Now corresponds to AMP's
404 # Application Specification 114-40013 03-APR-97 Rev B, for
405 # AMPLIMITE[TM] HD-20 Series 454 and 545.
406 # Also pulled silkscreen lines away from pins by NOSMUDGE.
407 # 12/99 Larry Doolittle  <LRDoolittle@lbl.gov>
409 # Parameterized silkscreen in terms of PANEL_DISTANCE, the distance
410 # from the drilling holes to the intended edge of the board.
411 # According to the drawing listed above, that should be 398 or 489
412 # plus some unknown flange thickness.  For the part I have in my hand
413 # (AMP 747846-4), it's about 365 mils.  The original version of this
414 # macro had it hard coded at 460.  I also reduced size of pads and holes
415 # to 60/35.  The drawing listed above recommends 47 mil holes, the part
416 # in my hand has 28 mil pins.
418 # Status: Female tested, works great, 07-Jan-2000.
420 # $1: canonical name
421 # $2: name on PCB
422 # $3: value
423 # $4: pins
425 # base is upper drilling hole
427 define(`PKG_SUBD_LAY_BASE',
428         `define(`BASEX', 1000)
429         define(`BASEY', 1000)
430         define(`PY1', `eval(BASEY +270)')
431         define(`PY2', `eval(PY1 +($4-1)/2*108)')
432         define(`OFFSET', `eval(($4+1)/2)')
433         define(`PANEL_DISTANCE', 365)
434 Element(0x00 "$1" "`$2'" "$3" eval(BASEX-0) eval(PY2-0) 1 150 0x00)
436         # Gehaeuse (schmaler Kasten incl. Bohrungen)
437         define(`X1', `eval(BASEX-PANEL_DISTANCE)')
438         define(`Y1', `eval(PY1-390)')
439         define(`X2', `eval(BASEX-PANEL_DISTANCE+30)')
440         define(`Y2', `eval(PY2+390)')
441         ElementLine(X1 Y1 X2 Y1 10)
442         ElementLine(X2 Y1 X2 Y2 10)
443         ElementLine(X2 Y2 X1 Y2 10)
444         ElementLine(X1 Y2 X1 Y1 10)
445         ElementLine(X1 eval(Y1+60) X2 eval(Y1+60) 10)
446         ElementLine(X1 eval(Y1+180) X2 eval(Y1+180) 10)
447         ElementLine(X1 eval(Y2-60) X2 eval(Y2-60) 10)
448         ElementLine(X1 eval(Y2-180) X2 eval(Y2-180) 10)
450         # Gehaeuse (aeusserer Kasten)
451         # This part of the connector normally hangs off the circuit board,
452         # so it is confusing to actually mark it on the silkscreen
453         # define(`X1', `eval(BASEX-PANEL_DISTANCE-260)')
454         # define(`Y1', `eval(PY1-100)')
455         # define(`X2', `eval(BASEX-PANEL_DISTANCE)')
456         # define(`Y2', `eval(PY2+100)')
457         # ElementLine(X1 Y1 X2 Y1 20)
458         # ElementLine(X2 Y1 X2 Y2 10)
459         # ElementLine(X2 Y2 X1 Y2 20)
460         # ElementLine(X1 Y2 X1 Y1 20)
462         # Gehaeuse (innerer Kasten)
463         define(`X1', `eval(BASEX-PANEL_DISTANCE+30)')
464         define(`Y1', `eval(PY1-160)')
465         define(`X2', `eval(BASEX-230)')
466         define(`Y2', `eval(PY2+160)')
467         ElementLine(X1 Y1 X2 Y1 20)
468         ElementLine(X2 Y1 X2 Y2 20)
469         ElementLine(X2 Y2 X1 Y2 20)
470         ElementLine(X1 Y2 X1 Y1 10)
472         # Pins
473         SUBD_SUBFUNCTION
475         # Befestigungsbohrung
476         Pin(BASEX  BASEY 250 125 "C1" 0x01)
477         Pin(BASEX eval(PY2+270) 250 125 "C2" 0x01)
481 define(`PKG_SUBD_MALE_LAY',
482         `define(`SUBD_SUBFUNCTION',
483                 `
484                 define(`NOSMUDGE', 40)
485                 # First row
486                 forloop(`i', 1, eval($4/2),
487                         `define(`Y', eval(PY1 +(i-1)*108))
488                         PIN(eval(BASEX+56), Y, 60, 35, i)
489                         ElementLine(eval(BASEX+56-NOSMUDGE) Y X2 Y 20)
490                 ')
492                 # Last pin in first row
493                 PIN(eval(BASEX+56), PY2, 60, 35, OFFSET)
494                 ElementLine(eval(BASEX+56-NOSMUDGE) PY2 X2 PY2 20)
496                 # Second row
497                 forloop(`i', 1, eval($4/2),
498                         `define(`Y', eval(PY1 +(i-1)*108+54))
499                         PIN(eval(BASEX-56), Y, 60, 35, eval(i+OFFSET))
500                         ElementLine(eval(BASEX-56-NOSMUDGE) Y X2 Y 20)
501                 ')
502                 # Plazierungsmarkierung == PIN 1
503                 Mark(eval(BASEX +50) PY1)
504         ')'
505         `PKG_SUBD_LAY_BASE(`$1', `$2', `$3', `$4')'
508 define(`PKG_SUBD_FEMALE_LAY',
509         `define(`SUBD_SUBFUNCTION',
510                 `
511                 define(`NOSMUDGE', 40)
512                 # Pin 1
513                 PIN(eval(BASEX+56), PY2, 60, 35, 1)
514                 ElementLine(eval(BASEX+56-NOSMUDGE) PY2 X2 PY2 20)
516                 # Plazierungsmarkierung == PIN 1
517                 # Changed PY1 to PY2 13-Dec-1999 LRD
518                 Mark(eval(BASEX +56) PY2)
520                 # Remainder of the first row
521                 forloop(`i', 1, eval($4/2),
522                         `define(`Y', eval(PY1 +($4/2-i)*108))
523                         PIN(eval(BASEX+56), Y, 60, 35, eval($4/2+i+2-OFFSET))
524                         ElementLine(eval(BASEX+56-NOSMUDGE) Y X2 Y 20)
525                 ')
527                 # Second row
528                 forloop(`i', 1, eval($4/2),
529                         `define(`Y', eval(PY1 +($4/2-i)*108+54))
530                         PIN(eval(BASEX-56), Y, 60, 35, eval($4/2+i+1))
531                         ElementLine(eval(BASEX-56-NOSMUDGE) Y X2 Y 20)
532                 ')
533         ')'
534         `PKG_SUBD_LAY_BASE(`$1', `$2', `$3', `$4')'
537 # ---------------------------------------------------------------
538 # definition for a right angle BNC connector,
539 # such as Amphenol 31-5640-1010 or OUPIIN 8928
540 # 12/99 Larry Doolittle <LRDoolittle@lbl.gov>
542 # $1: canonical name
543 # $2: name on PCB
544 # $3: value
545 # $4: pins
547 # base is one of the pegs
549 define(`PKG_BNC_LAY',
550         `define(`BASEX', 200)
551         define(`BASEY', -200)
552 Element(0x00 "$1" "`$2'" "$3" BASEX eval(BASEY+200) 3 100 0x00)
554         define(`X1', `eval(BASEX-260)')
555         define(`Y1', `eval(BASEY-90)')
556         define(`X2', `eval(BASEX+290)')
557         define(`Y2', `eval(BASEY+490)')
558         ElementLine(X1 Y1 X2 Y1 10)
559         ElementLine(X2 Y1 X2 Y2 10)
560         ElementLine(X2 Y2 X1 Y2 10)
561         ElementLine(X1 Y2 X1 Y1 10)
562         PIN(eval(BASEX-200), eval(BASEY+200), 60, 35, 1)
563         PIN(eval(BASEX-200), eval(BASEY+100), 60, 35, 2)
564         PIN(eval(BASEX),     eval(BASEY),     100, 81, m1)
565         PIN(eval(BASEX),     eval(BASEY+400), 100, 81, m2)
569 # ---------------------------------------------------------------
570 # definition for MTA-100 header,
571 # such as AMP 640456-x
573 # $1: canonical name
574 # $2: name on PCB
575 # $3: value
576 # $4: pins
578 #      0.100" pin pitch
579 #      0.038" drill diameter
580 #      0.060" pad diameter
581 #      Available with 2 through 15 pins
583 define(`PKG_MTA_100',
585         define(`PITCH', `100')
586         define(`NPINS', `eval($4)')
587         define(`SILKW', `10')
588         define(`SILKXOFS', `75')
589         define(`SILKYOFS', `115')
590         define(`SILKX1', `-SILKXOFS')
591         define(`SILKX2', `eval((NPINS-1)*PITCH + SILKXOFS)')
592         define(`SILKY1', `-SILKYOFS')
593         define(`SILKY2', `SILKYOFS')
594         define(`SILKY3', `eval(SILKYOFS+2*SILKW)')
596 Element(0x00 "$1" "`$2'" "$3" 0  140 0 150 0x00)
598         forloop(`i', 1, `$4',
599                 `PIN(eval((i-1)*100), 0, 60, 38, `i')
600         ')
601         define(`X1',-78)
602         define(`X2', `eval(`$4'*100-78)')
603         ElementLine(SILKX1  SILKY1 SILKX2 SILKY1 SILKW) 
604         ElementLine(SILKX2  SILKY1 SILKX2 SILKY3 SILKW) 
605         ElementLine(SILKX2  SILKY2 SILKX1 SILKY2 SILKW) 
606         ElementLine(SILKX1  SILKY3 SILKX1 SILKY1 SILKW) 
608         ElementLine(SILKX2  SILKY3 SILKX1 SILKY3 SILKW) 
610         Mark(0 0)
613 # ---------------------------------------------------------------
614 # definition for MTA-156 header,
615 # such as AMP 640445-x
616 # 12/99 Larry Doolittle <LRDoolittle@lbl.gov>
618 # $1: canonical name
619 # $2: name on PCB
620 # $3: value
621 # $4: pins
623 # base is pin 1 (although I don't claim to know which end is
624 #                conventionally pin 1)
625 #      0.156 pin pitch
626 #      0.070 holes
627 #      0.078 end clearance
628 #      0.180 and 0.120 side clearance
629 #      Available with 2 through 24 pins
631 define(`PKG_MTA_156',
632         `
633 Element(0x00 "$1" "`$2'" "$3" 0  140 0 150 0x00)
635         forloop(`i', 1, `$4',
636                 `PIN(eval((i-1)*156), 0, 100, 70, `i')
637         ')
638         define(`X1',-78)
639         define(`X2', `eval(`$4'*156-78)')
640         ElementLine(X1  120 X2  120 10) 
641         ElementLine(X2  120 X2 -180 10) 
642         ElementLine(X2 -180 X1 -180 10) 
643         ElementLine(X2  -80 X1  -80 10) 
644         ElementLine(X1 -180 X1  120 10)
647 # ---------------------------------------------------------------
648 # definition for a vertical SMA connector,
649 # 6/00 Larry Doolittle <LRDoolittle@lbl.gov>
651 # $1: canonical name
652 # $2: name on PCB
653 # $3: value
654 # $4: pins
656 # base is the center pin
658 define(`PKG_SMA_VERT',
659         `define(`BASEX', 0)
660         define(`BASEY', 0)
661 Element(0x00 "$1" "`$2'" "$3" BASEX eval(BASEY+150) 3 100 0x00)
663         define(`X1', `eval(BASEX-160)')
664         define(`Y1', `eval(BASEY-160)')
665         define(`X2', `eval(BASEX+160)')
666         define(`Y2', `eval(BASEY+160)')
667         ElementLine(X1 Y1 X2 Y1 10)
668         ElementLine(X2 Y1 X2 Y2 10)
669         ElementLine(X2 Y2 X1 Y2 10)
670         ElementLine(X1 Y2 X1 Y1 10)
671         PIN(     BASEX     ,      BASEY     , 80, 30, 1)
672         PIN(eval(BASEX-100), eval(BASEY+100), 80, 30, 2)
673         PIN(eval(BASEX-100), eval(BASEY-100), 80, 30, 3)
674         PIN(eval(BASEX+100), eval(BASEY+100), 80, 30, 4)
675         PIN(eval(BASEX+100), eval(BASEY-100), 80, 30, 5)
678 # ---------------------------------------------------------------
679 # definition for a Molex high density connector, 53467/53645
680 # Board-to-Board 0.635mm (0.25") Ptich Plug - SMT Dual Row, Vertical Stacking
681 # Reference: http://www.molex.com/product/micro/53467.html
682 # 4/01 Larry Doolittle <LRDoolittle@lbl.gov>
684 # $1: canonical name
685 # $2: name on PCB
686 # $3: value
687 # $4: pins
689 # base is on the symmetry line, between pins 1 and 2
691 define(`PKG_MOLEX_025',
692         `define(`PINPAIRS',`eval($4/2)')
693 Element(0x00 "$1" "`$2'" "$3" 0 0 3 100 0x00)
695         forloop(`i', 1, PINPAIRS,
696                 `define(`Y', eval(25*(i-1)) )'
697                 `PAD(  54, Y, 111, Y, 14, eval(i*2-1))'
698                 `PAD(-111, Y, -54, Y, 14, eval(i*2))'
699         )
700         define(`ENDY',eval(25*(PINPAIRS-1)))
702         # Keying is done with two sizes of alignment pins: 35 and 28 mils
703         Pin(0 -50 50 35 "M1" 0x01)
704         Pin(0 eval(ENDY+50) 43 28 "M2" 0x01)
706         # ends of mounting pads are 71 and 169 mils from end pad centers
707         PAD(0, -110, 0, -130, 79, M3)
708         PAD(0, eval(ENDY+110), 0, eval(ENDY+130), 79, M4)
710         define(`BOXY',eval(ENDY+150))
711         ElementLine(-100 -150   50 -150 10)
712         ElementLine(  50 -150  100 -100 10)
713         ElementLine( 100 -100  100 BOXY 10)
714         ElementLine( 100 BOXY -100 BOXY 10)
715         ElementLine(-100 BOXY -100 -150 10)
717         # Support for aggregate parts built from this base, like
718         # the nanoEngine below.
719         ifdef(`MOLEX_EXTRA', `MOLEX_EXTRA', )
722 # ---------------------------------------------------------------
723 # definition for a Bright Star nanoEngine, StrongARM single board computer
724 # Reference: http://www.brightstar.com/arm/nanoman.pdf
725 # 4/01 Larry Doolittle <LRDoolittle@lbl.gov>
727 # $1: canonical name
728 # $2: name on PCB
729 # $3: value
731 # base borrowed from the Molex connector
733 define(`PKG_NANOENGINE',
734         `define(`MOLEX_EXTRA', `
735                 ElementLine(-175 -215 -175 2185 15)
736                 ElementLine(-175 2185 1225 2185 15)
737                 ElementLine(1225 2185 1225 -215 15)
738                 ElementLine(1225 -215 -175 -215 15)
739                 Pin(525 -115 125 70 "M5" 0x01)
740                 Pin(525 2085 125 70 "M6" 0x01)
741         ')'
742         `PKG_MOLEX_025($1, $2, $3, 160)'
745 # -------------------------------------------------------------------
746 # the definition of a through hole test point
747 # $1: canonical name
748 # $2: name on PCB
749 # $3: value
750 # $4: drill diameter (mils)
751 # $5: silk diameter  (mils)
753 define(`PKG_TP',
754         `
755         define(`DRILL', `$4')
756         define(`SILK',  `eval($5/2)')
757         define(`PADDIA', `eval(DRILL + 20)')
758         define(`SILKW', `10')
759 Element(0x00 "$1" "`$2'" "$3" -20 eval(-SILK - 60) 0 100 0x00)
761         Pin( 0 0 PADDIA DRILL "1" "1" 0x0)
762         ElementArc(0 0 SILK SILK 0 360 SILKW)
763         
764         # Mark at the common centroid
765         Mark(0 0)