Skip to content

Commit a1259bb

Browse files
authored
Merge pull request #361 from adafruit/spi-highdrive
use high drive H0H1 for SCK and MOSI for better performance at highseed 32Mhz
2 parents d61c88a + bdb2c82 commit a1259bb

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

libraries/SPI/SPI.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,21 @@ void SPIClass::begin()
9797

9898
// blocking
9999
nrfx_spim_init(&_spim, &cfg, NULL, NULL);
100+
101+
// highspeed SPIM should set SCK and MOSI to high drive
102+
nrf_gpio_cfg(_uc_pinSCK,
103+
NRF_GPIO_PIN_DIR_OUTPUT,
104+
NRF_GPIO_PIN_INPUT_CONNECT,
105+
NRF_GPIO_PIN_NOPULL,
106+
NRF_GPIO_PIN_H0H1,
107+
NRF_GPIO_PIN_NOSENSE);
108+
109+
nrf_gpio_cfg(_uc_pinMosi,
110+
NRF_GPIO_PIN_DIR_OUTPUT,
111+
NRF_GPIO_PIN_INPUT_DISCONNECT,
112+
NRF_GPIO_PIN_NOPULL,
113+
NRF_GPIO_PIN_H0H1,
114+
NRF_GPIO_PIN_NOSENSE);
100115
}
101116

102117
void SPIClass::end()

0 commit comments

Comments
 (0)