opamp module#

class OpAmpSymbol[source]#

Bases: Symbol

Op-amp triangle with OUT, INp, INn and its Vp and Vn supply pins.

Use it for a single op-amp part, whose supplies belong on the same symbol.

pin_name_size: float | None = 0.7#

Font size of pin name text of Pin objects in this symbol, in grid units. If unset, defers to a parent Symbol, if a parent exists. This can be overriden at the Pin level by setting its pin_name_size attribute.

pad_name_size: float | None = 0.7#

Font size of pad name text of Pin objects in this symbol, in grid units. If unset, defers to a parent Symbol, if a parent exists. This can be overriden at the Pin level by setting its pad_name_size attribute.

OUT = Pin((4, 0), 4, <Direction.Right: 'right'>)#
Vp = Pin((0, 4), 4, <Direction.Up: 'up'>)#
INn = Pin((-4, 2), 4, <Direction.Left: 'left'>)#
INp = Pin((-4, -2), 4, <Direction.Left: 'left'>)#
Vn = Pin((0, -4), 4, <Direction.Down: 'down'>)#
value = Shape[Text]#
reference = Shape[Text]#
art = [Polyline(width=0.2, elements=[(-4, -4), (4, 0), (-4, 4), (-4, -4)]), Polyline(width=0.2, elements=[(0, -2), (0, -4)]), Polyline(width=0.2, elements=[(0, 4), (0, 2)]), Polyline(width=0.2, elements=[(-3.2, -2), (-2, -2)]), Polyline(width=0.2, elements=[(-2.6, -1.4), (-2.6, -2.6)]), Polyline(width=0.2, elements=[(-3.2, 2), (-2, 2)])]#
class OpAmpUnitSymbol[source]#

Bases: Symbol

Op-amp triangle with OUT, INp and INn and no supply pins.

Use it for one amplifier of a multi-amplifier part, with the supplies on a separate unit such as a BoxSymbol.

Create one per amplifier in the component’s __init__, put the supplies on a BoxSymbol, which maps its own pins, and map each amplifier’s ports to its unit with a SymbolMapping. For a quad part whose OUT, INn and INp are lists of four ports and whose Vp and Vn are single ports:

>>> class QuadOpAmp(Component):
...     OUT = [Port() for _ in range(4)]
...     INn = [Port() for _ in range(4)]
...     INp = [Port() for _ in range(4)]
...     Vp = Port()
...     Vn = Port()
...     landpattern = SOIC(num_leads=14).narrow(
...         8.65, span=Toleranced.min_max(5.8, 6.2)
...     )
...
...     def __init__(self):
...         self.amps = [OpAmpUnitSymbol() for _ in range(4)]
...         self.supply = BoxSymbol(
...             columns=Column(up=PinGroup(self.Vp), down=PinGroup(self.Vn))
...         )
...         self.mapping = SymbolMapping(
...             [(self.OUT[i], amp.OUT) for i, amp in enumerate(self.amps)]
...             + [(self.INn[i], amp.INn) for i, amp in enumerate(self.amps)]
...             + [(self.INp[i], amp.INp) for i, amp in enumerate(self.amps)]
...         )

Each port appears in exactly one mapping: each amplifier’s three ports in mapping, and the supplies in the box’s own mapping.

pin_name_size: float | None = 0.7#

Font size of pin name text of Pin objects in this symbol, in grid units. If unset, defers to a parent Symbol, if a parent exists. This can be overriden at the Pin level by setting its pin_name_size attribute.

pad_name_size: float | None = 0.7#

Font size of pad name text of Pin objects in this symbol, in grid units. If unset, defers to a parent Symbol, if a parent exists. This can be overriden at the Pin level by setting its pad_name_size attribute.

OUT = Pin((4, 0), 4, <Direction.Right: 'right'>)#
INn = Pin((-4, 2), 4, <Direction.Left: 'left'>)#
INp = Pin((-4, -2), 4, <Direction.Left: 'left'>)#
value = Shape[Text]#
reference = Shape[Text]#
art = [Polyline(width=0.2, elements=[(-4, -4), (4, 0), (-4, 4), (-4, -4)]), Polyline(width=0.2, elements=[(-3.2, -2), (-2, -2)]), Polyline(width=0.2, elements=[(-2.6, -1.4), (-2.6, -2.6)]), Polyline(width=0.2, elements=[(-3.2, 2), (-2, 2)])]#