From eab6601ebc4ff975086fe9a69a816f550b22b8f0 Mon Sep 17 00:00:00 2001 From: Sandeep Mistry Date: Tue, 25 Aug 2015 10:24:24 -0400 Subject: implement Wire.end() for AVR core --- libraries/Wire/utility/twi.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'libraries/Wire/utility/twi.c') diff --git a/libraries/Wire/utility/twi.c b/libraries/Wire/utility/twi.c index 201d7d1..d7d72bc 100644 --- a/libraries/Wire/utility/twi.c +++ b/libraries/Wire/utility/twi.c @@ -90,6 +90,22 @@ void twi_init(void) TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA); } +/* + * Function twi_disable + * Desc disables twi pins + * Input none + * Output none + */ +void twi_disable(void) +{ + // disable twi module, acks, and twi interrupt + TWCR &= ~(_BV(TWEN) | _BV(TWIE) | _BV(TWEA)); + + // deactivate internal pullups for twi. + digitalWrite(SDA, 0); + digitalWrite(SCL, 0); +} + /* * Function twi_slaveInit * Desc sets slave address and enables interrupt -- cgit v1.2.3-18-g5258