HAL2 Migrator HAL2 Migrator HAL2 Migrator Go to parent
/
  • latest
  • English
ST Online Support

Table Of Contents

  • HAL1 to HAL2 - migration guide
  • Getting started
  • HAL1 detection
    • HAL1 automatic detection script
    • Script scope
    • Script setup and usage
    • Script stubbing features
  • HAL1-to-HAL2 driver migration
    • Breaking changes in concepts
      • Optimized initialization and configuration APIs
      • Atomic configuration methods
      • Specialized clock and IRQ management in HAL2
      • HAL implementation built upon LL services
      • Improved driver mechanisms
      • Enhanced control services
      • New coding rules
      • Optimized input checks
      • HAL refactoring
      • Enhanced asserts
      • Flash driver refactoring
      • RTOS-aware HAL
      • Misc. updates
    • HAL driver migration
      • ADC
        • HAL ADC migration: List of applicable concepts
        • Typical HAL ADC use cases for migration
        • HAL ADC constant migration
        • HAL ADC macro migration
        • HAL ADC type migration
        • HAL ADC initialization and configuration functions migration
        • HAL ADC I/O operation function migration
        • HAL ADC control function migration
        • HAL ADC state and error function migration
        • HAL ADC APIs listing for migration
      • COMP
        • HAL COMP migration: List of applicable concepts
        • Typical HAL COMP use cases for migration
        • HAL COMP constants migration
        • HAL COMP macros migration
        • HAL COMP types migration
        • HAL COMP initialization and configuration functions migration
        • HAL COMP io operation functions migration
        • HAL COMP control functions migration
        • HAL COMP state and error functions migration
        • HAL COMP APIs listing for migration
      • CORDIC
        • HAL CORDIC migration: List of applicable concepts
        • Typical HAL CORDIC use cases for migration
        • HAL CORDIC constants migration
        • HAL CORDIC macros migration
        • HAL CORDIC types migration
        • HAL CORDIC initialization and configuration functions migration
        • HAL CORDIC control functions migration
        • HAL CORDIC irq handler and callbacks functions migration
        • HAL CORDIC state and error functions migration
        • HAL CORDIC APIs listing for migration
      • CORTEX
        • HAL CORTEX migration: List of applicable concepts
        • Typical HAL CORTEX use cases for migration
        • HAL CORTEX constants migration
        • HAL CORTEX macro migration
        • HAL CORTEX types migration
        • HAL CORTEX initialization and configuration functions migration
        • HAL CORTEX NVIC functions migration
        • HAL CORTEX SYSTICK functions migration
        • HAL CORTEX MPU functions migration
        • HAL CORTEX APIs listing for migration
      • CRC
        • HAL CRC migration: List of applicable concepts
        • Typical HAL CRC use cases for migration
        • HAL CRC constants migration
        • HAL CRC macro migration
        • HAL CRC types migration
        • HAL CRC initialization and configuration functions migration
        • HAL CRC control functions migration
        • HAL CRC state functions migration
        • HAL CRC APIs listing for migration
      • CRYP
        • HAL CRYP migration: List of applicable concepts
        • HAL CRYP typical use cases for migration
        • HAL CRYP exported constants
        • HAL CRYP exported macros
        • HAL CRYP exported types
        • HAL CRYP exported functions init config
        • HAL CRYP exported functions io operation
        • HAL CRYP exported functions irq handler and callbacks
        • HAL CRYP exported functions state and error
        • HAL CRYP APIs listing for migration
      • DAC
        • HAL DAC migration: List of applicable concepts
        • Typical HAL DAC use cases for migration
        • HAL DAC constants migration
        • HAL DAC macro migration
        • HAL DAC types migration
        • HAL DAC initialization and configuration functions migration
        • HAL DAC io operation functions migration
        • HAL DAC control functions migration
        • HAL DAC IRQ Handler and Callbacks Functions Migration
        • HAL DAC state and error functions migration
        • HAL DAC APIs listing for migration
      • DMA
        • HAL DMA migration: List of applicable concepts
        • Typical HAL DMA use cases for migration
        • HAL DMA constants migration
        • HAL DMA macro migration
        • HAL DMA types migration
        • HAL DMA initialization and configuration functions migration
        • HAL DMA io operation functions migration
        • HAL DMA linked-list management functions migration
        • HAL DMA IRQ Handler and Callbacks Functions Migration
        • HAL DMA state and error functions migration
        • HAL DMA secure attributes settings functions migration
        • HAL DMA APIs listing for migration
      • EXTI
        • HAL EXTI migration: List of applicable concepts
        • Typical HAL EXTI use cases for migration
        • HAL EXTI constants migration
        • HAL EXTI types migration
        • HAL EXTI initialization and configuration functions migration
        • HAL EXTI configuration functions
        • HAL EXTI IO operation functions
        • HAL EXTI APIs listing for migration
      • FDCAN
        • HAL FDCAN migration: List of applicable concepts
        • Typical HAL FDCAN use cases for migration
        • HAL FDCAN constants migration
        • HAL FDCAN macros migration
        • HAL FDCAN types migration
        • HAL FDCAN initialization and configuration functions migration
        • HAL FDCAN I/O operation functions migration
        • HAL FDCAN IRQ Handler and Callbacks Functions Migration
        • HAL FDCAN state and error functions migration
        • HAL FDCAN APIs listing for migration
      • FLASH
        • HAL FLASH migration: List of applicable concepts
        • Typical HAL FLASH use cases for migration
        • HAL FLASH constants migration
        • HAL FLASH macros migration
        • HAL FLASH types migration
        • HAL FLASH initialization and configuration functions migration
        • HAL FLASH IO function migration
        • HAL FLASH ITF function migration
        • HAL FLASH APIs listing for migration
      • GENERIC
        • HAL GENERIC migration: List of applicable concepts
        • Typical HAL GENERIC use cases for migration
        • HAL GENERIC constants migration
        • HAL GENERIC macro migration
        • HAL GENERIC types migration
        • HAL GENERIC initialization and control functions migration
        • HAL GENERIC APIs listing for migration
      • GPIO
        • HAL GPIO migration: List of applicable concepts
        • Typical HAL GPIO use cases for migration
        • HAL GPIO constants migration
        • HAL GPIO macro migration
        • HAL GPIO types migration
        • HAL GPIO initialization and configuration functions migration
        • HAL GPIO io operation functions migration
        • HAL GPIO APIs listing for migration
      • HASH
        • HAL HASH migration: List of applicable concepts
        • Typical HAL HASH use cases for migration
        • HAL HASH constants migration
        • HAL HASH macro migration
        • HAL HASH types migration
        • HAL HASH initialization and configuration functions migration
        • HAL HASH I/O operations migration
        • HAL HASH IRQ handler and callbacks functions migration
        • HAL HASH state and error functions migration
        • HAL HASH APIs listing for migration
      • I2C
        • HAL I2C migration: List of applicable concepts
        • Typical HAL I2C use cases for migration
        • HAL I2C constants migration
        • HAL I2C macro migration
        • HAL I2C types migration
        • HAL I2C initialization and configuration functions migration
        • HAL I2C io operation functions migration
        • HAL I2C IRQ handler and callbacks functions migration
        • HAL I2C state and error functions migration
        • HAL I2C APIs listing for migration
      • I2S
        • HAL I2S migration: List of applicable concepts
        • Typical HAL I2S use cases for migration
        • HAL I2S constants migration
        • HAL I2S macro migration
        • HAL I2S types migration
        • HAL I2S initialization and configuration functions migration
        • HAL I2S io operation functions migration
        • HAL I2S IRQ handler and callbacks functions migration
        • HAL I2S state and error functions migration
        • HAL I2S APIs listing for migration
      • I3C
        • HAL I3C migration: List of applicable concepts
        • Typical HAL I3C use cases for migration
        • HAL I3C constants migration
        • HAL I3C macros migration
        • HAL I3C types migration
        • HAL I3C initialization and configuration functions migration
        • HAL I3C I/O operation functions migration
        • HAL I3C IRQ handler and callbacks functions migration
        • HAL I3C state and error functions migration
        • HAL I3C APIs listing for migration
      • ICACHE
        • HAL ICACHE migration: List of applicable concepts
        • Typical HAL ICACHE use cases for migration
        • HAL ICACHE constants migration
        • HAL ICACHE macro migration
        • HAL ICACHE types migration
        • HAL ICACHE initialization and configuration functions migration
        • HAL ICACHE control functions migration
        • HAL ICACHE memory remapped regions functions migration
        • HAL ICACHE IRQHandler and callbacks functions migration
        • HAL ICACHE APIs listing for migration
      • IRDA
        • HAL IRDA migration: List of applicable concepts
        • Typical HAL IRDA use cases for migration
        • HAL IRDA constants migration
        • HAL IRDA macro migration
        • HAL IRDA types migration
        • HAL IRDA initialization and configuration functions migration
        • HAL IRDA I/O operations migration
        • HAL IRDA state and error functions migration
        • HAL IRDA APIs listing for migration
      • IWDG
        • HAL IWDG migration: List of applicable concepts
        • HAL IWDG typical use cases for migration
        • HAL IWDG constants migration
        • HAL IWDG macro migration
        • HAL IWDG types migration
        • HAL IWDG initialization and configuration functions migration
        • HAL IWDG io operation functions migration
        • HAL IWDG Callbacks Register/Unregister functions migration
        • HAL IWDG APIs listing for migration
      • LPTIM
        • HAL LPTIM migration: List of applicable concepts
        • Typical HAL LPTIM use cases for migration
        • HAL LPTIM constants migration
        • HAL LPTIM macro migration
        • HAL LPTIM types migration
        • HAL LPTIM I/O functions migration
        • HAL LPTIM functions IRQHandler and callbacks migration
        • HAL LPTIM function migration
        • HAL LPTIM initialization and configuration functions migration
        • HAL LPTIM APIs listing for migration
      • OPAMP
        • HAL OPAMP migration: List of applicable concepts
        • Typical HAL OPAMP use cases for migration
        • HAL OPAMP constants migration
        • HAL OPAMP macros migration
        • HAL OPAMP types migration
        • HAL OPAMP initialization and configuration functions migration
        • HAL OPAMP io operation function migration
        • HAL OPAMP callback function migration
        • HAL OPAMP control function migration
        • HAL OPAMP state function migration
        • HAL OPAMP APIs listing for migration
      • PKA
        • HAL PKA migration: List of applicable concepts
        • Typical HAL PKA use cases for migration
        • HAL PKA constants migration
        • HAL PKA macros migration
        • HAL PKA types migration
        • HAL PKA initialization and configuration functions migration
        • HAL PKA io operation functions migration
        • HAL PKA IRQ handler and callbacks functions migration
        • HAL PKA state and error functions migration
        • HAL PKA APIs listing for migration
      • PWR
        • HAL PWR migration: List of applicable concepts
        • HAL PWR typical use cases for migration
        • HAL PWR constants migration
        • HAL PWR macros migration
        • HAL PWR types migration
        • HAL PWR initialization and configuration functions migration
        • HAL PWR IRQ Handler and Callbacks Functions Migration
        • HAL PWR control function migration
        • HAL PWR voltage monitoring functions migration
        • HAL PWR supply control functions migration
        • HAL PWR low power control functions migration
        • HAL PWR pullUp pullDown configuration functions migration
        • HAL PWR memories retention functions migration
        • HAL PWR IO and JTAG retention functions migration
        • HAL PWR APIs listing for migration
      • RAMCFG
        • HAL RAMCFG migration: List of applicable concepts
        • HAL RAMCFG typical use cases for migration
        • HAL RAMCFG constants migration
        • HAL RAMCFG macro migration
        • HAL RAMCFG types migration
        • HAL RAMCFG initialization and configuration functions migration
        • HAL RAMCFG function migration
        • HAL RAMCFG IRQHandler and callbacks functions migration
        • HAL RAMCFG state and error functions migration
        • HAL RAMCFG APIs listing for migration
      • RCC
        • HAL RCC migration: List of applicable concepts
        • HAL RCC Typical use cases for migration
        • HAL RCC constants migration
        • HAL RCC macro migration
        • HAL RCC types migration
        • HAL RCC Initialization and de-initialization functions
        • HAL RCC control functions migration
        • HAL RCC PLL functions migration
        • HAL RCC Function services
        • HAL RCC clock recovery system (CRS) function control
        • HAL RCC secure attributes settings functions migration
        • HAL RCC APIs listing for migration
      • RNG
        • HAL RNG migration: List of applicable concepts
        • Typical HAL RNG use cases for migration
        • HAL RNG constants migration
        • HAL RNG macro migration
        • HAL RNG types migration
        • HAL RNG initialization and configuration functions migration
        • HAL RNG configuration functions migration
        • HAL RNG control functions migration
        • HAL RNG IRQ Handler and Callbacks Functions Migration
        • HAL RNG state and error functions migration
        • HAL RNG APIs listing for migration
      • RTC
        • HAL RTC migration: List of applicable concepts
        • HAL RTC Typical use cases for migration
        • HAL RTC constants migration
        • HAL RTC macro migration
        • HAL RTC types migration
        • HAL RTC initialization and configuration functions migration
        • HAL RTC time and date functions migration
        • HAL RTC alarm functions migration
        • HAL RTC control functions migration
        • HAL RTC state functions migration
        • HAL RTC TimeStamp functions migration
        • HAL RTC wake-up functions migration
        • HAL RTC tamper functions migration
        • HAL RTC backup functions migration
        • HAL RTC Secure and Privilege functions migration
        • HAL RTC APIs listing for migration
      • SMARTCARD
        • HAL SMARTCARD migration: List of applicable concepts
        • Typical HAL SMARTCARD use cases for migration
        • HAL SMARTCARD constants migration
        • HAL SMARTCARD macro migration
        • HAL SMARTCARD types migration
        • HAL SMARTCARD initialization and configuration functions migration
        • HAL SMARTCARD I/O operations migration
        • HAL SMARTCARD control functions migration
        • HAL SMARTCARD state and error functions migration
        • HAL SMARTCARD APIs listing for migration
      • SMBUS
        • HAL SMBUS migration: List of applicable concepts
        • Typical HAL SMBUS use cases for migration
        • HAL SMBUS constants migration
        • HAL SMBUS macro migration
        • HAL SMBUS types migration
        • HAL SMBUS initialization and configuration functions migration
        • HAL SMBUS io operation functions migration
        • HAL SMBUS IRQ Handler and Callbacks Functions Migration
        • HAL SMBUS state and error functions migration
        • HAL SMBUS APIs listing for migration
      • SPI
        • HAL SPI migration: List of applicable concepts
        • Typical HAL SPI use cases for migration
        • HAL SPI constants migration
        • HAL SPI macro migration
        • HAL SPI types migration
        • HAL SPI initialization and configuration functions migration
        • HAL SPI I/O operation functions
        • HAL SPI state and error functions migration
        • HAL SPI callbacks register/unregister functions
        • HAL SPI APIs listing for migration
      • TIM
        • HAL TIM migration: List of applicable concepts
        • Typical HAL TIM use cases for migration
        • HAL TIM constants migration
        • HAL TIM macro migration
        • HAL TIM types migration
        • HAL TIM initialization and configuration functions migration
        • HAL TIM I/O operation function migration
        • HAL TIM control functions migration
        • HAL TIM IRQ handler and callbacks functions migration
        • HAL TIM state and error functions migration
        • HAL TIM APIs listing for migration
      • UART
        • HAL UART migration: List of applicable concepts
        • Typical HAL UART use cases for migration
        • HAL UART constants migration
        • HAL UART macro migration
        • HAL UART types migration
        • HAL UART initialization and configuration functions migration
        • HAL UART I/O operations migration
        • HAL UART control functions migration
        • HAL UART state and error functions migration
        • HAL UART APIs listing for migration
      • USART
        • HAL USART migration: List of applicable concepts
        • Typical HAL USART use cases for migration
        • HAL USART constants migration
        • HAL USART macro migration
        • HAL USART types migration
        • HAL USART initialization and configuration functions migration
        • HAL USART I/O operations migration
        • HAL USART control functions migration
        • HAL USART state and error functions migration
        • HAL USART APIs listing for migration
      • WWDG
        • HAL WWDG migration: List of applicable concepts
        • HAL WWDG Typical Use Cases for Migration
        • HAL WWDG constants migration
        • HAL WWDG macro migration
        • HAL WWDG types migration
        • HAL WWDG initialization and configuration functions migration
        • HAL WWDG io operation functions migration
        • HAL WWDG Callbacks Register/Unregister functions migration
        • HAL WWDG APIs listing for migration
    • LL driver migration
      • ADC
        • LL ADC APIs listing for migration
        • LL_ADC_Init and LL_ADC_DeInit APIs migration
      • COMP
        • LL COMP APIs listing for migration
        • LL_COMP_Init and LL_COMP_DeInit APIs migration
      • CORDIC
        • LL CORDIC APIs listing for migration
        • LL_CORDIC_DeInit API migration
      • CORTEX
        • LL CORTEX APIs listing for migration
      • CRC
        • LL CRC APIs listing for migration
        • LL_CRC_DeInit API migration
      • CRS
        • LL CRS APIs listing for migration
        • LL_CRS_DeInit API migration
      • DAC
        • LL DAC APIs listing for migration
        • LL_DAC_Init and LL_DAC_DeInit APIs migration
      • DMA
        • LL DMA APIs listing for migration
        • LL_DMA_Init and LL_DMA_DeInit APIs migration
        • LL DMA secure attributes settings APIs migration
      • EXTI
        • LL EXTI APIs listing for migration
        • LL_EXTI_Init and LL_EXTI_DeInit APIs migration
      • GENERIC
        • LL SYSTEM APIs listing for migration
      • GPIO
        • LL GPIO APIs listing for migration
        • LL_GPIO_Init and LL_GPIO_DeInit APIs migration
      • I2C
        • LL I2C APIs listing for migration
        • LL_I2C_Init and LL_I2C_DeInit APIs migration
        • LL I2C function API migration
      • I3C
        • LL I3C APIs listing for migration
        • LL_I3C_Init and LL_I3C_DeInit APIs migration
      • ICACHE
        • LL ICACHE APIs listing for migration
        • LL ICACHE init and ICACHE deinit for migration
      • IWDG
        • LL IWDG APIs listing for migration
      • LPTIM
        • LL LPTIM APIs listing for migration
        • LL_LPTIM_Init and LL_LPTIM_DeInit APIs migration
      • LPUART
        • LL LPUART APIs listing for migration
        • LL_LPUART_Init and LL_LPUART_DeInit APIs migration
      • OPAMP
        • LL OPAMP APIs listing for migration
        • LL_OPAMP_Init and LL_OPAMP_DeInit APIs migration
      • PKA
        • LL PKA APIs listing for migration
        • LL_PKA_Init and LL_PKA_DeInit APIs migration
      • PWR
        • LL PWR APIs listing for migration
        • LL_PWR_DeInit APIs migration
      • RCC
        • LL RCC APIs listing for migration
        • LL_RCC_DeInit API migration
        • LL_RCC_GetSystemClocksFreq API migration
        • LL_RCC_GetPPPClockFreq APIs migration
      • RNG
        • LL RNG APIs listing for migration
        • LL_RNG_Init and LL_RNG_DeInit APIs migration
      • RTC
        • LL RTC APIs listing for migration
        • LL_RTC_Init and LL_RTC_DeInit APIs migration
      • SPI
        • LL SPI APIs listing for migration
        • LL_SPI_Init and LL_SPI_DeInit APIs migration
      • TIM
        • LL TIM APIs listing for migration
        • LL_TIM_Init and LL_TIM_DeInit APIs migration
      • USART
        • LL USART APIs listing for migration
        • LL_USART_Init and LL_USART_DeInit APIs migration
      • WWDG
        • LL WWDG APIs listing for migration
  • Migration example
    • STM32C5
      • Migration example introduction
      • STM32CubeMX2
      • Configure IDE Project Settings
      • Execute the automatic detection script
      • Resolve HAL1 detected references
      • Alternative option using Stubbing
  1. HAL2 Migrator /
  2. HAL1-to-HAL2 driver migration /
  3. LL driver migration /
  4. I2C

I2C ¶

This section provides information about the migration APIs of the LL GPIO driver.

  • LL I2C APIs listing for migration
  • LL_I2C_Init and LL_I2C_DeInit APIs migration
  • LL I2C function API migration
Previous
LL_GPIO_Init and LL_GPIO_DeInit APIs migration
Next
LL I2C APIs listing for migration

© Copyright 2026, STMicroelectronics.

Built with Sphinx and the Shibuya theme.