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