Skip to content
This is another Arduino SPI library separated from SdFat library, it uses SPI registers and DMA (Arduino Due only) to accelerate SPI communication
Branch: master
Clone or download
Latest commit f824647 Jan 12, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
SPIpinout add spi pinout image Aug 5, 2015
LICENSE Update LICENSE Jan 12, 2017
README.md change README.md Sep 8, 2015
TurboSPI.h modify DigitalRead Sep 8, 2015
TurboSPI_AVR.cpp modify DigitalRead Sep 8, 2015
TurboSPI_SAM3X.cpp modify DigitalRead Sep 8, 2015
library.properties add files Aug 5, 2015

README.md

Overview

This is another Arduino SPI library separated from SdFat library, it uses SPI registers and DMA (Arduino Due only) to accelerate SPI communication.

Thanks to Bill Greiman

Configuration

Put this folder into your arduino "libraries" folder.

I have test this library on Arduino Uno/Mega2560/Due, maybe support other AVR/SAM3X MCUs. You can search keywords like "Arduino Mega2560 pinout" to find pinout mapping with your board.

Connect your slave module to arduino:
SCK to SCK,
MISO to MISO,
MOSI to MOSI,
Reset to Reset,
CS to any digital pin.
  • Arduino Uno SPI pinout:

    alt tag

  • Arduino Mega2560 SPI pinout:

    alt tag

  • Arduino Due SPI pinout:

    alt tag

Example code:

#include <TurboSPI.h>

TurboSPI	g_SPI;
DigitalPin	g_PinCS, g_PinRS;
uint8_t		g_Buffer[256];	// some data buffer to transfer
uint8_t		g_Divisor = 2;	// transfer speed set to MCU's clock divide by 2

void setup()
{
	// setup pins
	g_PinCS.Begin(45);
	g_PinRS.Begin(47);

	g_PinCS.PinMode(OUTPUT);
	g_PinRS.PinMode(OUTPUT);

	// setup SPI
	g_SPI.Begin();
}

void loop()
{
	// setup speed and select slave
	g_SPI.Init(g_Divisor);
	g_PinCS.Low();
	
	// set some pins
	g_PinRS.High();

	// transfer data to slave
	g_SPI.Send(g_Buffer, sizeof(g_Buffer));
	
	// unselect slave
	g_PinCS.High();
}
You can’t perform that action at this time.