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_Dialog = SchLib(tool=SKIDL).add_parts(*[
        Part(**{ 'name':'DA14691', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'DA14691'}), 'ref_prefix':'U', 'fplist':['Package_BGA:VFBGA-86_6x6mm_Layout10x10_P0.55mm_Ball0.25mm_Pad0.2mm'], 'footprint':'Package_BGA:VFBGA-86_6x6mm_Layout10x10_P0.55mm_Ball0.25mm_Pad0.2mm', 'keywords':'BLE MCU', 'description':'', 'datasheet':'https://www.dialog-semiconductor.com/sites/default/files/da1469x_datasheet_3v1.pdf', 'search_text':'/usr/share/kicad/symbols/MCU_Dialog.kicad_sym\nDA14691\n\nBLE MCU', 'pins':[
            Pin(num='A1',name='QSPIF_CLK',func=pin_types.OUTPUT,unit=1),
            Pin(num='A10',name='RF_GND',func=pin_types.PASSIVE,unit=1),
            Pin(num='A2',name='QSPIF_D0',func=pin_types.BIDIR,unit=1),
            Pin(num='A3',name='P0_10/M33_SWDIO',func=pin_types.BIDIR,unit=1),
            Pin(num='A4',name='P0_12/CMAC_SWDIO',func=pin_types.BIDIR,unit=1),
            Pin(num='A5',name='VSUP_RF',func=pin_types.PWRIN,unit=1),
            Pin(num='A6',name='RF_GND',func=pin_types.PASSIVE,unit=1),
            Pin(num='A7',name='RF_GND',func=pin_types.PWRIN,unit=1),
            Pin(num='A8',name='RFIOP',func=pin_types.BIDIR,unit=1),
            Pin(num='A9',name='RF_GND',func=pin_types.PASSIVE,unit=1),
            Pin(num='B1',name='QSPIF_CS',func=pin_types.OUTPUT,unit=1),
            Pin(num='B10',name='P0_06',func=pin_types.BIDIR,unit=1),
            Pin(num='B2',name='QSPIF_D3',func=pin_types.BIDIR,unit=1),
            Pin(num='B3',name='P0_11/M33_SWCLK',func=pin_types.BIDIR,unit=1),
            Pin(num='B4',name='P0_13/CMAC_SWCLK',func=pin_types.BIDIR,unit=1),
            Pin(num='B5',name='P0_09',func=pin_types.BIDIR,unit=1),
            Pin(num='B7',name='RF_GND',func=pin_types.PASSIVE,unit=1),
            Pin(num='B8',name='~{RESET}',func=pin_types.INPUT,unit=1),
            Pin(num='B9',name='P0_07',func=pin_types.BIDIR,unit=1),
            Pin(num='C1',name='QSPIF_D2',func=pin_types.BIDIR,unit=1),
            Pin(num='C10',name='P0_27',func=pin_types.BIDIR,unit=1),
            Pin(num='C2',name='QSPIF_D1',func=pin_types.BIDIR,unit=1),
            Pin(num='C3',name='P0_30',func=pin_types.BIDIR,unit=1),
            Pin(num='C4',name='P0_21',func=pin_types.BIDIR,unit=1),
            Pin(num='C6',name='P0_19',func=pin_types.BIDIR,unit=1),
            Pin(num='C8',name='P0_17',func=pin_types.BIDIR,unit=1),
            Pin(num='C9',name='P0_16',func=pin_types.BIDIR,unit=1),
            Pin(num='D1',name='P0_05',func=pin_types.BIDIR,unit=1),
            Pin(num='D10',name='RF_GND',func=pin_types.PASSIVE,unit=1),
            Pin(num='D2',name='P0_00',func=pin_types.BIDIR,unit=1),
            Pin(num='D3',name='P0_31',func=pin_types.BIDIR,unit=1),
            Pin(num='D5',name='P0_29',func=pin_types.BIDIR,unit=1),
            Pin(num='D6',name='P0_08',func=pin_types.BIDIR,unit=1),
            Pin(num='D9',name='RF_GND',func=pin_types.PASSIVE,unit=1),
            Pin(num='E1',name='P0_04',func=pin_types.BIDIR,unit=1),
            Pin(num='E10',name='XTAL32M_GND',func=pin_types.PASSIVE,unit=1),
            Pin(num='E2',name='P0_03',func=pin_types.BIDIR,unit=1),
            Pin(num='E4',name='P1_05',func=pin_types.BIDIR,unit=1),
            Pin(num='E6',name='P1_03',func=pin_types.BIDIR,unit=1),
            Pin(num='E8',name='P1_01',func=pin_types.BIDIR,unit=1),
            Pin(num='E9',name='P1_00',func=pin_types.BIDIR,unit=1),
            Pin(num='F1',name='P0_02',func=pin_types.BIDIR,unit=1),
            Pin(num='F10',name='XTAL32M_M',func=pin_types.OUTPUT,unit=1),
            Pin(num='F2',name='P0_01',func=pin_types.BIDIR,unit=1),
            Pin(num='F3',name='VSSIOQ',func=pin_types.PWRIN,unit=1),
            Pin(num='F4',name='DGND',func=pin_types.PASSIVE,unit=1),
            Pin(num='F5',name='AGND',func=pin_types.PWRIN,unit=1),
            Pin(num='F7',name='P1_07',func=pin_types.BIDIR,unit=1),
            Pin(num='F9',name='XTAL32M_P',func=pin_types.INPUT,unit=1),
            Pin(num='G1',name='V18F',func=pin_types.PWROUT,unit=1),
            Pin(num='G10',name='P0_18',func=pin_types.BIDIR,unit=1),
            Pin(num='G2',name='V18P',func=pin_types.PWROUT,unit=1),
            Pin(num='G3',name='DGND',func=pin_types.PWRIN,unit=1),
            Pin(num='G4',name='DGND',func=pin_types.PASSIVE,unit=1),
            Pin(num='G5',name='AGND',func=pin_types.PASSIVE,unit=1),
            Pin(num='G6',name='P1_11',func=pin_types.BIDIR,unit=1),
            Pin(num='G8',name='P0_20',func=pin_types.BIDIR,unit=1),
            Pin(num='G9',name='P1_09',func=pin_types.BIDIR,unit=1),
            Pin(num='H1',name='V14',func=pin_types.PWROUT,unit=1),
            Pin(num='H10',name='P0_23/XTAL_32K_P',func=pin_types.BIDIR,unit=1),
            Pin(num='H2',name='V18',func=pin_types.PWROUT,unit=1),
            Pin(num='H3',name='P1_04',func=pin_types.BIDIR,unit=1),
            Pin(num='H5',name='P0_28',func=pin_types.BIDIR,unit=1),
            Pin(num='H7',name='P0_26',func=pin_types.BIDIR,unit=1),
            Pin(num='H8',name='P0_25',func=pin_types.BIDIR,unit=1),
            Pin(num='H9',name='P0_22/XTAL_32K_M',func=pin_types.BIDIR,unit=1),
            Pin(num='J1',name='LY',func=pin_types.PASSIVE,unit=1),
            Pin(num='J10',name='P1_02',func=pin_types.BIDIR,unit=1),
            Pin(num='J2',name='V12',func=pin_types.PWROUT,unit=1),
            Pin(num='J3',name='GND',func=pin_types.PASSIVE,unit=1),
            Pin(num='J4',name='NC',func=pin_types.NOCONNECT,unit=1),
            Pin(num='J5',name='VBUS',func=pin_types.PWRIN,unit=1),
            Pin(num='J6',name='V30',func=pin_types.PWROUT,unit=1),
            Pin(num='J7',name='P1_08',func=pin_types.BIDIR,unit=1),
            Pin(num='J8',name='P1_06',func=pin_types.BIDIR,unit=1),
            Pin(num='J9',name='P0_24',func=pin_types.BIDIR,unit=1),
            Pin(num='K1',name='LX',func=pin_types.PASSIVE,unit=1),
            Pin(num='K10',name='GND',func=pin_types.PWRIN,unit=1),
            Pin(num='K2',name='VBAT2',func=pin_types.PWROUT,unit=1),
            Pin(num='K3',name='BUCK_GND',func=pin_types.PWRIN,unit=1),
            Pin(num='K4',name='NC',func=pin_types.NOCONNECT,unit=1),
            Pin(num='K5',name='VBAT1',func=pin_types.PWROUT,unit=1),
            Pin(num='K6',name='P0_14/USB_P',func=pin_types.BIDIR,unit=1),
            Pin(num='K7',name='P0_15/USB_M',func=pin_types.BIDIR,unit=1),
            Pin(num='K8',name='P1_10',func=pin_types.BIDIR,unit=1),
            Pin(num='K9',name='GND',func=pin_types.PASSIVE,unit=1)], 'unit_defs':[] }),
        Part(**{ 'name':'DA14695', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'DA14695'}), 'ref_prefix':'U', 'fplist':['Package_BGA:VFBGA-86_6x6mm_Layout10x10_P0.55mm_Ball0.25mm_Pad0.2mm', 'Package_BGA:VFBGA-86_6x6mm_Layout10x10_P0.55mm_Ball0.25mm_Pad0.2mm'], 'footprint':'Package_BGA:VFBGA-86_6x6mm_Layout10x10_P0.55mm_Ball0.25mm_Pad0.2mm', 'keywords':'BLE MCU', 'description':'', 'datasheet':'https://www.dialog-semiconductor.com/sites/default/files/da1469x_datasheet_3v1.pdf', 'search_text':'/usr/share/kicad/symbols/MCU_Dialog.kicad_sym\nDA14695\n\nBLE MCU', 'pins':[
            Pin(num='A1',name='QSPIF_CLK',func=pin_types.OUTPUT,unit=1),
            Pin(num='A10',name='RF_GND',func=pin_types.PASSIVE,unit=1),
            Pin(num='A2',name='QSPIF_D0',func=pin_types.BIDIR,unit=1),
            Pin(num='A3',name='P0_10/M33_SWDIO',func=pin_types.BIDIR,unit=1),
            Pin(num='A4',name='P0_12/CMAC_SWDIO',func=pin_types.BIDIR,unit=1),
            Pin(num='A5',name='VSUP_RF',func=pin_types.PWRIN,unit=1),
            Pin(num='A6',name='RF_GND',func=pin_types.PASSIVE,unit=1),
            Pin(num='A7',name='RF_GND',func=pin_types.PWRIN,unit=1),
            Pin(num='A8',name='RFIOP',func=pin_types.BIDIR,unit=1),
            Pin(num='A9',name='RF_GND',func=pin_types.PASSIVE,unit=1),
            Pin(num='B1',name='QSPIF_CS',func=pin_types.OUTPUT,unit=1),
            Pin(num='B10',name='P0_06',func=pin_types.BIDIR,unit=1),
            Pin(num='B2',name='QSPIF_D3',func=pin_types.BIDIR,unit=1),
            Pin(num='B3',name='P0_11/M33_SWCLK',func=pin_types.BIDIR,unit=1),
            Pin(num='B4',name='P0_13/CMAC_SWCLK',func=pin_types.BIDIR,unit=1),
            Pin(num='B5',name='P0_09',func=pin_types.BIDIR,unit=1),
            Pin(num='B7',name='RF_GND',func=pin_types.PASSIVE,unit=1),
            Pin(num='B8',name='~{RESET}',func=pin_types.INPUT,unit=1),
            Pin(num='B9',name='P0_07',func=pin_types.BIDIR,unit=1),
            Pin(num='C1',name='QSPIF_D2',func=pin_types.BIDIR,unit=1),
            Pin(num='C10',name='P0_27',func=pin_types.BIDIR,unit=1),
            Pin(num='C2',name='QSPIF_D1',func=pin_types.BIDIR,unit=1),
            Pin(num='C3',name='P0_30',func=pin_types.BIDIR,unit=1),
            Pin(num='C4',name='P0_21',func=pin_types.BIDIR,unit=1),
            Pin(num='C6',name='P0_19',func=pin_types.BIDIR,unit=1),
            Pin(num='C8',name='P0_17',func=pin_types.BIDIR,unit=1),
            Pin(num='C9',name='P0_16',func=pin_types.BIDIR,unit=1),
            Pin(num='D1',name='P0_05',func=pin_types.BIDIR,unit=1),
            Pin(num='D10',name='RF_GND',func=pin_types.PASSIVE,unit=1),
            Pin(num='D2',name='P0_00',func=pin_types.BIDIR,unit=1),
            Pin(num='D3',name='P0_31',func=pin_types.BIDIR,unit=1),
            Pin(num='D5',name='P0_29',func=pin_types.BIDIR,unit=1),
            Pin(num='D6',name='P0_08',func=pin_types.BIDIR,unit=1),
            Pin(num='D9',name='RF_GND',func=pin_types.PASSIVE,unit=1),
            Pin(num='E1',name='P0_04',func=pin_types.BIDIR,unit=1),
            Pin(num='E10',name='XTAL32M_GND',func=pin_types.PASSIVE,unit=1),
            Pin(num='E2',name='P0_03',func=pin_types.BIDIR,unit=1),
            Pin(num='E4',name='P1_05',func=pin_types.BIDIR,unit=1),
            Pin(num='E6',name='P1_03',func=pin_types.BIDIR,unit=1),
            Pin(num='E8',name='P1_01',func=pin_types.BIDIR,unit=1),
            Pin(num='E9',name='P1_00',func=pin_types.BIDIR,unit=1),
            Pin(num='F1',name='P0_02',func=pin_types.BIDIR,unit=1),
            Pin(num='F10',name='XTAL32M_M',func=pin_types.OUTPUT,unit=1),
            Pin(num='F2',name='P0_01',func=pin_types.BIDIR,unit=1),
            Pin(num='F3',name='VSSIOQ',func=pin_types.PWRIN,unit=1),
            Pin(num='F4',name='DGND',func=pin_types.PASSIVE,unit=1),
            Pin(num='F5',name='AGND',func=pin_types.PWRIN,unit=1),
            Pin(num='F7',name='P1_07',func=pin_types.BIDIR,unit=1),
            Pin(num='F9',name='XTAL32M_P',func=pin_types.INPUT,unit=1),
            Pin(num='G1',name='V18F',func=pin_types.PWROUT,unit=1),
            Pin(num='G10',name='P0_18',func=pin_types.BIDIR,unit=1),
            Pin(num='G2',name='V18P',func=pin_types.PWROUT,unit=1),
            Pin(num='G3',name='DGND',func=pin_types.PWRIN,unit=1),
            Pin(num='G4',name='DGND',func=pin_types.PASSIVE,unit=1),
            Pin(num='G5',name='AGND',func=pin_types.PASSIVE,unit=1),
            Pin(num='G6',name='P1_11',func=pin_types.BIDIR,unit=1),
            Pin(num='G8',name='P0_20',func=pin_types.BIDIR,unit=1),
            Pin(num='G9',name='P1_09',func=pin_types.BIDIR,unit=1),
            Pin(num='H1',name='V14',func=pin_types.PWROUT,unit=1),
            Pin(num='H10',name='P0_23/XTAL_32K_P',func=pin_types.BIDIR,unit=1),
            Pin(num='H2',name='V18',func=pin_types.PWROUT,unit=1),
            Pin(num='H3',name='P1_04',func=pin_types.BIDIR,unit=1),
            Pin(num='H5',name='P0_28',func=pin_types.BIDIR,unit=1),
            Pin(num='H7',name='P0_26',func=pin_types.BIDIR,unit=1),
            Pin(num='H8',name='P0_25',func=pin_types.BIDIR,unit=1),
            Pin(num='H9',name='P0_22/XTAL_32K_M',func=pin_types.BIDIR,unit=1),
            Pin(num='J1',name='LY',func=pin_types.PASSIVE,unit=1),
            Pin(num='J10',name='P1_02',func=pin_types.BIDIR,unit=1),
            Pin(num='J2',name='V12',func=pin_types.PWROUT,unit=1),
            Pin(num='J3',name='GND',func=pin_types.PASSIVE,unit=1),
            Pin(num='J4',name='NC',func=pin_types.NOCONNECT,unit=1),
            Pin(num='J5',name='VBUS',func=pin_types.PWRIN,unit=1),
            Pin(num='J6',name='V30',func=pin_types.PWROUT,unit=1),
            Pin(num='J7',name='P1_08',func=pin_types.BIDIR,unit=1),
            Pin(num='J8',name='P1_06',func=pin_types.BIDIR,unit=1),
            Pin(num='J9',name='P0_24',func=pin_types.BIDIR,unit=1),
            Pin(num='K1',name='LX',func=pin_types.PASSIVE,unit=1),
            Pin(num='K10',name='GND',func=pin_types.PWRIN,unit=1),
            Pin(num='K2',name='VBAT2',func=pin_types.PWROUT,unit=1),
            Pin(num='K3',name='BUCK_GND',func=pin_types.PWRIN,unit=1),
            Pin(num='K4',name='NC',func=pin_types.NOCONNECT,unit=1),
            Pin(num='K5',name='VBAT1',func=pin_types.PWROUT,unit=1),
            Pin(num='K6',name='P0_14/USB_P',func=pin_types.BIDIR,unit=1),
            Pin(num='K7',name='P0_15/USB_M',func=pin_types.BIDIR,unit=1),
            Pin(num='K8',name='P1_10',func=pin_types.BIDIR,unit=1),
            Pin(num='K9',name='GND',func=pin_types.PASSIVE,unit=1)], 'unit_defs':[] })])