Update "missing" (automake) script to a later version
[geda-pcb/pcjc2.git] / lib / dil.inc
blob6a75e0a1f3cb431769e5171ab4ce38eb27cc1633
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
26 # DIL packages
28 # -------------------------------------------------------------------
29 # the definition of a dual-inline package N and similar types
30 # $1: canonical name
31 # $2: name on PCB
32 # $3: value
33 # $4: number of pins
34 # $5: package size (300, 600, 900 + 100 for socket space)
35 # $6: pin spacing
36 # $7: pad size
37 # $8: drill size
39 define(`PKG_DIL',
40         `
41 # retain backwards compatibility to older versions of PKG_DIL 
42 # which did not have $6,$7,$8 args
44         ifelse("`$6'","",
45                 `define(`PINSPACE', `100')'
46         ,
47                 `define(`PINSPACE', eval(`$6'))'
48         )      
49         ifelse("`$7'","",
50                 `define(`PADSIZE', `60')'
51         ,
52                 `define(`PADSIZE', `$7')'
53         )      
54         ifelse("`$8'","",
55                 `define(`DRILLSIZE', `28')'
56         ,
57                 `define(`DRILLSIZE', `$8')'
58         )      
59         define(`MAXY', `eval(`$4' / 2 * PINSPACE)')
60         define(`MAXX', `eval(`$5' + 100)')
61         define(`CENTERX', `eval(MAXX / 2)')
62         define(`MARKY', `eval(PINSPACE / 2)')
63 Element(0x00 "$1" "`$2'" "$3" eval(CENTERX + 20) 100 3 100 0x00)
65         forloop(`i', 1, eval($4 / 2),
66                 `PIN(50, eval((2*i-1) * PINSPACE/2), 
67                         eval(PADSIZE), eval(DRILLSIZE), i)
68         ')
69         forloop(`i', 1, eval($4 / 2),
70                 `PIN(eval(MAXX -50), eval(MAXY - (2*i-1) * PINSPACE/2), 
71                         eval(PADSIZE), eval(DRILLSIZE), eval(i + $4/2))
72         ')
73         ElementLine(0 0 0 MAXY 10)
74         ElementLine(0 MAXY MAXX MAXY 10)
75         ElementLine(MAXX MAXY MAXX 0 10)
76         ElementLine(0 0 eval(CENTERX - 50) 0 10)
77         ElementLine(eval(CENTERX + 50) 0 MAXX 0 10)
78         ElementArc(CENTERX 0 50 50 0 180 10)
79         Mark(50 MARKY)
80 )')
81 define(`PKG_J',  `PKG_DIL(`$1', `$2', `$3', `$4', `$5', 100, 60, 28)')
82 define(`PKG_JD', `PKG_DIL(`$1', `$2', `$3', `$4', `$5', 100, 60, 28)')
83 define(`PKG_JG', `PKG_DIL(`$1', `$2', `$3', `$4', `$5', 100, 60, 28)')
84 define(`PKG_N',  `PKG_DIL(`$1', `$2', `$3', `$4', `$5', 100, 60, 28)')
85 define(`PKG_NT', `PKG_DIL(`$1', `$2', `$3', `$4', `$5', 100, 60, 28)')
86 define(`PKG_P',  `PKG_DIL(`$1', `$2', `$3', `$4', `$5', 100, 60, 28)')
87 #shrink DIP
88 define(`PKG_NS', `PKG_DIL(`$1', `$2', `$3', `$4', `$5',  70, 55, 28)')
90 # -------------------------------------------------------------------
91 # the definition of a dual-inline package D and DW
92 # never used by circuits, just a short-cut for others
93 # width D==244, DW==419
94 # $1: canonical name
95 # $2: name on PCB
96 # $3: value
97 # $4: number of pins
98 # $5: width
100 define(`COMMON_D_DW',
101         `define(`MAXY', `eval(`$4' / 2 * 50)')
102         define(`MAXX', `$5')
103         define(`XLOW', `50')
104         define(`XHIGH', `eval(MAXX - 50)')
105         define(`CENTERX', `eval(MAXX / 2)')
106 Element(0x00 "$1" "`$2'" "$3" eval(CENTERX + 20) 50 3 100 0x00)
108         forloop(`i', 1, eval($4 / 2),
109                 `PAD(0, eval(i * 50 -25), XLOW, eval(i * 50 -25), 20, i)
110         ')
111         forloop(`i', 1, eval($4 / 2),
112                 `PAD(XHIGH, eval(MAXY - i * 50 +25), MAXX, eval(MAXY - i * 50 +25), 20, eval(i + $4/2))
113         ')
114         ElementLine(XLOW 0 XLOW MAXY 10)
115         ElementLine(XLOW MAXY XHIGH MAXY 10)
116         ElementLine(XHIGH MAXY XHIGH 0 10)
117         ElementLine(XLOW 0 eval(CENTERX - 25) 0 10)
118         ElementLine(eval(CENTERX + 25) 0 XHIGH 0 10)
119         ElementArc(CENTERX 0 25 25 0 180 10)
120         Mark(25 25)
123 define(`PKG_D', `COMMON_D_DW(`$1', `$2', `$3', `$4', 244)')
124 define(`PKG_DW', `COMMON_D_DW(`$1', `$2', `$3', `$4', 419)')