Class daisy::MultiSlaveSpiHandle¶
ClassList > daisy > MultiSlaveSpiHandle
#include <spiMultislave.h>
Classes¶
Type | Name |
---|---|
struct | Config |
Public Static Attributes¶
Type | Name |
---|---|
constexpr size_t | max_num_devices_ = 4 |
Public Functions¶
Detailed Description¶
Handler for a serial peripheral interface that connects to multiple devices on one bus such that up to 4 devices can share the same MOSI, MISO and SCLK pins. Each device has its own NSS/CS pin which is software driven by the MultiSlaveSpiHandle.
Public Static Attributes Documentation¶
variable max_num_devices_¶
Public Functions Documentation¶
function BlockingReceive¶
SpiHandle::Result daisy::MultiSlaveSpiHandle::BlockingReceive (
size_t device_index,
uint8_t * buff,
uint16_t size,
uint32_t timeout=100
)
Polling Receive
Parameters:
device_index
the index of the devicebuff
input buffersize
buffer sizetimeout
timeout time in ms
Returns:
Whether the receive was successful or not
function BlockingTransmit¶
SpiHandle::Result daisy::MultiSlaveSpiHandle::BlockingTransmit (
size_t device_index,
uint8_t * buff,
size_t size,
uint32_t timeout=100
)
Blocking transmit
Parameters:
device_index
the index of the devicebuff
input buffersize
buffer sizetimeout
timeout time in ms
function BlockingTransmitAndReceive¶
SpiHandle::Result daisy::MultiSlaveSpiHandle::BlockingTransmitAndReceive (
size_t device_index,
uint8_t * tx_buff,
uint8_t * rx_buff,
size_t size,
uint32_t timeout=100
)
Blocking transmit and receive
Parameters:
device_index
the index of the devicetx_buff
the transmit bufferrx_buff
the receive buffersize
the length of the transactiontimeout
timeout time in ms
function CheckError¶
Returns:
the result of HAL_SPI_GetError() to the user.
function DmaReceive¶
SpiHandle::Result daisy::MultiSlaveSpiHandle::DmaReceive (
size_t device_index,
uint8_t * buff,
size_t size,
SpiHandle::StartCallbackFunctionPtr start_callback,
SpiHandle::EndCallbackFunctionPtr end_callback,
void * callback_context
)
DMA-based receive
Parameters:
device_index
the index of the devicebuff
receive buffersize
buffer sizestart_callback
A callback to execute when the transfer starts, or NULL.end_callback
A callback to execute when the transfer finishes, or NULL.callback_context
A pointer that will be passed back to you in the callbacks.
Returns:
Whether the receive was successful or not
function DmaTransmit¶
SpiHandle::Result daisy::MultiSlaveSpiHandle::DmaTransmit (
size_t device_index,
uint8_t * buff,
size_t size,
SpiHandle::StartCallbackFunctionPtr start_callback,
SpiHandle::EndCallbackFunctionPtr end_callback,
void * callback_context
)
DMA-based transmit
Parameters:
device_index
the index of the devicebuff
transmit buffersize
buffer sizestart_callback
A callback to execute when the transfer starts, or NULL.end_callback
A callback to execute when the transfer finishes, or NULL.callback_context
A pointer that will be passed back to you in the callbacks.
Returns:
Whether the transmit was successful or not
function DmaTransmitAndReceive¶
SpiHandle::Result daisy::MultiSlaveSpiHandle::DmaTransmitAndReceive (
size_t device_index,
uint8_t * tx_buff,
uint8_t * rx_buff,
size_t size,
SpiHandle::StartCallbackFunctionPtr start_callback,
SpiHandle::EndCallbackFunctionPtr end_callback,
void * callback_context
)
DMA-based transmit and receive
Parameters:
device_index
the index of the devicetx_buff
the transmit bufferrx_buff
the receive buffersize
buffer sizestart_callback
A callback to execute when the transfer starts, or NULL.end_callback
A callback to execute when the transfer finishes, or NULL.callback_context
A pointer that will be passed back to you in the callbacks.
Returns:
Whether the receive was successful or not
function GetConfig¶
Returns the current config.
function Init¶
Initializes handler
function MultiSlaveSpiHandle [½]¶
function MultiSlaveSpiHandle [2/2]¶
The documentation for this class was generated from the following file external-docs/libDaisy/src/per/spiMultislave.h