interface for the temperature sensor chip adt7320, with sw SPI interface

Dependents:   SPItest sscm

Committer:
wbeaumont
Date:
Thu Oct 02 19:25:55 2014 +0000
Revision:
0:e252ae2774e8
Child:
1:1b9f706b8abc
initial (only) readout of the temperature sensor chip adt7320

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 0:e252ae2774e8 10 #include "SWSPI.h"
wbeaumont 0:e252ae2774e8 11
wbeaumont 0:e252ae2774e8 12 class adt7320 {
wbeaumont 0:e252ae2774e8 13
wbeaumont 0:e252ae2774e8 14 void set_spi_mode(u8 nrbyte);
wbeaumont 0:e252ae2774e8 15 u8 format_cmd( u8 reg, bool rw);
wbeaumont 0:e252ae2774e8 16 SWSPI* spi;
wbeaumont 0:e252ae2774e8 17 DigitalOut* cs;
wbeaumont 0:e252ae2774e8 18
wbeaumont 0:e252ae2774e8 19 public:
wbeaumont 0:e252ae2774e8 20
wbeaumont 0:e252ae2774e8 21 adt7320(SWSPI *spiinterface ,DigitalOut* chipselect );
wbeaumont 0:e252ae2774e8 22 float getTemperature(){return -280;};
wbeaumont 0:e252ae2774e8 23 u8 getR08( u8 addr);
wbeaumont 0:e252ae2774e8 24 u16 getR16( u8 addr);
wbeaumont 0:e252ae2774e8 25 u8 getId();
wbeaumont 0:e252ae2774e8 26 u16 get_TcritSP();
wbeaumont 0:e252ae2774e8 27 u16 get_T(); // get the temperature register
wbeaumont 0:e252ae2774e8 28
wbeaumont 0:e252ae2774e8 29
wbeaumont 0:e252ae2774e8 30 };
wbeaumont 0:e252ae2774e8 31
wbeaumont 0:e252ae2774e8 32
wbeaumont 0:e252ae2774e8 33
wbeaumont 0:e252ae2774e8 34
wbeaumont 0:e252ae2774e8 35 #endif