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.
Dependencies: DebugLibrary MCP23017_I2C mbed
Diff: MCP23017_I2C/AbstractGpioExpender.h
- Revision:
- 0:1d91b4046326
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/MCP23017_I2C/AbstractGpioExpender.h Wed Jan 07 09:49:59 2015 +0000
@@ -0,0 +1,43 @@
+#pragma once
+
+#include <list>
+
+#include <mbed.h>
+
+#define GPA0 0
+#define GPA1 1
+#define GPA2 2
+#define GPA3 3
+#define GPA4 4
+#define GPA5 5
+#define GPA6 6
+#define GPA7 7
+#define GPB0 8
+#define GPB1 9
+#define GPB2 10
+#define GPB3 11
+#define GPB4 12
+#define GPB5 13
+#define GPB6 14
+#define GPB7 15
+
+class AbstractGpioExpender {
+public:
+ virtual void reset() = 0;
+
+ virtual void setupInterrupts(const unsigned char p_mirroring, const unsigned char p_open, const unsigned char p_polarity) = 0;
+ virtual void setupInterruptPin(const unsigned char p_pinId, const unsigned char p_mode) = 0;
+
+ virtual int read(const unsigned char p_pinId) = 0;
+ virtual int write(const unsigned char p_pinId, const unsigned char p_value) = 0;
+
+ virtual unsigned char createBus(const std::list<unsigned char> p_lines, const PinMode p_mode = PullNone) = 0;
+ virtual void deleteBus(const unsigned char p_busId) = 0;
+ virtual int busRead(const unsigned char p_busId) = 0;
+ virtual int busWrite(const unsigned char p_busId, const unsigned char p_value) = 0;
+
+protected:
+ virtual bool writeRegister(const unsigned char p_registerId, const unsigned char p_value) = 0;
+ virtual bool readRegister(const unsigned char p_registerId, unsigned char * p_value) = 0;
+
+}; // End of class AbstractGpioExpender
\ No newline at end of file