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
Diff: MCP23017.h
- Revision:
- 16:9b5a51117afe
- Parent:
- 15:164d420bcbcf
--- a/MCP23017.h Thu Aug 07 19:59:32 2014 +0000 +++ b/MCP23017.h Tue Sep 02 07:11:53 2014 +0000 @@ -57,11 +57,10 @@ * * 16-bit I/O expander with I2C interface * - * @param sda I2C data pin - * @param scl I2C clock pin + * @param i2c I2C interface * @param i2cAddress I2C address */ - MCP23017(PinName sda, PinName scl, int i2cAddress, bool hispeed = false); + MCP23017(I2C & i2c, int i2cAddress); /** Reset MCP23017 device to its power-on state */ @@ -134,10 +133,10 @@ void write(int data); protected: - I2C _i2c; + I2C & _i2c; int MCP23017_i2cAddress; // physical I2C address unsigned short shadow_GPIO, shadow_IODIR, shadow_GPPU, shadow_IPOL; // Cached copies of the register values }; -#endif \ No newline at end of file +#endif