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:
- 28:501726e9220d
- Parent:
- 20:c20c8bd5be6b
- Child:
- 30:7b36639ee80a
--- a/Components/Common/TempSensor.h Wed Jun 03 15:12:38 2015 +0200
+++ b/Components/Common/TempSensor.h Thu Jun 04 11:51:44 2015 +0200
@@ -41,7 +41,7 @@
#define __TEMP_SENSOR_CLASS_H
/* Includes ------------------------------------------------------------------*/
-#include "mbed.h"
+#include <stdint.h>
/* Classes ------------------------------------------------------------------*/
/** An abstract class for Temperature sensors
@@ -49,24 +49,50 @@
class TempSensor
{
public:
+ /**
+ * @brief Initialization of temperature sensor
+ * @param[out] Pointer to device specific initalization structure
+ * @retval 0 in case of success, an error code otherwise
+ */
virtual int Init(void*) = 0;
+ /**
+ * @brief Enter sensor shutdown mode
+ * @retval 0 in case of success, an error code otherwise
+ */
virtual int PowerOff(void) = 0;
+
+ /**
+ * @brief Get ID of temperature sensor
+ * @param[out] Pointer to where to store the ID to
+ * @retval 0 in case of success, an error code otherwise
+ */
virtual int ReadID(uint8_t*) = 0;
+
+ /**
+ * @brief Reset sensor
+ * @retval 0 in case of success, an error code otherwise
+ */
virtual int Reset(void) = 0;
+ /**
+ * @brief Get current temperature [°C]
+ * @param[out] Pointer to where to store temperature to
+ * @retval 0 in case of success, an error code otherwise
+ */
+ virtual int GetTemperature(float*) = 0;
+
virtual void ConfigIT(uint16_t) = 0;
virtual void EnableIT(uint8_t) = 0;
virtual void DisableIT(uint8_t) = 0;
virtual uint8_t ITStatus(uint16_t, uint16_t) = 0;
virtual void ClearIT(uint16_t, uint16_t) = 0;
- virtual int GetTemperature(float*) = 0;
-
+ /**
+ * @brief Attach a function to be called when an interrupt occurs
+ * @param[in] fptr A pointer to a void function, or 0 to set as none
+ */
virtual void AttachIT(void (*fptr)(void)) = 0;
-
- protected:
- TempSensor(void) {};
};
#endif /* __TEMP_SENSOR_CLASS_H */
