Starting hall effect support

This commit is contained in:
Ben V. Brown
2020-10-13 18:46:37 +11:00
parent 2c626d7203
commit 58c4ecaea6
8 changed files with 103 additions and 2 deletions

View File

@@ -20,7 +20,8 @@
#define POW_QC
#define TEMP_TMP36
#define ACCEL_BMA
#define HALL_SENSOR
#define HALL_SI7210
#define BATTFILTERDEPTH 32
#endif

View File

@@ -9,10 +9,25 @@
#include "task.h"
#include "I2C_Wrapper.hpp"
#include "fusbpd.h"
#include "Si7210.h"
bool hall_effect_present = false;
void postRToSInit() {
// Any after RTos setup
#ifdef POW_PD
//Spawn all of the USB-C processors
fusb302_start_processing();
#endif
#ifdef HALL_SI7210
if (Si7210::detect()) {
hall_effect_present = Si7210::init();
}
#endif
}
int16_t getRawHallEffect() {
if (hall_effect_present) {
return Si7210::read();
}
return 0;
}