SPIIn¶
SPIIn node is used for receiving data that was sent from a MCU (via SPI). OAK-IOT devices have an on-board ESP32 that is connected to the VPU (MyriadX) 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
SPIIn node. Receives messages over SPI.
-
class
Connection
Connection between an Input and Output
-
class
Id
Node identificator. Unique for every node on a single Pipeline
-
Properties
alias of
depthai.SPIInProperties
-
getAssetManager
(*args, **kwargs) Overloaded function.
getAssetManager(self: depthai.Node) -> depthai.AssetManager
Get node AssetManager as a const reference
getAssetManager(self: depthai.Node) -> depthai.AssetManager
Get node AssetManager as a const reference
-
getBusId
(self: depthai.node.SPIIn) → int Get bus id
-
getInputRefs
(*args, **kwargs) Overloaded function.
getInputRefs(self: depthai.Node) -> List[depthai.Node.Input]
Retrieves reference to node inputs
getInputRefs(self: depthai.Node) -> List[depthai.Node.Input]
Retrieves reference to node inputs
-
getInputs
(self: depthai.Node) → List[depthai.Node.Input] Retrieves all nodes inputs
-
getMaxDataSize
(self: depthai.node.SPIIn) → int Get maximum messages size in bytes
-
getName
(self: depthai.Node) → str Retrieves nodes name
-
getNumFrames
(self: depthai.node.SPIIn) → int Get number of frames in pool
-
getOutputRefs
(*args, **kwargs) Overloaded function.
getOutputRefs(self: depthai.Node) -> List[depthai.Node.Output]
Retrieves reference to node outputs
getOutputRefs(self: depthai.Node) -> List[depthai.Node.Output]
Retrieves reference to node outputs
-
getOutputs
(self: depthai.Node) → List[depthai.Node.Output] Retrieves all nodes outputs
-
getParentPipeline
(*args, **kwargs) Overloaded function.
getParentPipeline(self: depthai.Node) -> depthai.Pipeline
getParentPipeline(self: depthai.Node) -> depthai.Pipeline
-
getStreamName
(self: depthai.node.SPIIn) → str Get stream name
-
property
id
Id of node
-
property
out
Outputs message of same type as send from host.
-
setBusId
(self: depthai.node.SPIIn, id: int) → None Specifies SPI Bus number to use
- Parameter
id
: SPI Bus id
- Parameter
-
setMaxDataSize
(self: depthai.node.SPIIn, maxDataSize: int) → None Set maximum message size it can receive
- Parameter
maxDataSize
: Maximum size in bytes
- Parameter
-
setNumFrames
(self: depthai.node.SPIIn, numFrames: int) → None Set number of frames in pool for sending messages forward
- Parameter
numFrames
: Maximum number of frames in pool
- Parameter
-
setStreamName
(self: depthai.node.SPIIn, name: str) → None Specifies stream name over which the node will receive data
- Parameter
name
: Stream name
- Parameter
-
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
-
constexpr const char *
NAME
= "SPIIn"¶
-
void
Got questions?
We’re always happy to help with code or other questions you might have.