aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/lib/peripherals/sensors/hal_compass.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/lib/peripherals/sensors/hal_compass.h')
-rw-r--r--os/hal/lib/peripherals/sensors/hal_compass.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/os/hal/lib/peripherals/sensors/hal_compass.h b/os/hal/lib/peripherals/sensors/hal_compass.h
index 34473e04a..83ab8b2ab 100644
--- a/os/hal/lib/peripherals/sensors/hal_compass.h
+++ b/os/hal/lib/peripherals/sensors/hal_compass.h
@@ -95,6 +95,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 getBaseCompass(ip) ((BaseCompass *)&(ip)->vmt_compass)
+
+/**
* @brief Compass get axes number.
*
* @param[in] ip pointer to a @p BaseCompass class.