Lines Matching +full:spi +full:- +full:dev

4  * SPDX-License-Identifier: Apache-2.0
9 #include <zephyr/drivers/spi.h>
15 #if DT_ANY_INST_ON_BUS_STATUS_OKAY(spi)
19 static int ens160_read_reg_spi(const struct device *dev, uint8_t reg, uint8_t *val) in ens160_read_reg_spi() argument
21 const struct ens160_config *config = dev->config; in ens160_read_reg_spi()
51 return spi_transceive_dt(&config->spi, &tx, &rx); in ens160_read_reg_spi()
54 static int ens160_read_data_spi(const struct device *dev, uint8_t start, uint8_t *data, size_t len) in ens160_read_data_spi() argument
56 const struct ens160_config *config = dev->config; in ens160_read_data_spi()
86 return spi_transceive_dt(&config->spi, &tx, &rx); in ens160_read_data_spi()
89 static int ens160_write_reg_spi(const struct device *dev, uint8_t reg, uint8_t val) in ens160_write_reg_spi() argument
91 const struct ens160_config *config = dev->config; in ens160_write_reg_spi()
111 return spi_write_dt(&config->spi, &tx); in ens160_write_reg_spi()
114 static int ens160_write_data_spi(const struct device *dev, uint8_t reg, uint8_t *data, size_t len) in ens160_write_data_spi() argument
116 const struct ens160_config *config = dev->config; in ens160_write_data_spi()
136 return spi_write_dt(&config->spi, &tx); in ens160_write_data_spi()
146 int ens160_spi_init(const struct device *dev) in ens160_spi_init() argument
148 const struct ens160_config *config = dev->config; in ens160_spi_init()
149 struct ens160_data *data = dev->data; in ens160_spi_init()
151 if (!spi_is_ready_dt(&config->spi)) { in ens160_spi_init()
152 LOG_DBG("SPI bus not ready"); in ens160_spi_init()
153 return -ENODEV; in ens160_spi_init()
156 data->tf = &ens160_spi_transfer_function; in ens160_spi_init()
161 #endif /* DT_ANY_INST_ON_BUS_STATUS_OKAY(spi) */