2#ifndef DSY_SPI_MULTISLAVE_H
3#define DSY_SPI_MULTISLAVE_H
103 void* callback_context);
120 void* callback_context);
139 void* callback_context);
150 void EnableDevice(
size_t device_index);
151 void DisableDevice(
size_t device_index);
152 static void DmaStartCallback(
void* context);
164 void* callback_context;
166 void Invalidate() { device_index = -1; }
167 bool IsValid()
const {
return device_index >= 0; }
168 } current_dma_transfer_;
General Purpose I/O control.
Definition gpio.h:22
Definition leddriver.h:33
Definition spiMultislave.h:21
MultiSlaveSpiHandle()
Definition spiMultislave.h:43
SpiHandle::Result BlockingReceive(size_t device_index, uint8_t *buff, uint16_t size, uint32_t timeout=100)
SpiHandle::Result Init(const Config &config)
static constexpr size_t max_num_devices_
Definition spiMultislave.h:23
SpiHandle::Result BlockingTransmit(size_t device_index, uint8_t *buff, size_t size, uint32_t timeout=100)
SpiHandle::Result BlockingTransmitAndReceive(size_t device_index, uint8_t *tx_buff, uint8_t *rx_buff, size_t size, uint32_t timeout=100)
const Config & GetConfig() const
Definition spiMultislave.h:50
MultiSlaveSpiHandle(const MultiSlaveSpiHandle &other)=delete
SpiHandle::Result DmaReceive(size_t device_index, uint8_t *buff, size_t size, SpiHandle::StartCallbackFunctionPtr start_callback, SpiHandle::EndCallbackFunctionPtr end_callback, void *callback_context)
SpiHandle::Result DmaTransmit(size_t device_index, uint8_t *buff, size_t size, SpiHandle::StartCallbackFunctionPtr start_callback, SpiHandle::EndCallbackFunctionPtr end_callback, void *callback_context)
SpiHandle::Result 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)
void(* EndCallbackFunctionPtr)(void *context, Result result)
Definition spi.h:137
void(* StartCallbackFunctionPtr)(void *context)
Definition spi.h:135
Result
Definition spi.h:116
Hardware defines and helpers for daisy field platform.
Definition index.h:2
Definition spiMultislave.h:25
SpiHandle::Config::Direction direction
Definition spiMultislave.h:35
SpiHandle::Config::ClockPhase clock_phase
Definition spiMultislave.h:38
size_t num_devices
Definition spiMultislave.h:40
Pin sclk
Definition spiMultislave.h:28
Pin mosi
Definition spiMultislave.h:30
struct daisy::MultiSlaveSpiHandle::Config::@19 pin_config
SpiHandle::Config::Peripheral periph
Definition spiMultislave.h:34
SpiHandle::Config::ClockPolarity clock_polarity
Definition spiMultislave.h:37
SpiHandle::Config::BaudPrescaler baud_prescaler
Definition spiMultislave.h:39
Pin nss[max_num_devices_]
Definition spiMultislave.h:31
Pin miso
Definition spiMultislave.h:29
unsigned long datasize
Definition spiMultislave.h:36
representation of hardware port/pin combination
Definition daisy_core.h:193
BaudPrescaler
Definition spi.h:72
ClockPolarity
Definition spi.h:53
Direction
Definition spi.h:45
ClockPhase
Definition spi.h:59
Peripheral
Definition spi.h:29