MCPcopy Create free account
hub / github.com/OpenEarable/open-earable / analogReference

Function analogReference

resources/variant/variant.cpp:24–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22};
23
24void analogReference(uint8_t mode)
25{
26 nrf_saadc_reference_t reference = NRF_SAADC_REFERENCE_VDD4;
27 nrf_saadc_gain_t gain = NRF_SAADC_GAIN1_4;
28 if (mode == AR_VDD) {
29 reference = NRF_SAADC_REFERENCE_VDD4;
30 gain = NRF_SAADC_GAIN1_4;
31 } else if (mode == AR_INTERNAL) {
32 reference = NRF_SAADC_REFERENCE_INTERNAL;
33 gain = NRF_SAADC_GAIN1;
34 } else if (mode == AR_INTERNAL1V2) {
35 reference = NRF_SAADC_REFERENCE_INTERNAL;
36 gain = NRF_SAADC_GAIN1_2;
37 } else if (mode == AR_INTERNAL2V4) {
38 reference = NRF_SAADC_REFERENCE_INTERNAL;
39 gain = NRF_SAADC_GAIN1_4;
40 }
41 adcCurrentConfig.reference = reference;
42 adcCurrentConfig.gain = gain;
43 analogUpdate();
44}
45
46void analogAcquisitionTime(uint8_t time)
47{

Callers 1

beginMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected