Kazuaki Hongu / ADS1100
Revision:
2:7ee26d7e2997
Parent:
0:b211ff96822b
Child:
3:7c8d1aa80a9d
--- a/ADS1100.h	Thu May 31 04:31:51 2018 +0000
+++ b/ADS1100.h	Wed Jun 20 07:05:53 2018 +0000
@@ -1,4 +1,4 @@
- //**********************
+//**********************
 // ADS1100.h for mbed
 //
 // Each ADS1100 is marked with "ADx".
@@ -13,7 +13,7 @@
 #define ADS1100_ADDR    0b1001
 
 typedef union {
-    uint8_t UC;   
+    char UC;   
     struct {
         unsigned char ST:1; //0
         unsigned char RE:2; //must be 00
@@ -26,20 +26,23 @@
 typedef union {
     uint16_t S;
     struct {
-        uint8_t UB; //upper Byte (8bit)
-        uint8_t LB; //lpper Byte (8bit)
-    }
+        char UB; //upper Byte (8bit)
+        char LB; //lpper Byte (8bit)
+    } byte;
 } RESULT;
 
-protected:
-    I2C _i2c;
-    CONFIG config;
-    RESULT result;
-    uint8_t buf[3];
-    uint8_t address;
-
-public:
-    ADS1100 (PinName sda, PinName scl, char addr);
-    ADS1100 (I2C& p_i2c, char addr);
-    void init();
-    uint16_t get();
\ No newline at end of file
+class ADS1100{
+    public:
+        ADS1100 (PinName sda, PinName scl, char addr);
+        ADS1100 (I2C& p_i2c, char addr);
+        void init(char addr);
+        uint16_t get();
+    
+    protected:
+        I2C _i2c;
+        CONFIG config;
+        RESULT result;
+        char buf[3];
+        char address;
+};
+#endif /* ADS1100_H_ */
\ No newline at end of file