Commit Graph

1 Commits

Author SHA1 Message Date
Armando Visconti 253cbfd0aa drivers/sensor: stmemsc: Add common i2c/spi read/write routines
Add common i2c/spi read/write routines for the benefit of those
ST sensor drivers who make use of the stmemsc HAL i/f.

Add generic stmemsc_cfg_i2c and stmemsc_cfg_spi structures which
contains all relevant information required by i2c/spi low level
routines, such as:

    - the pointer to the bus device
    - the I2C slave address (if instance is on I2C bus)
    - the spi_config structure (if istance is on SPI bus)

This level of abstraction allows the re-use of the i2c/spi read/write
routines among all stmemsc based sensor driver without the need to
reference the specific sensor data and or config structures.

The STMEMSC HAL source code is located here:
     zephyrproject-rtos/modules/hal/st/sensor/stmemsc/

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-04-01 15:34:36 -05:00