Skip to content

Commit 60ace07

Browse files
committed
Add comments and tweak config
1 parent e6b5014 commit 60ace07

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

drivers/CoreIMU/source/CoreIMU.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,18 +139,21 @@ void CoreIMU::disableDeepSleep()
139139

140140
void CoreIMU::enableOnWakeUpInterrupt(std::function<void()> const &callback)
141141
{
142+
// ODR = 52Hz for reference
143+
142144
// ? Set filter and disable user offset
143145
lsm6dsox_xl_hp_path_internal_set(&_register_io_function, LSM6DSOX_USE_SLOPE);
144146
lsm6dsox_xl_usr_offset_on_wkup_set(&_register_io_function, 0);
145147

146148
// ? Set Wakeup config
147-
lsm6dsox_wkup_threshold_set(&_register_io_function, 2);
148-
lsm6dsox_wkup_ths_weight_set(&_register_io_function, LSM6DSOX_LSb_FS_DIV_64);
149-
lsm6dsox_wkup_dur_set(&_register_io_function, 0x02);
149+
lsm6dsox_wkup_threshold_set(&_register_io_function, 3); // LSB multiplier / Max: 31
150+
lsm6dsox_wkup_ths_weight_set(&_register_io_function,
151+
LSM6DSOX_LSb_FS_DIV_64); // 2 Weights, 1 LSB = FS_XL/2^x x:{6,8}
152+
lsm6dsox_wkup_dur_set(&_register_io_function, 1); // 1 LSB = 1*ODR_time / Max: 3
150153

151154
// ? Set Activity config
152-
lsm6dsox_act_sleep_dur_set(&_register_io_function, 0x02);
153-
lsm6dsox_act_mode_set(&_register_io_function, LSM6DSOX_XL_AND_GY_NOT_AFFECTED);
155+
lsm6dsox_act_sleep_dur_set(&_register_io_function, 0); // 1 LSB = 512*ODR / Max: 15
156+
lsm6dsox_act_mode_set(&_register_io_function, LSM6DSOX_XL_12Hz5_GY_PD); // 4 Modes
154157

155158
lsm6dsox_pin_int1_route_t lsm6dsox_int1 {
156159
.sleep_change = PROPERTY_ENABLE,

0 commit comments

Comments
 (0)