From 94bbc4d19ca17984db3262089ba7365fbf62c6de Mon Sep 17 00:00:00 2001 From: Rocco Marco Guglielmi Date: Wed, 16 Mar 2016 11:45:23 +0000 Subject: Improved Gyroscope methods. Updated L3GD20 files and demos. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9126 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/lib/peripherals/sensors/hal_gyroscope.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'os/hal') diff --git a/os/hal/lib/peripherals/sensors/hal_gyroscope.h b/os/hal/lib/peripherals/sensors/hal_gyroscope.h index ac2901fe4..e61d06b0f 100644 --- a/os/hal/lib/peripherals/sensors/hal_gyroscope.h +++ b/os/hal/lib/peripherals/sensors/hal_gyroscope.h @@ -47,10 +47,10 @@ * @brief BaseGyroscope specific methods. */ #define _base_gyroscope_methods_alone \ - /* Remove the calibration data.*/ \ - msg_t (*reset_calibration)(void *instance); \ - /* Invokes the calibration procedure.*/ \ - msg_t (*calibrate)(void *instance); + /* Invoke the sample bias procedure.*/ \ + msg_t (*sample_bias)(void *instance); \ + /* Remove bias stored data.*/ \ + msg_t (*reset_bias)(void *instance); /** * @brief BaseGyroscope specific methods with inherited ones. @@ -132,7 +132,10 @@ typedef struct { (ip)->vmt_basegyroscope->read_cooked(ip, dp) /** - * @brief Delete calibration data. + * @brief Gyroscope bias sampling procedure. + * @note During this procedure gyroscope must be kept hold in the rest + * position. Sampled bias will be automatically removed after calling + * this procedure. * * @param[in] ip pointer to a @p BaseGyroscope class. * @@ -142,11 +145,11 @@ typedef struct { * * @api */ -#define gyroscopeResetCalibration(ip) \ - (ip)->vmt_basegyroscope->reset_calibration(ip) +#define gyroscopeSampleBias(ip) \ + (ip)->vmt_basegyroscope->sample_bias(ip) /** - * @brief Gyroscope calibration procedure. + * @brief Reset bias data restoring it to zero. * * @param[in] ip pointer to a @p BaseGyroscope class. * @@ -156,8 +159,8 @@ typedef struct { * * @api */ -#define gyroscopeCalibrate(ip) \ - (ip)->vmt_basegyroscope->calibrate(ip) +#define gyroscopeResetCalibration(ip) \ + (ip)->vmt_basegyroscope->reset_bias(ip) /** @} */ /*===========================================================================*/ -- cgit v1.2.3