RBControl
Library for the RB3201-RBControl board with the ESP32 by RoboticsBrno.
Public Member Functions | List of all members
Adafruit_MCP23017 Class Reference

Controls the expander pins. More...

#include <Adafruit_MCP23017.h>

Public Member Functions

 Adafruit_MCP23017 (uint8_t addr, i2c_port_t port, gpio_num_t sda, gpio_num_t scl)
 
 ~Adafruit_MCP23017 ()
 
void pinMode (uint8_t p, uint8_t d)
 
void digitalWrite (uint8_t p, uint8_t d)
 
void pullUp (uint8_t p, uint8_t d)
 
uint8_t digitalRead (uint8_t p)
 
void writeGPIOAB (uint16_t)
 
uint16_t readGPIOAB ()
 
uint8_t readGPIO (uint8_t b)
 
void setupInterrupts (uint8_t mirroring, uint8_t open, uint8_t polarity)
 
uint8_t getLastInterruptPin ()
 
uint8_t getLastInterruptPinValue ()
 

Detailed Description

Controls the expander pins.

Constructor & Destructor Documentation

◆ Adafruit_MCP23017()

Adafruit_MCP23017::Adafruit_MCP23017 ( uint8_t  addr,
i2c_port_t  port,
gpio_num_t  sda,
gpio_num_t  scl 
)

◆ ~Adafruit_MCP23017()

Adafruit_MCP23017::~Adafruit_MCP23017 ( )

Member Function Documentation

◆ digitalRead()

uint8_t Adafruit_MCP23017::digitalRead ( uint8_t  p)

◆ digitalWrite()

void Adafruit_MCP23017::digitalWrite ( uint8_t  p,
uint8_t  d 
)

◆ getLastInterruptPin()

uint8_t Adafruit_MCP23017::getLastInterruptPin ( )

◆ getLastInterruptPinValue()

uint8_t Adafruit_MCP23017::getLastInterruptPinValue ( )

◆ pinMode()

void Adafruit_MCP23017::pinMode ( uint8_t  p,
uint8_t  d 
)

Sets the pin mode to either INPUT or OUTPUT

◆ pullUp()

void Adafruit_MCP23017::pullUp ( uint8_t  p,
uint8_t  d 
)

◆ readGPIO()

uint8_t Adafruit_MCP23017::readGPIO ( uint8_t  b)

Read a single port, A or B, and return its current 8 bit value. Parameter b should be 0 for GPIOA, and 1 for GPIOB.

◆ readGPIOAB()

uint16_t Adafruit_MCP23017::readGPIOAB ( )

Reads all 16 pins (port A and B) into a single 16 bits variable.

◆ setupInterrupts()

void Adafruit_MCP23017::setupInterrupts ( uint8_t  mirroring,
uint8_t  openDrain,
uint8_t  polarity 
)

Configures the interrupt system. both port A and B are assigned the same configuration. Mirroring will OR both INTA and INTB pins. Opendrain will set the INT pin to value or open drain. polarity will set LOW or HIGH on interrupt. Default values after Power On Reset are: (false,flase, LOW) If you are connecting the INTA/B pin to arduino 2/3, you should configure the interupt handling as FALLING with the default configuration.

◆ writeGPIOAB()

void Adafruit_MCP23017::writeGPIOAB ( uint16_t  ba)

Writes all the pins in one go. This method is very useful if you are implementing a multiplexed matrix and want to get a decent refresh rate.


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