Skip to content

Commit 953aa8b

Browse files
Added end() to HardWire (I2C)
1 parent f478466 commit 953aa8b

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

STM32F1/libraries/Wire/HardWire.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,8 @@ HardWire::~HardWire() {
7575
void HardWire::begin(uint8 self_addr) {
7676
i2c_master_enable(sel_hard, dev_flags);
7777
}
78+
79+
void HardWire:end() {
80+
i2c_disable(sel_hard);
81+
sel_hard = 0;
82+
}

STM32F1/libraries/Wire/HardWire.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ class HardWire : public WireBase {
5959
* passed flags
6060
*/
6161
HardWire(uint8, uint8 = 0);
62+
63+
/*
64+
* Shuts down (disables) the hardware I2C
65+
*/
66+
void end();
6267

6368
/*
6469
* Disables the I2C device and remove the device address.

0 commit comments

Comments
 (0)