implement INT2, accelerometer test shows sleep state on LED

This commit is contained in:
joeycastillo
2024-10-09 02:05:12 -04:00
parent 9c0330f247
commit dd8599a5e1
3 changed files with 18 additions and 1 deletions

View File

@@ -237,6 +237,10 @@ void lis2dw_configure_int1(uint8_t sources) {
watch_i2c_write8(LIS2DW_ADDRESS, LIS2DW_REG_CTRL4_INT1, sources);
}
void lis2dw_configure_int2(uint8_t sources) {
watch_i2c_write8(LIS2DW_ADDRESS, LIS2DW_REG_CTRL5_INT2, sources);
}
void lis2dw_enable_interrupts(void) {
uint8_t configuration = watch_i2c_read8(LIS2DW_ADDRESS, LIS2DW_REG_CTRL7);
watch_i2c_write8(LIS2DW_ADDRESS, LIS2DW_REG_CTRL7, configuration | LIS2DW_CTRL7_VAL_INTERRUPTS_ENABLE);

View File

@@ -347,6 +347,8 @@ void lis2dw_configure_wakeup_threshold(uint8_t threshold);
void lis2dw_configure_int1(uint8_t sources);
void lis2dw_configure_int2(uint8_t sources);
void lis2dw_enable_interrupts(void);
void lis2dw_disable_interrupts(void);