aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/lib/peripherals/sensors/hal_gyroscope.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/lib/peripherals/sensors/hal_gyroscope.h')
-rw-r--r--os/hal/lib/peripherals/sensors/hal_gyroscope.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/os/hal/lib/peripherals/sensors/hal_gyroscope.h b/os/hal/lib/peripherals/sensors/hal_gyroscope.h
index 00786607e..47b3708c8 100644
--- a/os/hal/lib/peripherals/sensors/hal_gyroscope.h
+++ b/os/hal/lib/peripherals/sensors/hal_gyroscope.h
@@ -98,6 +98,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 getBaseGyroscope(ip) ((BaseGyroscope *)&(ip)->vmt_gyroscope)
+
+/**
* @brief Gyroscope get axes number.
*
* @param[in] ip pointer to a @p BaseGyroscope class.