GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - PowerBroker2/SerialTransfer: Arduino library to transfer dynamic, packetized data fast and reliably via Serial, I2C, etc.

BranchesTags
Open more actions menu

Latest commit

 

History

225 Commits
225 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/ISSUE_TEMPLATE
.github/ISSUE_TEMPLATE
 
 
examples
examples
 
 
src
src
 
 
.clang-format
.clang-format
 
 
.gitignore
.gitignore
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
_config.yml
_config.yml
 
 
library.properties
library.properties
 
 
logo.png
logo.png
 
 

Repository files navigation

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:

  • can be downloaded via the Arduino IDE's Libraries Manager (search "SerialTransfer.h")
  • works with "software-serial", "software-I2C", and "software-SPI" libraries
  • is non blocking
  • uses a start byte and payload length for packet framing
  • uses CRC-8 (Polynomial 0x9B with a lookup table) over the packet ID, length, and payload
  • allows dynamically sized packets with payloads from 0 to 255 bytes
  • supports user-specified callback functions
  • can transfer bytes, ints, floats, structs, even large files like JPEGs and CSVs!!

Packet Anatomy:

START | ID | LENGTH | PAYLOAD (0..255 bytes) | CRC-8(ID, LENGTH, PAYLOAD)

I2C frames are split into consecutive transactions of up to 32 bytes by default so the maximum-size packet fits common Wire buffers. The receiver reassembles those chunks in the packet parser. Call I2CTransfer::available() or I2CTransfer::tick() regularly from loop(); configured packet callbacks are dispatched there, outside the Wire receive interrupt. The receiver has one packet buffer, so consume each packet before the sender sends another. Define SERIALTRANSFER_I2C_CHUNK_SIZE before including I2CTransfer.h to match a different Wire buffer capacity.

How To Use:

See the curated example guide for Serial and I²C quickstarts, loopback analysis, callbacks, and multi-packet file transfer. Older sketches are retained in examples/Legacy/.

  • datum = tx/rx a single object
  • data = tx/rx multiple objects

For object helpers, the library copies raw in-memory bytes. Structure padding, endianness, and floating-point formats are not converted; use matching layouts or serialize multi-byte fields explicitly when communicating across different architectures.

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.

About

Arduino library to transfer dynamic, packetized data fast and reliably via Serial, I2C, etc.

Topics

arduino-libraryarduino-to-arduinobytescommunicationi2ci2c-communicationi2c-protocolinter-arduinopacketsrx-buffersenddataserialserial-communicationtransfertx-bufferuartusart

Resources

Readme
MIT license

Code of conduct

Code of conduct
Activity

Stars

487 stars

Watchers

21 watching

Forks

72 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.