zephyr/drivers/sensor/stmemsc/stmemsc.h
Armando Visconti dabaaa1e5d drivers/sensor: stmemsc: make use of spi_dt_spec and i2c_dt_spec
Make use of the new DT facilities that introduced two new
bus structures, spi_dt_spec and i2c_dt_spec, as well as the
macros, SPI_DT_SPEC_INST_GET and I2C_DT_SPEC_INST_GET, to
retrieve info from DT.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-10-22 09:06:07 -05:00

30 lines
888 B
C

/* ST Microelectronics STMEMS hal i/f
*
* Copyright (c) 2021 STMicroelectronics
*
* SPDX-License-Identifier: Apache-2.0
*
* zephyrproject-rtos/modules/hal/st/sensor/stmemsc/
*/
#ifndef ZEPHYR_DRIVERS_SENSOR_STMEMSC_STMEMSC_H_
#define ZEPHYR_DRIVERS_SENSOR_STMEMSC_STMEMSC_H_
#include <drivers/i2c.h>
#include <drivers/spi.h>
#ifdef CONFIG_I2C
int stmemsc_i2c_read(const struct i2c_dt_spec *stmemsc,
uint8_t reg_addr, uint8_t *value, uint8_t len);
int stmemsc_i2c_write(const struct i2c_dt_spec *stmemsc,
uint8_t reg_addr, uint8_t *value, uint8_t len);
#endif
#ifdef CONFIG_SPI
int stmemsc_spi_read(const struct spi_dt_spec *stmemsc,
uint8_t reg_addr, uint8_t *value, uint8_t len);
int stmemsc_spi_write(const struct spi_dt_spec *stmemsc,
uint8_t reg_addr, uint8_t *value, uint8_t len);
#endif
#endif /* ZEPHYR_DRIVERS_SENSOR_STMEMSC_STMEMSC_H_ */