Exposed the magnetometer's internal temperature sensor reading. It is not precise and not accurate, but interesting

This commit is contained in:
anschrammh 2023-04-20 12:57:44 +02:00
parent 8ea47fb03c
commit 2df2f332bf
2 changed files with 8 additions and 1 deletions

View File

@ -397,6 +397,11 @@ QMC5883L_MData_t watch_peripherals_magnetometer_raw_data_read(void)
return QMC5883L_get_MFields_raw(); 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) bool watch_peripherals_magnetometer_power_mode_set(QMC5883L_Mode_Control_e mode_control)
{ {
return QMC5883L_set_power_mode(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); 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) static void _bma4_delay_us(uint32_t period, void *intf_ptr)
{ {
(void) intf_ptr; (void) intf_ptr;

View File

@ -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); 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_magnetometer_power_mode_set(QMC5883L_Mode_Control_e mode_control);
bool watch_peripherals_pressure_sensor_init(void); bool watch_peripherals_pressure_sensor_init(void);