ON THIS PAGE

  • SPIIn
  • How to place it
  • Inputs and Outputs
  • Usage
  • Examples of functionality
  • Reference

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

Python
C++
Python
1pipeline = dai.Pipeline()
2spi = pipeline.create(dai.node.SPIIn)

Inputs and Outputs

Command Line
1/
2             ┌─────────────┐
3  SPI        │             │
4  (from MCU) |             │      out
5  ----------►│    SPIIn    ├─────────►
6             │             │
7             │             │
8             └─────────────┘
Message types
  • out - Any

Usage

Python
C++
Python
1pipeline = dai.Pipeline()
2spi = pipeline.create(dai.node.SPIIn)
3
4spi.setStreamName("control")
5spi.setBusId(0)

Examples of functionality

Reference

class

depthai.node.SPIIn(depthai.Node)

method
method
getMaxDataSize(self) -> int: int
Get maximum messages size in bytes
method
getNumFrames(self) -> int: int
Get number of frames in pool
method
method
setBusId(self, id: int)
Specifies SPI Bus number to use

Parameter ``id``:
    SPI Bus id
method
setMaxDataSize(self, maxDataSize: int)
Set maximum message size it can receive

Parameter ``maxDataSize``:
    Maximum size in bytes
method
setNumFrames(self, numFrames: int)
Set number of frames in pool for sending messages forward

Parameter ``numFrames``:
    Maximum number of frames in pool
method
setStreamName(self, name: str)
Specifies stream name over which the node will receive data

Parameter ``name``:
    Stream name
property
out
Outputs message of same type as send from host.

Need assistance?

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