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

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.

  1. getAssetManager(self: depthai.Node) -> depthai.AssetManager

Get node AssetManager as a const reference

  1. 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.

  1. getInputRefs(self: depthai.Node) -> List[depthai.Node.Input]

Retrieves reference to node inputs

  1. 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.

  1. getOutputRefs(self: depthai.Node) -> List[depthai.Node.Output]

Retrieves reference to node outputs

  1. 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.

  1. getParentPipeline(self: depthai.Node) -> depthai.Pipeline

  2. 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

setMaxDataSize(self: depthai.node.SPIIn, maxDataSize: int)None

Set maximum message size it can receive

Parameter maxDataSize:

Maximum size in bytes

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

setStreamName(self: depthai.node.SPIIn, name: str)None

Specifies stream name over which the node will receive data

Parameter name:

Stream name

class dai::node::SPIIn : public dai::NodeCRTP<Node, SPIIn, SPIInProperties>

SPIIn node. Receives messages over SPI.

Public Functions

SPIIn(const std::shared_ptr<PipelineImpl> &par, int64_t nodeId)
SPIIn(const std::shared_ptr<PipelineImpl> &par, int64_t nodeId, std::unique_ptr<Properties> props)
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"

Got questions?

Head over to Discussion Forum for technical support or any other questions you might have.