Starting hall effect support
This commit is contained in:
@@ -51,6 +51,10 @@ uint8_t showBootLogoIfavailable();
|
||||
void delay_ms(uint16_t count) ;
|
||||
//Used to allow knowledge of if usb_pd is being used
|
||||
uint8_t usb_pd_detect();
|
||||
// If the iron has a hall effect sensor in the handle, return an signed count of the reading
|
||||
// If the sensor is single polarity (or polarity insensitive) just return 0..32768
|
||||
int16_t getRawHallEffect();
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
#define POW_QC
|
||||
#define TEMP_TMP36
|
||||
#define ACCEL_BMA
|
||||
|
||||
#define HALL_SENSOR
|
||||
#define HALL_SI7210
|
||||
|
||||
#define BATTFILTERDEPTH 32
|
||||
#endif
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user