Skip to content

Commit 3951aaa

Browse files
authored
Merge pull request #536 from thaanstad/feature/I2C_setPins
Added I2C pin configuration
2 parents b35674f + 304e29d commit 3951aaa

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

libraries/Wire/Wire.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class TwoWire : public Stream
3939
void begin(uint8_t);
4040
void end();
4141
void setClock(uint32_t);
42+
void setPins(uint8_t pinSDA, uint8_t pinSCL);
4243

4344
void beginTransmission(uint8_t);
4445
uint8_t endTransmission(bool stopBit);

libraries/Wire/Wire_nRF52.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ void TwoWire::setClock(uint32_t baudrate) {
127127
}
128128
}
129129

130+
void TwoWire::setPins(uint8_t pinSDA, uint8_t pinSCL)
131+
{
132+
this->_uc_pinSDA = g_ADigitalPinMap[pinSDA];
133+
this->_uc_pinSCL = g_ADigitalPinMap[pinSCL];
134+
}
135+
130136
void TwoWire::end() {
131137
if (master)
132138
{

0 commit comments

Comments
 (0)