diff options
author | Rocco Marco Guglielmi <roccomarco.guglielmi@live.com> | 2016-09-27 23:29:24 +0000 |
---|---|---|
committer | Rocco Marco Guglielmi <roccomarco.guglielmi@live.com> | 2016-09-27 23:29:24 +0000 |
commit | a736f4dd7758d31c56290b0c436fb742e90724c7 (patch) | |
tree | 5bc2d0ec6feab9f45183b629e2e47e76415ec9c7 /os/ex/ST/lis3mdl.h | |
parent | b1eb97df6169e083d044acb32c0a3762d56b14fa (diff) | |
download | ChibiOS-a736f4dd7758d31c56290b0c436fb742e90724c7.tar.gz ChibiOS-a736f4dd7758d31c56290b0c436fb742e90724c7.tar.bz2 ChibiOS-a736f4dd7758d31c56290b0c436fb742e90724c7.zip |
Improved LIS3MDL driver and related demo: added multiple register read/write.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9813 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/ex/ST/lis3mdl.h')
-rw-r--r-- | os/ex/ST/lis3mdl.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/os/ex/ST/lis3mdl.h b/os/ex/ST/lis3mdl.h index edef58dd1..dc0ed5fa0 100644 --- a/os/ex/ST/lis3mdl.h +++ b/os/ex/ST/lis3mdl.h @@ -86,6 +86,8 @@ #define LIS3MDL_AD(n) (1 << n) /**< Address Data bit n */
#define LIS3MDL_MS (1 << 6) /**< Multiple selection */
#define LIS3MDL_RW (1 << 7) /**< Read Write selector */
+
+#define LIS3MDL_SUB_MS (1 << 7) /**< Multiple RW in I2C mode*/
/** @} */
/**
@@ -374,48 +376,48 @@ typedef struct { /**
* @brief LIS3MDL initial sensitivity.
*/
- float sensitivity[LIS3MDL_NUMBER_OF_AXES];
+ float* sensitivity;
/**
* @brief LIS3MDL initial bias.
*/
- float bias[LIS3MDL_NUMBER_OF_AXES];
+ float* bias;
/**
* @brief LIS3MDL slave address
*/
- lis3mdl_sad_t slaveaddress;
+ lis3mdl_sad_t slaveaddress;
/**
* @brief LIS3MDL full scale
*/
- lis3mdl_fs_t fullscale;
+ lis3mdl_fs_t fullscale;
/**
* @brief LIS3MDL output data rate
*/
- lis3mdl_odr_t outputdatarate;
+ lis3mdl_odr_t outputdatarate;
#if LIS3MDL_USE_ADVANCED || defined(__DOXYGEN__)
/**
* @brief LIS3MDL low power mode configuration
*/
- lis3mdl_lp_t lowpowermode;
+ lis3mdl_lp_t lowpowermode;
/**
* @brief LIS3MDL conversion mode
*/
- lis3mdl_md_t conversionmode;
+ lis3mdl_md_t conversionmode;
/**
* @brief LIS3MDL operation mode for X and Y axes
*/
- lis3mdl_omxy_t operationmodexy;
+ lis3mdl_omxy_t operationmodexy;
/**
* @brief LIS3MDL operation mode for Z axis
*/
- lis3mdl_omz_t operationmodez;
+ lis3mdl_omz_t operationmodez;
/**
* @brief LIS3MDL block data update
*/
- lis3mdl_bdu_t blockdataupdate;
+ lis3mdl_bdu_t blockdataupdate;
/**
* @brief LIS3MDL endianness
*/
- lis3mdl_end_t endianness;
+ lis3mdl_end_t endianness;
#endif
} LIS3MDLConfig;
@@ -453,7 +455,7 @@ struct LIS3MDLVMT { /* Current sensitivity.*/ \
float sensitivity[LIS3MDL_NUMBER_OF_AXES]; \
/* Bias data.*/ \
- int32_t bias[LIS3MDL_NUMBER_OF_AXES]; \
+ float bias[LIS3MDL_NUMBER_OF_AXES]; \
/* Current full scale value.*/ \
float fullscale;
|