8:4 Matrix Multiplexer

Fork of max14661 by Maxim Integrated

This is an untested driver for the MAX14724.

Revision:
2:88c168ddc145
Parent:
1:c1fdfe4c2354
Child:
3:638bf72e3a00
--- a/max14661.h	Mon Nov 17 23:57:52 2014 +0000
+++ b/max14661.h	Wed Nov 19 00:56:18 2014 +0000
@@ -129,10 +129,9 @@
 /******************************************************************//**
 * Max14661 Class
 **********************************************************************/
-class Max14661
+class Max14661 : public I2C
 {
-    //private members
-    I2C* p_i2c;
+
     uint8_t w_adrs, r_adrs;
     
     public:
@@ -140,7 +139,8 @@
         * Constructor for Max14661 Class
         *
         * On Entry:
-        *     @param[in] p_i2c - pointer to I2C object for bus
+        *     @param[in] sda - sda pin of I2C bus
+        *     @param[in] scl - scl pin of I2C bus
         *     @param[in] i2c_adrs - 7-bit slave address of MAX14661
         *
         * On Exit:
@@ -149,15 +149,12 @@
         * Example:
         * @code
         * 
-        * I2C i2c_bus(D14, D15); //instantiate I2C bus
-        * I2C * p_i2c_bus = &i2c_bus; //create pointer to bus
-        * 
-        * //instantiate mux object
-        * Max14661 mux(p_i2c_bus, MAX14661_I2C_ADRS0); 
+        * //declare mux object
+        * Max14661 mux(D14, D15, MAX14661_I2C_ADRS0); 
         *
         * @endcode
         **************************************************************/
-        Max14661(I2C* ptr_i2c_bus, max14661_i2c_adrs_t i2c_adrs);
+        Max14661(PinName sda, PinName scl, max14661_i2c_adrs_t i2c_adrs);
         
         
         /******************************************************************//**
@@ -173,11 +170,8 @@
         * Example:
         * @code
         *
-        * I2C i2c_bus(D14, D15); //instantiate I2C bus
-        * I2C * p_i2c_bus = &i2c_bus; //create pointer to bus
-        * 
-        * //instantiate mux object
-        * Max14661 mux(p_i2c_bus, MAX14661_I2C_ADRS0);   
+        * //declare mux object
+        * Max14661 mux(D14, D15, MAX14661_I2C_ADRS0); 
         *
         * uint16_t rtn_val;  
         *
@@ -201,11 +195,8 @@
         * Example:
         * @code
         *
-        * I2C i2c_bus(D14, D15); //instantiate I2C bus
-        * I2C * p_i2c_bus = &i2c_bus; //create pointer to bus
-        * 
-        * //instantiate mux object
-        * Max14661 mux(p_i2c_bus, MAX14661_I2C_ADRS0);   
+        * //declare mux object
+        * Max14661 mux(D14, D15, MAX14661_I2C_ADRS0); 
         *
         * uint8_t data[] = {1, 2, 3, 4};
         * uint16_t rtn_val;  
@@ -230,11 +221,8 @@
         * Example:
         * @code  
         *
-        * I2C i2c_bus(D14, D15); //instantiate I2C bus
-        * I2C * p_i2c_bus = &i2c_bus; //create pointer to bus
-        * 
-        * //instantiate mux object
-        * Max14661 mux(p_i2c_bus, MAX14661_I2C_ADRS0);   
+        * //declare mux object
+        * Max14661 mux(D14, D15, MAX14661_I2C_ADRS0);   
         *
         * uint8_t data[] = {1, 2, 3, 4};
         * uint16_t rtn_val;  
@@ -262,11 +250,8 @@
         * Example:
         * @code
         *
-        * I2C i2c_bus(D14, D15); //instantiate I2C bus
-        * I2C * p_i2c_bus = &i2c_bus; //create pointer to bus
-        * 
-        * //instantiate mux object
-        * Max14661 mux(p_i2c_bus, MAX14661_I2C_ADRS0);   
+        * //declare mux object
+        * Max14661 mux(D14, D15, MAX14661_I2C_ADRS0); 
         *
         * uint16_t rtn_val;  
         * uint8_t data[4];
@@ -294,11 +279,8 @@
         * Example:
         * @code
         *
-        * I2C i2c_bus(D14, D15); //instantiate I2C bus
-        * I2C * p_i2c_bus = &i2c_bus; //create pointer to bus
-        * 
-        * //instantiate mux object
-        * Max14661 mux(p_i2c_bus, MAX14661_I2C_ADRS0);   
+        * //declare mux object
+        * Max14661 mux(D14, D15, MAX14661_I2C_ADRS0); 
         *
         * uint16_t rtn_val;  
         * uint8_t data[4];