Small Parts¶
JellyBean¶
-
class
pcbdl.small_parts.
JellyBean
(value=None, refdes=None, package=None, part_number=None, populated=True, reversed=False, to=None)[source]¶ Bases:
pcbdl.base.Part
2 pin Jelly Bean components (this includes
Resistors
andCapacitors
).The main attraction to subclass this is because of the
to=
argument, it’s very easy to chain connections with such a part because its pins are pretty flexible therefore easy tochoose automatically. The use of this class is to allow quick connections of 2 pin devices (both pins at the same time).One way to do this is the
to=
argument, allows to connect the SECONDARY pin (usually in the same expression) easily without having to save the JellyBean part to a variable first:supply >> IC.VCC << C("100nF", to=gnd) # note how decoupling cap is fully connected
The other way these types of parts are cool and unique is the
^ operator
; it allows us to describe series connections through Jellybean components. Here’s an example with a resistor divider:some_net ^ R("1k") ^ attenuated_net ^ R("1k") ^ gnd
-
PINS
= [('P1', '1'), ('P2', '2')]¶
-
UNITS
= ''¶
-
__rxor__
(left_net)[source]¶ Implements
left_net ^ jellybean
. Connects the left_net to the PRIMARY pin, then returns the JellyBean part so it can keep chaining.Note
This is similar to
left_net << JellyBean()
, but with the slight difference in how it can chain.
-
Test Point¶
Predefined Parts¶
Using the previous simple classes a ton of predefined parts are available:
-
class
pcbdl.small_parts.
R
(value=None, refdes=None, package=None, part_number=None, populated=True, reversed=False, to=None)[source]¶ Bases:
pcbdl.small_parts.JellyBean
Resistor
-
REFDES_PREFIX
= 'R'¶
-
UNITS
= 'Ω'¶
-
-
class
pcbdl.small_parts.
C
(value=None, refdes=None, package=None, part_number=None, populated=True, reversed=False, to=None)[source]¶ Bases:
pcbdl.small_parts.JellyBean
Capacitor
-
REFDES_PREFIX
= 'C'¶
-
UNITS
= 'F'¶
-
-
class
pcbdl.small_parts.
C_POL
(value=None, refdes=None, package=None, part_number=None, populated=True, reversed=False, to=None)[source]¶ Bases:
pcbdl.small_parts.C
Polarized Capacitor
-
PINS
= [('+', 'P', 'PLUS', 'P2'), ('-', 'M', 'MINUS', 'P1')]¶
-
-
class
pcbdl.small_parts.
L
(value=None, refdes=None, package=None, part_number=None, populated=True, reversed=False, to=None)[source]¶ Bases:
pcbdl.small_parts.JellyBean
Inductor
-
REFDES_PREFIX
= 'L'¶
-
UNITS
= 'H'¶
-
-
class
pcbdl.small_parts.
D
(value=None, refdes=None, package=None, part_number=None, populated=True, reversed=False, to=None)[source]¶ Bases:
pcbdl.small_parts.JellyBean
Diode
-
REFDES_PREFIX
= 'D'¶
-
PINS
= [('A', 'ANODE', 'P1'), ('K', 'CATHODE', 'KATHODE', 'P2')]¶
-
-
class
pcbdl.small_parts.
LED
(value=None, refdes=None, package=None, part_number=None, populated=True, reversed=False, to=None)[source]¶ Bases:
pcbdl.small_parts.D
Light Emitting Diode
-
REFDES_PREFIX
= 'LED'¶
-
PINS
= [('A', '+'), ('K', '-')]¶
-