a
Dependents: 0A101_mDot_Sensor_Rev3_AUS 601_mDot_Sensor_RevJT_AUS
Diff: max31855.h
- Revision:
- 0:e5b2ddf1f113
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/max31855.h Thu Jan 04 03:40:07 2018 +0000 @@ -0,0 +1,32 @@ +#ifndef MAX31855_h +#define MAX31855_h + +#include "mbed.h" + +class max31855 +{ + SPI& spi; + DigitalOut ncs; + Timer pollTimer; + public: + + max31855(SPI& _spi, PinName _ncs); + void select(); + void deselect(); + void initialise(int setType=0); + + int ready(); + int faultCode; + + float chipTemp; + float read_temp(); + uint8_t read_temp_raw(int16_t *temperature); + private: + PinName _CS_pin; + PinName _SO_pin; + PinName _SCK_pin; + int _units; + float _error; +}; + +#endif