Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: tof100 gaasgjdvas LED_GAME11 tof100
Fork of MCP23017 by
Revision 14:1834cdf54c8f, committed 2016-09-26
- Comitter:
- Anunnaki
- Date:
- Mon Sep 26 10:08:33 2016 +0000
- Parent:
- 13:d57de266cf19
- Commit message:
- Added interrupt flags
Changed in this revision
| MCP23017.cpp | Show annotated file Show diff for this revision Revisions of this file |
| MCP23017.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r d57de266cf19 -r 1834cdf54c8f MCP23017.cpp
--- a/MCP23017.cpp Mon Nov 29 12:46:43 2010 +0000
+++ b/MCP23017.cpp Mon Sep 26 10:08:33 2016 +0000
@@ -19,6 +19,17 @@
#include "MCP23017.h"
#include "mbed.h"
+bool interrupt = 0;
+
+void setInt(){
+ interrupt = 1;
+}
+void clearInt(){
+ interrupt = 0;
+}
+bool getInt(){
+ return interrupt;
+}
union {
uint8_t value8[2];
uint16_t value16;
diff -r d57de266cf19 -r 1834cdf54c8f MCP23017.h
--- a/MCP23017.h Mon Nov 29 12:46:43 2010 +0000
+++ b/MCP23017.h Mon Sep 26 10:08:33 2016 +0000
@@ -42,6 +42,13 @@
#define DIR_OUTPUT 0
#define DIR_INPUT 1
+/*
+ * Interrupt setters and getters
+ */
+void setInt();
+void clearInt();
+bool getInt();
+
/** MCP23017 class
*
* Allow access to an I2C connected MCP23017 16-bit I/O extender chip
@@ -50,7 +57,7 @@
* MCP23017 *par_port;
* @endcode
*
- */
+ */
class MCP23017 {
public:
/** Constructor for the MCP23017 connected to specified I2C pins at a specific address

