_svd: ../svd/stm32f301.svd

_copy:
  TIM1:
    from: ../svd/stm32f302.svd:TIM1
  ADC1_2:
    from: ADC

_add:
  I2C3:
    derivedFrom: I2C1
    baseAddress: "0x40007800"
    interrupts:
      I2C3_EV_IRQ:
        description: I2C3 event interrupt / EXTI Line27 interrupt
        value: 72
      I2C3_ER_IRQ:
        description: I2C3 error interrupt
        value: 73

_modify:
  ADC:
    name: ADC1
  ADC1_2:
    description: ADC Common registers
    baseAddress: "0x50000300"
  # Rename in accordance with other devices and reference manual.
  Flash:
    name: FLASH

ADC1:
  _delete:
    - CSR
    - CRR
  CR:
    _modify:
      '*':
        access: read-write

ADC1_2:
  _delete:
    - I?R
    - CR
    - CFGR
    - SMPR*
    - TR*
    - '*SQR*'
    - '*DR*'
    - OFR*
    - AWD*CR
    - DIFSEL
    - CALFACT
  _modify:
    CSR:
      alternateRegister: ""
    CRR:
      name: CCR
      displayName: CCR
      alternateRegister: ""

"SPI*":
  SR:
    _modify:
      # This field has the wrong name in the SVD compared to RM0366
      TIFRFE:
        name: "FRE"

RCC:
  CFGR3:
    _modify:
      TIM17SW:
        bitWidth: 1

SYSCFG:
  _delete:
    - SYSCFG_RCR
    - SYSCFG_CFGR3
  CFGR1:
    _delete:
      - USB_IT_RMP
      - DAC_TRIG_RMP
      - ADC24_DMA_RMP
      - TIM7_DAC2_DMA_RMP
  CFGR2:
    _delete:
      - LOCUP_LOCK
      - SRAM_PARITY_LOCK
      - BYP_ADD_PAR
      - SRAM_PEF

_include:
 - common_patches/4_nvic_prio_bits.yaml
 - ./common_patches/merge_I2C_CR2_SADDx_fields.yaml
 - ./common_patches/merge_I2C_OAR1_OA1x_fields.yaml
 - ./common_patches/merge_USART_CR2_ADDx_fields.yaml
 - ./common_patches/merge_USART_BRR_fields.yaml
 - ./common_patches/f3_adc.yaml
 - ./common_patches/f3_rcc.yaml
 - ./common_patches/f3_rcc_i2c3.yaml
 - ./common_patches/f3_rcc_delete_cec.yaml
 - ./common_patches/f3_syscfg.yaml
 - ./common_patches/f3_syscfg_cfgr1_i2c3_fmp.yaml
 - ./common_patches/f3_opamp2.yaml
 - ./common_patches/f3_comp246.yaml
 - ./common_patches/f3_comp2_inp_dac.yaml
 - ../peripherals/syscfg/syscfg_f3.yaml
 - ../peripherals/syscfg/syscfg_f301.yaml
 - ../peripherals/syscfg/syscfg_f3_cfgr2_pvd_lock.yaml
 - common_patches/can/can.yaml
 - common_patches/can/can_filter_bank.yaml
 - ../peripherals/can/can.yaml
 - ./common_patches/unprefix_USB_registers.yaml
 - common_patches/tim/tim_o24ce.yaml
 - ../peripherals/crc/crc_advanced.yaml
 - ../peripherals/crc/crc_with_polysize.yaml
 - ../peripherals/crc/crc_pol.yaml
 - ../peripherals/spi/spi_v2.yaml
 - ../peripherals/wwdg/wwdg.yaml
 - ../peripherals/gpio/gpio_with_brr.yaml
 - ../peripherals/gpio/gpio_v2.yaml
 - ../peripherals/tim/tim_basic.yaml
 - ../peripherals/tim/tim16.yaml
 - ../peripherals/tim/tim6.yaml
 - ../peripherals/tim/tim2345_mixed.yaml
 - common_patches/tim/tim2345_mixed.yaml
 - ../peripherals/tim/tim_advanced.yaml
 - ../peripherals/rcc/rcc_f3.yaml
 - ../peripherals/rcc/rcc_f3_i2s.yaml
 - ../peripherals/rcc/rcc_pllsrc_1bit.yaml
 - common_patches/dma/dma_v1.yaml
 - ../peripherals/dma/dma_v1.yaml
 - ../peripherals/iwdg/iwdg_with_WINR.yaml
 - ../peripherals/exti/exti.yaml
 - ../peripherals/i2c/i2c_v2.yaml
 - ../peripherals/usart/usart_v2B.yaml
 - common_patches/rtc/rtc_bkpr.yaml
 - common_patches/tsc/tsc.yaml
 - common_patches/tim/tim_ccr.yaml
 - ../peripherals/usb/usb.yaml
 - common_patches/f3_dbgmcu.yaml
 - ../peripherals/tim/tim_ccm_v1.yaml
 - ../peripherals/comp/comp_f3.yaml
 - ../peripherals/opamp/opamp_f3.yaml
 - ../peripherals/adc/adc_v3_f3.yaml
 - ../peripherals/adc/adc_v3_common_single.yaml
 - ../peripherals/adc/adc_v3_common_f3_single.yaml
 - ../peripherals/dac/dac_common_1ch.yaml
 - ../peripherals/dac/dac_dmaudr.yaml
 - common_patches/f3_flash.yaml
 - ../peripherals/flash/flash_f3_common.yaml
 - ../peripherals/flash/flash_f3_acr_hlfcya.yaml
 - common_patches/rtc/rtc_cr.yaml
 - ../peripherals/rtc/rtc_common.yaml
 - ../peripherals/rtc/rtc_f3.yaml
