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
This commit is contained in:
Rocco Marco Guglielmi 2022-02-07 18:12:37 +00:00
parent 7a1228781e
commit 9f7c12e7fd
2 changed files with 23 additions and 23 deletions

View File

@ -34,23 +34,23 @@ static float hygrocooked;
static float thermocooked; static float thermocooked;
static const I2CConfig i2ccfg = { static const I2CConfig i2ccfg = {
.op_mode = OPMODE_I2C, .op_mode = OPMODE_I2C,
.clock_speed = 400000, .clock_speed = 400000,
.duty_cycle = FAST_DUTY_CYCLE_2 .duty_cycle = FAST_DUTY_CYCLE_2
}; };
static const HTS221Config hts221cfg = { static const HTS221Config hts221cfg = {
&I2CD1, .i2cp = &I2CD1,
&i2ccfg, .i2ccfg = &i2ccfg,
NULL, .hygrosensitivity = NULL,
NULL, .hygrobias = NULL,
NULL, .thermosensitivity = NULL,
NULL, .thermobias = NULL,
HTS221_ODR_7HZ, .outputdatarate = HTS221_ODR_7HZ
#if HTS221_USE_ADVANCED || defined(__DOXYGEN__) #if HTS221_USE_ADVANCED || defined(__DOXYGEN__)
HTS221_BDU_CONTINUOUS, .blockdataupdate = HTS221_BDU_CONTINUOUS,
HTS221_AVGH_256, .hygroresolution = HTS221_AVGH_256,
HTS221_AVGT_256 .thermoresolution = HTS221_AVGT_256
#endif #endif
}; };

View File

@ -32,9 +32,9 @@ static char axis_id[MAX_AXIS_NUMBER] = {'X', 'Y', 'Z'};
/* Generic I2C configuration for every MEMS. */ /* Generic I2C configuration for every MEMS. */
static const I2CConfig i2ccfg = { static const I2CConfig i2ccfg = {
.op_mode = OPMODE_I2C, .op_mode = OPMODE_I2C,
.clock_speed = 400000, .clock_speed = 400000,
.duty_cycle = FAST_DUTY_CYCLE_2 .duty_cycle = FAST_DUTY_CYCLE_2
}; };
static uint32_t i; static uint32_t i;
@ -48,13 +48,13 @@ static BaseSequentialStream* chp = (BaseSequentialStream*)&SD2;
static HTS221Driver HTS221D1; static HTS221Driver HTS221D1;
static const HTS221Config hts221cfg = { static const HTS221Config hts221cfg = {
&I2CD1, .i2cp = &I2CD1,
&i2ccfg, .i2ccfg = &i2ccfg,
NULL, .hygrosensitivity = NULL,
NULL, .hygrobias = NULL,
NULL, .thermosensitivity = NULL,
NULL, .thermobias = NULL,
HTS221_ODR_7HZ .outputdatarate = HTS221_ODR_7HZ
}; };
/*===========================================================================*/ /*===========================================================================*/