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.
Dependents: iks01a1_acc LoRaWAN-demo-72_mdotIKS01A1 MTDOT-UDKDemo_Senet MTDOT-UDKDemo
Fork of X_NUCLEO_IKS01A1 by
Diff: Components/Common/TempSensor.h
- Revision:
- 38:e06de1c26727
- Parent:
- 32:2bb1d4ced32b
--- 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;
