SPIIn¶
SPIIn node is used for receiving data that was sent from a MCU (via SPI). You can find demos here.
This allows you for example to control eg. ColorCamera or ImageManip from the MCU or send a Buffer of data from the MCU to a Script node.
SPIOut is used for sending data from the VPU to a MCU (via SPI).
How to place it¶
pipeline = dai.Pipeline()
spi = pipeline.create(dai.node.SPIIn)
dai::Pipeline pipeline;
auto spi = pipeline.create<dai::node::SPIIn>();
Inputs and Outputs¶
┌─────────────┐
SPI │ │
(from MCU) | │ out
----------►│ SPIIn ├─────────►
│ │
│ │
└─────────────┘
Message types
out-Any
Usage¶
pipeline = dai.Pipeline()
spi = pipeline.create(dai.node.SPIIn)
spi.setStreamName("control")
spi.setBusId(0)
dai::Pipeline pipeline;
auto spi = pipeline.create<dai::node::SPIIn>();
spi->setStreamName("control");
spi->setBusId(0);
Examples of functionality¶
Reference¶
-
class
depthai.node.SPIIn -
class
Id Node identificator. Unique for every node on a single Pipeline
-
getAssetManager(*args, **kwargs) Overloaded function.
getAssetManager(self: depthai.Node) -> depthai.AssetManager
getAssetManager(self: depthai.Node) -> depthai.AssetManager
-
getBusId(self: depthai.node.SPIIn) → int
-
getInputRefs(*args, **kwargs) Overloaded function.
getInputRefs(self: depthai.Node) -> list[depthai.Node.Input]
getInputRefs(self: depthai.Node) -> list[depthai.Node.Input]
-
getInputs(self: depthai.Node) → list[depthai.Node.Input]
-
getMaxDataSize(self: depthai.node.SPIIn) → int
-
getName(self: depthai.Node) → str
-
getNumFrames(self: depthai.node.SPIIn) → int
-
getOutputRefs(*args, **kwargs) Overloaded function.
getOutputRefs(self: depthai.Node) -> list[depthai.Node.Output]
getOutputRefs(self: depthai.Node) -> list[depthai.Node.Output]
-
getOutputs(self: depthai.Node) → list[depthai.Node.Output]
-
getParentPipeline(*args, **kwargs) Overloaded function.
getParentPipeline(self: depthai.Node) -> depthai.Pipeline
getParentPipeline(self: depthai.Node) -> depthai.Pipeline
-
getStreamName(self: depthai.node.SPIIn) → str
-
setBusId(self: depthai.node.SPIIn, id: int) → None
-
setMaxDataSize(self: depthai.node.SPIIn, maxDataSize: int) → None
-
setNumFrames(self: depthai.node.SPIIn, numFrames: int) → None
-
setStreamName(self: depthai.node.SPIIn, name: str) → None
-
class
-
class
dai::node::SPIIn: public dai::NodeCRTP<Node, SPIIn, SPIInProperties>¶ SPIIn node. Receives messages over SPI.
Public Functions
-
void
setStreamName(const std::string &name)¶ Specifies stream name over which the node will receive data
- Parameters
name: Stream name
-
void
setBusId(int id)¶ Specifies SPI Bus number to use
- Parameters
id: SPI Bus id
-
void
setMaxDataSize(std::uint32_t maxDataSize)¶ Set maximum message size it can receive
- Parameters
maxDataSize: Maximum size in bytes
-
void
setNumFrames(std::uint32_t numFrames)¶ Set number of frames in pool for sending messages forward
- Parameters
numFrames: Maximum number of frames in pool
-
std::string
getStreamName() const¶ Get stream name.
-
int
getBusId() const¶ Get bus id.
-
std::uint32_t
getMaxDataSize() const¶ Get maximum messages size in bytes.
-
std::uint32_t
getNumFrames() const¶ Get number of frames in pool.
Public Members
-
Output
out= {*this, "out", Output::Type::MSender, {{DatatypeEnum::Buffer, true}}}¶ Outputs message of same type as send from host.
Public Static Attributes
-
static constexpr const char *
NAME= "SPIIn"¶
-
void