diff options
author | Rocco Marco Guglielmi <roccomarco.guglielmi@gmail.com> | 2018-03-10 13:23:44 +0000 |
---|---|---|
committer | Rocco Marco Guglielmi <roccomarco.guglielmi@gmail.com> | 2018-03-10 13:23:44 +0000 |
commit | e0fcf2b6c7e1c722368934effec0e175bc7925d0 (patch) | |
tree | 19bffefb78a1a829ad82f266b07ee54b844badec | |
parent | 2adfd321e94f0324fe428d8436339b37a4dee9c7 (diff) | |
download | ChibiOS-e0fcf2b6c7e1c722368934effec0e175bc7925d0.tar.gz ChibiOS-e0fcf2b6c7e1c722368934effec0e175bc7925d0.tar.bz2 ChibiOS-e0fcf2b6c7e1c722368934effec0e175bc7925d0.zip |
Restored masks in HTS221 driver
Minor adjustment in HTS221 demo
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11684 110e8d01-0319-4d1e-a829-52ad28d1bb01
-rw-r--r-- | os/ex/ST/hts221.c | 7 | ||||
-rw-r--r-- | testex/STM32/STM32F4xx/I2C-HTS221/main.c | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/os/ex/ST/hts221.c b/os/ex/ST/hts221.c index a0367da23..d61fbf7ac 100644 --- a/os/ex/ST/hts221.c +++ b/os/ex/ST/hts221.c @@ -34,6 +34,13 @@ /* Driver local definitions. */
/*===========================================================================*/
+#define HTS221_SEL(mask, offset) (int16_t)(mask << offset)
+
+#define HTS221_FLAG_HYGRO_BIAS 0x01
+#define HTS221_FLAG_HYGRO_SENS 0x02
+#define HTS221_FLAG_THERMO_BIAS 0x04
+#define HTS221_FLAG_THERMO_SENS 0x08
+
/*===========================================================================*/
/* Driver exported variables. */
/*===========================================================================*/
diff --git a/testex/STM32/STM32F4xx/I2C-HTS221/main.c b/testex/STM32/STM32F4xx/I2C-HTS221/main.c index dc1cb5cd8..a67ab4931 100644 --- a/testex/STM32/STM32F4xx/I2C-HTS221/main.c +++ b/testex/STM32/STM32F4xx/I2C-HTS221/main.c @@ -108,7 +108,7 @@ int main(void) { /* Activates the HTS221 driver.*/
hts221Start(&HTS221D1, &hts221cfg);
- /* Normal main() thread activity, printing MEMS data on the SD1. */
+ /* Normal main() thread activity, printing MEMS data on the SD2. */
while (true) {
hts221HygrometerReadRaw(&HTS221D1, &hygroraw);
chprintf(chp, "HTS221D1 Hygrometer raw data...\r\n");
|