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'

Interface_Telecom = SchLib(tool=SKIDL).add_parts(*[
        Part(**{ 'name':'FX614', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'FX614'}), 'ref_prefix':'U', 'fplist':[''], 'footprint':'', 'keywords':'Bell Modem', 'description':'', 'datasheet':'https://www.cmlmicro.com/wp-content/uploads/2017/06/FX614_ds.pdf', 'search_text':'/usr/share/kicad/symbols/Interface_Telecom.kicad_sym\nFX614\n\nBell Modem', 'pins':[
            Pin(num='1',name='XTALN',func=pin_types.OUTPUT,unit=1),
            Pin(num='10',name='RXEQ',func=pin_types.INPUT,unit=1),
            Pin(num='11',name='TXD',func=pin_types.INPUT,unit=1),
            Pin(num='12',name='CLK',func=pin_types.INPUT,unit=1),
            Pin(num='13',name='RXD',func=pin_types.OUTPUT,unit=1),
            Pin(num='14',name='DET',func=pin_types.OUTPUT,unit=1),
            Pin(num='15',name='~{RDYN}',func=pin_types.OUTPUT,unit=1),
            Pin(num='16',name='VDD',func=pin_types.PWRIN,unit=1),
            Pin(num='2',name='XTAL/CLK',func=pin_types.INPUT,unit=1),
            Pin(num='3',name='M0',func=pin_types.INPUT,unit=1),
            Pin(num='4',name='M1',func=pin_types.INPUT,unit=1),
            Pin(num='5',name='RXIN',func=pin_types.INPUT,unit=1),
            Pin(num='6',name='RXFB',func=pin_types.OUTPUT,unit=1),
            Pin(num='7',name='TXOP',func=pin_types.OUTPUT,unit=1),
            Pin(num='8',name='VSS',func=pin_types.PWRIN,unit=1),
            Pin(num='9',name='VBIAS',func=pin_types.PASSIVE,unit=1)], 'unit_defs':[] }),
        Part(**{ 'name':'HT9170D', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'HT9170D'}), 'ref_prefix':'U', 'fplist':['Package_SO:SOIC-18W_7.5x11.6mm_P1.27mm'], 'footprint':'Package_SO:SOIC-18W_7.5x11.6mm_P1.27mm', 'keywords':'DTMF Receiver', 'description':'', 'datasheet':'http://www.holtek.com/documents/10179/116711/9170v111.pdf', 'search_text':'/usr/share/kicad/symbols/Interface_Telecom.kicad_sym\nHT9170D\n\nDTMF Receiver', 'pins':[
            Pin(num='1',name='VP',func=pin_types.INPUT,unit=1),
            Pin(num='10',name='OE',func=pin_types.INPUT,unit=1),
            Pin(num='11',name='D0',func=pin_types.TRISTATE,unit=1),
            Pin(num='12',name='D1',func=pin_types.TRISTATE,unit=1),
            Pin(num='13',name='D2',func=pin_types.TRISTATE,unit=1),
            Pin(num='14',name='D3',func=pin_types.TRISTATE,unit=1),
            Pin(num='15',name='DV',func=pin_types.OUTPUT,unit=1),
            Pin(num='16',name='EST',func=pin_types.OUTPUT,unit=1),
            Pin(num='17',name='RT/GT',func=pin_types.BIDIR,unit=1),
            Pin(num='18',name='VDD',func=pin_types.PWRIN,unit=1),
            Pin(num='2',name='VN',func=pin_types.INPUT,unit=1),
            Pin(num='3',name='GS',func=pin_types.OUTPUT,unit=1),
            Pin(num='4',name='VREF',func=pin_types.PWROUT,unit=1),
            Pin(num='5',name='INH',func=pin_types.INPUT,unit=1),
            Pin(num='6',name='PWDN',func=pin_types.INPUT,unit=1),
            Pin(num='7',name='X1',func=pin_types.INPUT,unit=1),
            Pin(num='8',name='X2',func=pin_types.OUTPUT,unit=1),
            Pin(num='9',name='VSS',func=pin_types.PWRIN,unit=1)], 'unit_defs':[] }),
        Part(**{ 'name':'Si3210', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'Si3210'}), 'ref_prefix':'U', 'fplist':['Package_SO:TSSOP-38_4.4x9.7mm_P0.5mm'], 'footprint':'Package_SO:TSSOP-38_4.4x9.7mm_P0.5mm', 'keywords':'ProSLIC slic', 'description':'', 'datasheet':'http://www.mouser.com/ds/2/368/si3210-38974.pdf', 'search_text':'/usr/share/kicad/symbols/Interface_Telecom.kicad_sym\nSi3210\n\nProSLIC slic', 'pins':[
            Pin(num='1',name='~{CS}',func=pin_types.INPUT,unit=1),
            Pin(num='10',name='VDDA1',func=pin_types.PWRIN,unit=1),
            Pin(num='11',name='IREF',func=pin_types.OUTPUT,unit=1),
            Pin(num='12',name='CAPP',func=pin_types.OUTPUT,unit=1),
            Pin(num='13',name='QGND',func=pin_types.PWRIN,unit=1),
            Pin(num='14',name='CAPM',func=pin_types.OUTPUT,unit=1),
            Pin(num='15',name='STIPDC',func=pin_types.INPUT,unit=1),
            Pin(num='16',name='SRINGDC',func=pin_types.INPUT,unit=1),
            Pin(num='17',name='STIPE',func=pin_types.INPUT,unit=1),
            Pin(num='18',name='SVBAT',func=pin_types.INPUT,unit=1),
            Pin(num='19',name='SRINGE',func=pin_types.INPUT,unit=1),
            Pin(num='2',name='~{INT}',func=pin_types.OUTPUT,unit=1),
            Pin(num='20',name='STIPAC',func=pin_types.INPUT,unit=1),
            Pin(num='21',name='SRINGAC',func=pin_types.INPUT,unit=1),
            Pin(num='22',name='IGMN',func=pin_types.OUTPUT,unit=1),
            Pin(num='23',name='GNDA',func=pin_types.PWRIN,unit=1),
            Pin(num='24',name='IGMP',func=pin_types.OUTPUT,unit=1),
            Pin(num='25',name='IRINGN',func=pin_types.INPUT,unit=1),
            Pin(num='26',name='IRINGP',func=pin_types.INPUT,unit=1),
            Pin(num='27',name='VDDA2',func=pin_types.PWRIN,unit=1),
            Pin(num='28',name='ITIPP',func=pin_types.INPUT,unit=1),
            Pin(num='29',name='ITIPN',func=pin_types.INPUT,unit=1),
            Pin(num='3',name='PCLK',func=pin_types.INPUT,unit=1),
            Pin(num='30',name='VDDD',func=pin_types.PWRIN,unit=1),
            Pin(num='31',name='GNDD',func=pin_types.PWRIN,unit=1),
            Pin(num='32',name='TEST',func=pin_types.INPUT,unit=1),
            Pin(num='33',name='DCFF',func=pin_types.OUTPUT,unit=1),
            Pin(num='34',name='DCDRV',func=pin_types.OUTPUT,unit=1),
            Pin(num='35',name='SDITHRU',func=pin_types.OUTPUT,unit=1),
            Pin(num='36',name='SDO',func=pin_types.OUTPUT,unit=1),
            Pin(num='37',name='SDI',func=pin_types.INPUT,unit=1),
            Pin(num='38',name='SCLK',func=pin_types.INPUT,unit=1),
            Pin(num='4',name='DRX',func=pin_types.INPUT,unit=1),
            Pin(num='5',name='DTX',func=pin_types.OUTPUT,unit=1),
            Pin(num='6',name='FSYNC',func=pin_types.INPUT,unit=1),
            Pin(num='7',name='~{RESET}',func=pin_types.INPUT,unit=1),
            Pin(num='8',name='SDCH',func=pin_types.OUTPUT,unit=1),
            Pin(num='9',name='SDCL',func=pin_types.OUTPUT,unit=1)], 'unit_defs':[] })])