Skip to content
Commit 6964fa8f authored by Jordan Yates's avatar Jordan Yates Committed by Anas Nashif
Browse files

i2c: introduce `struct i2c_dt_spec`



Introduces the `struct i2c_dt_spec` type, which contains the complete
I2c bus information derived from devicetree. It serves the same purpose
as `struct spi_dt_spec` in that it can be constructed automatically in
`DEVICE_DT_INST_DEFINE` macros and provided as a single handle to I2C
API calls. While I2C has much less instance configuration than SPI, this
is still useful to enable the following pattern in device drivers that
support both I2C and SPI comms:

```
struct config {
    union {
        struct spi_dt_spec spi;
        struct i2c_dt_spec i2c;
    };
};
```

Signed-off-by: default avatarJordan Yates <jordan.yates@data61.csiro.au>
parent 2070c099
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment