From 9f7c12e7fd4205c0cfa386588ee515b8b338520f Mon Sep 17 00:00:00 2001 From: Rocco Marco Guglielmi Date: Mon, 7 Feb 2022 18:12:37 +0000 Subject: [PATCH] Updated HTS221 demos in testex demos to be close to the pattern used in testhal demos. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15438 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- testex/STM32/STM32F4xx/I2C-HTS221/main.c | 26 +++++++++++------------ testex/STM32/STM32F4xx/I2C-IKS01A2/main.c | 20 ++++++++--------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/testex/STM32/STM32F4xx/I2C-HTS221/main.c b/testex/STM32/STM32F4xx/I2C-HTS221/main.c index 1d7f20d62..d37f8e35e 100644 --- a/testex/STM32/STM32F4xx/I2C-HTS221/main.c +++ b/testex/STM32/STM32F4xx/I2C-HTS221/main.c @@ -34,23 +34,23 @@ static float hygrocooked; 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 HTS221Config hts221cfg = { - &I2CD1, - &i2ccfg, - NULL, - NULL, - NULL, - NULL, - HTS221_ODR_7HZ, + .i2cp = &I2CD1, + .i2ccfg = &i2ccfg, + .hygrosensitivity = NULL, + .hygrobias = NULL, + .thermosensitivity = NULL, + .thermobias = NULL, + .outputdatarate = HTS221_ODR_7HZ #if HTS221_USE_ADVANCED || defined(__DOXYGEN__) - HTS221_BDU_CONTINUOUS, - HTS221_AVGH_256, - HTS221_AVGT_256 + .blockdataupdate = HTS221_BDU_CONTINUOUS, + .hygroresolution = HTS221_AVGH_256, + .thermoresolution = HTS221_AVGT_256 #endif }; diff --git a/testex/STM32/STM32F4xx/I2C-IKS01A2/main.c b/testex/STM32/STM32F4xx/I2C-IKS01A2/main.c index 183c51642..01c862816 100644 --- a/testex/STM32/STM32F4xx/I2C-IKS01A2/main.c +++ b/testex/STM32/STM32F4xx/I2C-IKS01A2/main.c @@ -32,9 +32,9 @@ static char axis_id[MAX_AXIS_NUMBER] = {'X', 'Y', 'Z'}; /* Generic I2C configuration for every MEMS. */ 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 uint32_t i; @@ -48,13 +48,13 @@ static BaseSequentialStream* chp = (BaseSequentialStream*)&SD2; static HTS221Driver HTS221D1; static const HTS221Config hts221cfg = { - &I2CD1, - &i2ccfg, - NULL, - NULL, - NULL, - NULL, - HTS221_ODR_7HZ + .i2cp = &I2CD1, + .i2ccfg = &i2ccfg, + .hygrosensitivity = NULL, + .hygrobias = NULL, + .thermosensitivity = NULL, + .thermobias = NULL, + .outputdatarate = HTS221_ODR_7HZ }; /*===========================================================================*/