zephyr,native-linux-i2c

Description

These nodes are “i2c” bus nodes.

Native Linux I2C controller

native_sim I2C controller backed by a host i2c-dev node. The host adapter
must support plain I2C transfers and sets the bus speed: the controller
only stores the configuration it is given, and returns it from get_config().
Transfers run on a host thread while simulated time goes on.

Examples

/ {
    i2c_host: i2c {
      compatible = "zephyr,native-linux-i2c";
      path = "/dev/i2c-1";
      #address-cells = <1>;
      #size-cells = <0>;

      sensor@76 {
        compatible = "bosch,bme280";
        reg = <0x76>;
      };
    };
};

Properties

Properties not inherited from the base binding file.

Name

Type

Details

path

string

Host i2c-dev node, e.g. "/dev/i2c-1". Overridden by the
--<node name>_path command line option.

This property is required.

clock-frequency

int

Initial clock frequency in Hz

sq-size

int

Size of the submission queue for blocking requests

Default value: 4

cq-size

int

Size of the completion queue for blocking requests

Default value: 4

zephyr,transfer-timeout-ms

int

Maximum time to wait for an I2C transfer to complete, in milliseconds.
When absent, the default value is CONFIG_I2C_TRANSFER_TIMEOUT_MS.