Added I2C pin configuration
To configure the I2C pins call Wire.setPins(SDA_Pin, SCL_pin) prior to Wire.begin()
This commit is contained in:
1 parent
1f0a5872c3
commit
73fb5887f5
2 files changed
+7
No files matched your search
@@ -39,6 +39,7 @@ class TwoWire : public Stream
|
||||
void begin(uint8_t);
|
||||
void end();
|
||||
void setClock(uint32_t);
|
||||
void setPins(uint8_t pin_SDA, uint8_t pin_SCL);
|
||||
|
||||
void beginTransmission(uint8_t);
|
||||
uint8_t endTransmission(bool stopBit);
|
||||
|
||||
@@ -127,6 +127,12 @@ void TwoWire::setClock(uint32_t baudrate) {
|
||||
}
|
||||
}
|
||||
|
||||
void TwoWire::setPins(uint8_t pin_SDA, uint8_t pin_SCL)
|
||||
{
|
||||
this->_uc_pinSDA = g_ADigitalPinMap[pin_SDA];
|
||||
this->_uc_pinSCL = g_ADigitalPinMap[pin_SCL];
|
||||
}
|
||||
|
||||
void TwoWire::end() {
|
||||
if (master)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user