2 # Copyright 2011 by Bdale Garbee <bdale@gag.com>. GPLv2
4 # Program to emit PCB footprint for Rayson BTM-182 Bluetooth module
7 # dimensions in mm from BTM182\ DataSheet.pdf
16 RowSpacing = RowCenters - PinHeight
24 # we're going to use the 1/100 of a mil fundamental unit form
26 return int( mm / 25.4 * 1000.0 * 100.0 + 0.5 )
28 print '# author: Bdale Garbee'
29 print '# email: bdale@gag.com'
30 print '# dist-license: GPL 2'
31 print '# use-license: unlimited'
33 print 'Element[0x0 "BTM182" "" "" 0 0 -10161 -12011 0 100 0x0]'
35 for pin in range (0,15):
37 mm2mils100((pin-7) * PinSpacing), \
38 mm2mils100(-(RowSpacing/2 + PinWidth/2)), \
39 mm2mils100((pin-7) * PinSpacing), \
40 mm2mils100(-(RowSpacing/2 + PinHeight - PinWidth/2)), \
41 mm2mils100(PinWidth), \
42 mm2mils100(PinSpacing - PinWidth), \
43 mm2mils100(PinWidth)+600, \
44 '"pin%i"' % (30 - pin), '"%i"' % (30 - pin), '0x0100]'
47 mm2mils100((pin-7) * PinSpacing), \
48 mm2mils100(RowSpacing/2 + PinWidth/2), \
49 mm2mils100((pin-7) * PinSpacing), \
50 mm2mils100(RowSpacing/2 + PinHeight - PinWidth/2), \
51 mm2mils100(PinWidth), \
52 mm2mils100(PinSpacing - PinWidth), \
53 mm2mils100(PinWidth)+600, \
54 '"pin%i"' % (1 + pin), '"%i"' % (1 + pin), '0x0100]'
57 mm2mils100(-(9.44+SmallPinWidth/2-SmallPinHeight)), \
58 mm2mils100(RowCenters/2 - 2.96), \
59 mm2mils100(-(9.44-SmallPinWidth/2+SmallPinHeight)), \
60 mm2mils100(RowCenters/2 - 2.96), \
61 mm2mils100(SmallPinHeight), \
62 mm2mils100(PinSpacing - PinWidth), \
63 mm2mils100(SmallPinHeight)+600, \
64 '"pin%i"' % 31, '"%i"' % 31, '0x0100]'
67 mm2mils100(-(9.44+SmallPinWidth/2-SmallPinHeight)), \
68 mm2mils100(RowCenters/2 - 1.69), \
69 mm2mils100(-(9.44-SmallPinWidth/2+SmallPinHeight)), \
70 mm2mils100(RowCenters/2 - 1.69), \
71 mm2mils100(SmallPinHeight), \
72 mm2mils100(PinSpacing - PinWidth), \
73 mm2mils100(SmallPinHeight)+600, \
74 '"pin%i"' % 32, '"%i"' % 32, '0x0100]'
76 print ' ElementLine[',\
77 mm2mils100(-BodyHeight/2-BodyOffset), \
78 mm2mils100(-BodyWidth/2), \
79 mm2mils100(-BodyHeight/2-BodyOffset), \
80 mm2mils100( BodyWidth/2), \
83 print ' ElementLine[',\
84 mm2mils100(-BodyHeight/2-BodyOffset), \
85 mm2mils100( BodyWidth/2), \
86 mm2mils100(-BodyHeight/2-BodyOffset+5.13), \
87 mm2mils100( BodyWidth/2), \
90 print ' ElementLine[',\
91 mm2mils100(-BodyHeight/2-BodyOffset+5.13), \
92 mm2mils100( BodyWidth/2), \
93 mm2mils100(-BodyHeight/2-BodyOffset+5.13), \
94 mm2mils100( BodyWidth/2-3.595), \
97 print ' ElementLine[',\
98 mm2mils100(-BodyHeight/2-BodyOffset+5.13), \
99 mm2mils100( BodyWidth/2-3.595), \
100 mm2mils100(-BodyHeight/2-BodyOffset+5.13+0.76), \
101 mm2mils100( BodyWidth/2-3.595), \
104 print ' ElementLine[',\
105 mm2mils100(-BodyHeight/2-BodyOffset+5.13+0.76), \
106 mm2mils100( BodyWidth/2), \
107 mm2mils100(-BodyHeight/2-BodyOffset+5.13+0.76), \
108 mm2mils100( BodyWidth/2-3.595), \
111 print ' ElementLine[',\
112 mm2mils100(-BodyHeight/2-BodyOffset+5.13+0.76), \
113 mm2mils100( BodyWidth/2), \
114 mm2mils100( BodyHeight/2-BodyOffset), \
115 mm2mils100( BodyWidth/2), \
118 print ' ElementLine[',\
119 mm2mils100( BodyHeight/2-BodyOffset), \
120 mm2mils100( BodyWidth/2), \
121 mm2mils100( BodyHeight/2-BodyOffset), \
122 mm2mils100(-BodyWidth/2), \
125 print ' ElementLine[',\
126 mm2mils100( BodyHeight/2-BodyOffset), \
127 mm2mils100(-BodyWidth/2), \
128 mm2mils100(-BodyHeight/2-BodyOffset), \
129 mm2mils100(-BodyWidth/2), \
132 print ' ElementArc[',\
133 mm2mils100(-7 * PinSpacing), \
134 mm2mils100(RowSpacing/2-PinHeight/6), \
135 '500 500 0 360 1000 ]'