![]() |
nRF Connect SDK Bare Metal API 2.0.99
|
| int bm_spi_mngr_schedule | ( | struct bm_spi_mngr * | mgr, |
| const struct bm_spi_mngr_transaction * | transaction ) |
#include <bm_spi_mngr.h>
Schedule an SPI transaction.
The transaction is enqueued and started as soon as the SPI bus is available, thus when all previously scheduled transactions have been finished (possibly immediately).
If bm_spi_mngr_transaction::required_spim_cfg is set to a non-NULL value, the module compares it with the current configuration and reinitializes the SPIM instance with the new parameters if any differences are found. If bm_spi_mngr_transaction::required_spim_cfg is NULL, the default configuration passed to bm_spi_mngr_init is used instead.
The queue stores only a pointer to transaction, not a copy. The caller must keep transaction and its transfers array valid until the transaction completes (until end_callback runs).
| [in] | mgr | SPI transaction manager instance. |
| [in] | transaction | Descriptor of the transaction to be scheduled. |
| 0 | On success. |
| -EFAULT | If mgr, transaction, or its transfers array is NULL. |
| -EINVAL | If the transaction has zero transfers. |
| -ENOMEM | If the queue is full. |