diff options
Diffstat (limited to 'watch-library/shared/driver')
-rw-r--r-- | watch-library/shared/driver/lis2dw.c | 4 | ||||
-rw-r--r-- | watch-library/shared/driver/lis2dw.h | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/watch-library/shared/driver/lis2dw.c b/watch-library/shared/driver/lis2dw.c index 318ea2e8..f5d83b14 100644 --- a/watch-library/shared/driver/lis2dw.c +++ b/watch-library/shared/driver/lis2dw.c @@ -91,6 +91,10 @@ lis2dw_reading_t lis2dw_get_raw_reading(void) { return retval; } +uint16_t lis2dw_get_temperature(void) { + return watch_i2c_read16(LIS2DW_ADDRESS, LIS2DW_REG_OUT_TEMP_L); +} + void lis2dw_set_range(lis2dw_range_t range) { uint8_t val = watch_i2c_read8(LIS2DW_ADDRESS, LIS2DW_REG_CTRL6) & ~(LIS2DW_RANGE_16_G << 4); uint8_t bits = range << 4; diff --git a/watch-library/shared/driver/lis2dw.h b/watch-library/shared/driver/lis2dw.h index ac5de929..25814634 100644 --- a/watch-library/shared/driver/lis2dw.h +++ b/watch-library/shared/driver/lis2dw.h @@ -275,6 +275,8 @@ lis2dw_reading_t lis2dw_get_raw_reading(void); lis2dw_acceleration_measurement_t lis2dw_get_acceleration_measurement(lis2dw_reading_t *out_reading); +uint16_t lis2dw_get_temperature(void); + void lis2dw_set_range(lis2dw_range_t range); lis2dw_range_t lis2dw_get_range(void); |