File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,13 @@ void SPIClass::endTransaction(void)
143143 nrf_spim_disable (_spim.p_reg );
144144}
145145
146+ void SPIClass::setPins (uint8_t uc_pinMISO, uint8_t uc_pinSCK, uint8_t uc_pinMOSI)
147+ {
148+ _uc_pinMiso = g_ADigitalPinMap[uc_pinMISO];
149+ _uc_pinSCK = g_ADigitalPinMap[uc_pinSCK];
150+ _uc_pinMosi = g_ADigitalPinMap[uc_pinMOSI];
151+ }
152+
146153void SPIClass::setBitOrder (BitOrder order)
147154{
148155 this ->_bitOrder = (order == MSBFIRST ? NRF_SPIM_BIT_ORDER_MSB_FIRST : NRF_SPIM_BIT_ORDER_LSB_FIRST);
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ class SPIClass {
8282 void begin ();
8383 void end ();
8484
85+ void setPins (uint8_t uc_pinMISO, uint8_t uc_pinSCK, uint8_t uc_pinMOSI);
8586 void setBitOrder (BitOrder order);
8687 void setDataMode (uint8_t uc_mode);
8788 void setClockDivider (uint32_t uc_div);
Original file line number Diff line number Diff line change @@ -123,6 +123,13 @@ void SPIClass::endTransaction(void)
123123 _p_spi->ENABLE = (SPI_ENABLE_ENABLE_Disabled << SPI_ENABLE_ENABLE_Pos);
124124}
125125
126+ void SPIClass::setPins (uint8_t uc_pinMISO, uint8_t uc_pinSCK, uint8_t uc_pinMOSI)
127+ {
128+ _uc_pinMiso = g_ADigitalPinMap[uc_pinMISO];
129+ _uc_pinSCK = g_ADigitalPinMap[uc_pinSCK];
130+ _uc_pinMosi = g_ADigitalPinMap[uc_pinMOSI];
131+ }
132+
126133void SPIClass::setBitOrder (BitOrder order)
127134{
128135 this ->_bitOrder = (order == MSBFIRST ? SPI_CONFIG_ORDER_MsbFirst : SPI_CONFIG_ORDER_LsbFirst);
You can’t perform that action at this time.
0 commit comments