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_HCS12 = SchLib(tool=SKIDL).add_parts(*[
        Part(**{ 'name':'MC9S12DT256', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'MC9S12DT256'}), 'ref_prefix':'U', 'fplist':[''], 'footprint':'', 'keywords':'HCS12 MCU', 'description':'', 'datasheet':'https://www.nxp.com/docs/en/fact-sheet/MC9S12DT256FS.pdf', 'search_text':'/usr/share/kicad/symbols/MCU_NXP_HCS12.kicad_sym\nMC9S12DT256\n\nHCS12 MCU', 'pins':[
            Pin(num='1',name='SS1/PWM3/KWP3/PP3',func=pin_types.BIDIR,unit=1),
            Pin(num='10',name='PT1/IOC1',func=pin_types.BIDIR,unit=1),
            Pin(num='100',name='BF_PROK/TXCAN0/TXCAN4/SCK0/PM5',func=pin_types.BIDIR,unit=1),
            Pin(num='101',name='BF_PSYN/RXCAN0/RXCAN4/MOSI0/PM4',func=pin_types.BIDIR,unit=1),
            Pin(num='102',name='TX_BF/TXCAN1/TXCAN0/SS0/PM3',func=pin_types.BIDIR,unit=1),
            Pin(num='103',name='RX_BF/RXCAN1/RXCAN0/MISO0/PM2',func=pin_types.BIDIR,unit=1),
            Pin(num='104',name='TXCAN0/TXB/PM1',func=pin_types.BIDIR,unit=1),
            Pin(num='105',name='RXCAN0/RXB/PM0',func=pin_types.BIDIR,unit=1),
            Pin(num='106',name='VSSX',func=pin_types.PWRIN,unit=1),
            Pin(num='107',name='VDDX',func=pin_types.PWRIN,unit=1),
            Pin(num='108',name='ECS/ROMCTL/PK7',func=pin_types.BIDIR,unit=1),
            Pin(num='109',name='PWM7/KWP7/PP7',func=pin_types.BIDIR,unit=1),
            Pin(num='11',name='PT2/IOC2',func=pin_types.BIDIR,unit=1),
            Pin(num='110',name='PWM6/KWP6/PP6',func=pin_types.BIDIR,unit=1),
            Pin(num='111',name='PWM5/KWP5/PP5',func=pin_types.BIDIR,unit=1),
            Pin(num='112',name='PWM4/KWP4/PP4',func=pin_types.BIDIR,unit=1),
            Pin(num='12',name='PT3/IOC3',func=pin_types.BIDIR,unit=1),
            Pin(num='13',name='VDD1',func=pin_types.PWRIN,unit=1),
            Pin(num='14',name='VSS1',func=pin_types.PWRIN,unit=1),
            Pin(num='15',name='PT4/IOC4',func=pin_types.BIDIR,unit=1),
            Pin(num='16',name='PT5/IOC5',func=pin_types.BIDIR,unit=1),
            Pin(num='17',name='PT6/IOC6',func=pin_types.BIDIR,unit=1),
            Pin(num='18',name='PT7/IOC7',func=pin_types.BIDIR,unit=1),
            Pin(num='19',name='XADDR19/PK5',func=pin_types.BIDIR,unit=1),
            Pin(num='2',name='SCK1/PWM2/KWP2/PP2',func=pin_types.BIDIR,unit=1),
            Pin(num='20',name='XADDR18/PK4',func=pin_types.BIDIR,unit=1),
            Pin(num='21',name='KWJ1/PJ1',func=pin_types.BIDIR,unit=1),
            Pin(num='22',name='KWJ0/PJ0',func=pin_types.BIDIR,unit=1),
            Pin(num='23',name='BKGD/TAGHI/MODC',func=pin_types.BIDIR,unit=1),
            Pin(num='24',name='ADDR0/DATA0/PB0',func=pin_types.BIDIR,unit=1),
            Pin(num='25',name='ADDR1/DATA1/PB1',func=pin_types.BIDIR,unit=1),
            Pin(num='26',name='ADDR2/DATA2/PB2',func=pin_types.BIDIR,unit=1),
            Pin(num='27',name='ADDR3/DATA3/PB3',func=pin_types.BIDIR,unit=1),
            Pin(num='28',name='ADDR4/DATA4/PB4',func=pin_types.BIDIR,unit=1),
            Pin(num='29',name='ADDR5/DATA5/PB5',func=pin_types.BIDIR,unit=1),
            Pin(num='3',name='MOSI1/PWM1/KWP1/PP1',func=pin_types.BIDIR,unit=1),
            Pin(num='30',name='ADDR6/DATA6/PB6',func=pin_types.BIDIR,unit=1),
            Pin(num='31',name='ADDR7/DATA7/PB7',func=pin_types.BIDIR,unit=1),
            Pin(num='32',name='PH7/KWH7',func=pin_types.BIDIR,unit=1),
            Pin(num='33',name='PH6/KWH6',func=pin_types.BIDIR,unit=1),
            Pin(num='34',name='PH5/KWH5',func=pin_types.BIDIR,unit=1),
            Pin(num='35',name='PH4/KWH4',func=pin_types.BIDIR,unit=1),
            Pin(num='36',name='PE7/NOACC/XCLKS',func=pin_types.BIDIR,unit=1),
            Pin(num='37',name='PE6/MODB',func=pin_types.BIDIR,unit=1),
            Pin(num='38',name='PE5/MODA',func=pin_types.BIDIR,unit=1),
            Pin(num='39',name='PE4/ECLK',func=pin_types.BIDIR,unit=1),
            Pin(num='4',name='MISO1/PWM0/KWP0/PP0',func=pin_types.BIDIR,unit=1),
            Pin(num='40',name='VSSR',func=pin_types.PWRIN,unit=1),
            Pin(num='41',name='VDDR',func=pin_types.PWRIN,unit=1),
            Pin(num='42',name='RESET',func=pin_types.BIDIR,unit=1),
            Pin(num='43',name='VDDPLL',func=pin_types.PWRIN,unit=1),
            Pin(num='44',name='XFC',func=pin_types.BIDIR,unit=1),
            Pin(num='45',name='VSSPLL',func=pin_types.BIDIR,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='TEST',func=pin_types.INPUT,unit=1),
            Pin(num='49',name='PH3/KWH3/SS1',func=pin_types.BIDIR,unit=1),
            Pin(num='5',name='XADDR17/PK3',func=pin_types.BIDIR,unit=1),
            Pin(num='50',name='PH2/KWH2/SCK1',func=pin_types.BIDIR,unit=1),
            Pin(num='51',name='PH1/KWH1/MOSI1',func=pin_types.BIDIR,unit=1),
            Pin(num='52',name='PH0/KWH0/MISO1',func=pin_types.BIDIR,unit=1),
            Pin(num='53',name='PE3/TAGLO/LSTRB',func=pin_types.BIDIR,unit=1),
            Pin(num='54',name='PE2/RW',func=pin_types.BIDIR,unit=1),
            Pin(num='55',name='PE1/IRQ',func=pin_types.INPUT,unit=1),
            Pin(num='56',name='PE0/XIRQ',func=pin_types.INPUT,unit=1),
            Pin(num='57',name='ADDR8/DATA8/PA0',func=pin_types.BIDIR,unit=1),
            Pin(num='58',name='ADDR9/DATA9/PA1',func=pin_types.BIDIR,unit=1),
            Pin(num='59',name='ADDR10/DATA10/PA2',func=pin_types.BIDIR,unit=1),
            Pin(num='6',name='XADDR16/PK2',func=pin_types.BIDIR,unit=1),
            Pin(num='60',name='ADDR11/DATA11/PA3',func=pin_types.BIDIR,unit=1),
            Pin(num='61',name='ADDR12/DATA12/PA4',func=pin_types.BIDIR,unit=1),
            Pin(num='62',name='ADDR13/DATA13/PA5',func=pin_types.BIDIR,unit=1),
            Pin(num='63',name='ADDR14/DATA14/PA6',func=pin_types.BIDIR,unit=1),
            Pin(num='64',name='ADDR15/DATA15/PA7',func=pin_types.BIDIR,unit=1),
            Pin(num='65',name='VDD2',func=pin_types.PWRIN,unit=1),
            Pin(num='66',name='VSS2',func=pin_types.PWRIN,unit=1),
            Pin(num='67',name='PAD00/AN00',func=pin_types.INPUT,unit=1),
            Pin(num='68',name='PAD08/AN08',func=pin_types.INPUT,unit=1),
            Pin(num='69',name='PAD01/AN01',func=pin_types.INPUT,unit=1),
            Pin(num='7',name='XADDR15/PK1',func=pin_types.BIDIR,unit=1),
            Pin(num='70',name='PAD09/AN09',func=pin_types.INPUT,unit=1),
            Pin(num='71',name='PAD02/AN02',func=pin_types.INPUT,unit=1),
            Pin(num='72',name='PAD10/AN10',func=pin_types.INPUT,unit=1),
            Pin(num='73',name='PAD03/AN03',func=pin_types.INPUT,unit=1),
            Pin(num='74',name='PAD11/AN11',func=pin_types.INPUT,unit=1),
            Pin(num='75',name='PAD04/AN04',func=pin_types.INPUT,unit=1),
            Pin(num='76',name='PAD12/AN12',func=pin_types.INPUT,unit=1),
            Pin(num='77',name='PAD05/AN05',func=pin_types.INPUT,unit=1),
            Pin(num='78',name='PAD13/AN13',func=pin_types.INPUT,unit=1),
            Pin(num='79',name='PAD06/AN06',func=pin_types.INPUT,unit=1),
            Pin(num='8',name='XADDR14/PK0',func=pin_types.BIDIR,unit=1),
            Pin(num='80',name='PAD14/AN14',func=pin_types.INPUT,unit=1),
            Pin(num='81',name='PAD07/AN07/ETRIG0',func=pin_types.INPUT,unit=1),
            Pin(num='82',name='PAD15/AN15/ETRIG1',func=pin_types.INPUT,unit=1),
            Pin(num='83',name='VDDA',func=pin_types.PWRIN,unit=1),
            Pin(num='84',name='VRH',func=pin_types.PASSIVE,unit=1),
            Pin(num='85',name='VRL',func=pin_types.PASSIVE,unit=1),
            Pin(num='86',name='VSSA',func=pin_types.PWRIN,unit=1),
            Pin(num='87',name='BF_PSLM/TXCAN4/PM7',func=pin_types.BIDIR,unit=1),
            Pin(num='88',name='BF_PERR/RXCAN4/PM6',func=pin_types.BIDIR,unit=1),
            Pin(num='89',name='RXD0/PS0',func=pin_types.BIDIR,unit=1),
            Pin(num='9',name='PT0/IOC0',func=pin_types.BIDIR,unit=1),
            Pin(num='90',name='TXD0/PS1',func=pin_types.BIDIR,unit=1),
            Pin(num='91',name='RXD1/PS2',func=pin_types.BIDIR,unit=1),
            Pin(num='92',name='TXD1/PS3',func=pin_types.BIDIR,unit=1),
            Pin(num='93',name='MISO0/PS4',func=pin_types.BIDIR,unit=1),
            Pin(num='94',name='MOSI0/PS5',func=pin_types.BIDIR,unit=1),
            Pin(num='95',name='SCK0/PS6',func=pin_types.BIDIR,unit=1),
            Pin(num='96',name='SS0/PS7',func=pin_types.BIDIR,unit=1),
            Pin(num='97',name='VREGEN',func=pin_types.INPUT,unit=1),
            Pin(num='98',name='KWJ7/TXCAN4/SCL/TXCAN0/PJ7',func=pin_types.BIDIR,unit=1),
            Pin(num='99',name='KWJ6/RXCAN4/SDA/RXCAN0/PJ6',func=pin_types.BIDIR,unit=1)], 'unit_defs':[] })])