PCA9555

Dependents:   Telliskivi2_2014 PowerManagementBoard_Rev_A_2017

Revision:
0:011622696878
Child:
1:a6699cd826bb
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PCA9555.h	Mon Jul 29 20:36:59 2013 +0000
@@ -0,0 +1,34 @@
+#include "mbed.h"
+ 
+#ifndef MBED_PCA9555_H
+#define MBED_PCA9555_H
+ 
+/** Interface to the PCA9555 I2C 16 Bit IO expander */
+class PCA9555 {
+public:
+    /** Create an instance of the PCA9555 connected to specfied I2C pins, with the specified address.
+     *
+     * @param sda The I2C data pin
+     * @param scl The I2C clock pin
+     * @param address The I2C address for this PCA9555
+     */
+    PCA9555(PinName sda, PinName scl, int address);
+ 
+    /** Read the IO pin level
+     *
+     * @return The two bytes read
+     */
+    int read();
+    
+    /** Write to the IO pins
+     * 
+     * @param data The 16 bits to write to the IO port
+     */
+    void write(int data);
+ 
+private:
+    I2C _i2c;
+    int _address;
+};
+ 
+#endif
\ No newline at end of file