Basic library of routines to interface to a Microchip MCP23017 16-bit I/O expander using an I2C interface.

Dependents:   AdaFruit_RGBLCD SX1276_GPS

Fork of MCP23017 by jim herd

Revision:
16:9b5a51117afe
Parent:
15:164d420bcbcf
--- a/MCP23017.cpp	Thu Aug 07 19:59:32 2014 +0000
+++ b/MCP23017.cpp	Tue Sep 02 07:11:53 2014 +0000
@@ -27,10 +27,7 @@
 /*-----------------------------------------------------------------------------
  *
  */
-MCP23017::MCP23017(PinName sda, PinName scl, int i2cAddress, bool hispeed)  : _i2c(sda, scl) {
-    // I2C can handle two different frequencies - switch to high speed if asked
-    _i2c.frequency(hispeed ? 400000 : 100000);
-
+MCP23017::MCP23017(I2C & i2c, int i2cAddress)  : _i2c(i2c) {
     MCP23017_i2cAddress = i2cAddress;
     reset();                                  // initialise chip to power-on condition
 }