ADT7320 temperature sensor.

Dependents:   sscm

Fork of T_adt7320 by wimbeaumont Project

Committer:
wbeaumont
Date:
Sun Oct 05 17:12:21 2014 +0000
Revision:
1:1b9f706b8abc
Parent:
0:e252ae2774e8
Child:
2:186e3c0afcad
dummy init functions added, version class added

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wbeaumont 0:e252ae2774e8 1 #ifndef ADT7320_H
wbeaumont 0:e252ae2774e8 2 #define ADT7320_H
wbeaumont 0:e252ae2774e8 3
wbeaumont 0:e252ae2774e8 4 /*
wbeaumont 0:e252ae2774e8 5
wbeaumont 0:e252ae2774e8 6 adt7320 interface
wbeaumont 0:e252ae2774e8 7
wbeaumont 0:e252ae2774e8 8 */
wbeaumont 0:e252ae2774e8 9 #include "solid_sctrl_def.h"
wbeaumont 1:1b9f706b8abc 10 #include "getVersion.h"
wbeaumont 0:e252ae2774e8 11 #include "SWSPI.h"
wbeaumont 0:e252ae2774e8 12
wbeaumont 1:1b9f706b8abc 13 #define ADT7320_HDR_VER "1.13"
wbeaumont 1:1b9f706b8abc 14
wbeaumont 1:1b9f706b8abc 15 class adt7320 : public getVersion{
wbeaumont 0:e252ae2774e8 16
wbeaumont 0:e252ae2774e8 17 void set_spi_mode(u8 nrbyte);
wbeaumont 1:1b9f706b8abc 18
wbeaumont 1:1b9f706b8abc 19 private:
wbeaumont 1:1b9f706b8abc 20 SWSPI* spi;
wbeaumont 1:1b9f706b8abc 21 DigitalOut* cs;
wbeaumont 0:e252ae2774e8 22
wbeaumont 1:1b9f706b8abc 23 u8 format_cmd( u8 reg, bool rw);
wbeaumont 1:1b9f706b8abc 24 u8 getR08( u8 addr);
wbeaumont 1:1b9f706b8abc 25 void setR08( u8 addr, u8 datain);
wbeaumont 1:1b9f706b8abc 26 u16 getR16( u8 addr);
wbeaumont 1:1b9f706b8abc 27 void setR16( u8 addr, u16 datain);
wbeaumont 1:1b9f706b8abc 28
wbeaumont 0:e252ae2774e8 29 public:
wbeaumont 0:e252ae2774e8 30
wbeaumont 0:e252ae2774e8 31 adt7320(SWSPI *spiinterface ,DigitalOut* chipselect );
wbeaumont 1:1b9f706b8abc 32 float getTemperature(){return -280;}; // to be implenented
wbeaumont 0:e252ae2774e8 33 u8 getId();
wbeaumont 0:e252ae2774e8 34 u16 get_TcritSP();
wbeaumont 1:1b9f706b8abc 35 void set_TcritSP(u16 tcrit);
wbeaumont 0:e252ae2774e8 36 u16 get_T(); // get the temperature register
wbeaumont 1:1b9f706b8abc 37 u16 get_hdr_ver();// returns the hdr version nr
wbeaumont 1:1b9f706b8abc 38 u16 get_src_ver();// returns the src version nr
wbeaumont 1:1b9f706b8abc 39 void init1();
wbeaumont 1:1b9f706b8abc 40 void init2();
wbeaumont 0:e252ae2774e8 41
wbeaumont 1:1b9f706b8abc 42
wbeaumont 0:e252ae2774e8 43 };
wbeaumont 0:e252ae2774e8 44
wbeaumont 0:e252ae2774e8 45
wbeaumont 0:e252ae2774e8 46
wbeaumont 0:e252ae2774e8 47
wbeaumont 0:e252ae2774e8 48 #endif