You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These functions must be added to reduce consumption (by @NicoPaolinelli ):
/*
* To keep power consumption low, it is important to disable the ADC voltage regulator
* before entering lowpower mode (LPRun, LPSleep or Stop mode).
*/
void LowPower_disableADCRegulator (void)
{
if (UTILITY_READ_REGISTER_BIT(ADC1->CR, ADC_CR_ADEN) == 1)
{
UTILITY_SET_REGISTER_BIT(ADC1->CR, ADC_CR_ADDIS);
}
UTILITY_CLEAR_REGISTER_BIT(ADC1->CR, ADC_CR_ADVREGEN);
}
void LowPower_enableADCRegulator (void)
{
UTILITY_SET_REGISTER_BIT(ADC1->CR, ADC_CR_ADVREGEN);
UTILITY_SET_REGISTER_BIT(ADC1->CR, ADC_CR_ADEN);
while (UTILITY_READ_REGISTER_BIT(ADC1->CR, ADC_ISR_ADRDY) != 1);
UTILITY_SET_REGISTER_BIT(ADC1->CR, ADC_ISR_ADRDY);
}
The text was updated successfully, but these errors were encountered:
These functions must be added to reduce consumption (by @NicoPaolinelli ):
The text was updated successfully, but these errors were encountered: