Lines Matching +full:spi +full:- +full:addr
4 * SPDX-License-Identifier: Apache-2.0
11 #include <zephyr/drivers/spi.h>
20 /* SPI device */
21 static const struct spi_dt_spec spi = SPI_DT_SPEC_INST_GET(0, variable
40 #define MAX_READ_LEN (UINT16_MAX - ADDR_SIZE - DUMMY_READ_SIZE)
41 #define MAX_WRITE_LEN (UINT16_MAX - ADDR_SIZE)
47 static void insert_addr(uint32_t addr, uint8_t *buff) in insert_addr() argument
49 buff[0] = (addr >> 16) & 0x3f; in insert_addr()
50 buff[1] = (addr >> 8) & 0xff; in insert_addr()
51 buff[2] = (addr) & 0xff; in insert_addr()
58 if (!spi_is_ready_dt(&spi)) { in ft8xx_drv_init()
59 LOG_ERR("SPI bus %s not ready", spi.bus->name); in ft8xx_drv_init()
60 return -ENODEV; in ft8xx_drv_init()
67 LOG_ERR("GPIO device %s is not ready", irq_gpio.port->name); in ft8xx_drv_init()
68 return -ENODEV; in ft8xx_drv_init()
112 ret = spi_write_dt(&spi, &tx_bufs); in ft8xx_drv_write()
114 LOG_ERR("SPI write error: %d", ret); in ft8xx_drv_write()
155 ret = spi_transceive_dt(&spi, &tx_bufs, &rx_bufs); in ft8xx_drv_read()
157 LOG_ERR("SPI transceive error: %d", ret); in ft8xx_drv_read()
181 ret = spi_write_dt(&spi, &tx_bufs); in ft8xx_drv_command()
183 LOG_ERR("SPI command error: %d", ret); in ft8xx_drv_command()