diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-07-27 12:41:03 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-27 12:41:03 +0000 |
commit | 9af68e005b91a35d1c741bc1d6e90f9c43be18b9 (patch) | |
tree | b97ffb2faca69b532a3743d505ef65df49ce7716 /examples/nrf/src/bin/nvmc.rs | |
parent | c0496f8bbe60f7badf17389c13804be8b8d8de8a (diff) | |
parent | 42434c75bc3472173cb71df14cc22899fb140ece (diff) | |
download | embassy-9af68e005b91a35d1c741bc1d6e90f9c43be18b9.zip |
Merge #879
879: Improve ADC configuration options r=Dirbaio a=chemicstry
This smooths out a few rough edges with ADC:
- Make `Resolution::to_max_count()` pub for all ADC versions. Useful if performing conversion manually.
- `VREF` and `VREFINT` were convoluted. `VREF` is an external voltage reference used for all ADC conversions and it is exposed as a separate pin on large chips, while on smaller ones it is connected to `VDDA` internally. `VREFINT` is an internal voltage reference connected to one of the ADC channels and can be used to calculate unknown `VREF` voltage.
- Add a separate `VREF_DEFAULT_MV`, equal to 3.3V, which is the usual supply voltage and should work for most simple cases.
- For an external voltage reference `set_vref()` can be used to set a known precise voltage.
- If no voltage reference is present, `VREFINT` calibration can be used to calculate unknown `VREF` voltage. If I understand correctly, this is only implemented for `adc_v3` (L4?), but is not currently exposed (private). If someone is interested, this can be fixed in separate PR.
Co-authored-by: chemicstry <chemicstry@gmail.com>
Diffstat (limited to 'examples/nrf/src/bin/nvmc.rs')
0 files changed, 0 insertions, 0 deletions