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.h23
1 files changed, 8 insertions, 15 deletions
diff --git a/os/hal/lib/peripherals/sensors/hal_compass.h b/os/hal/lib/peripherals/sensors/hal_compass.h
index e777070c3..8a314b8f2 100644
--- a/os/hal/lib/peripherals/sensors/hal_compass.h
+++ b/os/hal/lib/peripherals/sensors/hal_compass.h
@@ -85,7 +85,7 @@ struct BaseCompassVMT {
*/
typedef struct {
/** @brief Virtual Methods Table.*/
- const struct BaseCompassVMT *vmt_compass;
+ const struct BaseCompassVMT *vmt;
_base_compass_data
} BaseCompass;
@@ -97,13 +97,6 @@ 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.
@@ -112,7 +105,7 @@ typedef struct {
* @api
*/
#define compassGetAxesNumber(ip) \
- (ip)->vmt_compass->get_channels_number(ip)
+ (ip)->vmt->get_channels_number(ip)
/**
* @brief Compass read raw data.
@@ -127,7 +120,7 @@ typedef struct {
* @api
*/
#define compassReadRaw(ip, dp) \
- (ip)->vmt_compass->read_raw(ip, dp)
+ (ip)->vmt->read_raw(ip, dp)
/**
* @brief Compass read cooked data.
@@ -142,7 +135,7 @@ typedef struct {
* @api
*/
#define compassReadCooked(ip, dp) \
- (ip)->vmt_compass->read_cooked(ip, dp)
+ (ip)->vmt->read_cooked(ip, dp)
/**
* @brief Updates compass bias data from received buffer.
@@ -159,7 +152,7 @@ typedef struct {
* @api
*/
#define compassSetBias(ip, bp) \
- (ip)->vmt_compass->set_bias(ip, bp)
+ (ip)->vmt->set_bias(ip, bp)
/**
* @brief Reset compass bias data restoring it to zero.
@@ -173,7 +166,7 @@ typedef struct {
* @api
*/
#define compassResetBias(ip) \
- (ip)->vmt_compass->reset_bias(ip)
+ (ip)->vmt->reset_bias(ip)
/**
* @brief Updates compass sensitivity data from received buffer.
@@ -190,7 +183,7 @@ typedef struct {
* @api
*/
#define compassSetSensitivity(ip, sp) \
- (ip)->vmt_compass->set_sensitivity(ip, sp)
+ (ip)->vmt->set_sensitivity(ip, sp)
/**
* @brief Reset compass sensitivity data restoring it to its typical
@@ -205,7 +198,7 @@ typedef struct {
* @api
*/
#define compassResetSensitivity(ip) \
- (ip)->vmt_compass->reset_sensitivity(ip)
+ (ip)->vmt->reset_sensitivity(ip)
/** @} */
/*===========================================================================*/