This commit is contained in:
Sandeep Mistry 2016-02-24 12:10:28 -05:00
commit 08ae7bd3eb
1 changed files with 13 additions and 6 deletions

View File

@ -33,7 +33,7 @@ uint8_t const SPI_HALF_SPEED = 1;
uint8_t const SPI_QUARTER_SPEED = 2;
/**
* USE_SPI_LIB: if set, use the SPI library bundled with Arduino IDE, otherwise
* run with a standalone driver for AVR.
* run with a standalone driver for AVR.
*/
#define USE_SPI_LIB
/**
@ -54,6 +54,10 @@ uint8_t const SPI_QUARTER_SPEED = 2;
//
#ifndef SOFTWARE_SPI
// hardware pin defs
// include pins_arduino.h or variant.h depending on architecture, via Arduino.h
#include <Arduino.h>
/**
* SD Chip Select pin
*
@ -62,14 +66,17 @@ uint8_t const SPI_QUARTER_SPEED = 2;
* master unless SS is set to output mode.
*/
/** The default chip select pin for the SD card is SS. */
uint8_t const SD_CHIP_SELECT_PIN = SS_PIN;
// The following three pins must not be redefined for hardware SPI.
uint8_t const SD_CHIP_SELECT_PIN = SS;
// The following three pins must not be redefined for hardware SPI,
// so ensure that they are taken from pins_arduino.h or variant.h, depending on architecture.
/** SPI Master Out Slave In pin */
uint8_t const SPI_MOSI_PIN = MOSI_PIN;
uint8_t const SPI_MOSI_PIN = MOSI;
/** SPI Master In Slave Out pin */
uint8_t const SPI_MISO_PIN = MISO_PIN;
uint8_t const SPI_MISO_PIN = MISO;
/** SPI Clock pin */
uint8_t const SPI_SCK_PIN = SCK_PIN;
uint8_t const SPI_SCK_PIN = SCK;
/** optimize loops for hardware SPI */
#ifndef USE_SPI_LIB
#define OPTIMIZE_HARDWARE_SPI