/** ****************************************************************************** * @file stm32f4xx_hal_pwr_ex.h * @author MCD Application Team * @brief Header file of PWR HAL Extension module. ****************************************************************************** * @attention * * Copyright (c) 2017 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file in * the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. ****************************************************************************** *//* ... *//* Define to prevent recursive inclusion -------------------------------------*/#ifndef__STM32F4xx_HAL_PWR_EX_H#define__STM32F4xx_HAL_PWR_EX_H#ifdef__cplusplusextern"C"{#endif/* Includes ------------------------------------------------------------------*/#include"stm32f4xx_hal_def.h"/** @addtogroup STM32F4xx_HAL_Driver * @{ *//* ... *//** @addtogroup PWREx * @{ *//* ... */Includes/* Exported types ------------------------------------------------------------*//* Exported constants --------------------------------------------------------*//** @defgroup PWREx_Exported_Constants PWREx Exported Constants * @{ *//* ... */#ifdefined(STM32F427xx)||defined(STM32F437xx)||defined(STM32F429xx)||defined(STM32F439xx)||\defined(STM32F446xx)||defined(STM32F469xx)||defined(STM32F479xx)/** @defgroup PWREx_Regulator_state_in_UnderDrive_mode PWREx Regulator state in UnderDrive mode * @{ *//* ... */#definePWR_MAINREGULATOR_UNDERDRIVE_ONPWR_CR_MRUDS#definePWR_LOWPOWERREGULATOR_UNDERDRIVE_ON((uint32_t)(PWR_CR_LPDS|PWR_CR_LPUDS))/** * @} *//* ... *//** @defgroup PWREx_Over_Under_Drive_Flag PWREx Over Under Drive Flag * @{ *//* ... */#definePWR_FLAG_ODRDYPWR_CSR_ODRDY#definePWR_FLAG_ODSWRDYPWR_CSR_ODSWRDY#definePWR_FLAG_UDRDYPWR_CSR_UDSWRDY5 defines/** * @} *//* ... *//* ... */#endif/* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx *//** @defgroup PWREx_Regulator_Voltage_Scale PWREx Regulator Voltage Scale * @{ *//* ... */#ifdefined(STM32F405xx)||defined(STM32F407xx)||defined(STM32F415xx)||defined(STM32F417xx)#definePWR_REGULATOR_VOLTAGE_SCALE1PWR_CR_VOS/* Scale 1 mode(default value at reset): the maximum value of fHCLK = 168 MHz. */#definePWR_REGULATOR_VOLTAGE_SCALE20x00000000U/* Scale 2 mode: the maximum value of fHCLK = 144 MHz. *//* ... */#else#definePWR_REGULATOR_VOLTAGE_SCALE1PWR_CR_VOS/* Scale 1 mode(default value at reset): the maximum value of fHCLK is 168 MHz. It can be extended to 180 MHz by activating the over-drive mode. *//* ... */#definePWR_REGULATOR_VOLTAGE_SCALE2PWR_CR_VOS_1/* Scale 2 mode: the maximum value of fHCLK is 144 MHz. It can be extended to 168 MHz by activating the over-drive mode. *//* ... */#definePWR_REGULATOR_VOLTAGE_SCALE3PWR_CR_VOS_0/* Scale 3 mode: the maximum value of fHCLK is 120 MHz. *//* ... */#endif/* STM32F405xx || STM32F407xx || STM32F415xx || STM32F417xx *//** * @} *//* ... */#ifdefined(STM32F410Tx)||defined(STM32F410Cx)||defined(STM32F410Rx)||defined(STM32F446xx)||defined(STM32F412Zx)||defined(STM32F412Vx)||\defined(STM32F412Rx)||defined(STM32F412Cx)||defined(STM32F413xx)||defined(STM32F423xx)/** @defgroup PWREx_WakeUp_Pins PWREx WakeUp Pins * @{ *//* ... */#definePWR_WAKEUP_PIN20x00000080U#ifdefined(STM32F410Tx)||defined(STM32F410Cx)||defined(STM32F410Rx)||defined(STM32F412Zx)||defined(STM32F412Vx)||\defined(STM32F412Rx)||defined(STM32F412Cx)||defined(STM32F413xx)||defined(STM32F423xx)#definePWR_WAKEUP_PIN30x00000040U#endif/* STM32F410xx || STM32F412Zx || STM32F412Vx || STM32F412Rx || STM32F412Zx || STM32F412Vx || \ STM32F412Rx || STM32F412Cx || STM32F413xx || STM32F423xx *//* ... *//** * @} *//* ... *//* ... */#endif/* STM32F410xx || STM32F446xx || STM32F412Zx || STM32F412Vx || STM32F412Rx || STM32F412Cx || STM32F413xx || STM32F423xx *//* ... *//** * @} *//* ... */Exported constants/* Exported macro ------------------------------------------------------------*//** @defgroup PWREx_Exported_Constants PWREx Exported Constants * @{ *//* ... */#ifdefined(STM32F405xx)||defined(STM32F407xx)||defined(STM32F415xx)||defined(STM32F417xx)/** @brief macros configure the main internal regulator output voltage. * @param __REGULATOR__ specifies the regulator output voltage to achieve * a tradeoff between performance and power consumption when the device does * not operate at the maximum frequency (refer to the datasheets for more details). * This parameter can be one of the following values: * @arg PWR_REGULATOR_VOLTAGE_SCALE1: Regulator voltage output Scale 1 mode * @arg PWR_REGULATOR_VOLTAGE_SCALE2: Regulator voltage output Scale 2 mode * @retval None *//* ... */#define__HAL_PWR_VOLTAGESCALING_CONFIG(__REGULATOR__)do{\__IOuint32_ttmpreg=0x00U;\MODIFY_REG(PWR->CR,PWR_CR_VOS,(__REGULATOR__));\/* Delay after an RCC peripheral clock enabling */\tmpreg=READ_BIT(PWR->CR,PWR_CR_VOS);\UNUSED(tmpreg);\...}while(0U).../* ... */#else/** @brief macros configure the main internal regulator output voltage. * @param __REGULATOR__ specifies the regulator output voltage to achieve * a tradeoff between performance and power consumption when the device does * not operate at the maximum frequency (refer to the datasheets for more details). * This parameter can be one of the following values: * @arg PWR_REGULATOR_VOLTAGE_SCALE1: Regulator voltage output Scale 1 mode * @arg PWR_REGULATOR_VOLTAGE_SCALE2: Regulator voltage output Scale 2 mode * @arg PWR_REGULATOR_VOLTAGE_SCALE3: Regulator voltage output Scale 3 mode * @retval None *//* ... */#define__HAL_PWR_VOLTAGESCALING_CONFIG(__REGULATOR__)do{\__IOuint32_ttmpreg=0x00U;\MODIFY_REG(PWR->CR,PWR_CR_VOS,(__REGULATOR__));\/* Delay after an RCC peripheral clock enabling */\tmpreg=READ_BIT(PWR->CR,PWR_CR_VOS);\UNUSED(tmpreg);\...}while(0U).../* ... */#endif/* STM32F405xx || STM32F407xx || STM32F415xx || STM32F417xx */#ifdefined(STM32F427xx)||defined(STM32F437xx)||defined(STM32F429xx)||defined(STM32F439xx)||\defined(STM32F446xx)||defined(STM32F469xx)||defined(STM32F479xx)/** @brief Macros to enable or disable the Over drive mode. * @note These macros can be used only for STM32F42xx/STM3243xx devices. *//* ... */#define__HAL_PWR_OVERDRIVE_ENABLE()(*(__IOuint32_t*)CR_ODEN_BB=ENABLE)#define__HAL_PWR_OVERDRIVE_DISABLE()(*(__IOuint32_t*)CR_ODEN_BB=DISABLE)/** @brief Macros to enable or disable the Over drive switching. * @note These macros can be used only for STM32F42xx/STM3243xx devices. *//* ... */#define__HAL_PWR_OVERDRIVESWITCHING_ENABLE()(*(__IOuint32_t*)CR_ODSWEN_BB=ENABLE)#define__HAL_PWR_OVERDRIVESWITCHING_DISABLE()(*(__IOuint32_t*)CR_ODSWEN_BB=DISABLE)/** @brief Macros to enable or disable the Under drive mode. * @note This mode is enabled only with STOP low power mode. * In this mode, the 1.2V domain is preserved in reduced leakage mode. This * mode is only available when the main regulator or the low power regulator * is in low voltage mode. * @note If the Under-drive mode was enabled, it is automatically disabled after * exiting Stop mode. * When the voltage regulator operates in Under-drive mode, an additional * startup delay is induced when waking up from Stop mode. *//* ... */#define__HAL_PWR_UNDERDRIVE_ENABLE()(PWR->CR|=(uint32_t)PWR_CR_UDEN)#define__HAL_PWR_UNDERDRIVE_DISABLE()(PWR->CR&=(uint32_t)(~PWR_CR_UDEN))/** @brief Check PWR flag is set or not. * @note These macros can be used only for STM32F42xx/STM3243xx devices. * @param __FLAG__ specifies the flag to check. * This parameter can be one of the following values: * @arg PWR_FLAG_ODRDY: This flag indicates that the Over-drive mode * is ready * @arg PWR_FLAG_ODSWRDY: This flag indicates that the Over-drive mode * switching is ready * @arg PWR_FLAG_UDRDY: This flag indicates that the Under-drive mode * is enabled in Stop mode * @retval The new state of __FLAG__ (TRUE or FALSE). *//* ... */#define__HAL_PWR_GET_ODRUDR_FLAG(__FLAG__)((PWR->CSR&(__FLAG__))==(__FLAG__))/** @brief Clear the Under-Drive Ready flag. * @note These macros can be used only for STM32F42xx/STM3243xx devices. *//* ... */#define__HAL_PWR_CLEAR_ODRUDR_FLAG()(PWR->CSR|=PWR_FLAG_UDRDY)8 defines/* ... */#endif/* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx *//** * @} *//* ... */Exported macro/* Exported functions --------------------------------------------------------*//** @addtogroup PWREx_Exported_Functions PWREx Exported Functions * @{ *//* ... *//** @addtogroup PWREx_Exported_Functions_Group1 * @{ *//* ... */voidHAL_PWREx_EnableFlashPowerDown(void);voidHAL_PWREx_DisableFlashPowerDown(void);HAL_StatusTypeDefHAL_PWREx_EnableBkUpReg(void);HAL_StatusTypeDefHAL_PWREx_DisableBkUpReg(void);uint32_tHAL_PWREx_GetVoltageRange(void);HAL_StatusTypeDefHAL_PWREx_ControlVoltageScaling(uint32_tVoltageScaling);#ifdefined(STM32F410Tx)||defined(STM32F410Cx)||defined(STM32F410Rx)||defined(STM32F401xC)||\defined(STM32F401xE)||defined(STM32F411xE)||defined(STM32F412Zx)||defined(STM32F412Vx)||\defined(STM32F412Rx)||defined(STM32F412Cx)||defined(STM32F413xx)||defined(STM32F423xx)voidHAL_PWREx_EnableMainRegulatorLowVoltage(void);voidHAL_PWREx_DisableMainRegulatorLowVoltage(void);voidHAL_PWREx_EnableLowRegulatorLowVoltage(void);voidHAL_PWREx_DisableLowRegulatorLowVoltage(void);/* ... */#endif/* STM32F410xx || STM32F401xC || STM32F401xE || STM32F411xE || STM32F412Zx || STM32F412Vx ||\ STM32F412Rx || STM32F412Cx || STM32F413xx || STM32F423xx *//* ... */#ifdefined(STM32F427xx)||defined(STM32F437xx)||defined(STM32F429xx)||defined(STM32F439xx)||defined(STM32F446xx)||\defined(STM32F469xx)||defined(STM32F479xx)HAL_StatusTypeDefHAL_PWREx_EnableOverDrive(void);HAL_StatusTypeDefHAL_PWREx_DisableOverDrive(void);HAL_StatusTypeDefHAL_PWREx_EnterUnderDriveSTOPMode(uint32_tRegulator,uint8_tSTOPEntry);/* ... */#endif/* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx *//** * @} *//* ... *//** * @} *//* ... */Exported functions/* Private types -------------------------------------------------------------*//* Private variables ---------------------------------------------------------*//* Private constants ---------------------------------------------------------*//** @defgroup PWREx_Private_Constants PWREx Private Constants * @{ *//* ... *//** @defgroup PWREx_register_alias_address PWREx Register alias address * @{ *//* ... */Private constants/* ------------- PWR registers bit address in the alias region ---------------*//* --- CR Register ---*//* Alias word address of FPDS bit */#defineFPDS_BIT_NUMBERPWR_CR_FPDS_Pos#defineCR_FPDS_BB(uint32_t)(PERIPH_BB_BASE+(PWR_CR_OFFSET_BB*32U)+(FPDS_BIT_NUMBER*4U))/* Alias word address of ODEN bit */#defineODEN_BIT_NUMBERPWR_CR_ODEN_Pos#defineCR_ODEN_BB(uint32_t)(PERIPH_BB_BASE+(PWR_CR_OFFSET_BB*32U)+(ODEN_BIT_NUMBER*4U))/* Alias word address of ODSWEN bit */#defineODSWEN_BIT_NUMBERPWR_CR_ODSWEN_Pos#defineCR_ODSWEN_BB(uint32_t)(PERIPH_BB_BASE+(PWR_CR_OFFSET_BB*32U)+(ODSWEN_BIT_NUMBER*4U))/* Alias word address of MRLVDS bit */#defineMRLVDS_BIT_NUMBERPWR_CR_MRLVDS_Pos#defineCR_MRLVDS_BB(uint32_t)(PERIPH_BB_BASE+(PWR_CR_OFFSET_BB*32U)+(MRLVDS_BIT_NUMBER*4U))/* Alias word address of LPLVDS bit */#defineLPLVDS_BIT_NUMBERPWR_CR_LPLVDS_Pos#defineCR_LPLVDS_BB(uint32_t)(PERIPH_BB_BASE+(PWR_CR_OFFSET_BB*32U)+(LPLVDS_BIT_NUMBER*4U))/** * @} *//* ... *//** @defgroup PWREx_CSR_register_alias PWRx CSR Register alias address * @{ *//* ... *//* --- CSR Register ---*//* Alias word address of BRE bit */#defineBRE_BIT_NUMBERPWR_CSR_BRE_Pos#defineCSR_BRE_BB(uint32_t)(PERIPH_BB_BASE+(PWR_CSR_OFFSET_BB*32U)+(BRE_BIT_NUMBER*4U))12 defines/** * @} *//* ... *//** * @} *//* ... */------------- PWR registers bit address in the alias region/* Private macros ------------------------------------------------------------*//** @defgroup PWREx_Private_Macros PWREx Private Macros * @{ *//* ... *//** @defgroup PWREx_IS_PWR_Definitions PWREx Private macros to check input parameters * @{ *//* ... */#ifdefined(STM32F427xx)||defined(STM32F437xx)||defined(STM32F429xx)||defined(STM32F439xx)||\defined(STM32F446xx)||defined(STM32F469xx)||defined(STM32F479xx)#defineIS_PWR_REGULATOR_UNDERDRIVE(REGULATOR)(((REGULATOR)==PWR_MAINREGULATOR_UNDERDRIVE_ON)||\((REGULATOR)==PWR_LOWPOWERREGULATOR_UNDERDRIVE_ON)).../* ... */#endif/* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx */#ifdefined(STM32F405xx)||defined(STM32F407xx)||defined(STM32F415xx)||defined(STM32F417xx)#defineIS_PWR_VOLTAGE_SCALING_RANGE(VOLTAGE)(((VOLTAGE)==PWR_REGULATOR_VOLTAGE_SCALE1)||\((VOLTAGE)==PWR_REGULATOR_VOLTAGE_SCALE2)).../* ... */#else#defineIS_PWR_VOLTAGE_SCALING_RANGE(VOLTAGE)(((VOLTAGE)==PWR_REGULATOR_VOLTAGE_SCALE1)||\((VOLTAGE)==PWR_REGULATOR_VOLTAGE_SCALE2)||\((VOLTAGE)==PWR_REGULATOR_VOLTAGE_SCALE3)).../* ... */#endif/* STM32F405xx || STM32F407xx || STM32F415xx || STM32F417xx */#ifdefined(STM32F446xx)#defineIS_PWR_WAKEUP_PIN(PIN)(((PIN)==PWR_WAKEUP_PIN1)||((PIN)==PWR_WAKEUP_PIN2))#elifdefined(STM32F410Tx)||defined(STM32F410Cx)||defined(STM32F410Rx)||defined(STM32F412Zx)||\defined(STM32F412Vx)||defined(STM32F412Rx)||defined(STM32F412Cx)||defined(STM32F413xx)||\defined(STM32F423xx)#defineIS_PWR_WAKEUP_PIN(PIN)(((PIN)==PWR_WAKEUP_PIN1)||((PIN)==PWR_WAKEUP_PIN2)||\((PIN)==PWR_WAKEUP_PIN3)).../* ... */#else#defineIS_PWR_WAKEUP_PIN(PIN)((PIN)==PWR_WAKEUP_PIN1)#endif/* STM32F446xx *//** * @} *//* ... *//** * @} *//* ... *//** * @} *//* ... *//** * @} *//* ... */#ifdef__cplusplus}extern "C" { ... }#endif/* ... */#endif/* __STM32F4xx_HAL_PWR_EX_H */
Details
Show: from
Types: Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.