Accessing I2C Devices in Linux (uClinux)
This application note explains how to use the I2C Master interface in Linux (uClinux) BSP (Board Support Package) for the STM32H7 device.
The Linux kernel provides a device driver for the I2C controller of the STM32H7 BSPs, enabled in the kernel with the CONFIG_I2C_STM32F7
build-time option. Another kernel configuration option that you will require is CONFIG_I2C_CHARDEV
. This option enables the kernel API that allows accessing I2C devices from user-space application code. These kernel configuration options are enabled by default in the rootfs
project.
The STM32H7 device provide four I2C bus controllers. The parameters of each bus controller are specified in the i2c*
child nodes properties in the corresponding linux/arch/arm/boot/dts/stm32h743.dtsi
file: