File tree 1 file changed +19
-0
lines changed
hardware/esp8266com/esp8266/libraries/SPI
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 24
24
#include < Arduino.h>
25
25
#include < stdlib.h>
26
26
27
+ // This defines are not representing the real Divider of the ESP8266
28
+ // the Defines match to an AVR Arduino on 16MHz for better compatibility
29
+ #if F_CPU == 80000000L
30
+ #define SPI_CLOCK_DIV2 0x00101001 // 8 MHz
31
+ #define SPI_CLOCK_DIV4 0x00241001 // 4 MHz
32
+ #define SPI_CLOCK_DIV8 0x004c1001 // 2 MHz
33
+ #define SPI_CLOCK_DIV16 0x009c1001 // 1 MHz
34
+ #define SPI_CLOCK_DIV32 0x013c1001 // 500 KHz
35
+ #define SPI_CLOCK_DIV64 0x027c1001 // 250 KHz
36
+ #define SPI_CLOCK_DIV128 0x04fc1001 // 125 KHz
37
+ #else
38
+ #define SPI_CLOCK_DIV2 0x00241001 // 8 MHz
39
+ #define SPI_CLOCK_DIV4 0x004c1001 // 4 MHz
40
+ #define SPI_CLOCK_DIV8 0x009c1001 // 2 MHz
41
+ #define SPI_CLOCK_DIV16 0x013c1001 // 1 MHz
42
+ #define SPI_CLOCK_DIV32 0x027c1001 // 500 KHz
43
+ #define SPI_CLOCK_DIV64 0x04fc1001 // 250 KHz
44
+ #endif
45
+
27
46
const uint8_t SPI_MODE0 = 0x00 ; // /< CPOL: 0 CPHA: 0
28
47
const uint8_t SPI_MODE1 = 0x01 ; // /< CPOL: 0 CPHA: 1
29
48
const uint8_t SPI_MODE2 = 0x10 ; // /< CPOL: 1 CPHA: 0
You can’t perform that action at this time.
0 commit comments