diff options
author | Jes B. Klinke <jbk@chromium.org> | 2023-02-17 11:25:08 -0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-02-21 03:51:59 +0000 |
commit | e10f92f75e8745dfd59f09a127b5b9dcb450fdec (patch) | |
tree | f89f3e7c9113b30c34f0ea82c0ebc8b95653b47d /board/fusb307bgevb | |
parent | 6a3bd53a2034694cd76c57bb5f29763f7893fbb4 (diff) | |
download | chrome-ec-e10f92f75e8745dfd59f09a127b5b9dcb450fdec.tar.gz |
chip/stm32: ADC fixes
The ADC drivers for STM32L4 (and L5) seems to have significant flaws.
The chip has the ability to continuously perform ADC conversions
according to a set sequence of channels and bit depths. In addition to
that, the chip can perform a one-off "injected" sequence of up to four
channels, in response to a hardware or software trigger.
The driver uses only a software triggered "injected" sequence to convert
two pre-set channels.
The code of `adc_read_channel()` has some odd properties, though. On
first invocation, it sets up the injected sequence to consist of the two
configured ADC channels. Each invocation takes one particular ADC
channel number as input, but the code simply kicks of the sequence of
two channels to read, and then returns the relevant of the two,
discarding the other reading.
The has the needless limitation that it cannot be used with more than
two ADC channels.
Since it is permitted to modify the list of channels in the injected
sequence as long as no conversion is in progress, it would be more
straightforward, if each invocation of `adc_read_channel()` would
reconfigure the injected sequence to consist of a single channel, the
one requested. This CL makes that change.
BUG=b:269621551
TEST=Read and of a dozen ADC channels on HyperDebug
Change-Id: I62387979faf494cfefc3b6e7dd1d9a1954017ae6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4265223
Tested-by: Jes Klinke <jbk@chromium.org>
Commit-Queue: Eric Yilun Lin <yllin@google.com>
Auto-Submit: Jes Klinke <jbk@chromium.org>
Reviewed-by: Eric Yilun Lin <yllin@google.com>
Diffstat (limited to 'board/fusb307bgevb')
0 files changed, 0 insertions, 0 deletions