Library for MAX31855. Based on MAX6675 library. I have only implemented the temperature reading. The chip supports also the reading of internal reference temperature and faults for shorted thermocouple and shorts to vcc/gnd.

Committer:
ratsept
Date:
Sat Mar 10 19:30:40 2012 +0000
Revision:
0:a07644a18427

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ratsept 0:a07644a18427 1 #ifndef MAX31855_h
ratsept 0:a07644a18427 2 #define MAX31855_h
ratsept 0:a07644a18427 3
ratsept 0:a07644a18427 4 #include "mbed.h"
ratsept 0:a07644a18427 5
ratsept 0:a07644a18427 6 class MAX31855
ratsept 0:a07644a18427 7 {
ratsept 0:a07644a18427 8 SPI& spi;
ratsept 0:a07644a18427 9 DigitalOut ncs;
ratsept 0:a07644a18427 10 public:
ratsept 0:a07644a18427 11
ratsept 0:a07644a18427 12 MAX31855(SPI& _spi, PinName _ncs);
ratsept 0:a07644a18427 13 void select();
ratsept 0:a07644a18427 14 void deselect();
ratsept 0:a07644a18427 15
ratsept 0:a07644a18427 16 float read_temp();
ratsept 0:a07644a18427 17 private:
ratsept 0:a07644a18427 18 PinName _CS_pin;
ratsept 0:a07644a18427 19 PinName _SO_pin;
ratsept 0:a07644a18427 20 PinName _SCK_pin;
ratsept 0:a07644a18427 21 int _units;
ratsept 0:a07644a18427 22 float _error;
ratsept 0:a07644a18427 23 };
ratsept 0:a07644a18427 24
ratsept 0:a07644a18427 25 #endif