Fork the MAX31855 library. Allows a fxn to be called to select and unselect the TC. Now using a shift register array we can multiplex a great number of these TC chips!
Fork of MAX31855 by
max31855.h@2:b978f1503c27, 2013-10-30 (annotated)
- Committer:
- henryeherman
- Date:
- Wed Oct 30 07:05:34 2013 +0000
- Revision:
- 2:b978f1503c27
- Parent:
- 1:5eeee89cb281
Fork the MAX31855 library and allow functions to be called before reading the TC values, instead of a digital pin. Allows a shift register to be used to select the TC and a VERY large number of TC can be multiplexed!
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Stavlin | 0:656c522152d4 | 1 | #ifndef MAX31855_h |
Stavlin | 0:656c522152d4 | 2 | #define MAX31855_h |
Stavlin | 0:656c522152d4 | 3 | |
Stavlin | 0:656c522152d4 | 4 | #include "mbed.h" |
Stavlin | 0:656c522152d4 | 5 | |
Stavlin | 0:656c522152d4 | 6 | class max31855 |
Stavlin | 0:656c522152d4 | 7 | { |
Stavlin | 0:656c522152d4 | 8 | SPI& spi; |
henryeherman | 2:b978f1503c27 | 9 | void(*selectfxn)(void); |
henryeherman | 2:b978f1503c27 | 10 | void(*unselectfxn)(void); |
henryeherman | 2:b978f1503c27 | 11 | //DigitalOut ncs; |
Stavlin | 0:656c522152d4 | 12 | Timer pollTimer; |
Stavlin | 0:656c522152d4 | 13 | public: |
Stavlin | 0:656c522152d4 | 14 | |
henryeherman | 2:b978f1503c27 | 15 | max31855(SPI& _spi, void(*sel)(void), void(*usel)(void)); |
Stavlin | 0:656c522152d4 | 16 | void select(); |
Stavlin | 0:656c522152d4 | 17 | void deselect(); |
Stavlin | 1:5eeee89cb281 | 18 | void initialise(int setType=0); |
henryeherman | 2:b978f1503c27 | 19 | |
Stavlin | 1:5eeee89cb281 | 20 | int faultCode; |
Stavlin | 0:656c522152d4 | 21 | |
Stavlin | 0:656c522152d4 | 22 | float chipTemp; |
Stavlin | 0:656c522152d4 | 23 | float read_temp(); |
Stavlin | 0:656c522152d4 | 24 | private: |
Stavlin | 0:656c522152d4 | 25 | PinName _CS_pin; |
Stavlin | 0:656c522152d4 | 26 | PinName _SO_pin; |
Stavlin | 0:656c522152d4 | 27 | PinName _SCK_pin; |
Stavlin | 0:656c522152d4 | 28 | int _units; |
Stavlin | 0:656c522152d4 | 29 | float _error; |
Stavlin | 0:656c522152d4 | 30 | }; |
Stavlin | 0:656c522152d4 | 31 | |
Stavlin | 0:656c522152d4 | 32 | #endif |