Skip to content

Commit e366230

Browse files
committed
use spim3, testing with 32Mhz
1 parent 3adc899 commit e366230

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

libraries/SPI/SPI.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,13 @@ SPIClass::SPIClass(NRF_SPI_Type *p_spi, uint8_t uc_pinMISO, uint8_t uc_pinSCK, u
3636
assert(p_spi != NULL);
3737
_p_spi = p_spi;
3838

39+
#ifdef NRF52840_XXAA
40+
_spim.p_reg = NRF_SPIM3;
41+
_spim.drv_inst_idx = NRFX_SPIM3_INST_IDX;
42+
#else
3943
_spim.p_reg = NRF_SPIM0;
4044
_spim.drv_inst_idx = NRFX_SPIM0_INST_IDX;
45+
#endif
4146

4247
// pins
4348
_uc_pinMiso = g_ADigitalPinMap[uc_pinMISO];
@@ -62,7 +67,7 @@ void SPIClass::begin()
6267
.ss_active_high = false,
6368
.irq_priority = 3,
6469
.orc = 0xFF,
65-
.frequency = NRF_SPIM_FREQ_8M, // NRF_SPIM_FREQ_4M,
70+
.frequency = NRF_SPIM_FREQ_32M, // NRF_SPIM_FREQ_4M,
6671
.mode = NRF_SPIM_MODE_0,
6772
.bit_order = NRF_SPIM_BIT_ORDER_MSB_FIRST,
6873
};

0 commit comments

Comments
 (0)