16 #ifndef _Adafruit_MCP23017_H_
17 #define _Adafruit_MCP23017_H_
22 void begin(uint8_t addr);
25 void pinMode(uint8_t p, uint8_t d);
26 void digitalWrite(uint8_t p, uint8_t d);
27 void pullUp(uint8_t p, uint8_t d);
28 uint8_t digitalRead(uint8_t p);
34 void setupInterrupts(uint8_t mirroring, uint8_t open, uint8_t polarity);
36 uint8_t getLastInterruptPin();
37 uint8_t getLastInterruptPinValue();
42 uint8_t bitForPin(uint8_t pin);
43 uint8_t regForPin(uint8_t pin, uint8_t portAaddr, uint8_t portBaddr);
45 uint8_t readRegister(uint8_t addr);
46 void writeRegister(uint8_t addr, uint8_t value);
52 void updateRegisterBit(uint8_t p, uint8_t pValue, uint8_t portAaddr, uint8_t portBaddr);
56 #define MCP23017_ADDRESS 0x20
59 #define MCP23017_IODIRA 0x00
60 #define MCP23017_IPOLA 0x02
61 #define MCP23017_GPINTENA 0x04
62 #define MCP23017_DEFVALA 0x06
63 #define MCP23017_INTCONA 0x08
64 #define MCP23017_IOCONA 0x0A
65 #define MCP23017_GPPUA 0x0C
66 #define MCP23017_INTFA 0x0E
67 #define MCP23017_INTCAPA 0x10
68 #define MCP23017_GPIOA 0x12
69 #define MCP23017_OLATA 0x14
72 #define MCP23017_IODIRB 0x01
73 #define MCP23017_IPOLB 0x03
74 #define MCP23017_GPINTENB 0x05
75 #define MCP23017_DEFVALB 0x07
76 #define MCP23017_INTCONB 0x09
77 #define MCP23017_IOCONB 0x0B
78 #define MCP23017_GPPUB 0x0D
79 #define MCP23017_INTFB 0x0F
80 #define MCP23017_INTCAPB 0x11
81 #define MCP23017_GPIOB 0x13
82 #define MCP23017_OLATB 0x15
84 #define MCP23017_INT_ERR 255
uint8_t readGPIO(uint8_t b)
Definition: Adafruit_MCP23017.cpp:162
void setupInterrupts(uint8_t mirroring, uint8_t open, uint8_t polarity)
Definition: Adafruit_MCP23017.cpp:224
void setupInterruptPin(uint8_t p, uint8_t mode)
Definition: Adafruit_MCP23017.cpp:247
Definition: Adafruit_MCP23017.h:20
void writeGPIOAB(uint16_t)
Definition: Adafruit_MCP23017.cpp:180
void begin(void)
Definition: Adafruit_MCP23017.cpp:126
uint16_t readGPIOAB()
Definition: Adafruit_MCP23017.cpp:140
void pinMode(uint8_t p, uint8_t d)
Definition: Adafruit_MCP23017.cpp:133