Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of MAX31856_example_program by
Diff: MAX31856.h
- Revision:
- 6:e1200ae7d6a3
- Parent:
- 5:3a51bb306f41
- Child:
- 7:2e45068189b1
--- a/MAX31856.h Mon Jul 31 07:55:00 2017 +0000
+++ b/MAX31856.h Mon Jul 31 18:10:24 2017 +0000
@@ -142,12 +142,12 @@
#define CR1_CLEAR_BITS_3_0 ~0x0F
-#define MASK_CLEAR_BITS_5 ~0x01UL << 5))
-#define MASK_CLEAR_BITS_4 ~0x01UL << 4))
-#define MASK_CLEAR_BITS_3 ~0x01UL << 3))
-#define MASK_CLEAR_BITS_2 ~0x01UL << 2))
-#define MASK_CLEAR_BITS_1 ~0x01UL << 1))
-#define MASK_CLEAR_BITS_0 ~0x01
+#define MASK_CLEAR_BITS_5 ~0x20
+#define MASK_CLEAR_BITS_4 ~0x10
+#define MASK_CLEAR_BITS_3 ~0x08
+#define MASK_CLEAR_BITS_2 ~0x04
+#define MASK_CLEAR_BITS_1 ~0x02
+#define MASK_CLEAR_BITS_0 ~0x01
//The following are predefined times that the MAX31856 needs to wait in between
#define MIN_TIME_BETWEEN_READINGS
@@ -222,8 +222,8 @@
*/
MAX31856(SPI& _spi, PinName _ncs, uint8_t _type=CR1_TC_TYPE_K, uint8_t _fltr=CR0_FILTER_OUT_60Hz, uint8_t _samples=CR1_AVG_TC_SAMPLES_1, uint8_t _conversion_mode=CR0_CONV_MODE_NORMALLY_OFF);
- /** @brief Destructor */
- ~MAX31856(void);
+// /** @brief Destructor */
+// ~MAX31856(void);
/** @brief Writes the chip seleect pin low to begin SPI communications */
void spiEnable();
@@ -247,6 +247,8 @@
//Functions for register CR0
/**
* @brief Sets bits in the configuration register zero for setting the rate of conversions
+ * @param val - CR0_CONV_MODE_NORMALLY_OFF
+ * CR0_CONV_MODE_NORMALLY_ON
* @return 1 on success, and zero on failure or if there is an incorrect parameter is selected
*/
bool setConversionMode(uint8_t val);
@@ -281,11 +283,29 @@
*/
bool setEmiFilterFreq(uint8_t val);
+
+
+
//Functions for register CR1
+ /**
+ * @brief Sets bits in the configuration register one for setting how many readings are taken
+ * @return 1 on success, and zero on failure or if there is an incorrect parameter is selected
+ */
bool setNumSamplesAvg(uint8_t val);
+ /**
+ * @brief Sets bits in the configuration register one for setting which thermocouple type is going to beprogrammed into the MAX31856 for linearization of thermovoltage produced and temperature
+ * @return 1 on success, and zero on failure or if there is an incorrect parameter is selected
+ */
bool setThermocoupleType(uint8_t val);
+
+
+
//Functions for register MASK
+ /**
+ * @brief Sets bits in the configuration register one for setting which thermocouple type is going to beprogrammed into the MAX31856 for linearization of thermovoltage produced and temperature
+ * @return 1 on success, and zero on failure or if there is an incorrect parameter is selected
+ */
bool setFaultMasks(uint8_t val, bool enable);
float setFaultThresholds(uint8_t val, bool enable_mask, float temperature);
