From 2cdf2e4fa873094b65be56703773e2a3f1490afa Mon Sep 17 00:00:00 2001 From: Rocco Marco Guglielmi Date: Mon, 14 Mar 2016 16:43:47 +0000 Subject: Fixed vmt related code. Indent minor fixes. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9102 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/ex/ST/l3gd20.c | 10 +++++----- os/ex/ST/l3gd20.h | 4 ++-- os/ex/ST/lsm6ds0.c | 4 ++-- os/ex/ST/lsm6ds0.h | 38 +++++++++++++++++++------------------- 4 files changed, 28 insertions(+), 28 deletions(-) (limited to 'os/ex') diff --git a/os/ex/ST/l3gd20.c b/os/ex/ST/l3gd20.c index 46f9bb434..4c6965875 100644 --- a/os/ex/ST/l3gd20.c +++ b/os/ex/ST/l3gd20.c @@ -287,11 +287,11 @@ static msg_t calibrate(void *ip) { return MSG_OK; } -static const struct BaseSensorVMT vmtse = { +static const struct BaseSensorVMT vmt_basesensor = { get_axes_number, read_raw, read_cooked }; -static const struct BaseGyroscopeVMT vmtgy = { +static const struct BaseGyroscopeVMT vmt_basegyroscope = { get_axes_number, read_raw, read_cooked, reset_calibration, calibrate }; @@ -311,9 +311,9 @@ static const struct BaseGyroscopeVMT vmtgy = { void l3gd20ObjectInit(L3GD20Driver *devp) { uint32_t i; - devp->vmtse = &vmtse; - devp->vmtgy = &vmtgy; - devp->vmt = (struct L3GD20VMT*) &vmtgy; + devp->vmt_basesensor = &vmt_basesensor; + devp->vmt_basegyroscope = &vmt_basegyroscope; + devp->vmt = (struct L3GD20VMT*) &vmt_basegyroscope; devp->state = L3GD20_STOP; devp->config = NULL; for(i = 0; i < L3GD20_NUMBER_OF_AXES; i++) diff --git a/os/ex/ST/l3gd20.h b/os/ex/ST/l3gd20.h index d98aea972..410e6e28a 100644 --- a/os/ex/ST/l3gd20.h +++ b/os/ex/ST/l3gd20.h @@ -279,9 +279,9 @@ struct L3GD20VMT { */ struct L3GD20Driver { /** @brief Virtual Methods Table.*/ - const struct BaseSensorVMT *vmtse; + const struct BaseSensorVMT *vmt_basesensor; /** @brief Virtual Methods Table.*/ - const struct BaseGyroscopeVMT *vmtgy; + const struct BaseGyroscopeVMT *vmt_basegyroscope; /** @brief Virtual Methods Table.*/ const struct L3GD20VMT *vmt; _l3gd20_data diff --git a/os/ex/ST/lsm6ds0.c b/os/ex/ST/lsm6ds0.c index bc68c0aa1..4aa7a7eb0 100644 --- a/os/ex/ST/lsm6ds0.c +++ b/os/ex/ST/lsm6ds0.c @@ -338,7 +338,7 @@ static msg_t acc_read_cooked(void *ip, float axes[]) { return msg; } -static const struct LSM6DS0ACCVMT accvmt = { +static const struct LSM6DS0ACCVMT vmt_baseaccelerometer = { acc_get_axes_number, acc_read_raw, acc_read_cooked }; @@ -355,7 +355,7 @@ static const struct LSM6DS0ACCVMT accvmt = { */ void lsm6ds0ObjectInit(LSM6DS0Driver *devp) { - devp->vmtac = &accvmt; + devp->vmt_baseaccelerometer = &vmt_baseaccelerometer; devp->state = LSM6DS0_STOP; devp->config = NULL; } diff --git a/os/ex/ST/lsm6ds0.h b/os/ex/ST/lsm6ds0.h index 89d3d06ff..6adf58a94 100644 --- a/os/ex/ST/lsm6ds0.h +++ b/os/ex/ST/lsm6ds0.h @@ -100,10 +100,6 @@ /* Driver data structures and types. */ /*===========================================================================*/ -/** - * @name LSM6DS0 data structures and types - * @{ - */ /** * @name LSM6DS0 accelerometer subsystem data structures and types * @{ @@ -117,7 +113,7 @@ typedef enum { LSM6DS0_ACC_FS_4G = 0x10, /**< Full scale ±4g. */ LSM6DS0_ACC_FS_8G = 0x18, /**< Full scale ±8g. */ LSM6DS0_ACC_FS_16G = 0x08 /**< Full scale ±16g. */ -}lsm6ds0_acc_fs_t; +} lsm6ds0_acc_fs_t; /** * @brief LSM6DS0 accelerometer subsystem output data rate @@ -130,7 +126,7 @@ typedef enum { LSM6DS0_ACC_ODR_238Hz = 0x80, /**< ODR 238 Hz */ LSM6DS0_ACC_ODR_476Hz = 0xA0, /**< ODR 476 Hz */ LSM6DS0_ACC_ODR_952Hz = 0xC0 /**< ODR 952 Hz */ -}lsm6ds0_acc_odr_t; +} lsm6ds0_acc_odr_t; /** * @brief LSM6DS0 accelerometer subsystem axes enabling @@ -166,18 +162,18 @@ typedef enum { * @brief LSM6DS0 accelerometer subsystem filtered data selection */ typedef enum { - LSM6DS0_ACC_FDS_ENABLED = 0x00, /**< Internal filter bypassed. */ - LSM6DS0_ACC_FDS_DISABLED = 0x04 /**< Internal filter not bypassed. */ + LSM6DS0_ACC_FDS_ENABLED = 0x00, /**< Internal filter bypassed. */ + LSM6DS0_ACC_FDS_DISABLED = 0x04 /**< Internal filter not bypassed. */ } lsm6ds0_acc_fds_t; /** * @brief LSM6DS0 accelerometer subsystem digital filter */ typedef enum { - LSM6DS0_ACC_DCF_400 = 0x00, /**< Low pass cutoff freq. ODR/400 Hz. */ - LSM6DS0_ACC_DCF_100 = 0x20, /**< Low pass cutoff freq. ODR/100 Hz. */ - LSM6DS0_ACC_DCF_50 = 0x60, /**< Low pass cutoff freq. ODR/50 Hz. */ - LSM6DS0_ACC_DCF_9 = 0x40 /**< Low pass cutoff freq. ODR/9 Hz. */ + LSM6DS0_ACC_DCF_400 = 0x00, /**< Low pass cutoff freq. ODR/400 Hz. */ + LSM6DS0_ACC_DCF_100 = 0x20, /**< Low pass cutoff freq. ODR/100 Hz. */ + LSM6DS0_ACC_DCF_50 = 0x60, /**< Low pass cutoff freq. ODR/50 Hz. */ + LSM6DS0_ACC_DCF_9 = 0x40 /**< Low pass cutoff freq. ODR/9 Hz. */ } lsm6ds0_acc_dcf_t; /** @@ -209,6 +205,7 @@ typedef enum { LSM6DS0_ACC_UNIT_MG = 0x01, /**< Cooked data in mg. */ LSM6DS0_ACC_UNIT_SI = 0x02, /**< Cooked data in m/s^2. */ } lsm6ds0_acc_unit_t; + /** * @brief LSM6DS0 accelerometer subsystem configuration structure. */ @@ -260,7 +257,6 @@ typedef struct { * @name LSM6DS0 gyroscope subsystem data structures and types * @{ */ - /** * @brief LSM6DS0 gyroscope subsystem full scale */ @@ -268,7 +264,7 @@ typedef enum { LSM6DS0_GYRO_FS_245DSP = 0x00, /**< Full scale ±245 degree per second */ LSM6DS0_GYRO_FS_500DSP = 0x08, /**< Full scale ±500 degree per second */ LSM6DS0_GYRO_FS_2000DSP = 0x18 /**< Full scale ±2000 degree per second */ -}lsm6ds0_gyro_fs_t; +} lsm6ds0_gyro_fs_t; /** * @brief LSM6DS0 gyroscope subsystem output data rate @@ -292,7 +288,7 @@ typedef enum { LSM6DS0_GYRO_ODR_952HZ_FC_40 = 0XC1, LSM6DS0_GYRO_ODR_952HZ_FC_58 = 0XC2, LSM6DS0_GYRO_ODR_952HZ_FC_100 = 0XC3 -}lsm6ds0_gyro_odr_t; +} lsm6ds0_gyro_odr_t; /** * @brief LSM6DS0 gyroscope subsystem axes enabling @@ -384,13 +380,17 @@ typedef struct { } LSM6DS0GyroConfig; /** @} */ +/** + * @name LSM6DS0 main system data structures and types + * @{ + */ /** * @brief Accelerometer and Gyroscope Slave Address */ typedef enum { LSM6DS0_SAD_GND = 0x6A, /**< SAD pin connected to GND. */ LSM6DS0_SAD_VCC = 0x6B /**< SAD pin connected to VCC. */ -}lsm6ds0_sad_t; +} lsm6ds0_sad_t; /** * @brief LSM6DS0 block data update @@ -398,7 +398,7 @@ typedef enum { typedef enum { LSM6DS0_BDU_CONTINOUS = 0x00, /**< Block data continuously updated. */ LSM6DS0_BDU_BLOCKED = 0x40 /**< Block data updated after reading. */ -}lsm6ds0_bdu_t; +} lsm6ds0_bdu_t; /** * @brief LSM6DS0 endianness @@ -525,9 +525,9 @@ struct LSM6DS0GYROVMT { */ struct LSM6DS0Driver { /** @brief Accelerometer Virtual Methods Table.*/ - const struct LSM6DS0ACCVMT *vmtac; + const struct LSM6DS0ACCVMT *vmt_baseaccelerometer; /** @brief Gyroscope Virtual Methods Table.*/ - const struct LSM6DS0GYROVMT *vmtgy; + const struct LSM6DS0GYROVMT *vmt_basegyroscope; _lsm6ds0_data }; /** @} */ -- cgit v1.2.3