Dilbert
Firmware for the Dilbert interactive badge.
 All Classes Files Functions Variables Enumerations Macros Pages
Public Member Functions | Protected Member Functions | List of all members
MCP23017Button Class Reference

Represents a button on an MCP23017 GPIO pin. More...

#include <MCP23017Button.h>

Inheritance diagram for MCP23017Button:
Inheritance graph
[legend]
Collaboration diagram for MCP23017Button:
Collaboration graph
[legend]

Public Member Functions

 MCP23017Button (Adafruit_MCP23017 *io, inputid_t id, inputpin_t pin, bool activeLow=true, bool pullUp=true)
 Creates a new button on an MCP23017 GPIO pin. More...
 
inputpin_t getPin () const
 Gets the pin the button is attached to. More...
 
bool isActiveLow () const
 Determines if the pin logic is active low. More...
 
bool isPullUp () const
 Determines if the pin is pulled high. More...
 

Protected Member Functions

uint8_t getPhysicalState () const
 

Detailed Description

Represents a button on an MCP23017 GPIO pin.

Constructor & Destructor Documentation

MCP23017Button::MCP23017Button ( Adafruit_MCP23017 io,
inputid_t  id,
inputpin_t  pin,
bool  activeLow = true,
bool  pullUp = true 
)

Creates a new button on an MCP23017 GPIO pin.

Parameters
ioPointer to the MCP23017 driver
idID of the button
pinPin the button is attached to
activeLowIf the button logic is active low
pullUpIf the pin should be pulled high

Member Function Documentation

uint8_t MCP23017Button::getPhysicalState ( ) const
protected

inputpin_t MCP23017Button::getPin ( ) const
inline

Gets the pin the button is attached to.

Returns
Pin number
bool MCP23017Button::isActiveLow ( ) const
inline

Determines if the pin logic is active low.

Returns
True if active low
bool MCP23017Button::isPullUp ( ) const
inline

Determines if the pin is pulled high.

Returns
True if pull up active

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