We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 34bb9e8 commit 5c202bdCopy full SHA for 5c202bd
src/machine/machine_nrf52xxx.go
@@ -235,14 +235,11 @@ func (spi *SPI) Configure(config SPIConfig) error {
235
// Disable bus to configure it
236
spi.Bus.ENABLE.Set(nrf.SPIM_ENABLE_ENABLE_Disabled)
237
238
- // Pick a default frequency.
239
- if config.Frequency == 0 {
240
- config.Frequency = 4000000 // 4MHz
241
- }
242
-
243
// set frequency
244
var freq uint32
245
switch {
+ case config.Frequency == 0: // default MCU SPI speed
+ freq = nrf.SPIM_FREQUENCY_FREQUENCY_M4
246
case config.Frequency >= 8000000:
247
freq = nrf.SPIM_FREQUENCY_FREQUENCY_M8
248
case config.Frequency >= 4000000:
0 commit comments