diff options
author | Joey Castillo <joeycastillo@utexas.edu> | 2022-02-19 13:12:04 -0500 |
---|---|---|
committer | Joey Castillo <joeycastillo@utexas.edu> | 2022-02-19 13:12:04 -0500 |
commit | 9f0f72eb203ae1fe93c850a38a6a9de9ab192ba8 (patch) | |
tree | 98242256a61cb18d1a500c321b6520bbd0108004 /watch-library/shared/driver/lis2dw.c | |
parent | 3392f73d360c46d2bd79eec2c530a78d9657cf8c (diff) | |
download | Sensor-Watch-9f0f72eb203ae1fe93c850a38a6a9de9ab192ba8.tar.gz Sensor-Watch-9f0f72eb203ae1fe93c850a38a6a9de9ab192ba8.tar.bz2 Sensor-Watch-9f0f72eb203ae1fe93c850a38a6a9de9ab192ba8.zip |
lis2dw: add support for temperature sensing
Diffstat (limited to 'watch-library/shared/driver/lis2dw.c')
-rw-r--r-- | watch-library/shared/driver/lis2dw.c | 4 |
1 files changed, 4 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; |