wayne roberts / X_NUCLEO_IKS01A1

Dependencies:   X_NUCLEO_COMMON

Dependents:   iks01a1_acc LoRaWAN-demo-72_mdotIKS01A1 MTDOT-UDKDemo_Senet MTDOT-UDKDemo

Fork of X_NUCLEO_IKS01A1 by ST

Revision:
38:e06de1c26727
Parent:
32:2bb1d4ced32b
diff -r 8c73dbe43cf2 -r e06de1c26727 Components/Common/TempSensor.h
--- a/Components/Common/TempSensor.h	Thu Jun 04 14:09:11 2015 +0200
+++ b/Components/Common/TempSensor.h	Fri Jun 05 16:54:47 2015 +0200
@@ -76,12 +76,28 @@
 	virtual int Reset(void) = 0;
 
 	/**
-	 * @brief       Get current temperature [°C]
+	 * @brief       Get current temperature in degrees Celsius [°C]
 	 * @param[out]  pfData Pointer to where to store temperature to
 	 * @return      0 in case of success, an error code otherwise
 	 */
 	virtual int GetTemperature(float *pfData) = 0;
 
+	/**
+	 * @brief       Get current temperature in degrees Fahrenheit [°F]
+	 * @param[out]  pfData Pointer to where to store temperature to
+	 * @return      0 in case of success, an error code otherwise
+	 */
+	virtual int GetFahrenheit(float *pfData) {
+		float celsius;
+		int ret;
+
+		ret = GetTemperature(&celsius);
+		if(ret) return ret;
+
+		*pfData = ((celsius * 1.8f) + 32.0f);
+		return 0;
+	}
+
 	virtual void ConfigIT(uint16_t) = 0;
 	virtual void EnableIT(uint8_t) = 0;
 	virtual void DisableIT(uint8_t) = 0;