Dilbert
Firmware for the Dilbert interactive badge.
 All Classes Files Functions Variables Enumerations Macros Pages
MCP23017Button.h
Go to the documentation of this file.
1 
3 #ifndef _ARDUINOUNIVERSALINPUTS_MCP23017BUTTON_H
4 #define _ARDUINOUNIVERSALINPUTS_MCP23017BUTTON_H
5 
6 #include <IButton.h>
7 
8 #include "Adafruit_MCP23017.h"
9 
14 class MCP23017Button : public IButton
15 {
16 public:
17  MCP23017Button(Adafruit_MCP23017 *io, inputid_t id, inputpin_t pin, bool activeLow = true,
18  bool pullUp = true);
19 
20  virtual ~MCP23017Button()
21  {
22  }
23 
28  inputpin_t getPin() const
29  {
30  return m_pin;
31  }
32 
37  bool isActiveLow() const
38  {
39  return m_activeLow;
40  }
41 
46  bool isPullUp() const
47  {
48  return m_pullUp;
49  }
50 
51 protected:
52  uint8_t getPhysicalState() const;
53 
54 private:
55  Adafruit_MCP23017 *m_io;
56  inputpin_t m_pin;
57  bool m_activeLow;
58  bool m_pullUp;
59 };
60 
61 #endif
bool isPullUp() const
Determines if the pin is pulled high.
Definition: MCP23017Button.h:46
Definition: Adafruit_MCP23017.h:20
inputpin_t getPin() const
Gets the pin the button is attached to.
Definition: MCP23017Button.h:28
bool isActiveLow() const
Determines if the pin logic is active low.
Definition: MCP23017Button.h:37
Represents a button on an MCP23017 GPIO pin.
Definition: MCP23017Button.h:14
uint8_t getPhysicalState() const
Definition: MCP23017Button.cpp:32
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.
Definition: MCP23017Button.cpp:13