from jitx import PadMapping
from jitx.anchor import Anchor
from jitx.component import Component
from jitx.landpattern import Landpattern, Pad
from jitx.layerindex import Side
from jitx.net import Port
from jitx.shapes.composites import rectangle
from jitx.shapes.primitive import Polyline, Text
from jitx.feature import Finish, Paste, Silkscreen, Soldermask
from jitx.symbol import Direction, Pin, Symbol
[docs]
class RectSMDPad(Pad):
rect = rectangle(0.6, 0.6)
shape = rect
layer = Paste(rect)
layer = Soldermask(rect)
[docs]
class SOT23_3L(Landpattern):
p1 = RectSMDPad().at(-0.95, 0, on=Side.Top)
p2 = RectSMDPad().at(0, 0, on=Side.Top)
p3 = RectSMDPad().at(0.95, 0, on=Side.Top)
ref_text = Silkscreen(Text(">REF", 1.0, Anchor.C).at(0.0, 1.5))
value_text = Finish(Text(">VALUE", 1.0, Anchor.C).at(0.0, -1.5))
# SOT-23 package outline
silk_lines = [
Silkscreen(Polyline(0.1, [(-1.4, -0.6), (1.4, -0.6)])),
Silkscreen(Polyline(0.1, [(1.4, -0.6), (1.4, 0.6)])),
Silkscreen(Polyline(0.1, [(1.4, 0.6), (-1.4, 0.6)])),
Silkscreen(Polyline(0.1, [(-1.4, 0.6), (-1.4, -0.6)])),
]
[docs]
class AO3401A_Symbol(Symbol):
pin_name_size = 0.6
pad_name_size = 0.6
# P-channel MOSFET symbol
g = Pin(at=(-2, 0), direction=Direction.Left, length=1) # Gate
s = Pin(at=(0, -1), direction=Direction.Down, length=1) # Source
d = Pin(at=(0, 1), direction=Direction.Up, length=1) # Drain
ref_text = Text(">REF", 1.0, Anchor.C).at(0.0, 2.5)
value_text = Text(">VALUE", 1.0, Anchor.C).at(0.0, -2.5)
# MOSFET symbol elements
# Channel line
channel_line = Polyline(0.1, [(-0.5, -0.5), (0.5, -0.5)])
# Gate line
gate_line = Polyline(0.1, [(-1, 0), (-0.5, 0)])
# Drain and source lines
drain_line = Polyline(0.1, [(0, 0.5), (0, 1.5)])
source_line = Polyline(0.1, [(0, -0.5), (0, -1.5)])
# P-channel indicator (arrow pointing toward gate)
p_channel_arrow = Polyline(
0.1, [(-0.3, -0.3), (-0.1, -0.5), (-0.3, -0.7), (-0.3, -0.3)]
)
[docs]
class AO3401A(Component):
"""30V 4A 44mΩ@10V,4.3A 1.4W 1.3V@250uA P Channel SOT-23-3L MOSFETs ROHS"""
manufacturer = "Alpha & Omega Semicon"
mpn = "AO3401A"
reference_designator_prefix = "Q"
g = Port() # Gate
d = Port() # Drain
s = Port() # Source
landpattern = SOT23_3L()
symbol = AO3401A_Symbol()
# Pin mappings based on the original Stanza file
mappings = [
PadMapping(
{
g: [landpattern.p1], # Gate to pin 1
s: [landpattern.p2], # Source to pin 2
d: [landpattern.p3], # Drain to pin 3
}
),
]
Device: type[AO3401A] = AO3401A