|
| Adafruit_MCP23X17 () |
| default ctor.
|
|
uint8_t | readGPIOA () |
| Bulk read all pins on Port A. More...
|
|
void | writeGPIOA (uint8_t value) |
| Bulk write all pins on Port A. More...
|
|
uint8_t | readGPIOB () |
| Bulk read all pins on Port B. More...
|
|
void | writeGPIOB (uint8_t value) |
| Bulk write all pins on Port B. More...
|
|
uint16_t | readGPIOAB () |
| Bulk read all pins on Port A and B. More...
|
|
void | writeGPIOAB (uint16_t value) |
| Bulk write all pins on Port A and Port B. More...
|
|
void | enableAddrPins () |
| Enable usage of HW address pins (A0, A1, A2) on MCP23S17. More...
|
|
bool | begin_I2C (uint8_t i2c_addr=MCP23XXX_ADDR, TwoWire *wire=&Wire) |
| Initialize MCP using I2C. More...
|
|
bool | begin_SPI (uint8_t cs_pin, SPIClass *theSPI=&SPI, uint8_t _hw_addr=0x00) |
| Initialize MCP using hardware SPI. More...
|
|
bool | begin_SPI (int8_t cs_pin, int8_t sck_pin, int8_t miso_pin, int8_t mosi_pin, uint8_t _hw_addr=0x00) |
| Initialize MCP using software SPI. More...
|
|
void | pinMode (uint8_t pin, uint8_t mode) |
| Configures the specified pin to behave either as an input or an output. More...
|
|
uint8_t | digitalRead (uint8_t pin) |
| Reads the value from a specified digital pin, either HIGH or LOW. More...
|
|
void | digitalWrite (uint8_t pin, uint8_t value) |
| Write a HIGH or a LOW value to a digital pin. More...
|
|
uint8_t | readGPIO (uint8_t port=0) |
| Bulk read all pins on a port. More...
|
|
void | writeGPIO (uint8_t value, uint8_t port=0) |
| Bulk write all pins on a port. More...
|
|
void | setupInterrupts (bool mirroring, bool openDrain, uint8_t polarity) |
| Configure the interrupt system. More...
|
|
void | setupInterruptPin (uint8_t pin, uint8_t mode=CHANGE) |
| Enable interrupt and set mode for given pin. More...
|
|
void | disableInterruptPin (uint8_t pin) |
| Disable interrupt for given pin. More...
|
|
void | clearInterrupts () |
| Clear interrupts. NOTE:If using DEFVAL, INT clears only if interrupt condition does not exist. See Fig 1-7 in datasheet.
|
|
uint8_t | getLastInterruptPin () |
| Gets the pin that caused the latest interrupt, from INTF, without clearing any interrupt flags. More...
|
|
uint16_t | getCapturedInterrupt () |
| Get pin states captured at time of interrupt. More...
|
|
Class for MCP23017 I2C and MCP23S17 SPI variants.
void Adafruit_MCP23X17::enableAddrPins |
( |
| ) |
|
Enable usage of HW address pins (A0, A1, A2) on MCP23S17.
Send this message as first message after chip init, as it will set bits in IOCON register to default (except HAEN) By default pins are not used and disabled (see README for details) This message is sent to all devices on bus (no hw_addr is added to msg as it's not enabled yet) Due to HW bug in the chip message must be sent twice (to addr 0b000 and 0b1xx)