mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-11 10:25:20 +00:00
reef: Fix board ID ADC scaling factors
The ADC multiplier and divider factors were lazily set to 1 when the board support was first added, so the value was not scaled properly. The conversion formula is: Vi = CHNnDAT * (Vfs / 1024) where Vfs = Vref = 2.816V for Reef. BUG=none BRANCH=none TEST=added debug print and reading now approximately matches what the voltmeter reads. Change-Id: Ic60a8bc1d84c4f9a7b5664e9daddfa331b6a890c Signed-off-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/358613 Reviewed-by: Kevin K Wong <kevin.k.wong@intel.com>
This commit is contained in:
committed by
chrome-bot
parent
affc41cec2
commit
5fb5ccc390
@@ -98,7 +98,9 @@ BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT);
|
||||
|
||||
/* ADC channels */
|
||||
const struct adc_t adc_channels[] = {
|
||||
[ADC_BOARD_ID] = {"BOARD_ID", NPCX_ADC_CH2, 1, 1, 0},
|
||||
/* Vfs = Vref = 2.816V, 10-bit unsigned reading */
|
||||
[ADC_BOARD_ID] = {"BRD_ID", NPCX_ADC_CH2,
|
||||
ADC_MAX_VOLT, ADC_READ_MAX + 1, 0},
|
||||
};
|
||||
BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user