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_ST_STM32WBA = SchLib(tool=SKIDL).add_parts(*[
        Part(**{ 'name':'STM32WBA52CEUx', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'STM32WBA52CEUx'}), 'ref_prefix':'U', 'fplist':['Package_DFN_QFN:QFN-48-1EP_7x7mm_P0.5mm_EP5.6x5.6mm'], 'footprint':'Package_DFN_QFN:QFN-48-1EP_7x7mm_P0.5mm_EP5.6x5.6mm', 'keywords':'Arm Cortex-M33 STM32WBA STM32WBAx2', 'description':'', 'datasheet':'https://www.st.com/resource/en/datasheet/stm32wba52ce.pdf', 'search_text':'/usr/share/kicad/symbols/MCU_ST_STM32WBA.kicad_sym\nSTM32WBA52CEUx\n\nArm Cortex-M33 STM32WBA STM32WBAx2', 'pins':[
            Pin(num='1',name='PB12',func=pin_types.BIDIR,unit=1),
            Pin(num='10',name='PA2',func=pin_types.BIDIR,unit=1),
            Pin(num='11',name='VDD',func=pin_types.PWRIN,unit=1),
            Pin(num='12',name='PA1',func=pin_types.BIDIR,unit=1),
            Pin(num='13',name='PA0',func=pin_types.BIDIR,unit=1),
            Pin(num='14',name='PB9',func=pin_types.BIDIR,unit=1),
            Pin(num='15',name='PB8',func=pin_types.BIDIR,unit=1),
            Pin(num='16',name='PC15',func=pin_types.BIDIR,unit=1),
            Pin(num='17',name='PC14',func=pin_types.BIDIR,unit=1),
            Pin(num='18',name='PC13',func=pin_types.BIDIR,unit=1),
            Pin(num='19',name='PB7',func=pin_types.BIDIR,unit=1),
            Pin(num='2',name='PB11',func=pin_types.BIDIR,unit=1),
            Pin(num='20',name='PB6',func=pin_types.BIDIR,unit=1),
            Pin(num='21',name='PB5',func=pin_types.BIDIR,unit=1),
            Pin(num='22',name='VDD',func=pin_types.PWRIN,unit=1),
            Pin(num='23',name='PB4',func=pin_types.BIDIR,unit=1),
            Pin(num='24',name='PB3',func=pin_types.BIDIR,unit=1),
            Pin(num='25',name='PA15',func=pin_types.BIDIR,unit=1),
            Pin(num='26',name='PA14',func=pin_types.BIDIR,unit=1),
            Pin(num='27',name='PA13',func=pin_types.BIDIR,unit=1),
            Pin(num='28',name='PA12',func=pin_types.BIDIR,unit=1),
            Pin(num='29',name='PA11',func=pin_types.BIDIR,unit=1),
            Pin(num='3',name='PA8',func=pin_types.BIDIR,unit=1),
            Pin(num='30',name='PB2',func=pin_types.BIDIR,unit=1),
            Pin(num='31',name='PB1',func=pin_types.BIDIR,unit=1),
            Pin(num='32',name='PB0',func=pin_types.BIDIR,unit=1),
            Pin(num='33',name='PB15',func=pin_types.BIDIR,unit=1),
            Pin(num='34',name='PH3',func=pin_types.BIDIR,unit=1),
            Pin(num='35',name='VDD',func=pin_types.PWRIN,unit=1),
            Pin(num='36',name='NRST',func=pin_types.INPUT,unit=1),
            Pin(num='37',name='RF',func=pin_types.BIDIR,unit=1),
            Pin(num='38',name='VDDHPA',func=pin_types.PWRIN,unit=1),
            Pin(num='39',name='VDDRF',func=pin_types.PWRIN,unit=1),
            Pin(num='4',name='PA7',func=pin_types.BIDIR,unit=1),
            Pin(num='40',name='OSC_OUT',func=pin_types.INPUT,unit=1),
            Pin(num='41',name='OSC_IN',func=pin_types.INPUT,unit=1),
            Pin(num='42',name='VDDRFPA',func=pin_types.PWRIN,unit=1),
            Pin(num='43',name='VDD',func=pin_types.PWRIN,unit=1),
            Pin(num='44',name='VCAP',func=pin_types.PWROUT,unit=1),
            Pin(num='45',name='PA10',func=pin_types.BIDIR,unit=1),
            Pin(num='46',name='PA9',func=pin_types.BIDIR,unit=1),
            Pin(num='47',name='PB14',func=pin_types.BIDIR,unit=1),
            Pin(num='48',name='PB13',func=pin_types.BIDIR,unit=1),
            Pin(num='49',name='VSS/VSS',func=pin_types.PWRIN,unit=1),
            Pin(num='5',name='PA6',func=pin_types.BIDIR,unit=1),
            Pin(num='6',name='VDDA',func=pin_types.PWRIN,unit=1),
            Pin(num='7',name='PA5',func=pin_types.BIDIR,unit=1),
            Pin(num='8',name='PA3',func=pin_types.BIDIR,unit=1),
            Pin(num='9',name='PB10',func=pin_types.BIDIR,unit=1)], 'unit_defs':[] }),
        Part(**{ 'name':'STM32WBA52CGUx', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'STM32WBA52CGUx'}), 'ref_prefix':'U', 'fplist':['Package_DFN_QFN:QFN-48-1EP_7x7mm_P0.5mm_EP5.6x5.6mm'], 'footprint':'Package_DFN_QFN:QFN-48-1EP_7x7mm_P0.5mm_EP5.6x5.6mm', 'keywords':'Arm Cortex-M33 STM32WBA STM32WBAx2', 'description':'', 'datasheet':'https://www.st.com/resource/en/datasheet/stm32wba52cg.pdf', 'search_text':'/usr/share/kicad/symbols/MCU_ST_STM32WBA.kicad_sym\nSTM32WBA52CGUx\n\nArm Cortex-M33 STM32WBA STM32WBAx2', 'pins':[
            Pin(num='1',name='PB12',func=pin_types.BIDIR,unit=1),
            Pin(num='10',name='PA2',func=pin_types.BIDIR,unit=1),
            Pin(num='11',name='VDD',func=pin_types.PWRIN,unit=1),
            Pin(num='12',name='PA1',func=pin_types.BIDIR,unit=1),
            Pin(num='13',name='PA0',func=pin_types.BIDIR,unit=1),
            Pin(num='14',name='PB9',func=pin_types.BIDIR,unit=1),
            Pin(num='15',name='PB8',func=pin_types.BIDIR,unit=1),
            Pin(num='16',name='PC15',func=pin_types.BIDIR,unit=1),
            Pin(num='17',name='PC14',func=pin_types.BIDIR,unit=1),
            Pin(num='18',name='PC13',func=pin_types.BIDIR,unit=1),
            Pin(num='19',name='PB7',func=pin_types.BIDIR,unit=1),
            Pin(num='2',name='PB11',func=pin_types.BIDIR,unit=1),
            Pin(num='20',name='PB6',func=pin_types.BIDIR,unit=1),
            Pin(num='21',name='PB5',func=pin_types.BIDIR,unit=1),
            Pin(num='22',name='VDD',func=pin_types.PWRIN,unit=1),
            Pin(num='23',name='PB4',func=pin_types.BIDIR,unit=1),
            Pin(num='24',name='PB3',func=pin_types.BIDIR,unit=1),
            Pin(num='25',name='PA15',func=pin_types.BIDIR,unit=1),
            Pin(num='26',name='PA14',func=pin_types.BIDIR,unit=1),
            Pin(num='27',name='PA13',func=pin_types.BIDIR,unit=1),
            Pin(num='28',name='PA12',func=pin_types.BIDIR,unit=1),
            Pin(num='29',name='PA11',func=pin_types.BIDIR,unit=1),
            Pin(num='3',name='PA8',func=pin_types.BIDIR,unit=1),
            Pin(num='30',name='PB2',func=pin_types.BIDIR,unit=1),
            Pin(num='31',name='PB1',func=pin_types.BIDIR,unit=1),
            Pin(num='32',name='PB0',func=pin_types.BIDIR,unit=1),
            Pin(num='33',name='PB15',func=pin_types.BIDIR,unit=1),
            Pin(num='34',name='PH3',func=pin_types.BIDIR,unit=1),
            Pin(num='35',name='VDD',func=pin_types.PWRIN,unit=1),
            Pin(num='36',name='NRST',func=pin_types.INPUT,unit=1),
            Pin(num='37',name='RF',func=pin_types.BIDIR,unit=1),
            Pin(num='38',name='VDDHPA',func=pin_types.PWRIN,unit=1),
            Pin(num='39',name='VDDRF',func=pin_types.PWRIN,unit=1),
            Pin(num='4',name='PA7',func=pin_types.BIDIR,unit=1),
            Pin(num='40',name='OSC_OUT',func=pin_types.INPUT,unit=1),
            Pin(num='41',name='OSC_IN',func=pin_types.INPUT,unit=1),
            Pin(num='42',name='VDDRFPA',func=pin_types.PWRIN,unit=1),
            Pin(num='43',name='VDD',func=pin_types.PWRIN,unit=1),
            Pin(num='44',name='VCAP',func=pin_types.PWROUT,unit=1),
            Pin(num='45',name='PA10',func=pin_types.BIDIR,unit=1),
            Pin(num='46',name='PA9',func=pin_types.BIDIR,unit=1),
            Pin(num='47',name='PB14',func=pin_types.BIDIR,unit=1),
            Pin(num='48',name='PB13',func=pin_types.BIDIR,unit=1),
            Pin(num='49',name='VSS/VSS',func=pin_types.PWRIN,unit=1),
            Pin(num='5',name='PA6',func=pin_types.BIDIR,unit=1),
            Pin(num='6',name='VDDA',func=pin_types.PWRIN,unit=1),
            Pin(num='7',name='PA5',func=pin_types.BIDIR,unit=1),
            Pin(num='8',name='PA3',func=pin_types.BIDIR,unit=1),
            Pin(num='9',name='PB10',func=pin_types.BIDIR,unit=1)], 'unit_defs':[] })])