SPIOut

SPIOut node is used to send data through to a MCU via SPI. LUX-ESP32 module has integrated an integrated ESP32 connected to the MyriadX via SPI. You can find demos here.

How to place it

pipeline = dai.Pipeline()
spi = pipeline.createSPIOut()
dai::Pipeline pipeline;
auto spi = pipeline.create<dai::node::SPIOut>();

Inputs and Outputs

          ┌──────────────┐
          │              │
input     │              │ SPI (to MCU)
─────────►│    SPIOut    ├------------►
          │              │
          │              │
          └──────────────┘

Message types

  • input - Any

Usage

pipeline = dai.Pipeline()
spi = pipeline.createSPIOut()

spi.setStreamName("spimetaout")
spi.setBusId(0)
dai::Pipeline pipeline;
auto spi = pipeline.create<dai::node::SPIOut>();

spi->setStreamName("spimetaout");
spi->setBusId(0);

Examples of functionality

Reference

class depthai.SPIOut

SPIOut node. Sends messages over SPI.

class Connection

Connection between an Input and Output

class Id

Node identificator. Unique for every node on a single Pipeline

getAssets(self: depthai.Node) → List[depthai.Asset]

Retrieves all nodes assets

getInputs(self: depthai.Node) → List[dai::Node::Input]

Retrieves all nodes inputs

getName(self: depthai.Node)str

Retrieves nodes name

getOutputs(self: depthai.Node) → List[dai::Node::Output]

Retrieves all nodes outputs

property id

Id of node

property input

Input for any type of messages to be transfered over SPI stream

Default queue is blocking with size 8

setBusId(self: depthai.SPIOut, id: int)None

Specifies SPI Bus number to use

Parameter id:

SPI Bus id

setStreamName(self: depthai.SPIOut, name: str)None

Specifies stream name over which the node will send data

Parameter name:

Stream name

class dai::node::SPIOut : public dai::Node

SPIOut node. Sends messages over SPI.

Public Functions

SPIOut(const std::shared_ptr<PipelineImpl> &par, int64_t nodeId)
void setStreamName(std::string name)

Specifies stream name over which the node will send data

Parameters
  • name: Stream name

void setBusId(int id)

Specifies SPI Bus number to use

Parameters
  • id: SPI Bus id

Public Members

Input input = {*this, "in", Input::Type::SReceiver, true, 8, {{DatatypeEnum::Buffer, true}}}

Input for any type of messages to be transfered over SPI stream

Default queue is blocking with size 8

Private Functions

std::string getName() const

Retrieves nodes name.

std::vector<Input> getInputs()

Retrieves all nodes inputs.

std::vector<Output> getOutputs()

Retrieves all nodes outputs.

nlohmann::json getProperties()
std::shared_ptr<Node> clone()

Private Members

dai::SPIOutProperties properties

Got questions?

We’re always happy to help with code or other questions you might have.