From 5018723eb2d434a3da679f0a0733f233b063c4fa Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Wed, 6 Sep 2017 16:20:33 -1000 Subject: [PATCH] board_common:Define defaults for Open circuit max and UV min BOARD_ADC_OPEN_CIRCUIT_V is the voltage present on an ADC due to the bias current on the terminition resistor. BOARD_VALID_UV is the under voltage min set by resistors on a board's Power selector. A battery is considered connected when the Voltage measures is greater than BOARD_ADC_OPEN_CIRCUIT_V. In the case where BOARD_ADC_OPEN_CIRCUIT_V is greater then BOARD_VALID_UV we can use the HW to qualify connected. --- src/drivers/boards/common/board_common.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/drivers/boards/common/board_common.h b/src/drivers/boards/common/board_common.h index 446cb871b9..e2c6fd0920 100644 --- a/src/drivers/boards/common/board_common.h +++ b/src/drivers/boards/common/board_common.h @@ -148,6 +148,20 @@ /* Legacy default */ +/* Define the default maximum voltage resulting from the bias on ADC termination */ + +#if !defined(BOARD_ADC_OPEN_CIRCUIT_V) +# define BOARD_ADC_OPEN_CIRCUIT_V (1.5f) +#endif + +/* Define the default Under voltage Window on the LTC4417 as set by resistors on the + * board. Default is that of the FMUv2 at 3.7V + */ + +#if !defined(BOARD_VALID_UV) +# define BOARD_VALID_UV (3.7f) +#endif + #if !defined(BOARD_NUMBER_BRICKS) # define BOARD_NUMBER_BRICKS 1 # if !defined(BOARD_ADC_BRICK_VALID)