summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/servo_v4/board.c5
-rw-r--r--board/servo_v4/board.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/board/servo_v4/board.c b/board/servo_v4/board.c
index d0e1bd08be..690e67b5fc 100644
--- a/board/servo_v4/board.c
+++ b/board/servo_v4/board.c
@@ -12,6 +12,7 @@
#include "gpio.h"
#include "hooks.h"
#include "i2c.h"
+#include "ina2xx.h"
#include "queue_policies.h"
#include "registers.h"
#include "spi.h"
@@ -439,6 +440,10 @@ static void board_init(void)
*/
pd_set_max_voltage(PD_MIN_MV);
+ /* Calibrate INA0 (PP_DUT) and INA1 (PP_CHG) */
+ ina2xx_init(0, 0x8000 /* Reset */, INA2XX_CALIB_1MA(5 /* mOhm */));
+ ina2xx_init(1, 0x8000 /* Reset */, INA2XX_CALIB_1MA(5 /* mOhm */));
+
hook_call_deferred(&ccd_measure_sbu_data, 1000 * MSEC);
}
diff --git a/board/servo_v4/board.h b/board/servo_v4/board.h
index 3db2478ae4..ff2ae855b7 100644
--- a/board/servo_v4/board.h
+++ b/board/servo_v4/board.h
@@ -90,6 +90,7 @@
/* PD features */
#define CONFIG_ADC
+#define CONFIG_INA231
#define CONFIG_BOARD_PRE_INIT
/*
* If task profiling is enabled then the rx falling edge detection interrupts