Lines Matching refs:bus

155 	bool (*is_ready)(const struct pinnacle_bus *bus);
156 int (*write)(const struct pinnacle_bus *bus, uint8_t address, uint8_t value);
157 int (*seq_write)(const struct pinnacle_bus *bus, uint8_t *address, uint8_t *value,
159 int (*read)(const struct pinnacle_bus *bus, uint8_t address, uint8_t *value);
160 int (*seq_read)(const struct pinnacle_bus *bus, uint8_t address, uint8_t *data,
172 const struct pinnacle_bus bus; member
219 return config->bus.is_ready(&config->bus); in pinnacle_bus_is_ready()
226 return config->bus.write(&config->bus, address, value); in pinnacle_write()
233 return config->bus.seq_write(&config->bus, address, value, count); in pinnacle_seq_write()
239 return config->bus.read(&config->bus, address, value); in pinnacle_read()
247 return config->bus.seq_read(&config->bus, address, data, count); in pinnacle_seq_read()
254 return config->bus.write(&config->bus, PINNACLE_REG_STATUS1, 0x00); in pinnacle_clear_cmd_complete()
369 static bool pinnacle_is_ready_i2c(const struct pinnacle_bus *bus) in pinnacle_is_ready_i2c() argument
371 if (!i2c_is_ready_dt(&bus->i2c)) { in pinnacle_is_ready_i2c()
372 LOG_ERR("I2C bus %s is not ready", bus->i2c.bus->name); in pinnacle_is_ready_i2c()
379 static int pinnacle_write_i2c(const struct pinnacle_bus *bus, uint8_t address, uint8_t value) in pinnacle_write_i2c() argument
383 return i2c_write_dt(&bus->i2c, buf, 2); in pinnacle_write_i2c()
386 static int pinnacle_seq_write_i2c(const struct pinnacle_bus *bus, uint8_t *address, uint8_t *value, in pinnacle_seq_write_i2c() argument
396 return i2c_write_dt(&bus->i2c, buf, count * 2); in pinnacle_seq_write_i2c()
399 static int pinnacle_read_i2c(const struct pinnacle_bus *bus, uint8_t address, uint8_t *value) in pinnacle_read_i2c() argument
403 return i2c_write_read_dt(&bus->i2c, &reg, 1, value, 1); in pinnacle_read_i2c()
406 static int pinnacle_seq_read_i2c(const struct pinnacle_bus *bus, uint8_t address, uint8_t *buf, in pinnacle_seq_read_i2c() argument
411 return i2c_burst_read_dt(&bus->i2c, reg, buf, count); in pinnacle_seq_read_i2c()
416 static bool pinnacle_is_ready_spi(const struct pinnacle_bus *bus) in pinnacle_is_ready_spi() argument
418 if (!spi_is_ready_dt(&bus->spi)) { in pinnacle_is_ready_spi()
419 LOG_ERR("SPI bus %s is not ready", bus->spi.bus->name); in pinnacle_is_ready_spi()
426 static int pinnacle_write_spi(const struct pinnacle_bus *bus, uint8_t address, uint8_t value) in pinnacle_write_spi() argument
441 return spi_write_dt(&bus->spi, &tx_set); in pinnacle_write_spi()
444 static int pinnacle_seq_write_spi(const struct pinnacle_bus *bus, uint8_t *address, uint8_t *value, in pinnacle_seq_write_spi() argument
462 return spi_write_dt(&bus->spi, &tx_set); in pinnacle_seq_write_spi()
465 static int pinnacle_read_spi(const struct pinnacle_bus *bus, uint8_t address, uint8_t *value) in pinnacle_read_spi() argument
499 rc = spi_transceive_dt(&bus->spi, &tx_set, &rx_set); in pinnacle_read_spi()
501 LOG_ERR("Failed to read from SPI %s", bus->spi.bus->name); in pinnacle_read_spi()
508 static int pinnacle_seq_read_spi(const struct pinnacle_bus *bus, uint8_t address, uint8_t *buf, in pinnacle_seq_read_spi() argument
553 rc = spi_transceive_dt(&bus->spi, &tx_set, &rx_set); in pinnacle_seq_read_spi()
555 LOG_ERR("Failed to read from SPI %s", bus->spi.bus->name); in pinnacle_seq_read_spi()
852 .bus = { \
863 .bus = { \