I've been seeing 1.9uA going into my SAMD20 whenever I call sleepmgr_sleep(SLEEPMGR_STANDBY);
Except now when I started to use the ADC, I get 55uA in standby. I isolated the line of code, which is taken straight from the ASF example:
struct adc_config config_adc;
adc_init(&adc_instance, ADC, &config_adc);
It is the adc_init() function that causes the extra 53uA to show up. Comment out the adc_enable() and I get the same current. Put in adc_disable() right after adc_enable() and I still get the same current.
So I want to disable the ADC, but adc_disable() isn't doing it. How do I "undo" the effects of adc_init() ? The struct adc_config doesn't have a member named like "disabled", or a choice for reference disabled or dont take a clock input.
ANSWER: it was the voltage reference. disable it with system_voltage_reference_disable(SYSTEM_VOLTAGE_REFERENCE_BANDGAP); why ASF doesn't have that inside of adc.c, I don't understand.