Exemplo n.º 1
0
from kidraw.schematic import library as slib
from kidraw.footprint import library as flib

l = kidraw.Library('parts')
l.devices = [
    kidraw.Device(slib.vcc('+3.3V')),
    kidraw.Device(slib.vcc('+5V')),
    kidraw.Device(slib.vcc('Line')),
    kidraw.Device(slib.gnd('GND')),
    kidraw.Device(slib.gnd('LGND')),
    kidraw.Device(slib.power_flag()),
    kidraw.Device(slib.resistor(),
                  [flib.chip(flib.imperial('0603'))]),
    kidraw.Device(slib.capacitor(),
                  [flib.chip(flib.imperial('0603'))]),
    kidraw.Device(slib.led(),
                  [flib.chip(flib.imperial('0603'), polarized=True)]),
    kidraw.Device(slib.test_point(), [flib.test_point(1)]),
]

s = sch.Schematic('Si1869DH', description='Load Switch with Level Shift')
with sch.ICBuilder(s, 6) as ic:
    ic.side(sch.Pin.Left)
    ic.pin(4, name='Vin', type=sch.Pin.Passive)
    ic.pin(5, name='SW', type=sch.Pin.Input)
    ic.side(sch.Pin.Right)
    ic.pin([2, 3], name='Vout', type=sch.Pin.Passive)
    ic.pin(1, name='Slew', type=sch.Pin.Passive)
    ic.side(sch.Pin.Up)
    ic.pin(6, name='Bias', type=sch.Pin.Passive)
l.devices.append(kidraw.Device(s, [flib.SC70(6)]))
Exemplo n.º 2
0
            flib.chip(flib.imperial('0603')),
            flib.chip(flib.imperial('1206')),
        ]),
    kidraw.Device(
        schematic=slib.capacitor(polarized=True),
        footprints=[
            flib.chip(flib.imperial('0805'), polarized=True),
            flib.chip(flib.imperial('1206'), polarized=True),
        ]),
    kidraw.Device(
        schematic=slib.inductor(),
        footprints=[
            flib.chip(flib.imperial('1206')),
        ]),
    kidraw.Device(
        schematic=slib.led(),
        footprints=[
            flib.chip(flib.imperial('1206')),
        ]),
]

s = sch.Schematic(name='STM32F042K6T6',
                  description='ARM Cortex M0 microcontroller')
with sch.ICBuilder(s, 32, pin_len=300) as ic:
    ic.side(sch.Pin.Left)
    ic.pin([1, 5, 17], name='VDD', type=sch.Pin.Power)
    ic.gap(1)
    ic.pin(4, name='~RST', type=sch.Pin.Input)
    ic.pin(31, name='BOOT', type=sch.Pin.Input)
    ic.gap(1)
    ic.pin(21, name='USB_D-', type=sch.Pin.Bidirectional)