Added PAJ7620U2 defs, set mag for ICM20948 temp

This commit is contained in:
Niklas Jensen
2025-11-27 19:30:19 +01:00
parent 19b7da85fe
commit 70eb5b916c
4 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ class IMU : public SensorBase<IMUAnglesMsg> {
#if USE_ICM20948_SPIMODE > 0 #if USE_ICM20948_SPIMODE > 0
_imu.begin(CS_PIN, SPI_PORT); _imu.begin(CS_PIN, SPI_PORT);
#else #else
_imu.begin(Wire, 1); _imu.begin(Wire, 1, 0xFF);
#endif #endif
if (_imu.status != ICM_20948_Stat_Ok){ return false; } if (_imu.status != ICM_20948_Stat_Ok){ return false; }
+1 -1
View File
@@ -90,7 +90,7 @@ class Peripherals : public StatefulService<PeripheralsConfiguration> {
#if FT_ENABLED(USE_MPU6050 || USE_BNO055 || USE_ICM20948) #if FT_ENABLED(USE_MPU6050 || USE_BNO055 || USE_ICM20948)
IMU _imu; IMU _imu;
#endif #endif
#if FT_ENABLED(USE_HMC5883 || USE_ICM20948) #if FT_ENABLED(USE_HMC5883) // TODO: Add USE_ICM20948
Magnetometer _mag; Magnetometer _mag;
#endif #endif
#if FT_ENABLED(USE_BMP180) #if FT_ENABLED(USE_BMP180)
+2
View File
@@ -18,6 +18,8 @@ void printFeatureConfiguration() {
ESP_LOGI("Features", "USE_HMC5883: %s", USE_HMC5883 ? "enabled" : "disabled"); ESP_LOGI("Features", "USE_HMC5883: %s", USE_HMC5883 ? "enabled" : "disabled");
ESP_LOGI("Features", "USE_BMP180: %s", USE_BMP180 ? "enabled" : "disabled"); ESP_LOGI("Features", "USE_BMP180: %s", USE_BMP180 ? "enabled" : "disabled");
ESP_LOGI("Features", "USE_USS: %s", USE_USS ? "enabled" : "disabled"); ESP_LOGI("Features", "USE_USS: %s", USE_USS ? "enabled" : "disabled");
ESP_LOGI("Features", "USE_PAJ7620U2: %s", USE_PAJ7620U2 ? "enabled" : "disabled");
// Peripherals // Peripherals
ESP_LOGI("Features", "USE_PCA9685: %s", USE_PCA9685 ? "enabled" : "disabled"); ESP_LOGI("Features", "USE_PCA9685: %s", USE_PCA9685 ? "enabled" : "disabled");
+3 -3
View File
@@ -18,7 +18,7 @@ void Peripherals::begin() {
#if FT_ENABLED(USE_MPU6050 || USE_BNO055 || USE_ICM20948) #if FT_ENABLED(USE_MPU6050 || USE_BNO055 || USE_ICM20948)
if (!_imu.initialize()) ESP_LOGE("IMUService", "IMU initialize failed"); if (!_imu.initialize()) ESP_LOGE("IMUService", "IMU initialize failed");
#endif #endif
#if FT_ENABLED(USE_HMC5883 || USE_ICM20948) #if FT_ENABLED(USE_HMC5883) // TODO: Add USE_ICM20948
if (!_mag.initialize()) ESP_LOGE("IMUService", "MAG initialize failed"); if (!_mag.initialize()) ESP_LOGE("IMUService", "MAG initialize failed");
#endif #endif
#if FT_ENABLED(USE_BMP180) #if FT_ENABLED(USE_BMP180)
@@ -89,7 +89,7 @@ bool Peripherals::readImu() {
bool Peripherals::readMag() { bool Peripherals::readMag() {
bool updated = false; bool updated = false;
#if FT_ENABLED(USE_HMC5883) #if FT_ENABLED(USE_HMC5883) // TODO: Add USE_ICM20948
beginTransaction(); beginTransaction();
updated = _mag.update(); updated = _mag.update();
endTransaction(); endTransaction();
@@ -169,7 +169,7 @@ void Peripherals::getIMUResult(JsonVariant &root) {
JsonVariant imu = root["imu"].to<JsonVariant>(); JsonVariant imu = root["imu"].to<JsonVariant>();
_imu.getResults(imu); _imu.getResults(imu);
#endif #endif
#if FT_ENABLED(USE_HMC5883 || USE_ICM20948) #if FT_ENABLED(USE_HMC5883) // TODO: Add USE_ICM20948
JsonVariant mag = root["mag"].to<JsonVariant>(); JsonVariant mag = root["mag"].to<JsonVariant>();
_mag.getResults(mag); _mag.getResults(mag);
#endif #endif