This commit is contained in:
topicchi
2024-09-24 16:54:39 +00:00
parent e3ca99e4db
commit c7a68c0205
332 changed files with 6098 additions and 4139 deletions

View File

@@ -122,14 +122,28 @@
#define SPI_DRIVER_SELECT 0
#endif // SPI_DRIVER_SELECT
/**
* If USE_SPI_ARRAY_TRANSFER is non-zero and the standard SPI library is
* use, the array transfer function, transfer(buf, size), will be used.
* This option will allocate up to a 512 byte temporary buffer for send.
* If USE_SPI_ARRAY_TRANSFER is one and the standard SPI library is
* use, the array transfer function, transfer(buf, count), will be used.
* This option will allocate a 512 byte temporary buffer for send.
* This may be faster for some boards. Do not use this with AVR boards.
*
* Warning: the next options are often fastest but only available for some
* non-Arduino board packages.
*
* If USE_SPI_ARRAY_TRANSFER is two use transfer(nullptr, buf, count) for
* receive and transfer(buf, nullptr, count) for send.
*
* If USE_SPI_ARRAY_TRANSFER is three use transfer(nullptr, buf, count) for
* receive and transfer(buf, rxTmp, count) for send. Try this with Adafruit
* SAMD51.
*
* If USE_SPI_ARRAY_TRANSFER is four use transfer(txTmp, buf, count) for
* receive and transfer(buf, rxTmp, count) for send. Try this with STM32.
*/
#ifndef USE_SPI_ARRAY_TRANSFER
#define USE_SPI_ARRAY_TRANSFER 0
#endif // USE_SPI_ARRAY_TRANSFER
//------------------------------------------------------------------------------
/**
* SD maximum initialization clock rate.
*/
@@ -161,7 +175,8 @@
#ifndef USE_BLOCK_DEVICE_INTERFACE
#define USE_BLOCK_DEVICE_INTERFACE 0
#endif // USE_BLOCK_DEVICE_INTERFACE
/**
//------------------------------------------------------------------------------
/**
* SD_CHIP_SELECT_MODE defines how the functions
* void sdCsInit(SdCsPin_t pin) {pinMode(pin, OUTPUT);}
* and
@@ -346,8 +361,8 @@ typedef uint8_t SdCsPin_t;
* Set USE_SIMPLE_LITTLE_ENDIAN nonzero for little endian processors
* with no memory alignment restrictions.
*/
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__\
&& (defined(__AVR__) || defined(__ARM_FEATURE_UNALIGNED))
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && \
(defined(__AVR__) || defined(__ARM_FEATURE_UNALIGNED))
#define USE_SIMPLE_LITTLE_ENDIAN 1
#else // __BYTE_ORDER_
#define USE_SIMPLE_LITTLE_ENDIAN 0
@@ -394,11 +409,11 @@ typedef uint8_t SdCsPin_t;
#endif // BUILTIN_SDCARD
// SPI for built-in card.
#ifndef SDCARD_SPI
#define SDCARD_SPI SPI1
#define SDCARD_SPI SPI1
#define SDCARD_MISO_PIN 59
#define SDCARD_MOSI_PIN 61
#define SDCARD_SCK_PIN 60
#define SDCARD_SS_PIN 62
#define SDCARD_SCK_PIN 60
#define SDCARD_SS_PIN 62
#endif // SDCARD_SPI
#define HAS_SDIO_CLASS 1
#endif // defined(__MK64FX512__) || defined(__MK66FX1M0__)
@@ -409,15 +424,13 @@ typedef uint8_t SdCsPin_t;
/**
* Determine the default SPI configuration.
*/
#if defined(ARDUINO_ARCH_APOLLO3)\
|| (defined(__AVR__) && defined(SPDR) && defined(SPSR) && defined(SPIF))\
|| (defined(__AVR__) && defined(SPI0) && defined(SPI_RXCIF_bm))\
|| defined(ESP8266) || defined(ESP32)\
|| defined(PLATFORM_ID)\
|| defined(ARDUINO_SAM_DUE)\
|| defined(STM32_CORE_VERSION)\
|| defined(__STM32F1__) || defined(__STM32F4__)\
|| (defined(CORE_TEENSY) && defined(__arm__))
#if defined(ARDUINO_ARCH_APOLLO3) || \
(defined(__AVR__) && defined(SPDR) && defined(SPSR) && defined(SPIF)) || \
(defined(__AVR__) && defined(SPI0) && defined(SPI_RXCIF_bm)) || \
defined(ESP8266) || defined(ESP32) || defined(PLATFORM_ID) || \
defined(ARDUINO_SAM_DUE) || defined(STM32_CORE_VERSION) || \
defined(__STM32F1__) || defined(__STM32F4__) || \
(defined(CORE_TEENSY) && defined(__arm__))
#define SD_HAS_CUSTOM_SPI 1
#else // SD_HAS_CUSTOM_SPI
// Use standard SPI library.