瀏覽代碼

Enable SPI1 on Teensy-LC

main
PaulStoffregen 9 年之前
父節點
當前提交
009ca8f984
共有 3 個檔案被更改,包括 5 行新增2 行删除
  1. +1
    -0
      SPI.cpp
  2. +3
    -2
      SPI.h
  3. +1
    -0
      keywords.txt

+ 1
- 0
SPI.cpp 查看文件

@@ -315,6 +315,7 @@ uint8_t SPIClass::setCS(uint8_t pin)
#elif defined(__arm__) && defined(TEENSYDUINO) && defined(KINETISL)

SPIClass SPI;
SPI1Class SPI1;

uint32_t SPIClass::interruptMask = 0;
uint32_t SPIClass::interruptSave = 0;

+ 3
- 2
SPI.h 查看文件

@@ -935,7 +935,6 @@ public:
}
inTransactionFlag = 1;
#endif
// TODO: this is wrong for SPI1 - how to make SPI settings scale?
SPI1_C1 = settings.c1;
SPI1_BR = settings.br1;
}
@@ -1014,7 +1013,6 @@ public:

// This function is deprecated. New applications should use
// beginTransaction() to configure SPI settings.
// TODO: this is wrong for SPI1 - how to make SPI settings scale?
inline static void setClockDivider(uint8_t clockDiv) {
if (clockDiv == SPI_CLOCK_DIV2) {
SPI1_BR = (SPISettings(8000000, MSBFIRST, SPI_MODE0).br1);
@@ -1470,5 +1468,8 @@ class SPIClass {


extern SPIClass SPI;
#if defined(__arm__) && defined(TEENSYDUINO) && defined(KINETISL)
extern SPI1Class SPI1;
#endif

#endif

+ 1
- 0
keywords.txt 查看文件

@@ -7,6 +7,7 @@
#######################################

SPI KEYWORD1
SPI1 KEYWORD1

#######################################
# Methods and Functions (KEYWORD2)

Loading…
取消
儲存