Added end() to HardWire (I2C)

This commit is contained in:
Roger Clark 2017-06-11 15:55:08 +10:00
parent f47846662d
commit 953aa8b88e
2 changed files with 10 additions and 0 deletions

View File

@ -75,3 +75,8 @@ HardWire::~HardWire() {
void HardWire::begin(uint8 self_addr) {
i2c_master_enable(sel_hard, dev_flags);
}
void HardWire:end() {
i2c_disable(sel_hard);
sel_hard = 0;
}

View File

@ -59,6 +59,11 @@ public:
* passed flags
*/
HardWire(uint8, uint8 = 0);
/*
* Shuts down (disables) the hardware I2C
*/
void end();
/*
* Disables the I2C device and remove the device address.