aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/lib/peripherals/sensors/hal_sensors.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/lib/peripherals/sensors/hal_sensors.h')
-rw-r--r--os/hal/lib/peripherals/sensors/hal_sensors.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/os/hal/lib/peripherals/sensors/hal_sensors.h b/os/hal/lib/peripherals/sensors/hal_sensors.h
index 6a97ddaed..0a09a3b21 100644
--- a/os/hal/lib/peripherals/sensors/hal_sensors.h
+++ b/os/hal/lib/peripherals/sensors/hal_sensors.h
@@ -92,6 +92,13 @@ typedef struct {
* @{
*/
/**
+ * @brief Instance getter.
+ * @details This special method is used to get the instance of this class
+ * object from a derived class.
+ */
+#define getBaseSensor(ip) ((BaseSensor *)&(ip)->vmt_sensor)
+
+/**
* @brief Sensors get channels number.
*
* @param[in] ip pointer to a @p BaseSensor or derived class.