a
Dependents: 0A101_mDot_Sensor_Rev3_AUS 601_mDot_Sensor_RevJT_AUS
max31855.h@0:e5b2ddf1f113, 2018-01-04 (annotated)
- Committer:
- jortronm2
- Date:
- Thu Jan 04 03:40:07 2018 +0000
- Revision:
- 0:e5b2ddf1f113
No Changes
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jortronm2 | 0:e5b2ddf1f113 | 1 | #ifndef MAX31855_h |
jortronm2 | 0:e5b2ddf1f113 | 2 | #define MAX31855_h |
jortronm2 | 0:e5b2ddf1f113 | 3 | |
jortronm2 | 0:e5b2ddf1f113 | 4 | #include "mbed.h" |
jortronm2 | 0:e5b2ddf1f113 | 5 | |
jortronm2 | 0:e5b2ddf1f113 | 6 | class max31855 |
jortronm2 | 0:e5b2ddf1f113 | 7 | { |
jortronm2 | 0:e5b2ddf1f113 | 8 | SPI& spi; |
jortronm2 | 0:e5b2ddf1f113 | 9 | DigitalOut ncs; |
jortronm2 | 0:e5b2ddf1f113 | 10 | Timer pollTimer; |
jortronm2 | 0:e5b2ddf1f113 | 11 | public: |
jortronm2 | 0:e5b2ddf1f113 | 12 | |
jortronm2 | 0:e5b2ddf1f113 | 13 | max31855(SPI& _spi, PinName _ncs); |
jortronm2 | 0:e5b2ddf1f113 | 14 | void select(); |
jortronm2 | 0:e5b2ddf1f113 | 15 | void deselect(); |
jortronm2 | 0:e5b2ddf1f113 | 16 | void initialise(int setType=0); |
jortronm2 | 0:e5b2ddf1f113 | 17 | |
jortronm2 | 0:e5b2ddf1f113 | 18 | int ready(); |
jortronm2 | 0:e5b2ddf1f113 | 19 | int faultCode; |
jortronm2 | 0:e5b2ddf1f113 | 20 | |
jortronm2 | 0:e5b2ddf1f113 | 21 | float chipTemp; |
jortronm2 | 0:e5b2ddf1f113 | 22 | float read_temp(); |
jortronm2 | 0:e5b2ddf1f113 | 23 | uint8_t read_temp_raw(int16_t *temperature); |
jortronm2 | 0:e5b2ddf1f113 | 24 | private: |
jortronm2 | 0:e5b2ddf1f113 | 25 | PinName _CS_pin; |
jortronm2 | 0:e5b2ddf1f113 | 26 | PinName _SO_pin; |
jortronm2 | 0:e5b2ddf1f113 | 27 | PinName _SCK_pin; |
jortronm2 | 0:e5b2ddf1f113 | 28 | int _units; |
jortronm2 | 0:e5b2ddf1f113 | 29 | float _error; |
jortronm2 | 0:e5b2ddf1f113 | 30 | }; |
jortronm2 | 0:e5b2ddf1f113 | 31 | |
jortronm2 | 0:e5b2ddf1f113 | 32 | #endif |