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.

MAX31855.h

Committer:
ratsept
Date:
2012-03-10
Revision:
0:a07644a18427

File content as of revision 0:a07644a18427:

#ifndef MAX31855_h
#define MAX31855_h
 
#include "mbed.h"

class MAX31855
{
    SPI& spi;
    DigitalOut ncs;
    public:

    MAX31855(SPI& _spi, PinName _ncs);
    void select();
    void deselect();
     
    float read_temp();
    private:
    PinName _CS_pin;
    PinName _SO_pin;
    PinName _SCK_pin;
    int _units;
    float _error;
};
 
#endif