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:
Jordan Yates <jordan.yates@data61.csiro.au>
Loading
Please sign in to comment