This file is indexed.

/usr/share/pcb/m4/geda.inc is in pcb-common 1:4.0.2-4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
# -*- m4 -*-
#
#   gEDA compatible footprint names
#
#   the real component definitions are in the *.inc files
#
#   Initial version from Egil Kvaleberg <egil@kvaleberg.no>,
#   Oct 10 2002
#

# $1: canonical name
# $2: name on PCB
# $3: value

define(`PKG_TO263BASE',
       `
	# pad 1,2,3 width (1/100 mil)
	define(`PADW1',  `4200')

	# pad 1,2,3 length (1/100 mil)
	define(`PADL1',  `8500')

	# x value for pads 1,3 (1/100 mil)
	define(`PADX1', `10000')

	# y value for pads 1,2,3 (1/100 mil)
	define(`PADY1', `21025')


	# tab pad width (1/100 mil)
	# ideally we would be able to have a polygon
	# pad because the recommendation is a T shape where
	# the width is 328 mil on the thinner part and 425 mil on the
	# thicker part
	define(`PADW2',  `32800')
	define(`PADW2A', `42500')

	# tab pad length (1/100 mil)
	#define(`PADL2',  `27500')
	define(`PADL2',  `21000')
	define(`PADL2A', `7500')

	# x value for the tab pad (1/100 mil)
	define(`PADX2', `0')

	# y value for the tab pad (1/100 mil)
	#define(`PADY2', `-21025')
	define(`PADY2',  `-10900')
	define(`PADY2A', `-24150')

	# package width (1/100 mil)
	define(`PACKW', `40000')

	# package height (1/100 mil)
	define(`PACKH', `565')

	# y values for drawing the pad.  Recall we draw the pad with an aperture
	# we need a line segment of length PADL1 - PADW1 so we have end points:
	# PADY1 +/- 0.5*(PADL1 - PADW1)
	define(`PY1', `eval(PADY1 + (PADL1 - PADW1)/2)')
	define(`PY2', `eval(PADY1 - (PADL1 - PADW1)/2)')

	define(`TX1',  `eval(    (PADW2  - PADL2 )/2)')
	define(`TX2',  `eval( -1*(PADW2  - PADL2 )/2)')
	define(`TX1A', `eval(    (PADW2A - PADL2A)/2)')
	define(`TX2A', `eval( -1*(PADW2A - PADL2A)/2)')

	# width of soldermask relief (5 mil on each side)
	define(`MASKW1',  `eval(PADW1  + 1000)')
	define(`MASKW2',  `eval(PADL2  + 1000)')
	define(`MASKW2A', `eval(PADL2A + 1000)')

	# silkscreen width (1/100 mils)
	define(`SILKW', `1000')

	# clearance to polygons (1/100 mils)
	define(`PCLEAR', `2000')

	# how much space to leave around the part before the
	# silk screen (1/100 mils)
	define(`SILKS', `800')

	# X values for silk on sides and top
	define(`SX1', `eval(    (PADW2A + 2*SILKS + SILKW)/2)')
	define(`SX2', `eval( -1*(PADW2A + 2*SILKS + SILKW)/2)')

	# X values for silk on sides and bottom
	define(`SX1B', `eval(    (PADX1 + PADW1 + SILKS + SILKW/2))')

	define(`SY1', `eval(    (PADY1  + PADL1/2  + SILKS + SILKW/2))')
	define(`SYM', `eval(    (PADY1  - PADL1/2  - SILKS - SILKW/2))')
	define(`SY2', `eval(    (PADY2A - PADL2A/2 - SILKS - SILKW/2))')

# Element [SFlags "Desc" "Name" "Value" MX MY TX TY TDir TScale TSFlags]
Element[ "" "$1" "`$2'" "$3" 0 0 0 0 0 100 ""]
(

# Pad [rX1 rY1 rX2 rY2 Thickness Clearance Mask "Name" "Number" SFlags]

# the signal pads
Pad[ -PADX1 PY1 -PADX1 PY2 PADW1 PCLEAR MASKW1 "1"  "1" "square"]
Pad[      0 PY1      0 PY2 PADW1 PCLEAR MASKW1 "2"  "2" "square"]
Pad[  PADX1 PY1  PADX1 PY2 PADW1 PCLEAR MASKW1 "3"  "3" "square"]

# the tab pad
Pad[ TX1  PADY2  TX2  PADY2  PADL2  PCLEAR MASKW2  "4"  "4" "square"]
Pad[ TX1A PADY2A TX2A PADY2A PADL2A PCLEAR MASKW2A "4"  "4" "square"]


# ElementLine[ x1 y1 x2 y2 width]
# top and upper sides:
ElementLine[ SX1 SYM  SX1 SY2 SILKW ]
ElementLine[ SX1 SY2  SX2 SY2 SILKW ]
ElementLine[ SX2 SY2  SX2 SYM SILKW ]

# bottom and lower sides
ElementLine[ -SX1B SYM -SX1B SY1 SILKW ]
ElementLine[ -SX1B SY1  SX1B SY1 SILKW ]
ElementLine[  SX1B SY1  SX1B SYM SILKW ]

# and the two connecting lines
ElementLine[ SX2 SYM -SX1B SYM SILKW ]
ElementLine[ SX1 SYM  SX1B SYM SILKW ]

)')

# Generic Mounting Hole
#
# $1: canonical name
# $2: name on PCB
# $3: value
# $4: drill size [mm / 100]
# $5: pad size [mm / 100]
# $6: 1 = plated, 0 = not plated
# $7: 1 = silk surround, 0 = no silk surround
# $8: 1 = include pad, 0 = just a hole
# $9: 0 = no vias, 4,6,8 = number of vias
# $10: fab level:  "L", "N", "M" for least/nom/most material conditions
# $11: via drill size [mm / 100].  Defaults to 0.5mm
define(`PKG_MTHOLE_GENERIC',
       `
	# machine screw size
	define(`DRILLSIZE_MM',`eval($4)')
	define(`PADSIZE_MM',  `eval($5)')
	define(`PLATEFLAG',   `eval($6)')
	define(`SILKFLAG',    `eval($7)')
	define(`PADFLAG',     `eval($8)')
	define(`VIACNT',      `eval($9)')
	define(`FABLEVEL',    `$10')
	define(`VIADRILL_MM', ifelse( `$11'`missing', `missing', 50, $11))
dnl
dnl	silkscreen width (1/100 mils)
dnl
	define(`SILKW', `1000')
	define(`SILKW_MM', `eval( (SILKW*254)/10000)')
dnl
dnl     annular ring based on fab level -- it would be good if someone had a copy of IPC-2221B to
dnl     verify that both the top/bottom clearance to polygons and the silk (which marks placement
dnl     courtyard) are done correctly.
dnl
	define(`RING_MM',
		ifelse( 
			FABLEVEL, 1, 10,
			FABLEVEL, 2, 25,
			FABLEVEL, 3, 50,
			50
		)
	)
	define(`PADCLEAR_MM', `eval( 100 + 2*RING_MM)')
        define(`SILKR_MM',    `eval( (PADSIZE_MM + 2*RING_MM + SILKW_MM)/2)')
	define(`SILKR',       `eval( (SILKR_MM*10000)/254)')
	define(`HOLEFLAG', `ifelse( 0, PADFLAG,   `hole,thermal(0S)', 0, PLATEFLAG, `hole,thermal(0S)', `thermal(0S)' )')
	define(`PADSIZE',  `eval((PADSIZE_MM*10000)/254)')
	define(`PADCLEAR', `eval((PADCLEAR_MM*10000)/254)')
	define(`PADMASK',  `eval( PADSIZE + 1000)')
	define(`DRILLSIZE',`eval((DRILLSIZE_MM*10000)/254)')
	define(`VIADRILL', `eval((VIADRILL_MM*10000)/254)')
	define(`VIAPAD',   `eval((PADSIZE - DRILLSIZE)/2)')
dnl
dnl find coordinates for the supporting vias
dnl
	define(`VXY',  `eval((PADSIZE + DRILLSIZE)/4)')
dnl
dnl 70/99 = sqrt(0.5) with an error of about -0.005 % which is pretty good
dnl
	define(`VXY2', `eval((70*(PADSIZE + DRILLSIZE))/(99*4))')
dnl
dnl 30/60 degree needs a 0.5 and sqrt(3)/2
dnl 97/112 = sqrt(3)/2 with an error of about +0.005 %
dnl
	define(`VXY3', `eval((PADSIZE + DRILLSIZE)/8)')
	define(`VXY4', `eval((97*(PADSIZE + DRILLSIZE))/(112*4))')
dnl
dnl Element [SFlags "Desc" "Name" "Value" MX MY TX TY TDir TScale TSFlags]
dnl
Element[ "" "$1" "`$2'" "$3" 0 0 SILKR -SILKR 0 100 ""]
(
dnl
# Pin[x, y, thickness, clearance, mask, drilling hole, name,
#     number, flags.  By default, add a solid connection to the plane
Pin[ 0 0  PADSIZE  PADCLEAR PADMASK DRILLSIZE "1" "1" "HOLEFLAG"]

ifelse( 1, SILKFLAG,
	ElementArc[0 0 SILKR SILKR 0 360 SILKW]
)

ifelse( eval(VIACNT==4 || VIACNT == 8), 1,
dnl The on-axis vias:
Pin[  VXY    0 VIAPAD  0 0 VIADRILL "1" "1" ""]
Pin[ -VXY    0 VIAPAD  0 0 VIADRILL "1" "1" ""]
Pin[    0  VXY VIAPAD  0 0 VIADRILL "1" "1" ""]
Pin[    0 -VXY VIAPAD  0 0 VIADRILL "1" "1" ""]
)
ifelse( eval(VIACNT==8), 1,
dnl The 45 degree -axis vias:
Pin[  VXY2  VXY2 VIAPAD  0 0 VIADRILL "1" "1" ""]
Pin[ -VXY2  VXY2 VIAPAD  0 0 VIADRILL "1" "1" ""]
Pin[  VXY2 -VXY2 VIAPAD  0 0 VIADRILL "1" "1" ""]
Pin[ -VXY2 -VXY2 VIAPAD  0 0 VIADRILL "1" "1" ""]
)
ifelse(eval(VIACNT==6), 1,
Pin[     0   VXY  VIAPAD  0 0 VIADRILL "1" "1" ""]
Pin[     0  -VXY  VIAPAD  0 0 VIADRILL "1" "1" ""]
Pin[ -VXY4   VXY3 VIAPAD  0 0 VIADRILL "1" "1" ""]
Pin[  VXY4   VXY3 VIAPAD  0 0 VIADRILL "1" "1" ""]
Pin[ -VXY4  -VXY3 VIAPAD  0 0 VIADRILL "1" "1" ""]
Pin[  VXY4  -VXY3 VIAPAD  0 0 VIADRILL "1" "1" ""]
)
)')

# EXTRACT_BEGIN

#
##  Dual in-line package, narrow (300 mil)
#   DIP6 .. DIP64, DIP24N, DIP28N
#
define(`PKG_DIP4',   `PKG_N(`$1', `$2', `$3',   4,  300)');
define(`PKG_DIP6',   `PKG_N(`$1', `$2', `$3',   6,  300)');
define(`PKG_DIP8',   `PKG_N(`$1', `$2', `$3',   8,  300)');
define(`PKG_DIP14',  `PKG_N(`$1', `$2', `$3',  14,  300)');
define(`PKG_DIP16',  `PKG_N(`$1', `$2', `$3',  16,  300)');
define(`PKG_DIP18',  `PKG_N(`$1', `$2', `$3',  18,  300)');
define(`PKG_DIP20',  `PKG_N(`$1', `$2', `$3',  20,  300)');
define(`PKG_DIP22',  `PKG_N(`$1', `$2', `$3',  22,  300)');
define(`PKG_DIP24N', `PKG_N(`$1', `$2', `$3',  24,  300)');
define(`PKG_DIP28N', `PKG_N(`$1', `$2', `$3',  28,  300)');
##  Dual in-line package, medium wide (400 mil)
define(`PKG_DIP8M',  `PKG_N(`$1', `$2', `$3',   8,  400)');
define(`PKG_DIP14M', `PKG_N(`$1', `$2', `$3',  14,  400)');
define(`PKG_DIP16M', `PKG_N(`$1', `$2', `$3',  16,  400)');
define(`PKG_DIP18M', `PKG_N(`$1', `$2', `$3',  18,  400)');
define(`PKG_DIP20M', `PKG_N(`$1', `$2', `$3',  20,  400)');
define(`PKG_DIP22M', `PKG_N(`$1', `$2', `$3',  22,  400)');
define(`PKG_DIP24M', `PKG_N(`$1', `$2', `$3',  24,  400)');
define(`PKG_DIP28M', `PKG_N(`$1', `$2', `$3',  28,  400)');
##  Dual in-line package, wide (600 mil)
define(`PKG_DIP24',  `PKG_N(`$1', `$2', `$3',  24,  600)');
define(`PKG_DIP28',  `PKG_N(`$1', `$2', `$3',  28,  600)');
define(`PKG_DIP32',  `PKG_N(`$1', `$2', `$3',  32,  600)');
define(`PKG_DIP36',  `PKG_N(`$1', `$2', `$3',  36,  600)');
define(`PKG_DIP40',  `PKG_N(`$1', `$2', `$3',  40,  600)');
define(`PKG_DIP42',  `PKG_N(`$1', `$2', `$3',  42,  600)');
define(`PKG_DIP44',  `PKG_N(`$1', `$2', `$3',  44,  600)');
define(`PKG_DIP48',  `PKG_N(`$1', `$2', `$3',  48,  600)');
##  Dual in-line package, wide (900 mil)
define(`PKG_DIP64',  `PKG_N(`$1', `$2', `$3',  64,  900)');

#
##  Shrink dual in-line package, wide (300 mil)
#
define(`PKG_SDIP18',  `PKG_NS(`$1', `$2', `$3', 18,  300)');
define(`PKG_SDIP20',  `PKG_NS(`$1', `$2', `$3', 20,  300)');
define(`PKG_SDIP22',  `PKG_NS(`$1', `$2', `$3', 22,  300)');
define(`PKG_SDIP24',  `PKG_NS(`$1', `$2', `$3', 24,  300)');
#
##  Shrink dual in-line package, wide (400 mil)
define(`PKG_SDIP30',  `PKG_NS(`$1', `$2', `$3', 30,  400)');
define(`PKG_SDIP32',  `PKG_NS(`$1', `$2', `$3', 32,  400)');
#
##  Shrink dual in-line package, wide (600 mil)
define(`PKG_SDIP42',  `PKG_NS(`$1', `$2', `$3', 42,  600)');

#
##  Single in line package
#   SIP1 .. SIP13
#
define(`PKG_SIP1',  `PKG_CSIL(`$1', `$2', `$3', 1)');
define(`PKG_SIP2',  `PKG_CSIL(`$1', `$2', `$3', 2)');
define(`PKG_SIP3',  `PKG_CSIL(`$1', `$2', `$3', 3)');
define(`PKG_SIP4',  `PKG_CSIL(`$1', `$2', `$3', 4)');
define(`PKG_SIP5',  `PKG_CSIL(`$1', `$2', `$3', 5)');
define(`PKG_SIP6',  `PKG_CSIL(`$1', `$2', `$3', 6)');
define(`PKG_SIP7',  `PKG_CSIL(`$1', `$2', `$3', 7)');
define(`PKG_SIP8',  `PKG_CSIL(`$1', `$2', `$3', 8)');
define(`PKG_SIP9',  `PKG_CSIL(`$1', `$2', `$3', 9)');
define(`PKG_SIP10', `PKG_CSIL(`$1', `$2', `$3', 10)');
define(`PKG_SIP11', `PKG_CSIL(`$1', `$2', `$3', 11)');
define(`PKG_SIP12', `PKG_CSIL(`$1', `$2', `$3', 12)');
define(`PKG_SIP13', `PKG_CSIL(`$1', `$2', `$3', 13)');

#
##  Ultra (Micro?) Small outline package
#
# pins, width (1/100mil), pitch (1/100 mil)
define(`PKG_US8',     `PKG_US( `$1', `$2', `$3',  8)');
define(`PKG_US14',    `PKG_US( `$1', `$2', `$3', 14)');
define(`PKG_US16',    `PKG_US( `$1', `$2', `$3', 16)');

#
##  Small outline package, narrow (150mil)
#   aka SOP8, aka S8
#
# COMMON_SMT_DIL_{MIL,MM}
# $4: number of pins
# $5: pad width  (1/1000 mil or 1/100 mm)
# $6: pad length (1/1000 mil or 1/100 mm)
# $7: pad pitch (1/1000 mil 1/100 mm)
# $8: pad seperation for pads on opposite sides of
#     the package (1/1000 mil or 1/100 mm)
# $9: define to make the pins get numbered starting with the highest pin
#     instead of pin 1.  Needed for certain brain damaged packages like
#     the Mini-Circuits KK81

# dimensions from http://landpatterns.ipc.org/
define(`PKG_SO8',   `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',  8, 20000, 85000, 50000, 120000)');
define(`PKG_SO14',  `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 14, 20000, 85000, 50000, 120000)');
define(`PKG_SO16',  `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 16, 20000, 85000, 50000, 120000)');
define(`PKG_SO18N', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 18, 20000, 85000, 50000, 120000)');
define(`PKG_SO20N', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 20, 20000, 85000, 50000, 120000)');

##  Small outline package, medium (200mil)
#   aka 8S2
define(`PKG_SO8M',   `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',  8, 20000, 85000, 50000, 170000)');
define(`PKG_SO18M',  `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 18, 20000, 85000, 50000, 170000)');
define(`PKG_SO20M',  `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 20, 20000, 85000, 50000, 170000)');
define(`PKG_SO22M',  `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 22, 20000, 85000, 50000, 170000)');
define(`PKG_SO24M',  `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 24, 20000, 85000, 50000, 170000)');

##  Small outline package, wide (300mil)
# dimensions from http://landpatterns.ipc.org/
define(`PKG_SO8W',   `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',  8, 20000, 80000, 50000, 280000)');
define(`PKG_SO14W',  `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 14, 20000, 80000, 50000, 280000)');
define(`PKG_SO16W',  `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 16, 20000, 80000, 50000, 280000)');
define(`PKG_SO18W',  `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 18, 20000, 80000, 50000, 280000)');
define(`PKG_SO20W',  `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 20, 20000, 80000, 50000, 280000)');
define(`PKG_SO24W',  `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 24, 20000, 80000, 50000, 280000)');
define(`PKG_SO28',   `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 28, 20000, 80000, 50000, 280000)');
define(`PKG_SO32',   `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 32, 20000, 80000, 50000, 280000)');

##  Small outline package, wider (325mil)
define(`PKG_SO28W',  `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 28, 20000, 80000, 50000, 305000)');

##  Small outline package, wider (450mil)
define(`PKG_SO32W',  `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 32, 20000, 80000, 50000, 430000)');

##  Small outline package, wide (525mil)
define(`PKG_SO44',   `COMMON_SMT_DIL_MIL(`$1',`$2',`$3', 44, 20000, 80000, 50000, 505000)');



# NOTE: There is also SOJ20,28,32,40,42
# 0.300" size, 28,32 pin (MO-088, MO-077 respectively)
# 0.400" size, 28,32,36 pin (MO-061)
#
#
# from http://landpatterns.ipc.org/
# 14-28 pin 0.300"  - pitch = 1.27 mm, pad is 0.6 x 2.2, gap is 5
# 14-28 pin 0.350"  - pitch = 1.27 mm, pad is 0.6 x 2.2, gap is 6.2
# 14-28 pin 0.400"  - pitch = 1.27 mm, pad is 0.6 x 2.2, gap is 7.4
# 14-28 pin 0.450"  - pitch = 1.27 mm, pad is 0.6 x 2.2, gap is 8.8
#
# Cypress (www.cypress.com) has 20, 24, 28, 32 in the 0.3" and
# 28, 32, 36, 44 in the 0.4"

## Small outline J-leaded package (300 mil)
define(`PKG_SOJ14_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',14,23622,86614,50000,196850)');
define(`PKG_SOJ16_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',16,23622,86614,50000,196850)');
define(`PKG_SOJ18_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',18,23622,86614,50000,196850)');
define(`PKG_SOJ20_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',20,23622,86614,50000,196850)');
define(`PKG_SOJ22_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',22,23622,86614,50000,196850)');
define(`PKG_SOJ24_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',24,23622,86614,50000,196850)');
define(`PKG_SOJ26_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',26,23622,86614,50000,196850)');
define(`PKG_SOJ28_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',28,23622,86614,50000,196850)');
define(`PKG_SOJ30_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',30,23622,86614,50000,196850)');
define(`PKG_SOJ32_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',32,23622,86614,50000,196850)');
define(`PKG_SOJ34_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',34,23622,86614,50000,196850)');
define(`PKG_SOJ36_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',36,23622,86614,50000,196850)');
define(`PKG_SOJ38_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',38,23622,86614,50000,196850)');
define(`PKG_SOJ40_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',40,23622,86614,50000,196850)');
define(`PKG_SOJ42_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',42,23622,86614,50000,196850)');
define(`PKG_SOJ44_300', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',44,23622,86614,50000,196850)');

## Small outline J-leaded package (350 mil)
define(`PKG_SOJ14_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',14,23622,86614,50000,244094)');
define(`PKG_SOJ16_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',16,23622,86614,50000,244094)');
define(`PKG_SOJ18_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',18,23622,86614,50000,244094)');
define(`PKG_SOJ20_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',20,23622,86614,50000,244094)');
define(`PKG_SOJ22_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',22,23622,86614,50000,244094)');
define(`PKG_SOJ24_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',24,23622,86614,50000,244094)');
define(`PKG_SOJ26_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',26,23622,86614,50000,244094)');
define(`PKG_SOJ28_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',28,23622,86614,50000,244094)');
define(`PKG_SOJ30_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',30,23622,86614,50000,244094)');
define(`PKG_SOJ32_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',32,23622,86614,50000,244094)');
define(`PKG_SOJ34_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',34,23622,86614,50000,244094)');
define(`PKG_SOJ36_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',36,23622,86614,50000,244094)');
define(`PKG_SOJ38_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',38,23622,86614,50000,244094)');
define(`PKG_SOJ40_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',40,23622,86614,50000,244094)');
define(`PKG_SOJ42_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',42,23622,86614,50000,244094)');
define(`PKG_SOJ44_350', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',44,23622,86614,50000,244094)');

## Small outline J-leaded package (400 mil)
define(`PKG_SOJ14_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',14,23622,86614,50000,291339)');
define(`PKG_SOJ16_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',16,23622,86614,50000,291339)');
define(`PKG_SOJ18_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',18,23622,86614,50000,291339)');
define(`PKG_SOJ20_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',20,23622,86614,50000,291339)');
define(`PKG_SOJ22_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',22,23622,86614,50000,291339)');
define(`PKG_SOJ24_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',24,23622,86614,50000,291339)');
define(`PKG_SOJ26_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',26,23622,86614,50000,291339)');
define(`PKG_SOJ28_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',28,23622,86614,50000,291339)');
define(`PKG_SOJ30_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',30,23622,86614,50000,291339)');
define(`PKG_SOJ32_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',32,23622,86614,50000,291339)');
define(`PKG_SOJ34_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',34,23622,86614,50000,291339)');
define(`PKG_SOJ36_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',36,23622,86614,50000,291339)');
define(`PKG_SOJ38_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',38,23622,86614,50000,291339)');
define(`PKG_SOJ40_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',40,23622,86614,50000,291339)');
define(`PKG_SOJ42_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',42,23622,86614,50000,291339)');
define(`PKG_SOJ44_400', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',44,23622,86614,50000,291339)');

## Small outline J-leaded package (450 mil)
define(`PKG_SOJ14_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',14,23622,86614,50000,346457)');
define(`PKG_SOJ16_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',16,23622,86614,50000,346457)');
define(`PKG_SOJ18_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',18,23622,86614,50000,346457)');
define(`PKG_SOJ20_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',20,23622,86614,50000,346457)');
define(`PKG_SOJ22_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',22,23622,86614,50000,346457)');
define(`PKG_SOJ24_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',24,23622,86614,50000,346457)');
define(`PKG_SOJ26_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',26,23622,86614,50000,346457)');
define(`PKG_SOJ28_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',28,23622,86614,50000,346457)');
define(`PKG_SOJ30_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',30,23622,86614,50000,346457)');
define(`PKG_SOJ32_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',32,23622,86614,50000,346457)');
define(`PKG_SOJ34_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',34,23622,86614,50000,346457)');
define(`PKG_SOJ36_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',36,23622,86614,50000,346457)');
define(`PKG_SOJ38_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',38,23622,86614,50000,346457)');
define(`PKG_SOJ40_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',40,23622,86614,50000,346457)');
define(`PKG_SOJ42_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',42,23622,86614,50000,346457)');
define(`PKG_SOJ44_450', `COMMON_SMT_DIL_MIL(`$1',`$2',`$3',44,23622,86614,50000,346457)');


#
# NOTE:
# Shrink small outline SSOP is a full confusion of
#       pitch 25.00 mil, 0.65mm, 0.8mm
#       widths 244, 260, 311, 323 etc
# there are really too many variants, the ones listed here are
# fairly industry standard
#
##  Shrink small outline package, .65mm, narrow
define(`PKG_SSOP8',    `PKG_SSO(  `$1', `$2', `$3',  8, 323, 2559)');
define(`PKG_SSOP14',   `PKG_SSO(  `$1', `$2', `$3', 14, 323, 2559)');
define(`PKG_SSOP16',   `PKG_SSO(  `$1', `$2', `$3', 16, 244, 2559)');
define(`PKG_SSOP20',   `PKG_SSO(  `$1', `$2', `$3', 20, 260, 2559)');
define(`PKG_SSOP24',   `PKG_SSO(  `$1', `$2', `$3', 24, 323, 2559)');
define(`PKG_SSOP28',   `PKG_SSO(  `$1', `$2', `$3', 28, 323, 2559)');

#
##  Shrink small outline package, .65mm, wide
#define(`PKG_SSOP16W', `PKG_SSO(  `$1', `$2', `$3', 16, 420, 2559)');
#define(`PKG_SSOP20W', `PKG_SSO(  `$1', `$2', `$3', 20, 420, 2559)');
#define(`PKG_SSOP28W', `PKG_SSO(  `$1', `$2', `$3', 28, 420, 2559)');
#define(`PKG_SSOP30W', `PKG_SSO(  `$1', `$2', `$3', 30, 420, 2559)');
#define(`PKG_SSOP32W', `PKG_SSO(  `$1', `$2', `$3', 32, 420, 2559)');
#define(`PKG_SSOP36W', `PKG_SSO(  `$1', `$2', `$3', 36, 420, 2559)');

#
##  Shrink small outline package, 25mil, wide
define(`PKG_SSOP48W',  `PKG_SSO(  `$1', `$2', `$3', 48, 420, 2500)');
define(`PKG_SSOP56W',  `PKG_SSO(  `$1', `$2', `$3', 56, 420, 2500)');

#
##  Shrink small outline package, .80mm, wider
define(`PKG_SSOP64W',  `PKG_SSO(  `$1', `$2', `$3', 64, 545, 3150)');

##  Shrink small outline package, .65mm, narrow
# BUG:(`PKG_MSOP8',    `PKG_SSO(   `$1', `$2', `$3', 8, 323, 2559)');
#
##  Mini small outline package, .65mm
define(`PKG_MSOP8',    `PKG_SSO(   `$1', `$2', `$3', 8, 199, 2559)');
##  Mini small outline package, .5mm
define(`PKG_MSOP10',   `PKG_TSOP(  `$1', `$2', `$3', 10, 199, 1969)');

##  Quarter size small outline package
define(`PKG_QSOP16',   `PKG_SSO(   `$1', `$2', `$3', 16, 244, 2500)');
define(`PKG_QSOP20',   `PKG_SSO(   `$1', `$2', `$3', 20, 244, 2500)');
define(`PKG_QSOP24',   `PKG_SSO(   `$1', `$2', `$3', 24, 244, 2500)');
define(`PKG_QSOP28',   `PKG_SSO(   `$1', `$2', `$3', 28, 244, 2500)');

#
##  Thin small outline package
# BUG: TSOP in 26(x2),28(x2),32,44(x2),48,50(x2),54,66,70(x2),86
#
define(`PKG_TSOP28',   `PKG_TSOP(  `$1', `$2', `$3', 28, 535, 2165)');
define(`PKG_TSOP32A',  `PKG_TSOP(  `$1', `$2', `$3', 32, 795, 2000)');
define(`PKG_TSOP32B',  `PKG_TSOP(  `$1', `$2', `$3', 32, 559, 2000)');

##  Thin shrink small outline package, narrow (3mm)
#
define(`PKG_TSSOP8',  `COMMON_SMT_DIL_MM(`$1',`$2',`$3',  8, 33, 150, 65, 300)');
define(`PKG_TSSOP10', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 10, 30, 150, 50, 300)');

##  Thin shrink small outline package, standard (4.4mm)
#
define(`PKG_TSSOP8W',  `COMMON_SMT_DIL_MM(`$1',`$2',`$3',  8, 33, 150, 65, 440)');
define(`PKG_TSSOP14',  `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 14, 33, 150, 65, 440)');
define(`PKG_TSSOP16',  `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 16, 33, 150, 65, 440)');
define(`PKG_TSSOP20',  `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 20, 33, 150, 65, 440)');
define(`PKG_TSSOP24',  `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 24, 33, 150, 65, 440)');
define(`PKG_TSSOP28',  `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 28, 33, 150, 65, 440)');
define(`PKG_TSSOP38N', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 38, 30, 150, 50, 440)');
define(`PKG_TSSOP48N', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 48, 25, 150, 40, 440)');
define(`PKG_TSSOP56N', `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 56, 25, 150, 40, 440)');

##  Thin shrink small outline package, wide (6.1mm)
#
define(`PKG_TSSOP32',  `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 32, 33, 150, 65, 610)');
define(`PKG_TSSOP48',  `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 48, 30, 150, 50, 610)');
define(`PKG_TSSOP56',  `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 56, 30, 150, 50, 610)');
define(`PKG_TSSOP64',  `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 64, 30, 150, 50, 610)');
define(`PKG_TSSOP80',  `COMMON_SMT_DIL_MM(`$1',`$2',`$3', 80, 25, 150, 40, 610)');

#
##  Plastic leadless chip carrier
#   PLCC44 .. PLCC84
#
#   BUG: similar:
#   QFJ 18,20,22,28,32,44,68,84
#
define(`PKG_PLCC20',  `PKG_PLCC(`$1', `$2', `$3', 20, 150)');
define(`PKG_PLCC28',  `PKG_PLCC(`$1', `$2', `$3', 28, 150)');
define(`PKG_PLCC32',  `PKG_PLCC(`$1', `$2', `$3', 32, 150)');
define(`PKG_PLCC44',  `PKG_PLCC(`$1', `$2', `$3', 44, 150)');
define(`PKG_PLCC52',  `PKG_PLCC(`$1', `$2', `$3', 52, 150)');
define(`PKG_PLCC68',  `PKG_PLCC(`$1', `$2', `$3', 68, 150)');
define(`PKG_PLCC84',  `PKG_PLCC(`$1', `$2', `$3', 84, 150)');

#
##  Plastic leadless chip carrier with pin socket
#   PLCC44X .. PLCC84X
#
define(`PKG_PLCC20X',  `PKG_PLCC_SOCKET(`$1', `$2', `$3', 20, 150)');
define(`PKG_PLCC28X',  `PKG_PLCC_SOCKET(`$1', `$2', `$3', 28, 150)');
define(`PKG_PLCC32X',  `PKG_PLCC_SOCKET(`$1', `$2', `$3', 32, 150)');
define(`PKG_PLCC44X',  `PKG_PLCC_SOCKET(`$1', `$2', `$3', 44, 150)');
define(`PKG_PLCC52X',  `PKG_PLCC_SOCKET(`$1', `$2', `$3', 52, 150)');
define(`PKG_PLCC68X',  `PKG_PLCC_SOCKET(`$1', `$2', `$3', 68, 150)');
define(`PKG_PLCC84X',  `PKG_PLCC_SOCKET(`$1', `$2', `$3', 84, 150)');

##  Square Quad Flat Nolead (QFN) package
#

# 3x3 mm
define(`PKG_QFN16_3',     `PKG_QFN_50S(`$1',`$2',`$3', `16', `3', `0')')
define(`PKG_TQFN16_3',    `PKG_QFN_50S(`$1',`$2',`$3', `16', `3', `0')')
define(`PKG_QFN16_3_EP',  `PKG_QFN_50S(`$1',`$2',`$3', `16', `3', `150')')
define(`PKG_TQFN16_3_EP', `PKG_QFN_50S(`$1',`$2',`$3', `16', `3', `150')')

# 4x4 mm
define(`PKG_QFN12_4',     `PKG_QFN_80(`$1',`$2',`$3', `12', `4', `0')')
define(`PKG_TQFN12_4',    `PKG_QFN_80(`$1',`$2',`$3', `12', `4', `0')')
define(`PKG_QFN12_4_EP',  `PKG_QFN_80(`$1',`$2',`$3', `12', `4', `210')')
define(`PKG_TQFN12_4_EP', `PKG_QFN_80(`$1',`$2',`$3', `12', `4', `210')')

define(`PKG_QFN16_4',     `PKG_QFN_65(`$1',`$2',`$3', `16', `4', `0')')
define(`PKG_TQFN16_4',    `PKG_QFN_65(`$1',`$2',`$3', `16', `4', `0')')
define(`PKG_QFN16_4_EP',  `PKG_QFN_65(`$1',`$2',`$3', `16', `4', `210')')
define(`PKG_TQFN16_4_EP', `PKG_QFN_65(`$1',`$2',`$3', `16', `4', `210')')

define(`PKG_QFN20_4',     `PKG_QFN_50(`$1',`$2',`$3', `20', `4', `0')')
define(`PKG_TQFN20_4',    `PKG_QFN_50(`$1',`$2',`$3', `20', `4', `0')')
define(`PKG_QFN20_4_EP',  `PKG_QFN_50(`$1',`$2',`$3', `20', `4', `210')')
define(`PKG_TQFN20_4_EP', `PKG_QFN_50(`$1',`$2',`$3', `20', `4', `210')')

define(`PKG_QFN24_4',     `PKG_QFN_50S(`$1',`$2',`$3', `24', `4', `0')')
define(`PKG_TQFN24_4',    `PKG_QFN_50S(`$1',`$2',`$3', `24', `4', `0')')
define(`PKG_QFN24_4_EP',  `PKG_QFN_50S(`$1',`$2',`$3', `24', `4', `210')')
define(`PKG_TQFN24_4_EP', `PKG_QFN_50S(`$1',`$2',`$3', `24', `4', `260')')

# 5x5 mm
define(`PKG_QFN16_5',     `PKG_QFN_80(`$1',`$2',`$3', `16', `5', `0')')
define(`PKG_TQFN16_5',    `PKG_QFN_80(`$1',`$2',`$3', `16', `5', `0')')
define(`PKG_QFN16_5_EP',  `PKG_QFN_80(`$1',`$2',`$3', `16', `5', `310')')
define(`PKG_TQFN16_5_EP', `PKG_QFN_80(`$1',`$2',`$3', `16', `5', `310')')

define(`PKG_QFN20_5',     `PKG_QFN_65(`$1',`$2',`$3', `20', `5', `0')')
define(`PKG_TQFN20_5',    `PKG_QFN_65(`$1',`$2',`$3', `20', `5', `0')')
define(`PKG_QFN20_5_EP',  `PKG_QFN_65(`$1',`$2',`$3', `20', `5', `310')')
define(`PKG_TQFN20_5_EP', `PKG_QFN_65(`$1',`$2',`$3', `20', `5', `310')')

define(`PKG_QFN24_5',     `PKG_QFN_65(`$1',`$2',`$3', `24', `5', `0')')
define(`PKG_TQFN24_5',    `PKG_QFN_65(`$1',`$2',`$3', `24', `5', `0')')

define(`PKG_QFN28_5',     `PKG_QFN_50(`$1',`$2',`$3', `28', `5', `0')')
define(`PKG_TQFN28_5',    `PKG_QFN_50(`$1',`$2',`$3', `28', `5', `0')')
define(`PKG_QFN28_5_EP',  `PKG_QFN_50(`$1',`$2',`$3', `28', `5', `310')')
define(`PKG_TQFN28_5_EP', `PKG_QFN_50(`$1',`$2',`$3', `28', `5', `325')')

define(`PKG_QFN32_5',     `PKG_QFN_50S(`$1',`$2',`$3', `32', `5', `0')')
define(`PKG_TQFN32_5',    `PKG_QFN_50S(`$1',`$2',`$3', `32', `5', `0')')
define(`PKG_QFN32_5_EP',  `PKG_QFN_50S(`$1',`$2',`$3', `32', `5', `310')')
define(`PKG_TQFN32_5_EP', `PKG_QFN_50S(`$1',`$2',`$3', `32', `5', `310')')

# 6x6 mm
define(`PKG_QFN36_6',     `PKG_QFN_50(`$1',`$2',`$3', `36', `6', `0')')
define(`PKG_TQFN36_6',    `PKG_QFN_50(`$1',`$2',`$3', `36', `6', `0')')
define(`PKG_QFN36_6_EP',  `PKG_QFN_50(`$1',`$2',`$3', `36', `6', `370')')
define(`PKG_TQFN36_6_EP', `PKG_QFN_50(`$1',`$2',`$3', `36', `6', `370')')

define(`PKG_QFN40_6',     `PKG_QFN_50S(`$1',`$2',`$3', `40', `6', `0')')
define(`PKG_TQFN40_6',    `PKG_QFN_50S(`$1',`$2',`$3', `40', `6', `0')')
define(`PKG_QFN40_6_EP',  `PKG_QFN_50S(`$1',`$2',`$3', `40', `6', `410')')
define(`PKG_TQFN40_6_EP', `PKG_QFN_50S(`$1',`$2',`$3', `40', `6', `410')')

# 7x7 mm
define(`PKG_QFN32_7',     `PKG_QFN_65(`$1',`$2',`$3', `32', `7', `0')')
define(`PKG_TQFN32_7',    `PKG_QFN_65(`$1',`$2',`$3', `32', `7', `0')')
define(`PKG_QFN32_7_EP',  `PKG_QFN_65(`$1',`$2',`$3', `32', `7', `470')')
define(`PKG_TQFN32_7_EP', `PKG_QFN_65(`$1',`$2',`$3', `32', `7', `470')')

define(`PKG_QFN44_7',     `PKG_QFN_50(`$1',`$2',`$3', `44', `7', `0')')
define(`PKG_TQFN44_7',    `PKG_QFN_50(`$1',`$2',`$3', `44', `7', `0')')
define(`PKG_QFN44_7_EP',  `PKG_QFN_50(`$1',`$2',`$3', `44', `7', `470')')
define(`PKG_TQFN44_7_EP', `PKG_QFN_50(`$1',`$2',`$3', `44', `7', `470')')

define(`PKG_QFN48_7',     `PKG_QFN_50S(`$1',`$2',`$3', `48', `7', `0')')
define(`PKG_TQFN48_7',    `PKG_QFN_50S(`$1',`$2',`$3', `48', `7', `0')')
define(`PKG_QFN48_7_EP',  `PKG_QFN_50S(`$1',`$2',`$3', `48', `7', `560')')
define(`PKG_TQFN48_7_EP', `PKG_QFN_50S(`$1',`$2',`$3', `48', `7', `560')')

# 8x8 mm
define(`PKG_QFN56_8',     `PKG_QFN_50S(`$1',`$2',`$3', `56', `8', `0')')
define(`PKG_TQFN56_8',    `PKG_QFN_50S(`$1',`$2',`$3', `56', `8', `0')')
define(`PKG_QFN56_8_EP',  `PKG_QFN_50S(`$1',`$2',`$3', `56', `8', `665')')
define(`PKG_TQFN56_8_EP', `PKG_QFN_50S(`$1',`$2',`$3', `56', `8', `665')')

# 9x9 mm
define(`PKG_QFN64_9',     `PKG_QFN_50S(`$1',`$2',`$3', `64', `9', `0')')
define(`PKG_TQFN64_9',    `PKG_QFN_50S(`$1',`$2',`$3', `64', `9', `0')')
define(`PKG_QFN64_9_EP',  `PKG_QFN_50S(`$1',`$2',`$3', `64', `9', `715')')
define(`PKG_TQFN64_9_EP', `PKG_QFN_50S(`$1',`$2',`$3', `64', `9', `715')')

# 10x10 mm
define(`PKG_QFN68_10',     `PKG_QFN_50(`$1',`$2',`$3', `68', `10', `0')')
define(`PKG_TQFN68_10',    `PKG_QFN_50(`$1',`$2',`$3', `68', `10', `0')')
define(`PKG_QFN68_10_EP',  `PKG_QFN_50(`$1',`$2',`$3', `68', `10', `770')')
define(`PKG_TQFN68_10_EP', `PKG_QFN_50(`$1',`$2',`$3', `68', `10', `770')')

#
##  Square Quad-side flat pack
#   QFP 32,44,56,64,80,100,128,160,208,240,272,304
#   LQFP 144,176,208
#   TQFP 44,48,64,80,120

define(`PKG_LQFP24_4',   `PKG_LQFP_50(`$1',`$2',`$3', `24', `4',`0')');
define(`PKG_LQFP32_5',   `PKG_LQFP_50(`$1',`$2',`$3', `32', `5',`0')');
define(`PKG_LQFP32_7',   `PKG_LQFP_80(`$1',`$2',`$3', `32', `7',`0')');
define(`PKG_LQFP44_10',  `PKG_LQFP_80(`$1',`$2',`$3', `44',`10',`0')');
define(`PKG_LQFP48_7',   `PKG_LQFP_50(`$1',`$2',`$3', `48', `7',`0')');
define(`PKG_LQFP48_12',  `PKG_LQFP_80(`$1',`$2',`$3', `48',`12',`0')');
define(`PKG_LQFP52_10',  `PKG_LQFP_65(`$1',`$2',`$3', `52',`10',`0')');
define(`PKG_LQFP64_7',   `PKG_LQFP_40(`$1',`$2',`$3', `64', `7',`0')');
define(`PKG_LQFP64_10',  `PKG_LQFP_50(`$1',`$2',`$3', `64',`10',`0')');
define(`PKG_LQFP64_14',  `PKG_LQFP_80(`$1',`$2',`$3', `64',`14',`0')');
define(`PKG_LQFP72_10',  `PKG_LQFP_50(`$1',`$2',`$3', `72',`10',`0')');
define(`PKG_LQFP80_10',  `PKG_LQFP_40(`$1',`$2',`$3', `80',`10',`0')');
define(`PKG_LQFP80_12',  `PKG_LQFP_50(`$1',`$2',`$3', `80',`12',`0')');
define(`PKG_LQFP80_14',  `PKG_LQFP_65(`$1',`$2',`$3', `80',`14',`0')');
define(`PKG_LQFP100_10', `PKG_LQFP_40(`$1',`$2',`$3',`100',`10',`0')');
define(`PKG_LQFP100_14', `PKG_LQFP_50(`$1',`$2',`$3',`100',`14',`0')');
define(`PKG_LQFP112_20', `PKG_LQFP_65(`$1',`$2',`$3',`112',`20',`0')');
define(`PKG_LQFP120_16', `PKG_LQFP_50(`$1',`$2',`$3',`120',`16',`0')');
define(`PKG_LQFP128_14', `PKG_LQFP_40(`$1',`$2',`$3',`128',`14',`0')');
define(`PKG_LQFP128_14_EP', `PKG_LQFP_40(`$1',`$2',`$3',`128',`14',`970')');
define(`PKG_LQFP144_20', `PKG_LQFP_50(`$1',`$2',`$3',`144',`20',`0')');
define(`PKG_LQFP160_24', `PKG_LQFP_50(`$1',`$2',`$3',`160',`24',`0')');
define(`PKG_LQFP176_24', `PKG_LQFP_50(`$1',`$2',`$3',`176',`24',`0')');


define(`PKG_QFP32_7',   `PKG_QFP_80(`$1',`$2',`$3', `32', `7',`0')');
define(`PKG_QFP44_10',  `PKG_QFP_80(`$1',`$2',`$3', `44',`10',`0')');
define(`PKG_QFP52_10',  `PKG_QFP_65(`$1',`$2',`$3', `52',`10',`0')');
define(`PKG_QFP64_14',  `PKG_QFP_80(`$1',`$2',`$3', `64',`14',`0')');
define(`PKG_QFP80_14',  `PKG_QFP_65(`$1',`$2',`$3', `80',`14',`0')');
define(`PKG_QFP100_14', `PKG_QFP_50(`$1',`$2',`$3',`100',`14',`0')');
define(`PKG_QFP120_28', `PKG_QFP_80(`$1',`$2',`$3',`120',`28',`0')');
define(`PKG_QFP128_28', `PKG_QFP_80(`$1',`$2',`$3',`128',`28',`0')');
define(`PKG_QFP144_28', `PKG_QFP_65(`$1',`$2',`$3',`144',`28',`0')');
define(`PKG_QFP160_28', `PKG_QFP_65(`$1',`$2',`$3',`160',`28',`0')');
define(`PKG_QFP208_28', `PKG_QFP_50(`$1',`$2',`$3',`208',`28',`0')');
define(`PKG_QFP160_28', `PKG_QFP_65(`$1',`$2',`$3',`160',`28',`0')');
define(`PKG_QFP240_32', `PKG_QFP_50(`$1',`$2',`$3',`240',`32',`0')');
define(`PKG_QFP304_40', `PKG_QFP_50(`$1',`$2',`$3',`304',`40',`0')');

define(`PKG_TQFP32_7',   `PKG_QFP_80(`$1',`$2',`$3', `32', `7',`0')');
define(`PKG_TQFP44_10',  `PKG_QFP_80(`$1',`$2',`$3', `44',`10',`0')');
define(`PKG_TQFP52_10',  `PKG_QFP_65(`$1',`$2',`$3', `52',`10',`0')');
define(`PKG_TQFP64_10',  `PKG_QFP_50(`$1',`$2',`$3', `64',`10',`0')');
define(`PKG_TQFP64_14',  `PKG_QFP_80(`$1',`$2',`$3', `64',`14',`0')');
define(`PKG_TQFP80_12',  `PKG_QFP_50(`$1',`$2',`$3', `80',`12',`0')');
define(`PKG_TQFP80_14',  `PKG_QFP_65(`$1',`$2',`$3', `80',`14',`0')');
define(`PKG_TQFP100_12', `PKG_QFP_40(`$1',`$2',`$3',`100',`12',`0')');
define(`PKG_TQFP100_14', `PKG_QFP_50(`$1',`$2',`$3',`100',`14',`0')');
define(`PKG_TQFP120_28', `PKG_QFP_80(`$1',`$2',`$3',`120',`28',`0')');
define(`PKG_TQFP128_14', `PKG_LQFP_40(`$1',`$2',`$3',`128',`14',`0')');
define(`PKG_TQFP128_14_EP', `PKG_LQFP_40(`$1',`$2',`$3',`128',`14',`970')');
define(`PKG_TQFP128_28', `PKG_QFP_80(`$1',`$2',`$3',`128',`28',`0')');
define(`PKG_TQFP144_28', `PKG_QFP_65(`$1',`$2',`$3',`144',`28',`0')');
define(`PKG_TQFP160_28', `PKG_QFP_65(`$1',`$2',`$3',`160',`28',`0')');
define(`PKG_TQFP208_28', `PKG_QFP_50(`$1',`$2',`$3',`208',`28',`0')');
define(`PKG_TQFP160_28', `PKG_QFP_65(`$1',`$2',`$3',`160',`28',`0')');
define(`PKG_TQFP240_32', `PKG_QFP_50(`$1',`$2',`$3',`240',`32',`0')');
define(`PKG_TQFP304_40', `PKG_QFP_50(`$1',`$2',`$3',`304',`40',`0')');

#
##  Rectangular Quad-side flat pack

define(`PKG_QFP64_R',   `PKG_QFP_100(`$1',`$2',`$3', `64',`0',`0')');
define(`PKG_QFP80_R',   `PKG_QFP_80L(`$1',`$2',`$3', `80',`0',`0')');
define(`PKG_QFP100_R',  `PKG_QFP_65L(`$1',`$2',`$3',`100',`0',`0')');
define(`PKG_QFP128_R',  `PKG_QFP_50L(`$1',`$2',`$3',`128',`0',`0')');
define(`PKG_LQFP128_R', `PKG_LQFP_50(`$1',`$2',`$3',`128',`0',`0')');

##  Zig-zag in-line package
#   ZIP20 .. ZIP40
#
define(`PKG_ZIP9',   `PKG_SD(`$1', `$2', `$3',  9)');
define(`PKG_ZIP12',  `PKG_SD(`$1', `$2', `$3', 12)');
define(`PKG_ZIP16',  `PKG_SD(`$1', `$2', `$3', 16)');
define(`PKG_ZIP18',  `PKG_SD(`$1', `$2', `$3', 18)');
define(`PKG_ZIP20',  `PKG_SD(`$1', `$2', `$3', 20)');
define(`PKG_ZIP24',  `PKG_SD(`$1', `$2', `$3', 24)');
define(`PKG_ZIP28',  `PKG_SD(`$1', `$2', `$3', 28)');
define(`PKG_ZIP40',  `PKG_SD(`$1', `$2', `$3', 40)');

#
##  Axial non-polar component (typically resistor or capacitor),
#   100 through 1600 mil between pins
#   AXN100 .. AXN1600
#
define(`PKG_ACY100',  `PKG_AXIAL_LAY(`$1', `$2', `$3', 100)');
define(`PKG_ACY150',  `PKG_AXIAL_LAY(`$1', `$2', `$3', 150)');
define(`PKG_ACY200',  `PKG_AXIAL_LAY(`$1', `$2', `$3', 200)');
define(`PKG_ACY300',  `PKG_AXIAL_LAY(`$1', `$2', `$3', 300)');
define(`PKG_ACY400',  `PKG_AXIAL_LAY(`$1', `$2', `$3', 400)');
define(`PKG_ACY500',  `PKG_AXIAL_LAY(`$1', `$2', `$3', 500)');
define(`PKG_ACY600',  `PKG_AXIAL_LAY(`$1', `$2', `$3', 600)');
define(`PKG_ACY700',  `PKG_AXIAL_LAY(`$1', `$2', `$3', 700)');
define(`PKG_ACY800',  `PKG_AXIAL_LAY(`$1', `$2', `$3', 800)');
define(`PKG_ACY900',  `PKG_AXIAL_LAY(`$1', `$2', `$3', 900)');
define(`PKG_ACY1000', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1000)');
define(`PKG_ACY1100', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1100)');
define(`PKG_ACY1200', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1200)');
define(`PKG_ACY1300', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1300)');
define(`PKG_ACY1400', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1400)');
define(`PKG_ACY1500', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1500)');
define(`PKG_ACY1600', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1600)');


##  Axial polar component (typically capacitor),
#   100 through 1600 mil between pins
#
define(`PKG_ACY100P',  `PKG_AXIAL_LAY(`$1', `$2', `$3', 100, 1)')
define(`PKG_ACY150P',  `PKG_AXIAL_LAY(`$1', `$2', `$3', 150, 1)')
define(`PKG_ACY200P',  `PKG_AXIAL_LAY(`$1', `$2', `$3', 200, 1)')
define(`PKG_ACY300P',  `PKG_AXIAL_LAY(`$1', `$2', `$3', 300, 1)')
define(`PKG_ACY400P',  `PKG_AXIAL_LAY(`$1', `$2', `$3', 400, 1)')
define(`PKG_ACY500P',  `PKG_AXIAL_LAY(`$1', `$2', `$3', 500, 1)')
define(`PKG_ACY600P',  `PKG_AXIAL_LAY(`$1', `$2', `$3', 600, 1)')
define(`PKG_ACY700P',  `PKG_AXIAL_LAY(`$1', `$2', `$3', 700, 1)')
define(`PKG_ACY800P',  `PKG_AXIAL_LAY(`$1', `$2', `$3', 800, 1)')
define(`PKG_ACY900P',  `PKG_AXIAL_LAY(`$1', `$2', `$3', 900, 1)')
define(`PKG_ACY1000P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1000, 1)')
define(`PKG_ACY1100P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1100, 1)')
define(`PKG_ACY1200P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1200, 1)')
define(`PKG_ACY1300P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1300, 1)')
define(`PKG_ACY1400P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1400, 1)')
define(`PKG_ACY1500P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1500, 1)')
define(`PKG_ACY1600P', `PKG_AXIAL_LAY(`$1', `$2', `$3', 1600, 1)')

#
##  Axial diode (pin 1 is cathode)
#   ALF300 .. ALF1000
#
#
define(`PKG_ALF300', `PKG_DIODE_LAY(`$1', `$2', `$3',  300)');
define(`PKG_ALF400', `PKG_DIODE_LAY(`$1', `$2', `$3',  400)');
define(`PKG_ALF500', `PKG_DIODE_LAY(`$1', `$2', `$3',  500)');
define(`PKG_ALF600', `PKG_DIODE_LAY(`$1', `$2', `$3',  600)');
define(`PKG_ALF700', `PKG_DIODE_LAY(`$1', `$2', `$3',  700)');
define(`PKG_ALF800', `PKG_DIODE_LAY(`$1', `$2', `$3',  800)');
define(`PKG_ALF900', `PKG_DIODE_LAY(`$1', `$2', `$3',  900)');
define(`PKG_ALF1000',`PKG_DIODE_LAY(`$1', `$2', `$3', 1000)');

#
##  Axial diodes, horizontally mounted, IPC-7251 compliant, 1 is cathode
#
# The following are recommendations from IPC-7251
# The naming convention, here follows the IPC standard.
# Any additions to this section should follow the IPC naming convention and size.
# Yes, I know they are very verbose.
#
# DIOAD + lead spacing + W + lead width (diameter) + L + body length (axial) + D + body diameter (width) + {A,B,C}
#
# A = most material condition
# B = nominal material condition
# C = least material condition
#
# The base macro accepts the numbers directly (after multiplying by 100) from the IPC
# standard so they are fairly simple to add.

# $1:  canonical name
# $2:  name on PCB
# $3:  value
# $4:  pad drill diameter [1/100 mm]
# $5:  pad diameter [1/100 mm]
# $6:  pad clearance diameter [1/100 mm]
# $7:  pad center to center [1/100 mm]
# $8:  courtyard in direction perpendicular to axis of part [1/100 mm]
# $9:  courtyard in direction parallel to axis of part [1/100 mm]
# $10: 1 for polarized

# DO-41 package, www.diodes.com/assets/Datasheets/ds28002.pdf for example
#define(`PKG_DO41_H_M', `PKG_DIOAD1290W87L521D272A(`$1', `$2', `$3')');
#define(`PKG_DO41_H_N', `PKG_DIOAD1290W87L521D272B(`$1', `$2', `$3')');
#define(`PKG_DO41_H_L', `PKG_DIOAD1290W87L521D272C(`$1', `$2', `$3')');


define(`PKG_DIOAD1290W87L521D272A', `PKG_AXIAL_H_MM100(  `$1', `$2', `$3',  111,   211,  411,  1290,  621,  372, 1)');
define(`PKG_DO41_H_M',              `PKG_AXIAL_H_MM100(  `$1', `$2', `$3',  111,   211,  411,  1290,  621,  372, 1)');
define(`PKG_DIOAD1221W87L521D272B', `PKG_AXIAL_H_MM100(  `$1', `$2', `$3',  106,   176,  316,  1221,  571,  322, 1)');
define(`PKG_DO41_H_N',              `PKG_AXIAL_H_MM100(  `$1', `$2', `$3',  106,   176,  316,  1221,  571,  322, 1)');
define(`PKG_DIOAD1170W87L521D272C', `PKG_AXIAL_H_MM100(  `$1', `$2', `$3',  101,   161,  261,  1170,  541,  292, 1)');
define(`PKG_DO41_H_L',              `PKG_AXIAL_H_MM100(  `$1', `$2', `$3',  101,   161,  261,  1170,  541,  292, 1)');



#
##  Axial inductors, horizontally mounted, IPC-7251 compliant
#
# The following are recommendations from IPC-7251
# The naming convention, here follows the IPC standard.
# Any additions to this section should follow the IPC naming convention and size.  
# Yes, I know they are very verbose.
#
# INDAD + lead spacing + W + lead width (diameter) + L + body length (axial) + D + body diameter (width) + {A,B,C}
#
# A = most material condition
# B = nominal material condition
# C = least material condition
#
# The base macro accepts the numbers directly (after multiplying by 100) from the IPC
# standard so they are fairly simple to add.

# $1:  canonical name
# $2:  name on PCB
# $3:  value
# $4:  pad drill diameter [1/100 mm]
# $5:  pad diameter [1/100 mm]
# $6:  pad clearance diameter [1/100 mm]
# $7:  pad center to center [1/100 mm]
# $8:  courtyard in direction perpendicular to axis of part [1/100 mm]
# $9:  courtyard in direction parallel to axis of part [1/100 mm]
# $10: 1 for polarized
# perp  x parallel
# 6.5mm x 12mm body, 0.8 mm max lead.  TDK HLBC series for example
define(`PKG_INDAD1600W80L1200D650A', `PKG_AXIAL_H_MM100(  `$1', `$2', `$3',  105,   204,  405,  1600,  1300,  750)');
define(`PKG_INDAD1560W80L1200D650B', `PKG_AXIAL_H_MM100(  `$1', `$2', `$3',  100,   170,  309,  1560,  1250,  700)');
define(`PKG_INDAD1520W80L1200D650C', `PKG_AXIAL_H_MM100(  `$1', `$2', `$3',   95,   155,  254,  1520,  1220,  670)');

#
##  Bottom lead non-polar circular component (typically capacitor)
#   pin spacing 100 mil and up
#   RCY100 .. RCY1000
#
define(`PKG_RCY100',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 200)');
define(`PKG_RCY150',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 300)');
define(`PKG_RCY200',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 400)');
define(`PKG_RCY250',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 500)');
define(`PKG_RCY300',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 600)');
define(`PKG_RCY350',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 700)');
define(`PKG_RCY400',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 800)');
define(`PKG_RCY500',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 1000)');
define(`PKG_RCY600',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 1200)');
define(`PKG_RCY700',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 1400)');
define(`PKG_RCY800',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 1600)');
define(`PKG_RCY900',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 1800)');
define(`PKG_RCY1000', `PKG_RADIAL_CAN(`$1', `$2', `$3', 2000)');
define(`PKG_RCY1100', `PKG_RADIAL_CAN(`$1', `$2', `$3', 2200)');
define(`PKG_RCY1200', `PKG_RADIAL_CAN(`$1', `$2', `$3', 2400)');


##  Bottom lead polar circular component (typically capacitor)
#   pin spacing 100 mil and up
#
define(`PKG_RCY100P',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 200, 1)');
define(`PKG_RCY150P',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 300, 1)');
define(`PKG_RCY200P',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 400, 1)');
define(`PKG_RCY250P',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 500, 1)');
define(`PKG_RCY300P',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 600, 1)');
define(`PKG_RCY350P',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 700, 1)');
define(`PKG_RCY400P',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 800, 1)');
define(`PKG_RCY500P',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 1000, 1)');
define(`PKG_RCY600P',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 1200, 1)');
define(`PKG_RCY700P',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 1400, 1)');
define(`PKG_RCY800P',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 1600, 1)');
define(`PKG_RCY900P',  `PKG_RADIAL_CAN(`$1', `$2', `$3', 1800, 1)');
define(`PKG_RCY1000P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 2000, 1)');
define(`PKG_RCY1100P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 2200, 1)');
define(`PKG_RCY1200P', `PKG_RADIAL_CAN(`$1', `$2', `$3', 2400, 1)');

#
##  Capacitors, radial IPC-7251 compliant
#
# The following are recommendations from IPC-7251
# The naming convention, here follows the IPC standard.
# Any additions to this section should follow the IPC naming convention and size.
# Yes, I know they are very verbose.
#
# CAPPRD + lead spacing + W + lead width (diameter) + D + body diameter + H + body height + {A,B,C}
#
# A = most material condition
# B = nominal material condition
# C = least material condition
#
# The base macro accepts the numbers directly (after multiplying by 100) from the IPC
# standard so they are fairly simple to add.

# $1:  canonical name
# $2:  name on PCB
# $3:  value
# $4:  pad drill diameter [1/100 mm]
# $5:  pad diameter [1/100 mm]
# $6:  pad clearance diameter [1/100 mm]
# $7:  pad center to center [1/100 mm]
# $8:  courtyard radius [1/100 mm]
# $9:  0 for non polarized, 1 for polarized

# 16x30mm (dia x height), 0.8mm max lead, 7.5mm pitch.  Nippon Chemi-Con GPA series for example
define(`PKG_CAPPRD750W80D1600H3150A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   105,    204,    405,    750,   1700,  1)');
define(`PKG_CAPPRD750W80D1600H3150B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   100,    170,    309,    750,   1650,  1)');
define(`PKG_CAPPRD750W80D1600H3150C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',    95,    154,    254,    750,   1620,  1)');

# 18x31.5mm (dia x height), 0.8mm max lead, 7.5mm pitch.  Nichicon UPT series for example
define(`PKG_CAPPRD750W80D1800H3150A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   105,    204,    405,    750,   1900,  1)');
define(`PKG_CAPPRD750W80D1800H3150B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   100,    170,    309,    750,   1850,  1)');
define(`PKG_CAPPRD750W80D1800H3150C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',    95,    154,    254,    750,   1820,  1)');

# 22x25 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D2200H2500A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   2300,  1)');
define(`PKG_CAPPRD1000W170D2200H2500B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   2250,  1)');
define(`PKG_CAPPRD1000W170D2200H2500C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   2220,  1)');

# 22x30 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D2200H3000A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   2300,  1)');
define(`PKG_CAPPRD1000W170D2200H3000B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   2250,  1)');
define(`PKG_CAPPRD1000W170D2200H3000C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   2220,  1)');

# 22x35 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D2200H3500A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   2300,  1)');
define(`PKG_CAPPRD1000W170D2200H3500B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   2250,  1)');
define(`PKG_CAPPRD1000W170D2200H3500C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   2220,  1)');

# 22x40 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D2200H4000A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   2300,  1)');
define(`PKG_CAPPRD1000W170D2200H4000B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   2250,  1)');
define(`PKG_CAPPRD1000W170D2200H4000C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   2220,  1)');

# 22x45 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D2200H4500A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   2300,  1)');
define(`PKG_CAPPRD1000W170D2200H4500B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   2250,  1)');
define(`PKG_CAPPRD1000W170D2200H4500C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   2220,  1)');

# 22x50 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D2200H5000A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   2300,  1)');
define(`PKG_CAPPRD1000W170D2200H5000B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   2250,  1)');
define(`PKG_CAPPRD1000W170D2200H5000C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   2220,  1)');

# 25x25 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D2500H2500A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   2600,  1)');
define(`PKG_CAPPRD1000W170D2500H2500B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   2550,  1)');
define(`PKG_CAPPRD1000W170D2500H2500C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   2520,  1)');

# 25x30 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D2500H3000A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   2600,  1)');
define(`PKG_CAPPRD1000W170D2500H3000B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   2550,  1)');
define(`PKG_CAPPRD1000W170D2500H3000C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   2520,  1)');

# 25x35 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D2500H3500A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   2600,  1)');
define(`PKG_CAPPRD1000W170D2500H3500B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   2550,  1)');
define(`PKG_CAPPRD1000W170D2500H3500C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   2520,  1)');

# 25x40 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D2500H4000A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   2600,  1)');
define(`PKG_CAPPRD1000W170D2500H4000B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   2550,  1)');
define(`PKG_CAPPRD1000W170D2500H4000C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   2520,  1)');

# 25x45 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D2500H4500A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   2600,  1)');
define(`PKG_CAPPRD1000W170D2500H4500B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   2550,  1)');
define(`PKG_CAPPRD1000W170D2500H4500C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   2520,  1)');

# 25x50 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D2500H5000A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   2600,  1)');
define(`PKG_CAPPRD1000W170D2500H5000B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   2550,  1)');
define(`PKG_CAPPRD1000W170D2500H5000C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   2520,  1)');

# 30x25 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D3000H2500A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   3100,  1)');
define(`PKG_CAPPRD1000W170D3000H2500B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   3050,  1)');
define(`PKG_CAPPRD1000W170D3000H2500C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   3020,  1)');

# 30x30 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D3000H3000A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   3100,  1)');
define(`PKG_CAPPRD1000W170D3000H3000B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   3050,  1)');
define(`PKG_CAPPRD1000W170D3000H3000C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   3020,  1)');

# 30x35 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D3000H3500A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   3100,  1)');
define(`PKG_CAPPRD1000W170D3000H3500B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   3050,  1)');
define(`PKG_CAPPRD1000W170D3000H3500C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   3020,  1)');

# 30x40 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D3000H4000A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   3100,  1)');
define(`PKG_CAPPRD1000W170D3000H4000B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   3050,  1)');
define(`PKG_CAPPRD1000W170D3000H4000C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   3020,  1)');

# 30x45 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D3000H4500A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   3100,  1)');
define(`PKG_CAPPRD1000W170D3000H4500B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   3050,  1)');
define(`PKG_CAPPRD1000W170D3000H4500C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   3020,  1)');

# 30x50 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D3000H5000A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   3100,  1)');
define(`PKG_CAPPRD1000W170D3000H5000B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   3050,  1)');
define(`PKG_CAPPRD1000W170D3000H5000C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   3020,  1)');

# 35x25 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D3500H2500A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   3600,  1)');
define(`PKG_CAPPRD1000W170D3500H2500B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   3550,  1)');
define(`PKG_CAPPRD1000W170D3500H2500C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   3520,  1)');

# 35x30 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D3500H3000A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   3600,  1)');
define(`PKG_CAPPRD1000W170D3500H3000B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   3550,  1)');
define(`PKG_CAPPRD1000W170D3500H3000C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   3520,  1)');

# 35x35 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D3500H3500A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   3600,  1)');
define(`PKG_CAPPRD1000W170D3500H3500B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   3550,  1)');
define(`PKG_CAPPRD1000W170D3500H3500C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   3520,  1)');

# 35x40 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D3500H4000A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   3600,  1)');
define(`PKG_CAPPRD1000W170D3500H4000B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   3550,  1)');
define(`PKG_CAPPRD1000W170D3500H4000C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   3520,  1)');

# 35x45 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D3500H4500A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   3600,  1)');
define(`PKG_CAPPRD1000W170D3500H4500B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   3550,  1)');
define(`PKG_CAPPRD1000W170D3500H4500C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   3520,  1)');

# 35x50 mm, 1.5mm nom, 1.7mm max lead, 10.0mm pitch.  Nichicon LGX series for example
define(`PKG_CAPPRD1000W170D3500H5000A', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   195,    295,    495,   1000,   3600,  1)');
define(`PKG_CAPPRD1000W170D3500H5000B', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   190,    259,    399,   1000,   3550,  1)');
define(`PKG_CAPPRD1000W170D3500H5000C', `PKG_RADIAL_MM100(  `$1', `$2', `$3',   185,    245,    345,   1000,   3520,  1)');


#
##  Crystals
#
#
define(`PKG_HC49U',   `PKG_CRYSTAL_V(`$1', `$2', `$3', 192, 435, 183,  60, 32, 2)');
define(`PKG_HC49UH',  `PKG_CRYSTAL_H(`$1', `$2', `$3', 192, 435, 515,  60, 32, 2)');
define(`PKG_HC49U_3', `PKG_CRYSTAL_V(`$1', `$2', `$3',  96, 435, 183,  60, 32, 3)');
define(`PKG_HC49U_3H',`PKG_CRYSTAL_H(`$1', `$2', `$3',  96, 435, 515,  60, 32, 3)');
define(`PKG_HC51U',   `PKG_CRYSTAL_V(`$1', `$2', `$3', 485, 757, 352,  80, 40, 2)');
define(`PKG_HC51UH',  `PKG_CRYSTAL_H(`$1', `$2', `$3', 485, 757, 775,  80, 40, 2)');
define(`PKG_UM1',     `PKG_CRYSTAL_V(`$1', `$2', `$3', 148, 311, 126,  60, 32, 2)');
define(`PKG_UM1H',    `PKG_CRYSTAL_H(`$1', `$2', `$3', 148, 311, 322,  60, 32, 2)');
define(`PKG_UM1_3',   `PKG_CRYSTAL_V(`$1', `$2', `$3',  74, 311, 126,  60, 32, 3)');
define(`PKG_UM1_3H',  `PKG_CRYSTAL_H(`$1', `$2', `$3',  74, 311, 322,  60, 32, 3)');
#
#   HC49
#
define(`PKG_HC49',  `PKG_CRYSTAL(`$1', `$2', `$3', 300)');

#
##  Crystal oscillator
#   pins are NC, GND, CLK, VCC
#   OSC14
#
define(`PKG_OSC14',  `PKG_OSC(`$1', `$2', `$3')');

#
##  LED, size in mm (pin 1 is +, 2 is -)
#   LED3, LED5
#
define(`PKG_LED3',  `PKG_LED(`$1', `$2', `$3', 118)');
define(`PKG_LED5',  `PKG_LED(`$1', `$2', `$3', 236)');

#
## Transistor
#  TO3_90
#  TO3_45
#  TO126LAY
#  TO126W for wide
#  TO126S for standing
#  TO126SW for both
#  TO220
#  TO220W for wide
#  TO220S for standing
#  TO220SW for both
#
# as is TO3_90
# as is TO3_45
# as is TO5
# as is TO92
define(`PKG_TO126',  `PKG_TO126LAY(       `$1', `$2', `$3')');
define(`PKG_TO126S', `PKG_TO126LAY_WIDE(  `$1', `$2', `$3')');
define(`PKG_TO126W', `PKG_TO126STAND(     `$1', `$2', `$3')');
define(`PKG_TO126SW',`PKG_TO126STAND_WIDE(`$1', `$2', `$3')');
define(`PKG_TO220',  `PKG_TO220LAY(       `$1', `$2', `$3')');
define(`PKG_TO220S', `PKG_TO220LAY_WIDE(  `$1', `$2', `$3')');
define(`PKG_TO220W', `PKG_TO220STAND(     `$1', `$2', `$3')');
define(`PKG_TO220SW',`PKG_TO220STAND_WIDE(`$1', `$2', `$3')');

define(`PKG_TO263',  `PKG_TO263BASE(`$1', `$2', `$3')');

# these are just wrappers around the footprints from to.inc.
# they are done here to be in a standard format that will
# make them show up in the footprint window and also get
# generated via the m4lib_to_newlib.sh script
define(`PKG_TO18',   `PKG_TO18BASE(`$1', `$2', `$3')');
define(`PKG_TO39',   `PKG_TO39BASE(`$1', `$2', `$3')');
define(`PKG_TO92',   `PKG_TO92BASE(`$1', `$2', `$3')');

## diode in TO220
#
define(`PKG_TO220ACS', `PKG_TO220ACSTAND(`$1', `$2', `$3')');
define(`PKG_TO218',    `GENERIC_PL_POWER(`$1', `$2', `$3',  3, 219, 615, 200, 120,100, 60,   0)');
# aka TOP3
define(`PKG_TO247',    `GENERIC_PL_POWER(`$1', `$2', `$3',  3, 219, 630, 210, 130,100, 60,   0)');
# diode in TO247/TOP3
define(`PKG_TO247_2',  `GENERIC_PL_POWER(`$1', `$2', `$3',  2, 438, 630, 210, 130,100, 60,   0)');
# aka TOP3BIG
define(`PKG_TO264',    `GENERIC_PL_POWER(`$1', `$2', `$3',  3, 219, 800, 210, 130,100, 60,   0)');
# aka IPAK
define(`PKG_TO251',    `GENERIC_PL_POWER(`$1', `$2', `$3',  3,  90, 265, 100,  50, 70, 40,   0)');

define(`PKG_TO220ACSTAND',    `GENERIC_PL_POWER(`$1', `$2', `$3',  2, 200, 400, 180, 100, 80, 40,   0)')

# the definitions of PKG_TO220STAND PKG_TO220STAND-WIDE can be replaced by following lines:
#define(`PKG_TO220STAND',      `GENERIC_PL_POWER(`$1', `$2', `$3',  3, 100, 400, 180, 100, 80, 40,   0)')
#define(`PKG_TO220STAND-WIDE', `GENERIC_PL_POWER(`$1', `$2', `$3',  3, 100, 400, 180, 200, 80, 40,-100)')

#
##  Power IC, as in MULTIWATT15
#
# See the following:
# PENTAWATT: http://www.st.com/stonline/books/pdf/docs/9262.pdf
# HEPTAWATT: http://www.st.com/stonline/books/pdf/docs/5430.pdf
# MULTIWATT8: http://www.st.com/stonline/books/pdf/docs/5437.pdf
# MULTIWATT11: http://www.st.com/stonline/books/pdf/docs/5433.pdf
# MULTIWATT15: http://www.st.com/stonline/books/pdf/docs/5439.pdf

# GENERIC_PL_POWER
# $1: canonical name
# $2: name on PCB
# $3: value
# $4: pin count
# $5: pin spacing
# $6: body length (dimension parallel to rows of pins)
# $7: body width  (dimension perpendicular to rows of pins)
# $8: pin/tab spacing
# $9: pad size
# $10: drill size
# $11: pin row spacing

define(`PKG_PENTAWATT',       `GENERIC_PL_POWER(`$1', `$2', `$3',  5,  67, 409, 189, 177, 90, 60, 157)' );
define(`PKG_HEPTAWATT',       `GENERIC_PL_POWER(`$1', `$2', `$3',  7,  50, 409, 189, 110, 90, 60, 200)' );
define(`PKG_MULTIWATT8',      `GENERIC_PL_POWER(`$1', `$2', `$3',  8, 100, 800, 200, 115, 90, 60,   0)' );
define(`PKG_MULTIWATT11',     `GENERIC_PL_POWER(`$1', `$2', `$3', 11,  67, 800, 200, 180, 90, 60, 200)' );
define(`PKG_MULTIWATT15',     `GENERIC_PL_POWER(`$1', `$2', `$3', 15,  50, 800, 200, 180, 90, 60, 200)' );

#
## Jumper, i.e. single row headers
#
define(`PKG_JUMPER1',    `PKG_CONNECTOR(`$1', `$2', `$3',  1, 1)');
define(`PKG_JUMPER2',    `PKG_CONNECTOR(`$1', `$2', `$3',  2, 1)');
define(`PKG_JUMPER3',    `PKG_CONNECTOR(`$1', `$2', `$3',  3, 1)');
define(`PKG_JUMPER4',    `PKG_CONNECTOR(`$1', `$2', `$3',  4, 1)');
define(`PKG_JUMPER5',    `PKG_CONNECTOR(`$1', `$2', `$3',  5, 1)');
define(`PKG_JUMPER6',    `PKG_CONNECTOR(`$1', `$2', `$3',  6, 1)');
define(`PKG_JUMPER7',    `PKG_CONNECTOR(`$1', `$2', `$3',  7, 1)');
define(`PKG_JUMPER8',    `PKG_CONNECTOR(`$1', `$2', `$3',  8, 1)');
define(`PKG_JUMPER9',    `PKG_CONNECTOR(`$1', `$2', `$3',  9, 1)');
define(`PKG_JUMPER10',   `PKG_CONNECTOR(`$1', `$2', `$3', 10, 1)');
define(`PKG_JUMPER11',   `PKG_CONNECTOR(`$1', `$2', `$3', 11, 1)');
define(`PKG_JUMPER12',   `PKG_CONNECTOR(`$1', `$2', `$3', 12, 1)');
define(`PKG_JUMPER13',   `PKG_CONNECTOR(`$1', `$2', `$3', 13, 1)');
define(`PKG_JUMPER14',   `PKG_CONNECTOR(`$1', `$2', `$3', 14, 1)');
define(`PKG_JUMPER15',   `PKG_CONNECTOR(`$1', `$2', `$3', 15, 1)');
define(`PKG_JUMPER16',   `PKG_CONNECTOR(`$1', `$2', `$3', 16, 1)');
define(`PKG_JUMPER17',   `PKG_CONNECTOR(`$1', `$2', `$3', 17, 1)');
define(`PKG_JUMPER18',   `PKG_CONNECTOR(`$1', `$2', `$3', 18, 1)');
define(`PKG_JUMPER19',   `PKG_CONNECTOR(`$1', `$2', `$3', 19, 1)');
define(`PKG_JUMPER20',   `PKG_CONNECTOR(`$1', `$2', `$3', 20, 1)');
define(`PKG_JUMPER21',   `PKG_CONNECTOR(`$1', `$2', `$3', 21, 1)');
define(`PKG_JUMPER22',   `PKG_CONNECTOR(`$1', `$2', `$3', 22, 1)');
define(`PKG_JUMPER23',   `PKG_CONNECTOR(`$1', `$2', `$3', 23, 1)');
define(`PKG_JUMPER24',   `PKG_CONNECTOR(`$1', `$2', `$3', 24, 1)');
define(`PKG_JUMPER25',   `PKG_CONNECTOR(`$1', `$2', `$3', 25, 1)');
define(`PKG_JUMPER26',   `PKG_CONNECTOR(`$1', `$2', `$3', 26, 1)');

#
## MTA Connector, (0.100 inch pitch)
#
define(`PKG_MTA100_2',    `PKG_MTA_100(`$1', `$2', `$3',  2)');
define(`PKG_MTA100_3',    `PKG_MTA_100(`$1', `$2', `$3',  3)');
define(`PKG_MTA100_4',    `PKG_MTA_100(`$1', `$2', `$3',  4)');
define(`PKG_MTA100_5',    `PKG_MTA_100(`$1', `$2', `$3',  5)');
define(`PKG_MTA100_6',    `PKG_MTA_100(`$1', `$2', `$3',  6)');
define(`PKG_MTA100_7',    `PKG_MTA_100(`$1', `$2', `$3',  7)');
define(`PKG_MTA100_8',    `PKG_MTA_100(`$1', `$2', `$3',  8)');
define(`PKG_MTA100_9',    `PKG_MTA_100(`$1', `$2', `$3',  9)');
define(`PKG_MTA100_10',   `PKG_MTA_100(`$1', `$2', `$3', 10)');
define(`PKG_MTA100_11',   `PKG_MTA_100(`$1', `$2', `$3', 11)');
define(`PKG_MTA100_12',   `PKG_MTA_100(`$1', `$2', `$3', 12)');
define(`PKG_MTA100_13',   `PKG_MTA_100(`$1', `$2', `$3', 13)');
define(`PKG_MTA100_14',   `PKG_MTA_100(`$1', `$2', `$3', 14)');
define(`PKG_MTA100_15',   `PKG_MTA_100(`$1', `$2', `$3', 15)');

#
## Header connector, DIP pin numbering
#  Corresponding to gEDA symbols header2-1 .. header64-1
#
define(`PKG_HEADER2_1',  `PKG_CONNECTOR_DIL(`$1', `$2', `$3',  1)');
define(`PKG_HEADER4_1',  `PKG_CONNECTOR_DIL(`$1', `$2', `$3',  2)');
define(`PKG_HEADER6_1',  `PKG_CONNECTOR_DIL(`$1', `$2', `$3',  3)');
define(`PKG_HEADER8_1',  `PKG_CONNECTOR_DIL(`$1', `$2', `$3',  4)');
define(`PKG_HEADER10_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3',  5)');
define(`PKG_HEADER12_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3',  6)');
define(`PKG_HEADER14_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3',  7)');
define(`PKG_HEADER16_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3',  8)');
define(`PKG_HEADER18_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3',  9)');
define(`PKG_HEADER20_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 10)');
define(`PKG_HEADER22_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 11)');
define(`PKG_HEADER24_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 12)');
define(`PKG_HEADER26_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 13)');
define(`PKG_HEADER28_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 14)');
define(`PKG_HEADER30_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 15)');
define(`PKG_HEADER32_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 16)');
define(`PKG_HEADER34_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 17)');
define(`PKG_HEADER36_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 18)');
define(`PKG_HEADER38_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 19)');
define(`PKG_HEADER40_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 20)');
define(`PKG_HEADER42_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 21)');
define(`PKG_HEADER44_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 22)');
define(`PKG_HEADER46_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 23)');
define(`PKG_HEADER48_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 24)');
define(`PKG_HEADER50_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 25)');
define(`PKG_HEADER52_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 26)');
define(`PKG_HEADER54_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 27)');
define(`PKG_HEADER56_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 28)');
define(`PKG_HEADER58_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 29)');
define(`PKG_HEADER60_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 30)');
define(`PKG_HEADER62_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 31)');
define(`PKG_HEADER64_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 32)');
define(`PKG_HEADER80_1', `PKG_CONNECTOR_DIL(`$1', `$2', `$3', 40)');

#
## Header connector, ribbon cable numbering
#  corresponding to gEDA symbols header2-2 .. header64-2
#
define(`PKG_HEADER2_2',  `PKG_CONNECTOR(`$1', `$2', `$3',  1, 2)');
define(`PKG_HEADER4_2',  `PKG_CONNECTOR(`$1', `$2', `$3',  2, 2)');
define(`PKG_HEADER6_2',  `PKG_CONNECTOR(`$1', `$2', `$3',  3, 2)');
define(`PKG_HEADER8_2',  `PKG_CONNECTOR(`$1', `$2', `$3',  4, 2)');
define(`PKG_HEADER10_2', `PKG_CONNECTOR(`$1', `$2', `$3',  5, 2)');
define(`PKG_HEADER12_2', `PKG_CONNECTOR(`$1', `$2', `$3',  6, 2)');
define(`PKG_HEADER14_2', `PKG_CONNECTOR(`$1', `$2', `$3',  7, 2)');
define(`PKG_HEADER16_2', `PKG_CONNECTOR(`$1', `$2', `$3',  8, 2)');
define(`PKG_HEADER18_2', `PKG_CONNECTOR(`$1', `$2', `$3',  9, 2)');
define(`PKG_HEADER20_2', `PKG_CONNECTOR(`$1', `$2', `$3', 10, 2)');
define(`PKG_HEADER22_2', `PKG_CONNECTOR(`$1', `$2', `$3', 11, 2)');
define(`PKG_HEADER24_2', `PKG_CONNECTOR(`$1', `$2', `$3', 12, 2)');
define(`PKG_HEADER26_2', `PKG_CONNECTOR(`$1', `$2', `$3', 13, 2)');
define(`PKG_HEADER28_2', `PKG_CONNECTOR(`$1', `$2', `$3', 14, 2)');
define(`PKG_HEADER30_2', `PKG_CONNECTOR(`$1', `$2', `$3', 15, 2)');
define(`PKG_HEADER32_2', `PKG_CONNECTOR(`$1', `$2', `$3', 16, 2)');
define(`PKG_HEADER34_2', `PKG_CONNECTOR(`$1', `$2', `$3', 17, 2)');
define(`PKG_HEADER36_2', `PKG_CONNECTOR(`$1', `$2', `$3', 18, 2)');
define(`PKG_HEADER38_2', `PKG_CONNECTOR(`$1', `$2', `$3', 19, 2)');
define(`PKG_HEADER40_2', `PKG_CONNECTOR(`$1', `$2', `$3', 20, 2)');
define(`PKG_HEADER42_2', `PKG_CONNECTOR(`$1', `$2', `$3', 21, 2)');
define(`PKG_HEADER44_2', `PKG_CONNECTOR(`$1', `$2', `$3', 22, 2)');
define(`PKG_HEADER46_2', `PKG_CONNECTOR(`$1', `$2', `$3', 23, 2)');
define(`PKG_HEADER48_2', `PKG_CONNECTOR(`$1', `$2', `$3', 24, 2)');
define(`PKG_HEADER50_2', `PKG_CONNECTOR(`$1', `$2', `$3', 25, 2)');
define(`PKG_HEADER52_2', `PKG_CONNECTOR(`$1', `$2', `$3', 26, 2)');
define(`PKG_HEADER54_2', `PKG_CONNECTOR(`$1', `$2', `$3', 27, 2)');
define(`PKG_HEADER56_2', `PKG_CONNECTOR(`$1', `$2', `$3', 28, 2)');
define(`PKG_HEADER58_2', `PKG_CONNECTOR(`$1', `$2', `$3', 29, 2)');
define(`PKG_HEADER60_2', `PKG_CONNECTOR(`$1', `$2', `$3', 30, 2)');
define(`PKG_HEADER62_2', `PKG_CONNECTOR(`$1', `$2', `$3', 31, 2)');
define(`PKG_HEADER64_2', `PKG_CONNECTOR(`$1', `$2', `$3', 32, 2)');
define(`PKG_HEADER80_2', `PKG_CONNECTOR(`$1', `$2', `$3', 40, 2)');

#
## Header connector with latches
#
define(`PKG_DIN41651_10',  `PKG_DIN41_651LAY(  `$1', `$2', `$3', 10)');
define(`PKG_DIN41651_14',  `PKG_DIN41_651LAY(  `$1', `$2', `$3', 14)');
define(`PKG_DIN41651_16',  `PKG_DIN41_651LAY(  `$1', `$2', `$3', 16)');
define(`PKG_DIN41651_20',  `PKG_DIN41_651LAY(  `$1', `$2', `$3', 20)');
define(`PKG_DIN41651_26',  `PKG_DIN41_651LAY(  `$1', `$2', `$3', 26)');
define(`PKG_DIN41651_34',  `PKG_DIN41_651LAY(  `$1', `$2', `$3', 34)');
define(`PKG_DIN41651_40',  `PKG_DIN41_651LAY(  `$1', `$2', `$3', 40)');
define(`PKG_DIN41651_50',  `PKG_DIN41_651LAY(  `$1', `$2', `$3', 50)');
define(`PKG_DIN41651_60',  `PKG_DIN41_651LAY(  `$1', `$2', `$3', 60)');
define(`PKG_DIN41651_64',  `PKG_DIN41_651LAY(  `$1', `$2', `$3', 64)');

define(`PKG_DIN41651_10S', `PKG_DIN41_651STAND(`$1', `$2', `$3', 10)');
define(`PKG_DIN41651_14S', `PKG_DIN41_651STAND(`$1', `$2', `$3', 14)');
define(`PKG_DIN41651_16S', `PKG_DIN41_651STAND(`$1', `$2', `$3', 16)');
define(`PKG_DIN41651_20S', `PKG_DIN41_651STAND(`$1', `$2', `$3', 20)');
define(`PKG_DIN41651_26S', `PKG_DIN41_651STAND(`$1', `$2', `$3', 26)');
define(`PKG_DIN41651_34S', `PKG_DIN41_651STAND(`$1', `$2', `$3', 34)');
define(`PKG_DIN41651_40S', `PKG_DIN41_651STAND(`$1', `$2', `$3', 40)');
define(`PKG_DIN41651_50S', `PKG_DIN41_651STAND(`$1', `$2', `$3', 50)');
define(`PKG_DIN41651_60S', `PKG_DIN41_651STAND(`$1', `$2', `$3', 60)');
define(`PKG_DIN41651_64S', `PKG_DIN41_651STAND(`$1', `$2', `$3', 64)');

#
## DSUB connector, female/male
#  DB9F .. DB37F
#  DB9M .. DB37M
#
define(`PKG_DB9F',       `PKG_SUBD_FEMALE_LAY(`$1', `$2', `$3',  9)');
define(`PKG_DB15F',      `PKG_SUBD_FEMALE_LAY(`$1', `$2', `$3', 15)');
define(`PKG_DB25F',      `PKG_SUBD_FEMALE_LAY(`$1', `$2', `$3', 25)');
define(`PKG_DB37F',      `PKG_SUBD_FEMALE_LAY(`$1', `$2', `$3', 37)');
define(`PKG_DB9M',       `PKG_SUBD_MALE_LAY(  `$1', `$2', `$3',  9)');
define(`PKG_DB15M',      `PKG_SUBD_MALE_LAY(  `$1', `$2', `$3', 15)');
define(`PKG_DB25M',      `PKG_SUBD_MALE_LAY(  `$1', `$2', `$3', 25)');
define(`PKG_DB37M',      `PKG_SUBD_MALE_LAY(  `$1', `$2', `$3', 37)');

#
## DIN connector, 96 pin housing
#  DIN41612C96F ...
#
define(`PKG_DIN41612C96F', `PKG_DIN41_612FEMALE(`$1', `$2', `$3', `abc')');
define(`PKG_DIN41612C96M', `PKG_DIN41_612MALE(  `$1', `$2', `$3', `abc')');
define(`PKG_DIN41612C64F', `PKG_DIN41_612FEMALE(`$1', `$2', `$3', `ac')');
define(`PKG_DIN41612C64M', `PKG_DIN41_612MALE(  `$1', `$2', `$3', `ac')');

define(`PKG_DIN41612C96FS', `PKG_DIN41_612FEMALE_SMALL(`$1', `$2', `$3', `abc')');
define(`PKG_DIN41612C96MS', `PKG_DIN41_612MALE_SMALL(  `$1', `$2', `$3', `abc')');
define(`PKG_DIN41612C64FS', `PKG_DIN41_612FEMALE_SMALL(`$1', `$2', `$3', `ac')');
define(`PKG_DIN41612C64MS', `PKG_DIN41_612MALE_SMALL(  `$1', `$2', `$3', `ac')');

#
## Standard SMT resistor, capacitor etc
#  0201 .. 2706
#
#define(`PKG_0201',      `PKG_SMT_2PAD_MIL(  `$1', `$2', `$3',  20,   10)');
#define(`PKG_0402',      `PKG_SMT_2PAD_MIL(  `$1', `$2', `$3',  40,   20)');
#define(`PKG_0603',      `PKG_SMT_2PAD_MIL(  `$1', `$2', `$3',  60,   30)');
#define(`PKG_0805',      `PKG_SMT_2PAD_MIL(  `$1', `$2', `$3',  80,   50)');
#define(`PKG_1008',      `PKG_SMT_2PAD_MIL(  `$1', `$2', `$3', 100,   80)');
#define(`PKG_1206',      `PKG_SMT_2PAD_MIL(  `$1', `$2', `$3', 120,   60)');
#define(`PKG_1210',      `PKG_SMT_2PAD_MIL(  `$1', `$2', `$3', 120, 100)');
#define(`PKG_1806',      `PKG_SMT_2PAD_MIL(  `$1', `$2', `$3', 180,   60)');
#define(`PKG_1812',      `PKG_SMT_2PAD_MIL(  `$1', `$2', `$3', 180, 120)');
#define(`PKG_1825',      `PKG_SMT_2PAD_MIL(  `$1', `$2', `$3', 180, 250)');
define(`PKG_2706',      `PKG_SMT_2PAD_MIL(  `$1', `$2', `$3', 270,   60)');

# The following are recommendations from IPC-7351
# The naming convention, like 'CAPC0603L' follows the IPC standard.  At the end
# of each size is a package named like '0603', '1206' which is more or less a compromise part based 
# on the nominal IPC footprints for that package size.  Any additions to this section
# should follow the IPC naming convention and size.  
# 
# The base macro accepts the numbers directly (after multiplying by 100) from the IPC
# standard so they are fairly simple to add.

# $1:  canonical name
# $2:  name on PCB
# $3:  value
# $4:  pad X (size of pad in direction perpendicular to axis of part) [1/100 mm]
# $5:  pad Y (size of pad in direction parallel to axis of part) [1/100 mm]
# $6:  pad center to center spacing [1/100 mm]
# $7:  courtyard size in direction parallel to axis of part [1/100 mm] (V1)
# $8:  courtyard size in direction perpendicular to axis of part [1/100 mm] (V2)
# $9:  length of silk screen line [1/100 mm] (R1)
# $10: spacing of silk screen line [1/100 mm] (R2)

# 01005
# See for example Murata GRM02 series.
# package X is 0.2 mm +/- 0.02 mm
# package Y is 0.07 to 0.14 mm
# package inner pad edge to pad edge is 0.13 min
# package outer pad edge to outer pad edge is 0.4 mm +/- 0.02 mm
# package height is 0.2mm +/- 0.02 mm

# From page 10 of IPC-7351, Feb 2005,
# Zmax = length of pattern = Lmin (overall length of the component) + 2*Jt + sqrt(Cl^2 + F^2 + P^2)
# Gmin = Distance between lands of the pattern = Smax (distance between terminals) - 2*Jh - sqrt(Cs^2 + F^2 + P^2)
# Xmax = Width of pattern = Wmin (width of lead) + 2*Js + sqrt(Cw^2 + F^2 + P^2)
#
# C = component tolerance = *max - *min
# F = PCB tolerance - used 0.05
# P = placement tolerance - used 0.05
#
# X = Xmax = 0.18/0.18/0.23 round to get 0.20/0.20/0.25
# Y = 0.5 * (Zmax - Gmin)  
# center to center = 0.5 * (Zmax + Gmin)
# 
#
# Jt = 0.00/0.10/0.20
# Jh = -0.05/-0.05/-0.05
# Js = 0.00/0.00/0.05
# Round to nearest 0.05
# Courtyard excess 0.10/0.15/0.20
#
#
# Note that rounding to 0.05 mm produces a roundoff error of up to +/- 1 mil.  This can be significant
# when we're talking about gaps on the order of 6 mils.  So for this really tiny part, round to 0.01 mm
define(`PKG_CAPC0402L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  26,   15,  31,  56,  28,   0,   0)');
define(`PKG_CAPC0402N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  26,   25,  41,  81,  33,   0,   0)');
define(`PKG_CAPC0402M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  36,   35,  51, 106,  38,   0,   0)');

define(`PKG_INDC0402L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  26,   15,  31,  56,  28,   0,   0)');
define(`PKG_INDC0402N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  26,   25,  41,  81,  33,   0,   0)');
define(`PKG_INDC0402M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  36,   35,  51, 106,  38,   0,   0)');

define(`PKG_RESC0402L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  26,   15,  31,  56,  28,   0,   0)');
define(`PKG_RESC0402N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  26,   25,  41,  81,  33,   0,   0)');
define(`PKG_RESC0402M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  36,   35,  51, 106,  38,   0,   0)');

define(`PKG_01005',     `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  26,   25,  41,  81,  33,   0,   0)');

# 0201
define(`PKG_CAPC0603L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  30,   30,  50, 100,  60,   0,   0)');
define(`PKG_CAPC0603N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  40,   40,  60, 130,  80,   0,   0)');
define(`PKG_CAPC0603M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  50,   50,  80, 160,  90,   0,   0)');

define(`PKG_RESC0603L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  30,   30,  50, 100,  60,   0,   0)');
define(`PKG_RESC0603N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  40,   40,  60, 130,  80,   0,   0)');
define(`PKG_RESC0603M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  50,   50,  80, 160,  90,   0,   0)');

define(`PKG_0201',      `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  40,   40,  60, 130,  80,   0,   0)');

# 0402 (C,L = 0.6 mm high, R = 0.4 mm high)
define(`PKG_CAPC1005L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  55,   40,  90, 150,  80,   0,   0)');
define(`PKG_CAPC1005N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  65,   50,  90, 170, 100,   0,   0)');
define(`PKG_CAPC1005M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  75,   60, 100, 200, 120,   0,   0)');

define(`PKG_INDC1005L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  60,   50,  80, 150,  90,   0,   0)');
define(`PKG_INDC1005N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  70,   50,  80, 170, 100,   0,   0)');
define(`PKG_INDC1005M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  80,   70, 100, 200, 120,   0,   0)');

define(`PKG_RESC1005L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  55,   35,  90, 150,  80,   0,   0)');
define(`PKG_RESC1005N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  65,   45, 100, 170, 100,   0,   0)');
define(`PKG_RESC1005M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  75,   55, 110, 200, 120,   0,   0)');

define(`PKG_0402',      `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  70,   50,  80, 170, 100,   0,   0)');

# 0603 (C = 0.85 mm high, L = 0.95 mm high, R = 0.60 mm high)
define(`PKG_CAPC1608L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  90,   65, 120, 200, 120,   0,   0)');
define(`PKG_CAPC1608N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 100,   75, 130, 230, 130,   0,   0)');
define(`PKG_CAPC1608M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 110,   85, 140, 270, 150,   0,   0)');

define(`PKG_INDC1608L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  90,   65, 120, 200, 120,   0,   0)');
define(`PKG_INDC1608N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 100,   75, 130, 230, 130,   0,   0)');
define(`PKG_INDC1608M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 110,   85, 140, 270, 150,   0,   0)');

define(`PKG_RESC1608L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3',  90,   50, 120, 200, 120,   0,  90)');
define(`PKG_RESC1608N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 100,   60, 140, 230, 130,   0,   0)');
define(`PKG_RESC1608M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 110,   70, 150, 270, 150,  10, 110)');

define(`PKG_0603',      `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 100,   75, 130, 230, 130,   0,   0)');

# 0805 (C = 1.1 mm high, L = 1.2 mm high, R = 0.65 mm high)
define(`PKG_CAPC2012L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 140,  110, 160, 280, 170,   0,   0)');
define(`PKG_CAPC2012N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 150,  130, 180, 350, 200,   0,   0)');
define(`PKG_CAPC2012M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 160,  150, 200, 440, 260,   0,   0)');

define(`PKG_INDC2012L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 140,  110, 160, 280, 170,   0,   0)');
define(`PKG_INDC2012N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 150,  130, 180, 350, 200,   0,   0)');
define(`PKG_INDC2012M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 160,  150, 200, 440, 260,   0,   0)');

define(`PKG_RESC2012L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 130,  100, 160, 280, 160,  20, 130)');
define(`PKG_RESC2012N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 140,  120, 180, 350, 190,  20, 140)');
define(`PKG_RESC2012M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 150,  140, 200, 440, 250,  20, 150)');

define(`PKG_0805',      `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 150,  130, 180, 350, 200,  20, 140)');

# 1008 (L = 2.2 mm high)
define(`PKG_INDC2520L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 220,   90, 240, 340, 250,  80, 220)');
define(`PKG_INDC2520N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 230,  110, 260, 410, 280,  70, 230)');
define(`PKG_INDC2520M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 240,  130, 280, 500, 340,  80, 240)');

define(`PKG_1008',      `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 230,  110, 260, 410, 280,  70, 230)');

# 1206 (C = 1.35 mm high, L = 1.9 mm high, R = 0.71 mm high)
define(`PKG_CAPC3216L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 170,  110, 280, 400, 200,  90, 170)');
define(`PKG_CAPC3216N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 180,  130, 300, 470, 230, 100, 180)');
define(`PKG_CAPC3216M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 190,  150, 320, 560, 290, 100, 190)');

define(`PKG_INDC3216L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 180,  100, 300, 420, 210, 120, 180)');
define(`PKG_INDC3216N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 190,  120, 320, 490, 240, 120, 190)');
define(`PKG_INDC3216M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 200,  140, 340, 580, 300, 130, 200)');

define(`PKG_RESC3216L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 170,  110, 280, 400, 200,  90, 170)');
define(`PKG_RESC3216N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 180,  130, 300, 470, 230, 100, 180)');
define(`PKG_RESC3216M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 190,  150, 320, 560, 290, 100, 190)');

define(`PKG_1206',      `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 190,  130, 300, 490, 240, 120, 190)');

# 1210 (C = 1.35 mm high, L = 1.35 mm high, R = 0.71 mm high)
define(`PKG_CAPC3225L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 260,  110, 280, 400, 290,  90, 260)');
define(`PKG_CAPC3225N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 270,  130, 300, 470, 320, 100, 270)');
define(`PKG_CAPC3225M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 280,  150, 320, 560, 380, 100, 280)');

define(`PKG_INDC3225L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 260,  110, 280, 400, 290,  90, 260)');
define(`PKG_INDC3225N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 270,  130, 300, 470, 320, 100, 270)');
define(`PKG_INDC3225M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 280,  150, 320, 560, 380, 100, 280)');

define(`PKG_RESC3225L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 260,  110, 280, 400, 290,  90, 260)');
define(`PKG_RESC3225N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 270,  130, 300, 470, 320, 100, 270)');
define(`PKG_RESC3225M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 280,  150, 320, 560, 380, 100, 280)');

define(`PKG_1210',      `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 270,  130, 300, 470, 320, 100, 270)');

# 1806 (L = 1.9 mm high)

define(`PKG_INDC4509L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 110,  130, 400, 540, 150, 200, 110)');
define(`PKG_INDC4509N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 120,  150, 420, 610, 170, 190, 120)');
define(`PKG_INDC4509M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 130,  170, 440, 700, 230, 200, 130)');

define(`PKG_1806',      `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 120,  150, 420, 610, 170, 190, 120)');

# 1812 (C = 1.35 mm high, L = 1.75 mm high, R = 1.1 mm high)
define(`PKG_CAPC4532L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 330,  140, 380, 540, 370, 160, 330)');
define(`PKG_CAPC4532N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 340,  160, 400, 610, 390, 160, 340)');
define(`PKG_CAPC4532M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 350,  180, 420, 700, 450, 160, 350)');

define(`PKG_INDC4532L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 330,  140, 380, 540, 370, 160, 330)');
define(`PKG_INDC4532N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 340,  160, 400, 610, 390, 160, 340)');
define(`PKG_INDC4532M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 350,  180, 420, 700, 450, 160, 350)');

define(`PKG_RESC4532L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 330,  140, 380, 540, 370, 160, 330)');
define(`PKG_RESC4532N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 340,  160, 400, 610, 390, 160, 340)');
define(`PKG_RESC4532M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 350,  180, 420, 700, 450, 160, 350)');

define(`PKG_1806',      `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 340,  160, 400, 610, 390, 160, 340)');

# 1825 (C = 1.1 mm high, R = 1.35 mm high)
define(`PKG_CAPC4564L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 670,  140, 380, 540, 700, 160, 670)');
define(`PKG_CAPC4564N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 680,  160, 400, 610, 730, 160, 680)');
define(`PKG_CAPC4564M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 690,  180, 420, 700, 790, 160, 690)');

define(`PKG_RESC4564L', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 670,  140, 380, 540, 700, 160, 670)');
define(`PKG_RESC4564N', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 680,  160, 400, 610, 730, 160, 680)');
define(`PKG_RESC4564M', `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 690,  180, 420, 700, 790, 160, 690)');

define(`PKG_1825',      `PKG_SMT_2PAD_MM100(  `$1', `$2', `$3', 680,  160, 400, 610, 730, 160, 680)');



#
## 3-Pin SMT EMI Filter based on standard SMT sizes
#  See www.murata.com for example
#
define(`PKG_EMI0603',      `COMMON_SMT_3PAD_MIL(  `$1', `$2', `$3', 24, 24,  63,  47, 16, 10, 10)');
define(`PKG_EMI0805',      `COMMON_SMT_3PAD_MIL(  `$1', `$2', `$3', 32, 24,  79,  75, 24, 10, 10)');
define(`PKG_EMI1206',      `COMMON_SMT_3PAD_MIL(  `$1', `$2', `$3', 32, 28, 126,  79, 39, 10, 10)');
define(`PKG_EMI1806',      `COMMON_SMT_3PAD_MIL(  `$1', `$2', `$3', 39, 39, 177, 102, 59, 10, 10)');

#
## Tantalum SMT capacitor (pin 1 is +)
#  pin 1 is marked (and is presumably +), pin 2 is minus
#  EIA3216 .. EIA7343
#
define(`PKG_EIA3216',   `PKG_SMT_2PAD_EIA(  `$1', `$2', `$3', 32, 16)');
define(`PKG_EIA3528',   `PKG_SMT_2PAD_EIA(  `$1', `$2', `$3', 35, 28)');
define(`PKG_EIA6032',   `PKG_SMT_2PAD_EIA(  `$1', `$2', `$3', 60, 32)');
define(`PKG_EIA7343',   `PKG_SMT_2PAD_EIA(  `$1', `$2', `$3', 73, 43)');

define(`PKG_TANT_A',    `PKG_SMT_2PAD_EIA(  `$1', `$2', `$3', 32, 16)');
define(`PKG_TANT_B',    `PKG_SMT_2PAD_EIA(  `$1', `$2', `$3', 35, 28)');
define(`PKG_TANT_C',    `PKG_SMT_2PAD_EIA(  `$1', `$2', `$3', 60, 32)');
define(`PKG_TANT_D',    `PKG_SMT_2PAD_EIA(  `$1', `$2', `$3', 73, 43)');

#
## Surface mount electrolytic capacitor, number is dia in mm
define(`PKG_SME3',      `PKG_SMT_2PAD_EIA(  `$1', `$2', `$3', 33, 33)');
define(`PKG_SME4',      `PKG_SMT_2PAD_EIA(  `$1', `$2', `$3', 43, 43)');
define(`PKG_SME5',      `PKG_SMT_2PAD_EIA(  `$1', `$2', `$3', 53, 53)');
define(`PKG_SME6',      `PKG_SMT_2PAD_EIA(  `$1', `$2', `$3', 66, 66)');
define(`PKG_SME8',      `PKG_SMT_2PAD_EIA(  `$1', `$2', `$3', 84, 84)');
define(`PKG_SME10',     `PKG_SMT_2PAD_EIA(  `$1', `$2', `$3',104,104)');

#
## SMT diode (pin 1 is cathode)
#  (pin 2 is anode)
#  SOD110 ..
#
#  SOD23D is a SOT23 housing with pin numbers that match diodes
#  it can also be used for transistors that used this numbering
# dimensions of `PKG_SMT_DIODE( `$1', `$2', `$3', len=mm/10, wid=mm/10)'); #JG
# dimensions of `PKG_SM/EIT_2PAD_EIA( `$1', `$2', `$3', len=mm/10, wid=mm/10)'); #JG
#
define(`PKG_SOD80',    `PKG_SMT_2PAD_EIA(    `$1', `$2', `$3', 37, 16)');
define(`PKG_SOD87',    `PKG_SMT_2PAD_EIA(    `$1', `$2', `$3', 37, 21)');
define(`PKG_SOD106A',  `PKG_SMT_DIODE(       `$1', `$2', `$3', 55, 25)');
define(`PKG_SOD110',   `PKG_SMT_DIODE(       `$1', `$2', `$3', 21, 14)');
# BUG: pads are only 0.65 mm wide:
define(`PKG_SOD123',   `PKG_SMT_DIODE(       `$1', `$2', `$3', 40, 15)');
# BUG: pads are only 0.60 mm wide:
define(`PKG_SOD323',   `PKG_SMT_DIODE(       `$1', `$2', `$3', 27, 13)');
define(`PKG_SOD523',   `PKG_SMT_DIODE(       `$1', `$2', `$3', 12,  8)');
define(`PKG_DO214',   `PKG_SMT_DIODE(       `$1', `$2', `$3', 77, 33)'); #JG
define(`PKG_DO214AB',   `PKG_SMT_DIODE(       `$1', `$2', `$3', 79, 34)'); #JG
define(`PKG_SOT23D',   `PKG_SMT_TRANSISTOR2( `$1', `$2', `$3', 20, 21)');
define(`PKG_SOT323D',  `PKG_SMT_TRANSISTOR2( `$1', `$2', `$3', 13, 18)');

#
## SMT transistor, 3 pins
define(`PKG_SOT23',    `PKG_SMT_TRANSISTOR3( `$1', `$2', `$3', 20, 21)');
define(`PKG_SOT323',   `PKG_SMT_TRANSISTOR3( `$1', `$2', `$3', 13, 18)');
define(`PKG_SC90',     `PKG_SMT_TRANSISTOR3( `$1', `$2', `$3', 10, 15)');
define(`PKG_SC70_3',   `PKG_SMT_TRANSISTOR3( `$1', `$2', `$3', 13, 18)');

## SMT transistor, 4 pins
define(`PKG_SOT89',    `PKG_SMT_TRANSISTOR4X(`$1', `$2', `$3', 31, 31)');
define(`PKG_SOT143',   `PKG_SMT_TRANSISTOR4( `$1', `$2', `$3', 19, 21)');
define(`PKG_SOT223',   `PKG_SMT_TRANSISTOR4X(`$1', `$2', `$3', 46, 62)');
define(`PKG_SC70_4',   `PKG_SMT_TRANSISTOR4( `$1', `$2', `$3', 13, 18)');

## SMT transistor, 5 pins
# aka SOT23-5
define(`PKG_SOT25',    `PKG_SMT_TRANSISTOR5A( `$1', `$2', `$3', 20, 21)');
define(`PKG_SOT353',   `PKG_SMT_TRANSISTOR5A( `$1', `$2', `$3', 13, 18)');
define(`PKG_SC70_5',   `PKG_SMT_TRANSISTOR5A(`$1', `$2', `$3', 13, 18)');
define(`PKG_SC88A',   `PKG_SMT_TRANSISTOR5A(`$1', `$2', `$3', 13, 18)');

## SMT transistor, 6 pins
# aka SOT23-6
define(`PKG_SOT26',    `PKG_SMT_TRANSISTOR6( `$1', `$2', `$3', 20, 21)');
define(`PKG_SOT326',   `PKG_SMT_TRANSISTOR6( `$1', `$2', `$3', 13, 18)');
define(`PKG_SC70_6',   `PKG_SMT_TRANSISTOR6( `$1', `$2', `$3', 13, 18)');

## Pressure transducer
define(`PKG_MPAK',     `COMMON_SMT_TRANSISTORX_MIL(`$1', `$2', `$3', 150, 437, 20, `12345')');

## Mounting holes

# IPC-7251 naming convention:
# MTG + {P=plated, NP=non-plated} + land size + H + hole size + V + #vias + fab level
# Generic Mounting Hole
#
# $1: canonical name
# $2: name on PCB
# $3: value
# $4: drill size [mm / 100]
# $5: pad size [mm / 100]
# $6: 1 = plated, 0 = not plated
# $7: 1 = silk surround, 0 = no silk surround
# $8: 1 = include pad, 0 = just a hole
# $9: 0 = no vias, 4,6,8 = number of vias
# $10: fab level:  "L", "N", "M" for least/nom/most material conditions
# $11: via drill size [mm / 100].  Defaults to 0.5mm

# see tables in http://blogs.mentor.com/tom-hausherr/blog/tag/pcb-mounting-holes/

# 4-40 machine screw, pan head, plated, loose fit (4" boards and larger)
define(`PKG_MTGP610H370V6L', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 370, 610, 1, 1, 1, 6, 1, 50)');
define(`PKG_MTGP610H370V6N', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 370, 610, 1, 1, 1, 6, 2, 50)');
define(`PKG_MTGP610H370V6M', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 370, 610, 1, 1, 1, 6, 3, 50)');

# 4-40 machine screw, pan head, nonplated, loose fit (4" boards and larger)
# FIXME -- non-plated is not quite working yet.  Does PCB support a pad that includes
# the copper but specifies an unplated hole?
#define(`PKG_MTGNP610H370V6L', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 370, 610, 0, 1, 1, 6, 1, 50)');
#define(`PKG_MTGNP610H370V6N', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 370, 610, 0, 1, 1, 6, 2, 50)');
#define(`PKG_MTGNP610H370V6M', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 370, 610, 0, 1, 1, 6, 3, 50)');

# 4-40 machine screw, flat washer, plated, loose fit (4" boards and larger)
define(`PKG_MTGP1010H370V8L', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 370, 1010, 1, 1, 1, 8, 1, 100)');
define(`PKG_MTGP1010H370V8N', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 370, 1010, 1, 1, 1, 8, 2, 100)');
define(`PKG_MTGP1010H370V8M', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 370, 1010, 1, 1, 1, 8, 3, 100)');

# 4-40 machine screw, pan head, plated, tight fit (4" boards and smaller)
define(`PKG_MTGP570H330V6L', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 330, 570, 1, 1, 1, 6, 1, 50)');
define(`PKG_MTGP570H330V6N', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 330, 570, 1, 1, 1, 6, 2, 50)');
define(`PKG_MTGP570H330V6M', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 330, 570, 1, 1, 1, 6, 3, 50)');

# 4-40 machine screw, flat washer, plated, tight fit (4" boards and smaller)
define(`PKG_MTGP970H330V8L', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 330, 970, 1, 1, 1, 8, 1, 100)');
define(`PKG_MTGP970H330V8N', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 330, 970, 1, 1, 1, 8, 2, 100)');
define(`PKG_MTGP970H330V8M', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 330, 970, 1, 1, 1, 8, 3, 100)');

# 6-32 machine screw, pan head, plated, loose fit (4" boards and larger)
define(`PKG_MTGP730H390V6L', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 390, 730, 1, 1, 1, 6, 1, 50)');
define(`PKG_MTGP730H390V6N', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 390, 730, 1, 1, 1, 6, 2, 50)');
define(`PKG_MTGP730H390V6M', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 390, 730, 1, 1, 1, 6, 3, 50)');

# 6-32 machine screw, flat washer, plated, loose fit (4" boards and larger)
define(`PKG_MTGP1200H390V8L', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 390, 1200, 1, 1, 1, 6, 1, 100)');
define(`PKG_MTGP1200H390V8N', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 390, 1200, 1, 1, 1, 6, 2, 100)');
define(`PKG_MTGP1200H390V8M', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 390, 1200, 1, 1, 1, 6, 3, 100)');

# 6-32 machine screw, pan head, plated, tight fit (4" boards and smaller)
define(`PKG_MTGP700H360V6L', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 360, 700, 1, 1, 1, 6, 1, 50)');
define(`PKG_MTGP700H360V6N', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 360, 700, 1, 1, 1, 6, 2, 50)');
define(`PKG_MTGP700H360V6M', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 360, 700, 1, 1, 1, 6, 3, 50)');

# 6-32 machine screw, flat washer, plated, tight fit (4" boards and smaller)
define(`PKG_MTGP1170H360V8L', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 360, 1170, 1, 1, 1, 6, 1, 100)');
define(`PKG_MTGP1170H360V8N', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 360, 1170, 1, 1, 1, 6, 2, 100)');
define(`PKG_MTGP1170H360V8M', `PKG_MTHOLE_GENERIC(`$1', `$2', `$3', 360, 1170, 1, 1, 1, 6, 3, 100)');


# EXTRACT_END