File tree 3 files changed +15
-0
lines changed
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)
143
143
nrf_spim_disable (_spim.p_reg );
144
144
}
145
145
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
+
146
153
void SPIClass::setBitOrder (BitOrder order)
147
154
{
148
155
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 {
82
82
void begin ();
83
83
void end ();
84
84
85
+ void setPins (uint8_t uc_pinMISO, uint8_t uc_pinSCK, uint8_t uc_pinMOSI);
85
86
void setBitOrder (BitOrder order);
86
87
void setDataMode (uint8_t uc_mode);
87
88
void setClockDivider (uint32_t uc_div);
Original file line number Diff line number Diff line change @@ -123,6 +123,13 @@ void SPIClass::endTransaction(void)
123
123
_p_spi->ENABLE = (SPI_ENABLE_ENABLE_Disabled << SPI_ENABLE_ENABLE_Pos);
124
124
}
125
125
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
+
126
133
void SPIClass::setBitOrder (BitOrder order)
127
134
{
128
135
this ->_bitOrder = (order == MSBFIRST ? SPI_CONFIG_ORDER_MsbFirst : SPI_CONFIG_ORDER_LsbFirst);
You can’t perform that action at this time.
0 commit comments