PU2CLR MCP23008 Arduino Library  1.0.3
Arduino Library for MCP23008 Device - By Ricardo Lima Caratti
MCP Class Reference

#include <pu2clr_mcp23008.h>

Public Member Functions

uint8_t lookForDevice ()
 Look for MCP23008 device I2C Address. More...
 
void setup (uint8_t i2c=0x20, uint8_t io=GPIO_OUTPUT)
 Starts the MCP23008. More...
 
uint8_t getRegister (uint8_t reg)
 Gets the corrent register information. More...
 
void setRegister (uint8_t reg, uint8_t value)
 Sets a value to a given register. More...
 
void turnGpioOn (uint8_t gpio)
 Turns a given GPIO port on (high level) More...
 
void turnGpioOff (uint8_t gpio)
 Turns a given GPIO port off (low level) More...
 
void pullUpGpioOn (uint8_t gpio)
 Turns intenal pull up resistor ON to a given GPIO PIN (high level) More...
 
void pullUpGpioOff (uint8_t gpio)
 Turns intenal pull up resistor OFF to a given GPIO PIN (low level) More...
 
void setIoCon (uint8_t INTPOL, uint8_t ODR, uint8_t HAEN, uint8_t DISSLW, uint8_t SEQOP)
 Sets the IO Configurarion gerister. More...
 
void invertGpioPolarity ()
 Inverts the polarity of the all GPIO port bits. More...
 
void setInterrupt (uint8_t polatity=0, uint8_t openDrainOutput=0)
 Configures the MCP23008 interrupt feature. More...
 
void interruptGpioOn (uint8_t gpio, uint8_t bitCompare=1)
 Sets the interrupt-on-change feature to a given GPIO pin. More...
 
bool gpioRead (uint8_t gpio)
 Reads the status (high or low) or a given GPIO. More...
 
void gpioWrite (uint8_t gpio, uint8_t value)
 Sets a given value (high(1) or low(0) ) to a given gpio pin. More...
 
uint8_t getGPIOS ()
 Returns the current MCP GPIO pin levels. More...
 
void setGPIOS (uint8_t value)
 Sets a value to the GPIO Register. More...
 
uint8_t getINTCAP ()
 Returns the last value of INTCAP register (value immediately after the last interrupt event) More...
 
uint8_t getINTF ()
 Returns the last value of INTCAP register (value immediately after the last interrupt event) More...
 

Protected Attributes

uint8_t i2cAddress = 0x20
 
uint8_t gpios = 0
 
uint8_t intcap = 0
 
uint8_t intf = 0
 

Field Documentation

◆ i2cAddress

uint8_t MCP::i2cAddress = 0x20
protected

◆ gpios

uint8_t MCP::gpios = 0
protected

◆ intcap

uint8_t MCP::intcap = 0
protected

◆ intf

uint8_t MCP::intf = 0
protected

The documentation for this class was generated from the following files: