Update "missing" (automake) script to a later version
[geda-pcb/pcjc2.git] / lib / qfp2.inc
blob130f237522f29d303b37fe0fc66f18001bc28aac
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 #  QFP packages
29 # -------------------------------------------------------------------
30 # ThanX to Johan Andersson (johan@homemail.com), modified by Thomas Nau
31 # the definition of a plcc package for base code to make qfp package.
32 # modified for correct pad numbering by Holm Tiffe
34 # Code from plcc.inc modified by Thomas Olson to make this qfp.inc definition.
35 # Although in retrospec quad flat packs are more diverse than this algorithm will do.
36 # Many qfp are the same physical size but have more thus narrower pads. 
37 # $1: canonical name
38 # $2: name on PCB
39 # $3: value
40 # $4: number of pins
41 # $5: additional border (will be ignored)
43 define(`PKG_QFP2',
44         `define(`QUARTER', `eval($4 /4)')
45         define(`OFFSET', `eval((QUARTER +1) /2)')
46         define(`WIDTH', `eval((QUARTER-1) *25 +2*50)')
47         define(`CENTER', `eval(WIDTH / 2)')
48         define(`NUMPINS', `$4')
49 Element(0x00 "$1" "`$2'" "$3" 100 CENTER 0 100 0x00)
52         # left row
53 define(`X', 0)
54 define(`Y', 50)
55 #define(`count', `eval(OFFSET+1)')
56 define(`count', 1)
57 forloop(`i', 1, QUARTER,
58         `PAD(eval(X-65), Y, eval(X+5), Y, 15, count)' `define(`count', incr(count))'
59         `define(`Y', eval(Y+25))'
60         )
62         # bottom row
63 define(`X', 50)
64 define(`Y', WIDTH)
65 forloop(`i', 1, QUARTER,
66         `PAD(X, eval(Y+65), X, eval(Y-5), 15, count)' `define(`count', incr(count))'
67         `define(`X', eval(X+25))'
70         # right row
71 define(`X', WIDTH)
72 define(`Y', eval(WIDTH-50))
73 forloop(`i', 1, QUARTER,
74         `PAD(eval(X+65), Y, eval(X-5), Y, 15, count)' `define(`count', incr(count))'
75         `define(`Y', eval(Y-25))'
78         # top row
79 define(`X', eval(WIDTH-50))
80 define(`Y', 0)
81 forloop(`i', 1, QUARTER,
82         `PAD(X, eval(Y-65), X, eval(Y+5), 15, count)' `define(`count', incr(count))'
83         `ifelse(eval(count > NUMPINS), 1, `define(`count', 1)')'
84         `define(`X', eval(X-25))'
87         ElementLine(28 0 WIDTH 0 10)
88         ElementLine(WIDTH 0 WIDTH WIDTH 10)
89         ElementLine(WIDTH WIDTH 0 WIDTH 10)
90         ElementLine(0 WIDTH 0 28 10)
91         ElementLine(0 28 28 0 10)
93         ElementArc(80 80 20 20 0 360 10)
95         Mark(0 0)
96 )')
98 # -------------------------------------------------------------------