|
STM32G474xx HAL 用户手册
|
00001 /** 00002 ****************************************************************************** 00003 * @file stm32g4xx_ll_pwr.h 00004 * @author MCD 应用团队 00005 * @brief PWR LL 模块的头文件。 00006 ****************************************************************************** 00007 * @attention 00008 * 00009 * 版权所有 (c) 2019 STMicroelectronics. 00010 * 保留所有权利。 00011 * 00012 * 本软件根据 LICENSE 文件中的条款进行许可,该文件位于 00013 * 本软件组件的根目录中。 00014 * 如果本软件没有附带 LICENSE 文件,则按“原样”提供。 00015 * 00016 ****************************************************************************** 00017 */ 00018 00019 /* 定义以防止重复包含 -------------------------------------*/ 00020 #ifndef STM32G4xx_LL_PWR_H 00021 #define STM32G4xx_LL_PWR_H 00022 00023 #ifdef __cplusplus 00024 extern "C" { 00025 #endif 00026 00027 /* 包含文件 ------------------------------------------------------------------*/ 00028 #include "stm32g4xx.h" 00029 00030 /** @addtogroup STM32G4xx_LL_Driver 00031 * @{ 00032 */ 00033 00034 #if defined(PWR) 00035 00036 /** @defgroup PWR_LL PWR 00037 * @{ 00038 */ 00039 00040 /* 私有类型 -------------------------------------------------------------*/ 00041 /* 私有变量 ---------------------------------------------------------*/ 00042 00043 /* 私有常量 ---------------------------------------------------------*/ 00044 00045 /* 私有宏 ------------------------------------------------------------*/ 00046 00047 /* 导出类型 ------------------------------------------------------------*/ 00048 /* 导出常量 --------------------------------------------------------*/ 00049 /** @defgroup PWR_LL_Exported_Constants PWR 导出常量 00050 * @{ 00051 */ 00052 00053 /** @defgroup PWR_LL_EC_CLEAR_FLAG 清除标志定义 00054 * @brief 标志定义,可与 LL_PWR_WriteReg 函数一起使用 00055 * @{ 00056 */ 00057 #define LL_PWR_SCR_CSBF PWR_SCR_CSBF 00058 #define LL_PWR_SCR_CWUF PWR_SCR_CWUF 00059 #define LL_PWR_SCR_CWUF5 PWR_SCR_CWUF5 00060 #define LL_PWR_SCR_CWUF4 PWR_SCR_CWUF4 00061 #define LL_PWR_SCR_CWUF3 PWR_SCR_CWUF3 00062 #define LL_PWR_SCR_CWUF2 PWR_SCR_CWUF2 00063 #define LL_PWR_SCR_CWUF1 PWR_SCR_CWUF1 00064 /** 00065 * @} 00066 */ 00067 00068 /** @defgroup PWR_LL_EC_GET_FLAG 获取标志定义 00069 * @brief 标志定义,可与 LL_PWR_ReadReg 函数一起使用 00070 * @{ 00071 */ 00072 #define LL_PWR_SR1_WUFI PWR_SR1_WUFI 00073 #define LL_PWR_SR1_SBF PWR_SR1_SBF 00074 #define LL_PWR_SR1_WUF5 PWR_SR1_WUF5 00075 #define LL_PWR_SR1_WUF4 PWR_SR1_WUF4 00076 #define LL_PWR_SR1_WUF3 PWR_SR1_WUF3 00077 #define LL_PWR_SR1_WUF2 PWR_SR1_WUF2 00078 #define LL_PWR_SR1_WUF1 PWR_SR1_WUF1 00079 #if defined(PWR_SR2_PVMO4) 00080 #define LL_PWR_SR2_PVMO4 PWR_SR2_PVMO4 00081 #endif /* PWR_SR2_PVMO4 */ 00082 #if defined(PWR_SR2_PVMO3) 00083 #define LL_PWR_SR2_PVMO3 PWR_SR2_PVMO3 00084 #endif /* PWR_SR2_PVMO3 */ 00085 #if defined(PWR_SR2_PVMO2) 00086 #define LL_PWR_SR2_PVMO2 PWR_SR2_PVMO2 00087 #endif /* PWR_SR2_PVMO2 */ 00088 #if defined(PWR_SR2_PVMO1) 00089 #define LL_PWR_SR2_PVMO1 PWR_SR2_PVMO1 00090 #endif /* PWR_SR2_PVMO1 */ 00091 #define LL_PWR_SR2_PVDO PWR_SR2_PVDO 00092 #define LL_PWR_SR2_VOSF PWR_SR2_VOSF 00093 #define LL_PWR_SR2_REGLPF PWR_SR2_REGLPF 00094 #define LL_PWR_SR2_REGLPS PWR_SR2_REGLPS 00095 /** 00096 * @} 00097 */ 00098 00099 /** @defgroup PWR_LL_EC_REGU_VOLTAGE 稳压器电压 00100 * @{ 00101 */ 00102 #define LL_PWR_REGU_VOLTAGE_SCALE1 (PWR_CR1_VOS_0) 00103 #define LL_PWR_REGU_VOLTAGE_SCALE2 (PWR_CR1_VOS_1) 00104 /** 00105 * @} 00106 */ 00107 00108 /** @defgroup PWR_LL_EC_MODE_PWR 电源模式 00109 * @{ 00110 */ 00111 #define LL_PWR_MODE_STOP0 (PWR_CR1_LPMS_STOP0) 00112 #define LL_PWR_MODE_STOP1 (PWR_CR1_LPMS_STOP1) 00113 #define LL_PWR_MODE_STANDBY (PWR_CR1_LPMS_STANDBY) 00114 #define LL_PWR_MODE_SHUTDOWN (PWR_CR1_LPMS_SHUTDOWN) 00115 /** 00116 * @} 00117 */ 00118 00119 /** @defgroup PWR_LL_EC_PVM_VDDUSB_1 外设电压监测 00120 * @{ 00121 */ 00122 #if defined(PWR_CR2_PVME1) 00123 #define LL_PWR_PVM_VDDA_COMP (PWR_CR2_PVME1) /* 监测 VDDA 与 x.xV 比较 */ 00124 #endif 00125 #if defined(PWR_CR2_PVME2) 00126 #define LL_PWR_PVM_VDDA_FASTDAC (PWR_CR2_PVME2) /* 监测 VDDA 与 x.xV 比较 */ 00127 #endif 00128 #if defined(PWR_CR2_PVME3) 00129 #define LL_PWR_PVM_VDDA_ADC (PWR_CR2_PVME3) /* 监测 VDDA 与 1.62V 比较 */ 00130 #endif 00131 #if defined(PWR_CR2_PVME4) 00132 #define LL_PWR_PVM_VDDA_OPAMP_DAC (PWR_CR2_PVME4) /* 监测 VDDA 与 1x.xV 比较 */ 00133 #endif 00134 /** 00135 * @} 00136 */ 00137 00138 /** @defgroup PWR_LL_EC_PVDLEVEL PVD 电平 00139 * @{ 00140 */ 00141 #define LL_PWR_PVDLEVEL_0 (PWR_CR2_PLS_LEV0) /* VPVD0 大约 2.0 V */ 00142 #define LL_PWR_PVDLEVEL_1 (PWR_CR2_PLS_LEV1) /* VPVD1 大约 2.2 V */ 00143 #define LL_PWR_PVDLEVEL_2 (PWR_CR2_PLS_LEV2) /* VPVD2 大约 2.4 V */ 00144 #define LL_PWR_PVDLEVEL_3 (PWR_CR2_PLS_LEV3) /* VPVD3 大约 2.5 V */ 00145 #define LL_PWR_PVDLEVEL_4 (PWR_CR2_PLS_LEV4) /* VPVD4 大约 2.6 V */ 00146 #define LL_PWR_PVDLEVEL_5 (PWR_CR2_PLS_LEV5) /* VPVD5 大约 2.8 V */ 00147 #define LL_PWR_PVDLEVEL_6 (PWR_CR2_PLS_LEV6) /* VPVD6 大约 2.9 V */ 00148 #define LL_PWR_PVDLEVEL_7 (PWR_CR2_PLS_LEV7) /* 外部输入模拟电压(内部与 VREFINT 比较) */ 00149 /** 00150 * @} 00151 */ 00152 00153 /** @defgroup PWR_LL_EC_WAKEUP 唤醒 00154 * @{ 00155 */ 00156