1
0
forked from me/IronOS

Make I2C mag optional

This commit is contained in:
Ben V. Brown
2023-07-22 18:18:29 +10:00
parent 1396363eaa
commit 296aecab00
4 changed files with 15 additions and 8 deletions

View File

@@ -151,6 +151,7 @@
#define POW_DC 1
#define POW_QC_20V 1
#define ENABLE_QC2 1
#define MAG_SLEEP_SUPPORT 1
#define TEMP_TMP36
#define ACCEL_BMA
#define ACCEL_SC7

View File

@@ -152,6 +152,7 @@
#define POW_QC_20V 1 // Supported features
#define POW_EPR 1
#define ENABLE_QC2 1
#define MAG_SLEEP_SUPPORT 1
#define DEVICE_HAS_VALIDATION_SUPPORT
#define TEMP_NTC
#define ACCEL_BMA

View File

@@ -13,6 +13,7 @@
#include "I2C_Wrapper.hpp"
#include "Si7210_defines.h"
#include <Si7210.h>
#ifdef MAG_SLEEP_SUPPORT
bool Si7210::detect() { return FRToSI2C::wakePart(SI7210_ADDRESS); }
bool Si7210::init() {
@@ -175,3 +176,4 @@ bool Si7210::set_high_range() {
worked &= write_reg(SI7210_A5, 0, val);
return worked;
}
#endif // MAG_SLEEP_SUPPORT

View File

@@ -7,7 +7,10 @@
#ifndef CORE_DRIVERS_SI7210_H_
#define CORE_DRIVERS_SI7210_H_
#include "configuration.h"
#include <stdint.h>
#ifdef MAG_SLEEP_SUPPORT
class Si7210 {
public:
// Return true if present
@@ -23,5 +26,5 @@ private:
static bool get_field_strength(int16_t *field);
static bool set_high_range();
};
#endif // MAG_SLEEP_SUPPORT
#endif /* CORE_DRIVERS_SI7210_H_ */