File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -188,17 +188,18 @@ void SPIClass::setClockDivider(uint8_t div)
188
188
{
189
189
uint32_t clockFreq;
190
190
191
- if (div >= SPI_CLOCK_DIV128) {
191
+ // Adafruit Note: nrf52 run at 64MHz
192
+ if (div >= SPI_CLOCK_DIV512) {
192
193
clockFreq = SPI_FREQUENCY_FREQUENCY_K125;
193
- } else if (div >= SPI_CLOCK_DIV64 ) {
194
+ } else if (div >= SPI_CLOCK_DIV256 ) {
194
195
clockFreq = SPI_FREQUENCY_FREQUENCY_K250;
195
- } else if (div >= SPI_CLOCK_DIV32 ) {
196
+ } else if (div >= SPI_CLOCK_DIV128 ) {
196
197
clockFreq = SPI_FREQUENCY_FREQUENCY_K500;
197
- } else if (div >= SPI_CLOCK_DIV16 ) {
198
+ } else if (div >= SPI_CLOCK_DIV64 ) {
198
199
clockFreq = SPI_FREQUENCY_FREQUENCY_M1;
199
- } else if (div >= SPI_CLOCK_DIV8 ) {
200
+ } else if (div >= SPI_CLOCK_DIV32 ) {
200
201
clockFreq = SPI_FREQUENCY_FREQUENCY_M2;
201
- } else if (div >= SPI_CLOCK_DIV4 ) {
202
+ } else if (div >= SPI_CLOCK_DIV16 ) {
202
203
clockFreq = SPI_FREQUENCY_FREQUENCY_M4;
203
204
} else {
204
205
clockFreq = SPI_FREQUENCY_FREQUENCY_M8;
Original file line number Diff line number Diff line change @@ -137,16 +137,18 @@ void SPIClass::transfer(void *buf, size_t count)
137
137
extern SPIClass SPI;
138
138
#endif
139
139
140
- // For compatibility with sketches designed for AVR @ 16 MHz
140
+ // For compatibility with sketches designed for AVR @ 64 MHz
141
141
// New programs should use SPI.beginTransaction to set the SPI clock
142
- #if F_CPU == 16000000
142
+ #if F_CPU == 64000000 // feather52 run @ 64Mhz
143
143
#define SPI_CLOCK_DIV2 2
144
144
#define SPI_CLOCK_DIV4 4
145
145
#define SPI_CLOCK_DIV8 8
146
146
#define SPI_CLOCK_DIV16 16
147
147
#define SPI_CLOCK_DIV32 32
148
148
#define SPI_CLOCK_DIV64 64
149
149
#define SPI_CLOCK_DIV128 128
150
+ #define SPI_CLOCK_DIV256 256
151
+ #define SPI_CLOCK_DIV512 512
150
152
#endif
151
153
152
- #endif
154
+ #endif
You can’t perform that action at this time.
0 commit comments