Basic library for MCP23017 16-bit I/O expander using an I2C interface used in aconno ACD52832 dev board.
Dependents: tof100 gaasgjdvas LED_GAME11 tof100
Fork of MCP23017 by
Diff: MCP23017.h
- Revision:
- 7:c282ea90cdb5
- Parent:
- 5:79b8535dc5ac
- Child:
- 10:a3b9eabb0e50
--- a/MCP23017.h Sun Nov 28 22:20:59 2010 +0000 +++ b/MCP23017.h Sun Nov 28 22:44:56 2010 +0000 @@ -97,59 +97,33 @@ void config(unsigned short dir_config, unsigned short pullup_config, unsigned short polarity_config); -/* ****************************************************************************** +/* * pinmode * Set units to sequential, bank0 mode */ - /** - */ - void pinMode(int pin, int mode); - /** - */ + void pinMode(int pin, int mode); void digitalWrite(int pin, int val); - /** - */ int digitalRead(int pin); // These provide a more advanced mapping of the chip functionality // See the data sheet for more information on what they do //Returns a word with the current pin states (ie contents of the GPIO register) - /** - */ unsigned short digitalWordRead(); // Allows you to write a word to the GPIO register - /** - */ void digitalWordWrite(unsigned short w); // Sets up the polarity mask that the MCP23017 supports // if set to 1, it will flip the actual pin value. - /** - */ void inputPolarityMask(unsigned short mask); //Sets which pins are inputs or outputs (1 = input, 0 = output) NB Opposite to arduino's //definition for these - /** - */ void inputOutputMask(unsigned short mask); // Allows enabling of the internal 100k pullup resisters (1 = enabled, 0 = disabled) - /** - */ void internalPullupMask(unsigned short mask); - /** - */ int read(void); - /** - */ void write(int data); - /** - */ void writeRegister(int regAddress, unsigned char val); - /** - */ void writeRegister(int regAddress, unsigned short val); - /** - */ int readRegister(int regAddress); protected: