From 4ef99d2775f034f2e5657373219f6564deb23238 Mon Sep 17 00:00:00 2001 From: Rocco Marco Guglielmi Date: Tue, 8 Feb 2022 08:20:55 +0000 Subject: [PATCH] Updated Updated LPS25H demos in testex demos to be close to the pattern used in testhal demos. Minor changes to field names in LPS25H. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15445 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/ex/devices/ST/lps25h.c | 4 ++-- os/ex/devices/ST/lps25h.h | 8 +++---- testex/STM32/STM32F4xx/I2C-LPS25H/main.c | 28 ++++++++++++------------ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/os/ex/devices/ST/lps25h.c b/os/ex/devices/ST/lps25h.c index 3aa651fe9..402725253 100644 --- a/os/ex/devices/ST/lps25h.c +++ b/os/ex/devices/ST/lps25h.c @@ -581,9 +581,9 @@ void lps25hStart(LPS25HDriver *devp, const LPS25HConfig *config) { /* Control register 1 configuration block.*/ { cr[0] = LPS25H_AD_CTRL_REG1; - cr[1] = devp->config->outputdatarate | LPS25H_CTRL_REG1_PD; + cr[1] = devp->config->odr | LPS25H_CTRL_REG1_PD; #if LPS25H_USE_ADVANCED || defined(__DOXYGEN__) - cr[1] |= devp->config->blockdataupdate; + cr[1] |= devp->config->bdu; #endif } diff --git a/os/ex/devices/ST/lps25h.h b/os/ex/devices/ST/lps25h.h index 3f3f02211..cd8aa800f 100644 --- a/os/ex/devices/ST/lps25h.h +++ b/os/ex/devices/ST/lps25h.h @@ -43,7 +43,7 @@ /** * @brief LPS25H driver version string. */ -#define EX_LPS25H_VERSION "1.1.2" +#define EX_LPS25H_VERSION "1.1.3" /** * @brief LPS25H driver version major number. @@ -58,7 +58,7 @@ /** * @brief LPS25H driver version patch number. */ -#define EX_LPS25H_PATCH 2 +#define EX_LPS25H_PATCH 3 /** @} */ /** @@ -406,12 +406,12 @@ typedef struct { /** * @brief LPS25H output data rate selection. */ - lps25h_odr_t outputdatarate; + lps25h_odr_t odr; #if LPS25H_USE_ADVANCED || defined(__DOXYGEN__) /** * @brief LPS25H block data update. */ - lps25h_bdu_t blockdataupdate; + lps25h_bdu_t bdu; /** * @brief LPS25H barometer subsystem resolution. */ diff --git a/testex/STM32/STM32F4xx/I2C-LPS25H/main.c b/testex/STM32/STM32F4xx/I2C-LPS25H/main.c index 954e111b9..c9f76bd44 100644 --- a/testex/STM32/STM32F4xx/I2C-LPS25H/main.c +++ b/testex/STM32/STM32F4xx/I2C-LPS25H/main.c @@ -34,24 +34,24 @@ static float barocooked; static float thermocooked; static const I2CConfig i2ccfg = { - .op_mode = OPMODE_I2C, - .clock_speed = 400000, - .duty_cycle = FAST_DUTY_CYCLE_2 + .op_mode = OPMODE_I2C, + .clock_speed = 400000, + .duty_cycle = FAST_DUTY_CYCLE_2 }; static const LPS25HConfig lps25hcfg = { - &I2CD1, - &i2ccfg, - LPS25H_SAD_VCC, - NULL, - NULL, - NULL, - NULL, - LPS25H_ODR_7HZ, + .i2cp = &I2CD1, + .i2ccfg = &i2ccfg, + .slaveaddress = LPS25H_SAD_VCC, + .barosensitivity = NULL, + .barobias = NULL, + .thermosensitivity = NULL, + .thermobias = NULL, + .odr = LPS25H_ODR_7HZ, #if LPS25H_USE_ADVANCED - LPS25H_BDU_CONTINUOUS, - LPS25H_AVGP_512, - LPS25H_AVGT_512 + .bdu = LPS25H_BDU_CONTINUOUS, + .baroresolution = LPS25H_AVGP_512, + .thermoresolution = LPS25H_AVGT_512 #endif };