Skip to content

Bit-bang SPI in both master and slave modes on Teensy 4

License

Notifications You must be signed in to change notification settings

lu-maca/SoftwareSpi_T4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SoftwareSpi_T4

SPI bit-banging for Teensy 4.

This library comes from this thread. I needed to emulate the behavior of a sensor, that behaves as a SPI slave. The sensor shall reply dynamically to any request of a microcontroller, and RT1060 is not capable of this. In particular, you have to decide the contents of the reply before the message from the master arrives, and this does not suite with my needs. That's why I implemented a software SPI, that supports both master and slave modes.

In slave mode, I tried running it up to 2 Mbps and still works fine. Master mode is not tested yet, but I'm quite confident it works.

Features

  • supports master mode, with multiple slave devices
  • supports slave mode, by emulating multiple slaves on a single SPI bus
  • supports SPI mode 0 only (CPOL=0, CPHA=0)
  • supports 8 bits messages only (no 16/32 bits)

How to install

Download the repository and follow the instructions here.

To do

  • add support for other SPI modes
  • add support for other transmission sizes

About

Bit-bang SPI in both master and slave modes on Teensy 4

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages