PowerBroker2 / SerialTransfer

Arduino library to transfer dynamic, packetized data fast and reliably via Serial, I2C, or SPI
MIT License
428 stars 68 forks source link
arduino-library arduino-to-arduino bytes communication i2c i2c-communication i2c-protocol inter-arduino packets rx-buffer senddata serial serial-communication spi spi-communication spi-protocol transfer tx-buffer uart usart

SerialTransfer

GitHub version arduino-library-badge

SerialTransfer is an easy to use Arduino library for transferring packetized data fast and reliably via Serial, I2C, and SPI interfaces. Interconnect your Arduinos today minus the headache with SerialTransfer!

A mirror library is also available for Python!

This library:

Packet Anatomy:

01111110 00000000 11111111 00000000 00000000 00000000 ... 00000000 10000001
|      | |      | |      | |      | |      | |      | | | |      | |______|__Stop byte
|      | |      | |      | |      | |      | |      | | | |______|___________8-bit CRC
|      | |      | |      | |      | |      | |      | |_|____________________Rest of payload
|      | |      | |      | |      | |      | |______|________________________2nd payload byte
|      | |      | |      | |      | |______|_________________________________1st payload byte
|      | |      | |      | |______|__________________________________________# of payload bytes
|      | |      | |______|___________________________________________________COBS Overhead byte
|      | |______|____________________________________________________________Packet ID (0 by default)
|______|_____________________________________________________________________Start byte (constant)

How To Use:

See the example sketches

NOTE:

SPITransfer.h and it's associated features are not supported for the Arduino Nano 33 BLE or DUE and other boards. This header file is disabled by default, but can be enabled by commenting out #define DISABLE_SPI_SERIALTRANSFER 1 within SerialTransfer.h.