Add LXA TAC hardware generation 3 support #64
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The ADC channels 0 and 1 on the STM32MP1 are a bit special, in that they are not muxable as GPIOs but connected directly to the ADC peripheral.
This has cause us a bit of trouble in the past, because these pins seem to leak current (like all other channels did until the transition into ADC standby was fixed by unmuxing the ADC pins beforehand). We could once again try to fix the issue with these pins, but that could also turn out to be impossible to do (since the pins can not be muxed away).
This is why we have instead decided to just not use these pins on generation 3 (and likely later) hardware and use other pins instead.
This means we have to detect which ADC pins we should use based on if we are running on Gen 1 / Gen 2 or Gen 3.
Luckily this can be decided without doing an explicit generation detection. Instead we can just try setting up channels voltage0 and voltage1 (Gen 1 and Gen 2) and if that fails fall back to setting up voltage18 and voltage14 instead (Gen 3), since these channels only exist on the respective hardware generations.
TODO before merging: