ADT7320 temperature sensor.

Dependents:   sscm

Fork of T_adt7320 by wimbeaumont Project

Revision:
1:1b9f706b8abc
Parent:
0:e252ae2774e8
Child:
2:186e3c0afcad
--- a/adt7320.h	Thu Oct 02 19:25:55 2014 +0000
+++ b/adt7320.h	Sun Oct 05 17:12:21 2014 +0000
@@ -7,26 +7,39 @@
 
 */
 #include "solid_sctrl_def.h" 
+#include "getVersion.h"
 #include "SWSPI.h"
 
-class adt7320 {
+#define ADT7320_HDR_VER "1.13" 
+
+class adt7320 : public getVersion{
 
 void set_spi_mode(u8 nrbyte);
-u8   format_cmd( u8 reg, bool rw);
-SWSPI* spi;
-DigitalOut* cs;
+
+private:
+    SWSPI* spi;
+    DigitalOut* cs;
     
+    u8   format_cmd( u8 reg, bool rw);
+    u8   getR08( u8 addr);
+    void setR08( u8 addr, u8 datain);
+    u16  getR16( u8 addr);
+    void  setR16( u8 addr, u16 datain);
+        
 public:
 
     adt7320(SWSPI *spiinterface ,DigitalOut* chipselect );
-    float getTemperature(){return -280;};    
-    u8   getR08( u8 addr);
-    u16   getR16( u8 addr);
+    float getTemperature(){return -280;};    // to be implenented 
     u8  getId();
     u16 get_TcritSP();
+    void set_TcritSP(u16 tcrit);
     u16 get_T(); //  get the temperature register
-
+    u16 get_hdr_ver();// returns the hdr version nr 
+    u16 get_src_ver();// returns the src version nr 
+    void init1();
+    void init2();
     
+   
 };