Lines Matching +full:slave +full:- +full:mode
4 * SPDX-License-Identifier: Apache-2.0
20 if (config->slave != 0) { in spi_config()
21 if (config->slave >= SPI_MAX_CS_SIZE) { in spi_config()
23 return -ENOTSUP; in spi_config()
25 cs = (uint8_t)(config->slave); in spi_config()
28 if (config->operation & SPI_HALF_DUPLEX) { in spi_config()
29 LOG_ERR("Half-duplex not supported"); in spi_config()
30 return -ENOTSUP; in spi_config()
33 if (SPI_WORD_SIZE_GET(config->operation) != 8) { in spi_config()
35 return -ENOTSUP; in spi_config()
38 if (config->operation & SPI_CS_ACTIVE_HIGH) { in spi_config()
40 return -ENOTSUP; in spi_config()
43 if (config->operation & SPI_LOCK_ON) { in spi_config()
45 return -ENOTSUP; in spi_config()
49 (config->operation & SPI_LINES_MASK) != SPI_LINES_SINGLE) { in spi_config()
50 LOG_ERR("Only supports single mode"); in spi_config()
51 return -ENOTSUP; in spi_config()
54 if (config->operation & SPI_TRANSFER_LSB) { in spi_config()
56 return -ENOTSUP; in spi_config()
59 if (config->operation & (SPI_MODE_CPOL | SPI_MODE_CPHA)) { in spi_config()
61 return -ENOTSUP; in spi_config()
64 if (config->operation & SPI_OP_MODE_SLAVE) { in spi_config()
65 LOG_ERR("Slave mode not supported"); in spi_config()
66 return -ENOTSUP; in spi_config()
70 if (config->operation & SPI_MODE_LOOP) { in spi_config()
74 *control = (uint16_t) (SPI_WORD_SIZE_GET(config->operation) in spi_config()
105 struct spi_context *ctx = &SPI_DATA(dev)->ctx; in spi_litespi_xfer()
111 if (i < ctx->tx_len) { in spi_litespi_xfer()
112 spi_litespi_send(dev, (uint8_t) (ctx->tx_buf)[i], in spi_litespi_xfer()
120 if (i < ctx->rx_len) { in spi_litespi_xfer()
121 ctx->rx_buf[i] = read_data; in spi_litespi_xfer()
137 spi_context_buffers_setup(&SPI_DATA(dev)->ctx, tx_bufs, rx_bufs, 1); in spi_litespi_transceive()
149 return -ENOTSUP; in spi_litespi_transceive_async()
157 return -EBUSY; in spi_litespi_release()