Git Product home page Git Product logo

esp32-spi-message-demo's Introduction

NOTE!

OAK IoT series and this repository is community supported only, and is provided as-is. We most likely won't update it and we don't provide support for it (Discord, forums, email...).

Demo

See below for this running on the BW1092:

SPI ESP32 Interface with DepthAI

Building

The first time you build, the repository submodules need be initialized:

git submodule update --init --recursive

# Tip: You can ask Git to do that automatically:
git config submodule.recurse true

Later submodules also need to be updated. To build an example, you will need to use ESP-IDF's idf.py. Examples here were only tested with ESP-IDF version 4.1 and we encourage you to use the same version as well.

SPI Protocol

SPI messaging is currently arranged in 2 layers. The first is the spi protocol. The spi protocol is the lowest level. It defines a standard packet for all SPI communication. It is a 256 byte packet arranged in the following manner:

typedef struct {
    uint8_t start;
    uint8_t data[SPI_PROTOCOL_PAYLOAD_SIZE];
    uint8_t crc[2];
    uint8_t end;
} SpiProtocolPacket;

start and end are constant bytes to mark the beginning and end of packets.

static const uint8_t START_BYTE_MAGIC = 0b10101010;
static const uint8_t END_BYTE_MAGIC = 0b00000000;

SPI Messaging

On top of this we have a layer called SPI messaging. This code defines the following:

  • A list of a supported commands,
  • A way to encapsulate commands going to the MyriadX over SPI.
  • A way to receive and parse command responses.
  • We’ll go into greater depth as to how exactly to use this in the SPI Messaging Example.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.