diff options
Diffstat (limited to 'board/slippy/board.c')
-rw-r--r-- | board/slippy/board.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/board/slippy/board.c b/board/slippy/board.c index 3bfd0ef6e3..ff37bc82f1 100644 --- a/board/slippy/board.c +++ b/board/slippy/board.c @@ -125,11 +125,13 @@ const struct adc_t adc_channels[ADC_CH_COUNT] = { {"ECTemp", LM4_ADC_SEQ0, -225, ADC_READ_MAX, 420, LM4_AIN_NONE, 0x0e /* TS0 | IE0 | END0 */, 0, 0}, - /* HEY: need different equation for Slippy */ - /* Charger current is mapped from 0~4000mA to 0~1.6V. - * And ADC maps 0~3.3V to ADC_READ_MAX. + /* IOUT == ICMNT is on PE3/AIN0 */ + /* We have 0.01-ohm resistors, and IOUT is 20X the differential + * voltage, so 1000mA ==> 200mV. + * ADC returns 0x000-0xFFF, which maps to 0.0-3.3V (as configured). + * mA = 1000 * ADC_VALUE / ADC_READ_MAX * 3300 / 200 */ - {"ChargerCurrent", LM4_ADC_SEQ1, 33 * 4000, ADC_READ_MAX * 16, 0, + {"ChargerCurrent", LM4_ADC_SEQ1, 33000, ADC_READ_MAX * 2, 0, LM4_AIN(0), 0x06 /* IE0 | END0 */, LM4_GPIO_E, (1<<3)}, }; |