From 2df2f332bf18a3dedf766d2c79c3e57a5f5f7b2c Mon Sep 17 00:00:00 2001 From: anschrammh Date: Thu, 20 Apr 2023 12:57:44 +0200 Subject: [PATCH] Exposed the magnetometer's internal temperature sensor reading. It is not precise and not accurate, but interesting --- .../app/app_drivers/watch_peripherals/watch_peripherals.c | 7 ++++++- .../app/app_drivers/watch_peripherals/watch_peripherals.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/W800_SDK_v1.00.10/app/app_drivers/watch_peripherals/watch_peripherals.c b/src/W800_SDK_v1.00.10/app/app_drivers/watch_peripherals/watch_peripherals.c index 0a2c264..a9ea306 100644 --- a/src/W800_SDK_v1.00.10/app/app_drivers/watch_peripherals/watch_peripherals.c +++ b/src/W800_SDK_v1.00.10/app/app_drivers/watch_peripherals/watch_peripherals.c @@ -397,6 +397,11 @@ QMC5883L_MData_t watch_peripherals_magnetometer_raw_data_read(void) return QMC5883L_get_MFields_raw(); } +float watch_peripherals_magnetometer_temperature_read() +{ + return QMC5883L_get_temperature(); +} + bool watch_peripherals_magnetometer_power_mode_set(QMC5883L_Mode_Control_e mode_control) { return QMC5883L_set_power_mode(mode_control); @@ -447,7 +452,7 @@ static BMA4_INTF_RET_TYPE _bma4_i2c_write(uint8_t reg_addr, const uint8_t *read_ return !i2c_write(dev_address, reg_addr, read_data, len); } -// TODO: Rework the delay_us function to rather use a timer and have real µs resolution and not ms ... + static void _bma4_delay_us(uint32_t period, void *intf_ptr) { (void) intf_ptr; diff --git a/src/W800_SDK_v1.00.10/app/app_drivers/watch_peripherals/watch_peripherals.h b/src/W800_SDK_v1.00.10/app/app_drivers/watch_peripherals/watch_peripherals.h index 0ff1646..d45a0e7 100644 --- a/src/W800_SDK_v1.00.10/app/app_drivers/watch_peripherals/watch_peripherals.h +++ b/src/W800_SDK_v1.00.10/app/app_drivers/watch_peripherals/watch_peripherals.h @@ -129,6 +129,8 @@ uint16_t watch_peripherals_magnetometer_azimuth_read(bool *is_data_available); QMC5883L_MData_t watch_peripherals_magnetometer_raw_data_read(void); +float watch_peripherals_magnetometer_temperature_read(); + bool watch_peripherals_magnetometer_power_mode_set(QMC5883L_Mode_Control_e mode_control); bool watch_peripherals_pressure_sensor_init(void);