circuits/audio_chain.py wires stages 1/1b/2/3/4 with shared nets and deduplicated parts: ONE OPA1612 (U4) does both the Stage-2 filter (A) and Stage-3 summer (B); ONE ULN2003 (U6) drives all three relays (K1 select, K2 mute, K3 ground-lift). 54 components, ERC 0 errors, netlist 0 errors. Per-stage files remain as the documented, individually-simulated building blocks. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
106 lines
No EOL
8.1 KiB
Python
106 lines
No EOL
8.1 KiB
Python
from collections import defaultdict
|
|
from skidl import Pin, Part, Alias, SchLib, SKIDL, TEMPLATE
|
|
|
|
from skidl.pin import pin_types
|
|
|
|
SKIDL_lib_version = '0.0.1'
|
|
|
|
audio_chain = SchLib(tool=SKIDL).add_parts(*[
|
|
Part(**{ 'name':'THAT1240', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'THAT1240'}), 'ref_prefix':'U', 'fplist':None, 'footprint':'Package_SO:SOIC-8_3.9x4.9mm_P1.27mm', 'keywords':None, 'description':'', 'datasheet':None, 'pins':[
|
|
Pin(num='1',name='REF',func=pin_types.INPUT),
|
|
Pin(num='2',name='IN-',func=pin_types.INPUT),
|
|
Pin(num='3',name='IN+',func=pin_types.INPUT),
|
|
Pin(num='4',name='V-',func=pin_types.PWRIN),
|
|
Pin(num='5',name='SENSE',func=pin_types.PASSIVE),
|
|
Pin(num='6',name='OUT',func=pin_types.OUTPUT),
|
|
Pin(num='7',name='V+',func=pin_types.PWRIN),
|
|
Pin(num='8',name='NC',func=pin_types.NOCONNECT)] }),
|
|
Part(**{ 'name':'OPA1641', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'OPA1641'}), 'ref_prefix':'U', 'fplist':None, 'footprint':'Package_SO:SOIC-8_3.9x4.9mm_P1.27mm', 'keywords':None, 'description':'', 'datasheet':None, 'pins':[
|
|
Pin(num='1',name='NC1',func=pin_types.NOCONNECT),
|
|
Pin(num='2',name='-IN',func=pin_types.INPUT),
|
|
Pin(num='3',name='+IN',func=pin_types.INPUT),
|
|
Pin(num='4',name='V-',func=pin_types.PWRIN),
|
|
Pin(num='5',name='NC5',func=pin_types.NOCONNECT),
|
|
Pin(num='6',name='OUT',func=pin_types.OUTPUT),
|
|
Pin(num='7',name='V+',func=pin_types.PWRIN),
|
|
Pin(num='8',name='NC8',func=pin_types.NOCONNECT)] }),
|
|
Part(**{ 'name':'PCM5102A', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'PCM5102A'}), 'ref_prefix':'U', 'fplist':None, 'footprint':'Package_SO:TSSOP-20_4.4x6.5mm_P0.65mm', 'keywords':None, 'description':'', 'datasheet':None, 'pins':[
|
|
Pin(num='1',name='CPVDD',func=pin_types.PWRIN),
|
|
Pin(num='2',name='CAPP',func=pin_types.PASSIVE),
|
|
Pin(num='3',name='CPGND',func=pin_types.PWRIN),
|
|
Pin(num='4',name='CAPM',func=pin_types.PASSIVE),
|
|
Pin(num='5',name='VNEG',func=pin_types.PASSIVE),
|
|
Pin(num='6',name='OUTL',func=pin_types.OUTPUT),
|
|
Pin(num='7',name='OUTR',func=pin_types.OUTPUT),
|
|
Pin(num='8',name='AVDD',func=pin_types.PWRIN),
|
|
Pin(num='9',name='AGND',func=pin_types.PWRIN),
|
|
Pin(num='10',name='DEMP',func=pin_types.INPUT),
|
|
Pin(num='11',name='FLT',func=pin_types.INPUT),
|
|
Pin(num='12',name='SCK',func=pin_types.INPUT),
|
|
Pin(num='13',name='BCK',func=pin_types.INPUT),
|
|
Pin(num='14',name='DIN',func=pin_types.INPUT),
|
|
Pin(num='15',name='LRCK',func=pin_types.INPUT),
|
|
Pin(num='16',name='FMT',func=pin_types.INPUT),
|
|
Pin(num='17',name='XSMT',func=pin_types.INPUT),
|
|
Pin(num='18',name='LDOO',func=pin_types.PWROUT),
|
|
Pin(num='19',name='DGND',func=pin_types.PWRIN),
|
|
Pin(num='20',name='DVDD',func=pin_types.PWRIN)] }),
|
|
Part(**{ 'name':'OPA1612', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'OPA1612'}), 'ref_prefix':'U', 'fplist':None, 'footprint':'Package_SO:SOIC-8_3.9x4.9mm_P1.27mm', 'keywords':None, 'description':'', 'datasheet':None, 'pins':[
|
|
Pin(num='1',name='OUTA',func=pin_types.OUTPUT),
|
|
Pin(num='2',name='-INA',func=pin_types.INPUT),
|
|
Pin(num='3',name='+INA',func=pin_types.INPUT),
|
|
Pin(num='4',name='V-',func=pin_types.PWRIN),
|
|
Pin(num='5',name='+INB',func=pin_types.INPUT),
|
|
Pin(num='6',name='-INB',func=pin_types.INPUT),
|
|
Pin(num='7',name='OUTB',func=pin_types.OUTPUT),
|
|
Pin(num='8',name='V+',func=pin_types.PWRIN)] }),
|
|
Part(**{ 'name':'THAT1646', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'THAT1646'}), 'ref_prefix':'U', 'fplist':None, 'footprint':'Package_SO:SOIC-8_3.9x4.9mm_P1.27mm', 'keywords':None, 'description':'', 'datasheet':None, 'pins':[
|
|
Pin(num='1',name='OUT-',func=pin_types.OUTPUT),
|
|
Pin(num='2',name='SNS-',func=pin_types.INPUT),
|
|
Pin(num='3',name='GND',func=pin_types.PWRIN),
|
|
Pin(num='4',name='IN',func=pin_types.INPUT),
|
|
Pin(num='5',name='V-',func=pin_types.PWRIN),
|
|
Pin(num='6',name='V+',func=pin_types.PWRIN),
|
|
Pin(num='7',name='SNS+',func=pin_types.INPUT),
|
|
Pin(num='8',name='OUT+',func=pin_types.OUTPUT)] }),
|
|
Part(**{ 'name':'ULN2003A', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'ULN2003A'}), 'ref_prefix':'U', 'fplist':None, 'footprint':'Package_SO:SOIC-16_3.9x9.9mm_P1.27mm', 'keywords':None, 'description':'', 'datasheet':None, 'pins':[
|
|
Pin(num='1',name='1B',func=pin_types.INPUT),
|
|
Pin(num='2',name='2B',func=pin_types.INPUT),
|
|
Pin(num='3',name='3B',func=pin_types.INPUT),
|
|
Pin(num='4',name='4B',func=pin_types.INPUT),
|
|
Pin(num='5',name='5B',func=pin_types.INPUT),
|
|
Pin(num='6',name='6B',func=pin_types.INPUT),
|
|
Pin(num='7',name='7B',func=pin_types.INPUT),
|
|
Pin(num='8',name='GND',func=pin_types.PWRIN),
|
|
Pin(num='9',name='COM',func=pin_types.PWRIN),
|
|
Pin(num='10',name='7C',func=pin_types.OPENCOLL),
|
|
Pin(num='11',name='6C',func=pin_types.OPENCOLL),
|
|
Pin(num='12',name='5C',func=pin_types.OPENCOLL),
|
|
Pin(num='13',name='4C',func=pin_types.OPENCOLL),
|
|
Pin(num='14',name='3C',func=pin_types.OPENCOLL),
|
|
Pin(num='15',name='2C',func=pin_types.OPENCOLL),
|
|
Pin(num='16',name='1C',func=pin_types.OPENCOLL)] }),
|
|
Part(**{ 'name':'TQ2SA-5V', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'TQ2SA-5V'}), 'ref_prefix':'K', 'fplist':None, 'footprint':'Relay_SMD:Relay_DPDT_Panasonic_TQ2-SA', 'keywords':None, 'description':'', 'datasheet':None, 'pins':[
|
|
Pin(num='1',name='COIL_A',func=pin_types.PASSIVE),
|
|
Pin(num='10',name='COIL_B',func=pin_types.PASSIVE),
|
|
Pin(num='3',name='P1_COM',func=pin_types.PASSIVE),
|
|
Pin(num='4',name='P1_NC',func=pin_types.PASSIVE),
|
|
Pin(num='2',name='P1_NO',func=pin_types.PASSIVE),
|
|
Pin(num='8',name='P2_COM',func=pin_types.PASSIVE),
|
|
Pin(num='7',name='P2_NC',func=pin_types.PASSIVE),
|
|
Pin(num='9',name='P2_NO',func=pin_types.PASSIVE),
|
|
Pin(num='5',name='NC5',func=pin_types.NOCONNECT),
|
|
Pin(num='6',name='NC6',func=pin_types.NOCONNECT)] }),
|
|
Part(**{ 'name':'C', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'C'}), 'ref_prefix':'C', 'fplist':[''], 'footprint':'Capacitor_SMD:C_1206_3216Metric', 'keywords':'cap capacitor', 'description':'Unpolarized capacitor', 'datasheet':'~', 'pins':[
|
|
Pin(num='1',name='~',func=pin_types.PASSIVE,unit=1),
|
|
Pin(num='2',name='~',func=pin_types.PASSIVE,unit=1)], 'unit_defs':[] }),
|
|
Part(**{ 'name':'R', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'R'}), 'ref_prefix':'R', 'fplist':[''], 'footprint':'Resistor_SMD:R_0805_2012Metric', 'keywords':'R res resistor', 'description':'Resistor', 'datasheet':'~', 'pins':[
|
|
Pin(num='1',name='~',func=pin_types.PASSIVE,unit=1),
|
|
Pin(num='2',name='~',func=pin_types.PASSIVE,unit=1)], 'unit_defs':[] }),
|
|
Part(**{ 'name':'D', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'D'}), 'ref_prefix':'D', 'fplist':[''], 'footprint':'Diode_SMD:D_SOD-323', 'keywords':'diode', 'description':'Diode', 'datasheet':'~', 'pins':[
|
|
Pin(num='1',name='K',func=pin_types.PASSIVE,unit=1),
|
|
Pin(num='2',name='A',func=pin_types.PASSIVE,unit=1)], 'unit_defs':[] }),
|
|
Part(**{ 'name':'R_Potentiometer', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'R_Potentiometer'}), 'ref_prefix':'RV', 'fplist':[''], 'footprint':'Potentiometer_THT:Potentiometer_Bourns_3296W_Vertical', 'keywords':'resistor variable', 'description':'Potentiometer', 'datasheet':'~', 'pins':[
|
|
Pin(num='1',name='1',func=pin_types.PASSIVE,unit=1),
|
|
Pin(num='3',name='3',func=pin_types.PASSIVE,unit=1),
|
|
Pin(num='2',name='2',func=pin_types.PASSIVE,unit=1)], 'unit_defs':[] })]) |