.. include:: ../substitutions.rst I2C === The Inter-Integrated Circuit (I2C) interface is a two-wire, bidirectional serial bus that provides a simple and efficient method for data exchange among devices. The |product| provides independent multimaster fast-mode I2C modules. This guide will show you how to test the I2C interface on the |product-cb|. .. note:: Only a subset of I2C interfaces are supported on the |product-cb| by default but others can be enabled via pin multiplexing. .. list-table:: I2C Settings :header-rows: 1 * - Hardware Interface - sysfs Path * - WKUP_I2C0 - /dev/i2c-1 * - I2C0 - /dev/i2c-2 * - I2C1 - /dev/i2c-3 * - I2C2 - /dev/i2c-4 Scanning the I2C Buses ---------------------- * Power on the |product-cb| and boot into Linux. * List the available I2C devices. Each ``/dev/i2c-*`` entry corresponds to one of the I2C interfaces in the table above. .. code-block:: console :caption: List I2C devices :substitutions: |target-prompt| ls /dev/i2c* * Use the ``i2cdetect`` command to scan each bus for devices. WKUP_I2C0 carries the SOM's own devices (PMIC, VDD_CORE regulator, EEPROM, RTC). I2C0, I2C1 and I2C2 carry the carrier-board peripherals. .. jinja:: :file: ../templates/interfaceguides/i2c-scan.jinja .. note:: UU indicates that the device with that particular address is tied to a kernel driver and you will be unable to communicate with the device via i2c commands (i2cset and i2cget). The devices on each bus correspond to: .. jinja:: :file: ../templates/interfaceguides/i2c-device-table.jinja .. note:: The list of visible I2C devices in your output may differ from what is shown above. This is because our System on Modules (SoMs) come in different variants, and some devices (like the RTC) are optional depending on the specific variant you are using. .. The device tree declares the sensor as "nxp,p3t1755"; the schematic populates a .. P3T1750DPZ. Temperature Sensor ------------------ The |product-cb| features an NXP P3T1750 digital temperature sensor (U56) on I2C2 (/dev/i2c-4, address 0x4F). It measures the temperature of the carrier board. Linux exposes the sensor through the hardware monitoring (hwmon) subsystem. For the temperature sensors inside the |soc-caps| processor, see :ref:`ThermalZone-62P`. * Each hwmon device has a ``name`` attribute. Find the hwmon device that belongs to the P3T1750: .. code-block:: console :substitutions: |target-prompt| grep -l p3t1755 /sys/class/hwmon/hwmon*/name * Read the temperature from the ``temp1_input`` attribute of that hwmon device (replace ``hwmonX`` with the device found above): .. code-block:: console :substitutions: |target-prompt| cat /sys/class/hwmon/hwmonX/temp1_input The value is in millidegrees Celsius. For example, a value of 32125 means 32.125°C. * The driver also provides the ``temp1_max`` and ``temp1_max_hyst`` attributes, which set the sensor's over-temperature limit and hysteresis (also in millidegrees Celsius).