nRF Connect SDK Bare Metal API 2.0.99
Loading...
Searching...
No Matches

◆ BM_SPI_MNGR_DEF

#define BM_SPI_MNGR_DEF ( _name,
_queue_size,
_spim_inst )

#include <bm_spi_mngr.h>

Value:
static uint8_t _name##_queue_bytes[(_queue_size) * \
sizeof(const struct bm_spi_mngr_transaction *)]; \
static nrfx_spim_t _name##_spim = NRFX_SPIM_INSTANCE(_spim_inst); \
static struct bm_spi_mngr _name = { \
.queue = { \
.size = (_queue_size), \
.byte_storage = _name##_queue_bytes, \
}, \
.spim = &_name##_spim, \
}
SPI transaction descriptor.
Definition bm_spi_mngr.h:116
uint8_t * byte_storage
Buffer that ring_buf uses to store the queued transaction pointers.
Definition bm_spi_mngr.h:196
SPI transaction manager instance.
Definition bm_spi_mngr.h:154

Macro for defining an SPI transaction manager instance.

This macro allocates a static buffer for the transaction queue. Therefore, use it in only one place in the code for a given instance name.

The queue size is the maximum number of pending transactions not counting the one that is running. For an empty queue with size of for example 4 elements, it is possible to schedule up to 5 transactions.

Parameters
[in]_nameName of the instance to be created.
[in]_queue_sizeSize of the transaction queue (maximum number of pending transactions).
[in]_spim_instIndex of the SPIM hardware instance to be used.