STM32 PWR: Adds stm32_pwr_getsbf and stm32_pwr_getwuf functions that return the standby flag and the wakeup flag PWR power control/status register.

This commit is contained in:
Oleg Evseev
2017-09-28 07:50:21 -06:00
committed by Gregory Nutt
parent 1535613534
commit ef059f78ac
2 changed files with 49 additions and 4 deletions
+26 -1
View File
@@ -144,7 +144,6 @@ void stm32_pwr_enablesdadc(uint8_t sdadc)
}
stm32_pwr_modifyreg32(STM32_PWR_CR_OFFSET, 0, setbits);
}
#endif
@@ -320,6 +319,32 @@ int stm32_pwr_enablewkup(enum stm32_pwr_wupin_e wupin, bool wupon)
return OK;
}
/************************************************************************************
* Name: stm32_pwr_getsbf
*
* Description:
* Return the standby flag.
*
************************************************************************************/
bool stm32_pwr_getsbf(void)
{
return (stm32_pwr_getreg32(STM32_PWR_CSR_OFFSET) & PWR_CSR_SBF) != 0;
}
/************************************************************************************
* Name: stm32_pwr_getwuf
*
* Description:
* Return the wakeup flag.
*
************************************************************************************/
bool stm32_pwr_getwuf(void)
{
return (stm32_pwr_getreg32(STM32_PWR_CSR_OFFSET) & PWR_CSR_WUF) != 0;
}
/************************************************************************************
* Name: stm32_pwr_enablebreg
*
+23 -3
View File
@@ -73,9 +73,9 @@ extern "C"
enum stm32_pwr_wupin_e
{
PWR_WUPIN_1 = 0, /* Wake-up pin 1 (all parts) */
PWR_WUPIN_2, /* Wake-up pin 2 */
PWR_WUPIN_3 /* Wake-up pin 3 */
PWR_WUPIN_1 = 0, /* Wake-up pin 1 (all parts) */
PWR_WUPIN_2, /* Wake-up pin 2 */
PWR_WUPIN_3 /* Wake-up pin 3 */
};
/************************************************************************************
@@ -161,6 +161,26 @@ void stm32_pwr_enablebkp(bool writable);
int stm32_pwr_enablewkup(enum stm32_pwr_wupin_e wupin, bool wupon);
/************************************************************************************
* Name: stm32_pwr_getsbf
*
* Description:
* Return the standby flag.
*
************************************************************************************/
bool stm32_pwr_getsbf(void);
/************************************************************************************
* Name: stm32_pwr_getwuf
*
* Description:
* Return the wakeup flag.
*
************************************************************************************/
bool stm32_pwr_getwuf(void);
/************************************************************************************
* Name: stm32_pwr_enablebreg
*