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'

MCU_NXP_HC12 = SchLib(tool=SKIDL).add_parts(*[
        Part(**{ 'name':'MC68HC812A4', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'MC68HC812A4'}), 'ref_prefix':'U', 'fplist':[''], 'footprint':'', 'keywords':'68HC12 Microcontroller', 'description':'', 'datasheet':'', 'search_text':'/usr/share/kicad/symbols/MCU_NXP_HC12.kicad_sym\nMC68HC812A4\n\n68HC12 Microcontroller', 'pins':[
            Pin(num='1',name='VSSX',func=pin_types.PWRIN,unit=1),
            Pin(num='10',name='PJ7/KWUJ7',func=pin_types.BIDIR,unit=1),
            Pin(num='100',name='PS3/TXD1',func=pin_types.BIDIR,unit=1),
            Pin(num='101',name='PS4/SDI/MISO',func=pin_types.BIDIR,unit=1),
            Pin(num='102',name='PS5/SDO/MOSI',func=pin_types.BIDIR,unit=1),
            Pin(num='103',name='PS6/SCK',func=pin_types.BIDIR,unit=1),
            Pin(num='104',name='PS7/SS',func=pin_types.BIDIR,unit=1),
            Pin(num='105',name='PT0/IOC0',func=pin_types.BIDIR,unit=1),
            Pin(num='106',name='PT1/IOC1',func=pin_types.BIDIR,unit=1),
            Pin(num='107',name='PT2/IOC2',func=pin_types.BIDIR,unit=1),
            Pin(num='108',name='PT3/IOC3',func=pin_types.BIDIR,unit=1),
            Pin(num='109',name='PT4/IOC4',func=pin_types.BIDIR,unit=1),
            Pin(num='11',name='PG0/A16',func=pin_types.BIDIR,unit=1),
            Pin(num='110',name='PT5/IOC5',func=pin_types.BIDIR,unit=1),
            Pin(num='111',name='PT6/IOC6',func=pin_types.BIDIR,unit=1),
            Pin(num='112',name='PT7/IOC7/PAI',func=pin_types.BIDIR,unit=1),
            Pin(num='12',name='PG1/A17',func=pin_types.BIDIR,unit=1),
            Pin(num='13',name='PG2/A18',func=pin_types.BIDIR,unit=1),
            Pin(num='14',name='VDD',func=pin_types.PWRIN,unit=1),
            Pin(num='15',name='VSS',func=pin_types.PWRIN,unit=1),
            Pin(num='16',name='PG3/A19',func=pin_types.BIDIR,unit=1),
            Pin(num='17',name='PG4/A20',func=pin_types.BIDIR,unit=1),
            Pin(num='18',name='PG5/A21',func=pin_types.BIDIR,unit=1),
            Pin(num='19',name='BKGD/TAGHI',func=pin_types.BIDIR,unit=1),
            Pin(num='2',name='VDDX',func=pin_types.PWRIN,unit=1),
            Pin(num='20',name='PD0/D0/KWUD0',func=pin_types.BIDIR,unit=1),
            Pin(num='21',name='PD1/D1/KWUD1',func=pin_types.BIDIR,unit=1),
            Pin(num='22',name='PD2/D2/KWUD2',func=pin_types.BIDIR,unit=1),
            Pin(num='23',name='PD3/D3/KWUD3',func=pin_types.BIDIR,unit=1),
            Pin(num='24',name='PD4/D4/KWUD4',func=pin_types.BIDIR,unit=1),
            Pin(num='25',name='PD5/D5/KWUD5',func=pin_types.BIDIR,unit=1),
            Pin(num='26',name='PD6/D6/KWUD6',func=pin_types.BIDIR,unit=1),
            Pin(num='27',name='PD7/D7/KWUD7',func=pin_types.BIDIR,unit=1),
            Pin(num='28',name='PC0/D8/D0',func=pin_types.BIDIR,unit=1),
            Pin(num='29',name='PC1/D9/D1',func=pin_types.BIDIR,unit=1),
            Pin(num='3',name='PJ0/KWUJ0',func=pin_types.BIDIR,unit=1),
            Pin(num='30',name='PC2/D10/D2',func=pin_types.BIDIR,unit=1),
            Pin(num='31',name='PC3/D11/D3',func=pin_types.BIDIR,unit=1),
            Pin(num='32',name='PC4/D12/D4',func=pin_types.BIDIR,unit=1),
            Pin(num='33',name='PC5/D13/D5',func=pin_types.BIDIR,unit=1),
            Pin(num='34',name='PC6/D14/D6',func=pin_types.BIDIR,unit=1),
            Pin(num='35',name='PC7/D15/D7',func=pin_types.BIDIR,unit=1),
            Pin(num='36',name='PE0/XIRQ',func=pin_types.INPUT,unit=1),
            Pin(num='37',name='PE1/IRQ',func=pin_types.INPUT,unit=1),
            Pin(num='38',name='PE2/RW',func=pin_types.BIDIR,unit=1),
            Pin(num='39',name='PE3/LSTRB/TAGL0',func=pin_types.BIDIR,unit=1),
            Pin(num='4',name='PJ1/KWUJ1',func=pin_types.BIDIR,unit=1),
            Pin(num='40',name='RESET',func=pin_types.BIDIR,unit=1),
            Pin(num='41',name='VSSX',func=pin_types.PWRIN,unit=1),
            Pin(num='42',name='VDDX',func=pin_types.PWRIN,unit=1),
            Pin(num='43',name='VDDPLL',func=pin_types.INPUT,unit=1),
            Pin(num='44',name='XFC',func=pin_types.PASSIVE,unit=1),
            Pin(num='45',name='VSSPLL',func=pin_types.INPUT,unit=1),
            Pin(num='46',name='EXTAL',func=pin_types.INPUT,unit=1),
            Pin(num='47',name='XTAL',func=pin_types.OUTPUT,unit=1),
            Pin(num='48',name='PE4/ECLK',func=pin_types.BIDIR,unit=1),
            Pin(num='49',name='PE5/MODA/IPIPE0',func=pin_types.BIDIR,unit=1),
            Pin(num='5',name='PJ2/KWUJ2',func=pin_types.BIDIR,unit=1),
            Pin(num='50',name='PE6/MODB/IPIPE1',func=pin_types.BIDIR,unit=1),
            Pin(num='51',name='PE7/ARST',func=pin_types.BIDIR,unit=1),
            Pin(num='52',name='PB0/A0',func=pin_types.BIDIR,unit=1),
            Pin(num='53',name='PB1/A1',func=pin_types.BIDIR,unit=1),
            Pin(num='54',name='PB2/A2',func=pin_types.BIDIR,unit=1),
            Pin(num='55',name='PB3/A3',func=pin_types.BIDIR,unit=1),
            Pin(num='56',name='PB4/A4',func=pin_types.BIDIR,unit=1),
            Pin(num='57',name='PB5/A5',func=pin_types.BIDIR,unit=1),
            Pin(num='58',name='PB6/A6',func=pin_types.BIDIR,unit=1),
            Pin(num='59',name='PB7/A7',func=pin_types.BIDIR,unit=1),
            Pin(num='6',name='PJ3/KWUJ3',func=pin_types.BIDIR,unit=1),
            Pin(num='60',name='PA0/A8',func=pin_types.BIDIR,unit=1),
            Pin(num='61',name='PA1/A9',func=pin_types.BIDIR,unit=1),
            Pin(num='62',name='PA2/A10',func=pin_types.BIDIR,unit=1),
            Pin(num='63',name='PA3/A11',func=pin_types.BIDIR,unit=1),
            Pin(num='64',name='PA4/A12',func=pin_types.BIDIR,unit=1),
            Pin(num='65',name='PA5/A13',func=pin_types.BIDIR,unit=1),
            Pin(num='66',name='PA6/A14',func=pin_types.BIDIR,unit=1),
            Pin(num='67',name='PA7/A15',func=pin_types.BIDIR,unit=1),
            Pin(num='68',name='PF0/CS0',func=pin_types.BIDIR,unit=1),
            Pin(num='69',name='PF1/CS1',func=pin_types.BIDIR,unit=1),
            Pin(num='7',name='PJ4/KWUJ4',func=pin_types.BIDIR,unit=1),
            Pin(num='70',name='PF2/CS2',func=pin_types.BIDIR,unit=1),
            Pin(num='71',name='PF3/CS3',func=pin_types.BIDIR,unit=1),
            Pin(num='72',name='PF4/CSD',func=pin_types.BIDIR,unit=1),
            Pin(num='73',name='PF5/CSP0',func=pin_types.BIDIR,unit=1),
            Pin(num='74',name='PF6/CSP1',func=pin_types.BIDIR,unit=1),
            Pin(num='75',name='PH0/KWUH0',func=pin_types.BIDIR,unit=1),
            Pin(num='76',name='PH1/KWUH1',func=pin_types.BIDIR,unit=1),
            Pin(num='77',name='PH2/KWUH2',func=pin_types.BIDIR,unit=1),
            Pin(num='78',name='PH3/KWUH3',func=pin_types.BIDIR,unit=1),
            Pin(num='79',name='VDDX',func=pin_types.PWRIN,unit=1),
            Pin(num='8',name='PJ5/KWUJ5',func=pin_types.BIDIR,unit=1),
            Pin(num='80',name='VSSX',func=pin_types.PWRIN,unit=1),
            Pin(num='81',name='PH4/KWUH4',func=pin_types.BIDIR,unit=1),
            Pin(num='82',name='PH5/KWUH5',func=pin_types.BIDIR,unit=1),
            Pin(num='83',name='PH6/KWUH6',func=pin_types.BIDIR,unit=1),
            Pin(num='84',name='PH7/KWUH7',func=pin_types.BIDIR,unit=1),
            Pin(num='85',name='VRH',func=pin_types.INPUT,unit=1),
            Pin(num='86',name='VRL',func=pin_types.INPUT,unit=1),
            Pin(num='87',name='PAD0',func=pin_types.INPUT,unit=1),
            Pin(num='88',name='PAD1',func=pin_types.INPUT,unit=1),
            Pin(num='89',name='PAD2',func=pin_types.INPUT,unit=1),
            Pin(num='9',name='PJ6/KWUJ6',func=pin_types.BIDIR,unit=1),
            Pin(num='90',name='PAD3',func=pin_types.INPUT,unit=1),
            Pin(num='91',name='PAD4',func=pin_types.INPUT,unit=1),
            Pin(num='92',name='PAD5',func=pin_types.INPUT,unit=1),
            Pin(num='93',name='PAD6',func=pin_types.INPUT,unit=1),
            Pin(num='94',name='VSTBY/PAD7',func=pin_types.INPUT,unit=1),
            Pin(num='95',name='VDDAD',func=pin_types.INPUT,unit=1),
            Pin(num='96',name='VSSAD',func=pin_types.INPUT,unit=1),
            Pin(num='97',name='PS0/RXD0',func=pin_types.BIDIR,unit=1),
            Pin(num='98',name='PS1/TXD0',func=pin_types.BIDIR,unit=1),
            Pin(num='99',name='PS2/RXD1',func=pin_types.BIDIR,unit=1)], 'unit_defs':[] }),
        Part(**{ 'name':'MC68HC912', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'MC68HC912'}), 'ref_prefix':'U', 'fplist':[''], 'footprint':'', 'keywords':'68HC12 Microcontroller', 'description':'', 'datasheet':'', 'search_text':'/usr/share/kicad/symbols/MCU_NXP_HC12.kicad_sym\nMC68HC912\n\n68HC12 Microcontroller', 'pins':[
            Pin(num='1',name='PP5',func=pin_types.BIDIR,unit=1),
            Pin(num='10',name='VDD',func=pin_types.PWRIN,unit=1),
            Pin(num='11',name='VSS',func=pin_types.PWRIN,unit=1),
            Pin(num='12',name='PT3-IOC3',func=pin_types.BIDIR,unit=1),
            Pin(num='13',name='PT4-IOC4',func=pin_types.BIDIR,unit=1),
            Pin(num='14',name='PT5-IOC5',func=pin_types.BIDIR,unit=1),
            Pin(num='15',name='PT6-IOC6',func=pin_types.BIDIR,unit=1),
            Pin(num='16',name='PT7-IOC7-PAI',func=pin_types.BIDIR,unit=1),
            Pin(num='17',name='BKGD/SMODN/TAGHI',func=pin_types.BIDIR,unit=1),
            Pin(num='18',name='PB0/AD0',func=pin_types.BIDIR,unit=1),
            Pin(num='19',name='PB1/AD1',func=pin_types.BIDIR,unit=1),
            Pin(num='2',name='PP4',func=pin_types.BIDIR,unit=1),
            Pin(num='20',name='PB2/AD2',func=pin_types.BIDIR,unit=1),
            Pin(num='21',name='PB3/AD3',func=pin_types.BIDIR,unit=1),
            Pin(num='22',name='PB4/AD4',func=pin_types.BIDIR,unit=1),
            Pin(num='23',name='PB5/AD5',func=pin_types.BIDIR,unit=1),
            Pin(num='24',name='PB6/AD6',func=pin_types.BIDIR,unit=1),
            Pin(num='25',name='PB7/AD7',func=pin_types.BIDIR,unit=1),
            Pin(num='26',name='PE7/DBE',func=pin_types.BIDIR,unit=1),
            Pin(num='27',name='PE6-MODB/IPIPE1',func=pin_types.BIDIR,unit=1),
            Pin(num='28',name='PE5-MODA/IPIPE0',func=pin_types.BIDIR,unit=1),
            Pin(num='29',name='PE4-ECLK',func=pin_types.BIDIR,unit=1),
            Pin(num='3',name='PP3/PW3',func=pin_types.BIDIR,unit=1),
            Pin(num='30',name='VSSX',func=pin_types.PWRIN,unit=1),
            Pin(num='31',name='VDDX',func=pin_types.PWRIN,unit=1),
            Pin(num='32',name='RST',func=pin_types.BIDIR,unit=1),
            Pin(num='33',name='EXTAL',func=pin_types.INPUT,unit=1),
            Pin(num='34',name='XTAL',func=pin_types.OUTPUT,unit=1),
            Pin(num='35',name='PE3/LSTRB/TAGLO',func=pin_types.BIDIR,unit=1),
            Pin(num='36',name='PE2-R/W',func=pin_types.BIDIR,unit=1),
            Pin(num='37',name='PE1/IRQ',func=pin_types.INPUT,unit=1),
            Pin(num='38',name='PE0/XIRQ',func=pin_types.INPUT,unit=1),
            Pin(num='39',name='PA0/AD8',func=pin_types.BIDIR,unit=1),
            Pin(num='4',name='PP2/PW3',func=pin_types.BIDIR,unit=1),
            Pin(num='40',name='PA1/D9/A9',func=pin_types.BIDIR,unit=1),
            Pin(num='41',name='PA2/AD10',func=pin_types.BIDIR,unit=1),
            Pin(num='42',name='PA3/AD11',func=pin_types.BIDIR,unit=1),
            Pin(num='43',name='PA4/AD12',func=pin_types.BIDIR,unit=1),
            Pin(num='44',name='PA5/AD13',func=pin_types.BIDIR,unit=1),
            Pin(num='45',name='PA6/AD14',func=pin_types.BIDIR,unit=1),
            Pin(num='46',name='PA7/AD15',func=pin_types.BIDIR,unit=1),
            Pin(num='47',name='VDD',func=pin_types.PWRIN,unit=1),
            Pin(num='48',name='VSS',func=pin_types.PWRIN,unit=1),
            Pin(num='49',name='VRH',func=pin_types.INPUT,unit=1),
            Pin(num='5',name='PP1/PW1',func=pin_types.BIDIR,unit=1),
            Pin(num='50',name='VRL',func=pin_types.INPUT,unit=1),
            Pin(num='51',name='PAD0',func=pin_types.INPUT,unit=1),
            Pin(num='52',name='PAD1',func=pin_types.INPUT,unit=1),
            Pin(num='53',name='PAD2',func=pin_types.INPUT,unit=1),
            Pin(num='54',name='PAD3',func=pin_types.INPUT,unit=1),
            Pin(num='55',name='PAD4',func=pin_types.INPUT,unit=1),
            Pin(num='56',name='PAD5',func=pin_types.INPUT,unit=1),
            Pin(num='57',name='PAD6',func=pin_types.INPUT,unit=1),
            Pin(num='58',name='PAD7',func=pin_types.INPUT,unit=1),
            Pin(num='59',name='VDDA',func=pin_types.INPUT,unit=1),
            Pin(num='6',name='PP0/PW0',func=pin_types.BIDIR,unit=1),
            Pin(num='60',name='VSSA',func=pin_types.INPUT,unit=1),
            Pin(num='61',name='PS0/RxD',func=pin_types.BIDIR,unit=1),
            Pin(num='62',name='PS1/TxD',func=pin_types.BIDIR,unit=1),
            Pin(num='63',name='PS2',func=pin_types.BIDIR,unit=1),
            Pin(num='64',name='PS3',func=pin_types.BIDIR,unit=1),
            Pin(num='65',name='PS4SDI/MISO',func=pin_types.BIDIR,unit=1),
            Pin(num='66',name='PS5/SD0/MOSI',func=pin_types.BIDIR,unit=1),
            Pin(num='67',name='PS6/SCLK',func=pin_types.BIDIR,unit=1),
            Pin(num='68',name='PS7/CS/SS',func=pin_types.BIDIR,unit=1),
            Pin(num='69',name='VFP',func=pin_types.INPUT,unit=1),
            Pin(num='7',name='PT0-IOC0',func=pin_types.BIDIR,unit=1),
            Pin(num='70',name='PDLC6',func=pin_types.BIDIR,unit=1),
            Pin(num='71',name='PDLC5',func=pin_types.BIDIR,unit=1),
            Pin(num='72',name='PDLC4',func=pin_types.BIDIR,unit=1),
            Pin(num='73',name='PDLC3',func=pin_types.BIDIR,unit=1),
            Pin(num='74',name='PDLC2',func=pin_types.BIDIR,unit=1),
            Pin(num='75',name='PDLC1/DLCTx',func=pin_types.BIDIR,unit=1),
            Pin(num='76',name='PDLC0/DLCRx',func=pin_types.BIDIR,unit=1),
            Pin(num='77',name='VSSX',func=pin_types.PWRIN,unit=1),
            Pin(num='78',name='VDDX',func=pin_types.PWRIN,unit=1),
            Pin(num='79',name='PP7',func=pin_types.BIDIR,unit=1),
            Pin(num='8',name='PT1-IOC1',func=pin_types.BIDIR,unit=1),
            Pin(num='80',name='PP6',func=pin_types.BIDIR,unit=1),
            Pin(num='9',name='PT2-IOC2',func=pin_types.BIDIR,unit=1)], 'unit_defs':[] })])