spectro and PT100
Fork of max31865 by
Diff: MAX31865.cpp
- Revision:
- 1:5262db31116a
- Parent:
- 0:ae18c7b91185
--- a/MAX31865.cpp Sun Aug 14 05:09:52 2016 +0000 +++ b/MAX31865.cpp Tue Jun 20 12:11:24 2017 +0000 @@ -33,7 +33,7 @@ //#include <SPI.h> #include <MAX31865.h> #include "mbed.h" - +extern Serial serial; /** * The constructor for the MAX31865_RTD class registers the CS pin and * configures it as an output. @@ -99,12 +99,16 @@ /* Store the control bits and the fault threshold limits for reconfiguration purposes. */ + + this->configuration_control_bits = control_bits; this->configuration_low_threshold = low_threshold; this->configuration_high_threshold = high_threshold; /* Perform an initial "reconfiguration." */ + reconfigure( ); + } @@ -115,23 +119,23 @@ */ void MAX31865_RTD::reconfigure( ) { - /* Write the configuration to the MAX31865. */ + nss = 0; // wait_us(100); spi.write( 0x80 ); - spi.write( this->configuration_control_bits ); + /* spi.write( this->configuration_control_bits ); nss = 1; - /* Write the threshold values. */ + nss = 0; - // wait_us(100); + spi.write( 0x83 ); spi.write( ( this->configuration_high_threshold >> 8 ) & 0x00ff ); spi.write( this->configuration_high_threshold & 0x00ff ); spi.write( ( this->configuration_low_threshold >> 8 ) & 0x00ff ); spi.write( this->configuration_low_threshold & 0x00ff ); nss = 1; - + */ }