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.
Dependencies: X_NUCLEO_COMMON
Fork of X_NUCLEO_IKS01A1 by
Diff: Components/Common/HumiditySensor.h
- Revision:
- 28:501726e9220d
- Parent:
- 20:c20c8bd5be6b
- Child:
- 30:7b36639ee80a
diff -r ff11b6df3e8a -r 501726e9220d Components/Common/HumiditySensor.h
--- a/Components/Common/HumiditySensor.h Wed Jun 03 15:12:38 2015 +0200
+++ b/Components/Common/HumiditySensor.h Thu Jun 04 11:51:44 2015 +0200
@@ -41,7 +41,7 @@
#define __HUMIDITY_SENSOR_CLASS_H
/* Includes ------------------------------------------------------------------*/
-#include "mbed.h"
+#include <stdint.h>
/* Classes ------------------------------------------------------------------*/
/** An abstract class for Humidity sensors
@@ -49,24 +49,50 @@
class HumiditySensor
{
public:
+ /**
+ * @brief Initialization of humidity 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 humidity 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 humidity [%]
+ * @param[out] Pointer to where to store humidity to
+ * @retval 0 in case of success, an error code otherwise
+ */
+ virtual int GetHumidity(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 GetHumidity(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:
- HumiditySensor(void) {};
};
#endif /* __HUMIDITY_SENSOR_CLASS_H */
