Lines Matching +full:time +full:- +full:of +full:- +full:flight
4 * SPDX-License-Identifier: Apache-2.0
27 #include <zephyr/dt-bindings/spi/spi.h>
73 * Whatever data is transmitted is looped-back to the receiving buffer of
115 /** Requests - if possible - to keep CS asserted after the transaction */
139 * Default is single, which is the case most of the time.
155 * This can be used to control a CS line via a GPIO line, instead of
161 * GPIO devicetree specification of CS GPIO.
187 * cs-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>,
190 * a: spi-dev-a@0 {
194 * b: spi-dev-b@1 {
241 * cs-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
242 * spidev: spi-device@0 { ... };
309 * - 0: Master or slave.
310 * - 1..3: Polarity, phase and loop mode.
311 * - 4: LSB or MSB first.
312 * - 5..10: Size of a data frame (word) in bits.
313 * - 11: Full/half duplex.
314 * - 12: Hold on the CS line if possible.
315 * - 13: Keep resource locked for the caller.
316 * - 14: Active high CS logic.
317 * - 15: Motorola or TI frame format (optional).
321 * - 16..17: MISO lines (Single/Dual/Quad/Octal).
322 * - 18..31: Reserved for future use.
328 * @brief GPIO chip-select line (optional, must be initialized to zero
430 * can be queried at compile-time to determine whether allocating a constant
461 /** Length of the buffer @a buf in bytes.
463 * buffer) or the length of bytes that should be skipped (as RX buffer).
472 /** Pointer to an array of spi_buf, or NULL */
474 /** Length of the array (number of buffers) pointed by @a buffers */
503 CONTAINER_OF(dev_->state, struct spi_device_state, devstate)->stats
541 * This does device instance specific initialization of common data (such as stats)
548 CONTAINER_OF(dev->state, struct spi_device_state, devstate); \
549 stats_init(&state->stats.s_hdr, STATS_SIZE_32, 3, \
551 stats_register(dev->name, &(state->stats.s_hdr)); \
563 * @param init_fn Name of the init function of the driver.
567 * information for this instance of the driver.
600 tx_bytes = tx_bufs->count ? tx_bufs->buffers->len : 0; in spi_transceive_stats()
605 rx_bytes = rx_bufs->count ? rx_bufs->buffers->len : 0; in spi_transceive_stats()
631 * @brief Like SPI_DEVICE_DT_DEFINE(), but uses an instance of a `DT_DRV_COMPAT`
632 * compatible instead of a node identifier.
654 * @param dev SPI device which is notifying of transfer completion or error
655 * @param result Result code of the transfer request. 0 is success, -errno for failure.
715 return config->cs.gpio.port != NULL; in spi_cs_is_gpio()
727 return spi_cs_is_gpio(&spec->config); in spi_cs_is_gpio_dt()
741 if (!device_is_ready(spec->bus)) { in spi_is_ready_dt()
746 !gpio_is_ready_dt(&spec->config.cs.gpio)) { in spi_is_ready_dt()
753 * @brief Read/write the specified amount of data from the SPI driver.
759 * Pointer-comparison may be used to detect changes from
766 * @retval frames Positive number of frames received in slave mode.
768 * @retval -errno Negative errno code on failure.
781 (const struct spi_driver_api *)dev->api; in z_impl_spi_transceive()
784 ret = api->transceive(dev, config, tx_bufs, rx_bufs); in z_impl_spi_transceive()
795 * spi_transceive(spec->bus, &spec->config, tx_bufs, rx_bufs);
809 return spi_transceive(spec->bus, &spec->config, tx_bufs, rx_bufs); in spi_transceive_dt()
813 * @brief Read the specified amount of data from the SPI driver.
821 * Pointer-comparison may be used to detect changes from
825 * @retval frames Positive number of frames received in slave mode.
827 * @retval -errno Negative errno code on failure.
841 * spi_read(spec->bus, &spec->config, rx_bufs);
851 return spi_read(spec->bus, &spec->config, rx_bufs); in spi_read_dt()
855 * @brief Write the specified amount of data from the SPI driver.
863 * Pointer-comparison may be used to detect changes from
868 * @retval -errno Negative errno code on failure.
882 * spi_write(spec->bus, &spec->config, tx_bufs);
892 return spi_write(spec->bus, &spec->config, tx_bufs); in spi_write_dt()
898 * @brief Read/write the specified amount of data from the SPI driver.
907 * Pointer-comparison may be used to detect changes from
915 * notify the end of the transaction, and whether it went
919 * @retval frames Positive number of frames received in slave mode.
921 * @retval -errno Negative errno code on failure.
931 (const struct spi_driver_api *)dev->api; in spi_transceive_cb()
933 return api->transceive_async(dev, config, tx_bufs, rx_bufs, callback, userdata); in spi_transceive_cb()
943 * @brief Read/write the specified amount of data from the SPI driver.
952 * Pointer-comparison may be used to detect changes from
960 * notify the end of the transaction, and whether it went
963 * @retval frames Positive number of frames received in slave mode.
965 * @retval -errno Negative errno code on failure.
974 (const struct spi_driver_api *)dev->api; in spi_transceive_signal()
977 return api->transceive_async(dev, config, tx_bufs, rx_bufs, cb, sig); in spi_transceive_signal()
981 * @brief Read the specified amount of data from the SPI driver.
992 * Pointer-comparison may be used to detect changes from
997 * notify the end of the transaction, and whether it went
1000 * @retval frames Positive number of frames received in slave mode.
1002 * @retval -errno Negative errno code on failure.
1013 * @brief Write the specified amount of data from the SPI driver.
1024 * Pointer-comparison may be used to detect changes from
1029 * notify the end of the transaction, and whether it went
1033 * @retval -errno Negative errno code on failure.
1055 * Must live as long as the request is in flight.
1059 const struct spi_dt_spec *dt_spec = (const struct spi_dt_spec *)iodev_sqe->sqe.iodev->data; in spi_iodev_submit()
1060 const struct device *dev = dt_spec->bus; in spi_iodev_submit()
1061 const struct spi_driver_api *api = (const struct spi_driver_api *)dev->api; in spi_iodev_submit()
1063 api->iodev_submit(dt_spec->bus, iodev_sqe); in spi_iodev_submit()
1072 * will save a small amount of memory.
1094 struct spi_dt_spec *spec = (struct spi_dt_spec *)spi_iodev->data; in spi_is_ready_iodev()
1106 * given config parameter was the last one to be used (in any of the
1119 * @retval -errno Negative errno code on failure.
1128 (const struct spi_driver_api *)dev->api; in z_impl_spi_release()
1130 return api->release(dev, config); in z_impl_spi_release()
1138 * spi_release(spec->bus, &spec->config);
1146 return spi_release(spec->bus, &spec->config); in spi_release_dt()