Skip to content

Commit 777a110

Browse files
committed
implement Wire.end() for SAMD core
1 parent 7b80688 commit 777a110

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

libraries/Wire/Wire.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ void TwoWire::begin(uint8_t address) {
4949
sercom->enableWIRE();
5050
}
5151

52+
void TwoWire::end() {
53+
sercom->disableWIRE();
54+
}
55+
5256
void TwoWire::setClock(uint32_t frequency) {
5357
// dummy funtion
5458
}

libraries/Wire/Wire.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@
2828

2929
#define BUFFER_LENGTH 32
3030

31+
// WIRE_HAS_END means Wire has end()
32+
#define WIRE_HAS_END 1
33+
3134
class TwoWire : public Stream
3235
{
3336
public:
3437
TwoWire(SERCOM *s, uint8_t pinSDA, uint8_t pinSCL);
3538
void begin();
3639
void begin(uint8_t);
40+
void end();
3741
void setClock(uint32_t); // dummy function
3842

3943
void beginTransmission(uint8_t);

0 commit comments

Comments
 (0)