stm32h747/stm32h747i-disco/CM7/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_pwr_ex.c
Go to the documentation of this file.
1 
153 /* Includes ------------------------------------------------------------------*/
154 #include "stm32h7xx_hal.h"
155 
165 #ifdef HAL_PWR_MODULE_ENABLED
166 
167 /* Private typedef -----------------------------------------------------------*/
168 /* Private define ------------------------------------------------------------*/
169 
177 #define AVD_MODE_IT (0x00010000U)
178 #define AVD_MODE_EVT (0x00020000U)
179 #define AVD_RISING_EDGE (0x00000001U)
180 #define AVD_FALLING_EDGE (0x00000002U)
181 #define AVD_RISING_FALLING_EDGE (0x00000003U)
182 
189 #define PWR_FLAG_SETTING_DELAY (1000U)
190 
197 /* Wake-Up Pins EXTI register mask */
198 #if defined (EXTI_IMR2_IM57)
199 #define PWR_EXTI_WAKEUP_PINS_MASK (EXTI_IMR2_IM55 | EXTI_IMR2_IM56 |\
200  EXTI_IMR2_IM57 | EXTI_IMR2_IM58 |\
201  EXTI_IMR2_IM59 | EXTI_IMR2_IM60)
202 #else
203 #define PWR_EXTI_WAKEUP_PINS_MASK (EXTI_IMR2_IM55 | EXTI_IMR2_IM56 |\
204  EXTI_IMR2_IM58 | EXTI_IMR2_IM60)
205 #endif /* defined (EXTI_IMR2_IM57) */
206 
207 /* Wake-Up Pins PWR Pin Pull shift offsets */
208 #define PWR_WAKEUP_PINS_PULL_SHIFT_OFFSET (2U)
209 
217 /* Private macro -------------------------------------------------------------*/
218 /* Private variables ---------------------------------------------------------*/
219 /* Private function prototypes -----------------------------------------------*/
220 /* Private functions ---------------------------------------------------------*/
221 /* Exported types ------------------------------------------------------------*/
222 /* Exported functions --------------------------------------------------------*/
223 
314 HAL_StatusTypeDef HAL_PWREx_ConfigSupply (uint32_t SupplySource)
315 {
316  uint32_t tickstart;
317 
318  /* Check the parameters */
319  assert_param (IS_PWR_SUPPLY (SupplySource));
320 
321  /* Check if supply source was configured */
322 #if defined (PWR_FLAG_SCUEN)
324 #else
326 #endif /* defined (PWR_FLAG_SCUEN) */
327  {
328  /* Check supply configuration */
329  if ((PWR->CR3 & PWR_SUPPLY_CONFIG_MASK) != SupplySource)
330  {
331  /* Supply configuration update locked, can't apply a new supply config */
332  return HAL_ERROR;
333  }
334  else
335  {
336  /* Supply configuration update locked, but new supply configuration
337  matches with old supply configuration : nothing to do
338  */
339  return HAL_OK;
340  }
341  }
342 
343  /* Set the power supply configuration */
344  MODIFY_REG (PWR->CR3, PWR_SUPPLY_CONFIG_MASK, SupplySource);
345 
346  /* Get tick */
347  tickstart = HAL_GetTick ();
348 
349  /* Wait till voltage level flag is set */
350  while (__HAL_PWR_GET_FLAG (PWR_FLAG_ACTVOSRDY) == 0U)
351  {
352  if ((HAL_GetTick () - tickstart) > PWR_FLAG_SETTING_DELAY)
353  {
354  return HAL_ERROR;
355  }
356  }
357 
358 #if defined (SMPS)
359  /* When the SMPS supplies external circuits verify that SDEXTRDY flag is set */
360  if ((SupplySource == PWR_SMPS_1V8_SUPPLIES_EXT_AND_LDO) ||
361  (SupplySource == PWR_SMPS_2V5_SUPPLIES_EXT_AND_LDO) ||
362  (SupplySource == PWR_SMPS_1V8_SUPPLIES_EXT) ||
363  (SupplySource == PWR_SMPS_2V5_SUPPLIES_EXT))
364  {
365  /* Get the current tick number */
366  tickstart = HAL_GetTick ();
367 
368  /* Wait till SMPS external supply ready flag is set */
369  while (__HAL_PWR_GET_FLAG (PWR_FLAG_SMPSEXTRDY) == 0U)
370  {
371  if ((HAL_GetTick () - tickstart) > PWR_FLAG_SETTING_DELAY)
372  {
373  return HAL_ERROR;
374  }
375  }
376  }
377 #endif /* defined (SMPS) */
378 
379  return HAL_OK;
380 }
381 
386 uint32_t HAL_PWREx_GetSupplyConfig (void)
387 {
388  return (PWR->CR3 & PWR_SUPPLY_CONFIG_MASK);
389 }
390 
414 HAL_StatusTypeDef HAL_PWREx_ControlVoltageScaling (uint32_t VoltageScaling)
415 {
416  uint32_t tickstart;
417 
418  /* Check the parameters */
419  assert_param (IS_PWR_REGULATOR_VOLTAGE (VoltageScaling));
420 
421  /* Get the voltage scaling */
422  if ((PWR->CSR1 & PWR_CSR1_ACTVOS) == VoltageScaling)
423  {
424  /* Old and new voltage scaling configuration match : nothing to do */
425  return HAL_OK;
426  }
427 
428 #if defined (PWR_SRDCR_VOS)
429  /* Set the voltage range */
430  MODIFY_REG (PWR->SRDCR, PWR_SRDCR_VOS, VoltageScaling);
431 #else
432 #if defined(SYSCFG_PWRCR_ODEN) /* STM32H74xxx and STM32H75xxx lines */
433  if (VoltageScaling == PWR_REGULATOR_VOLTAGE_SCALE0)
434  {
435  if ((PWR->CR3 & PWR_CR3_LDOEN) == PWR_CR3_LDOEN)
436  {
437  /* Set the voltage range */
439 
440  /* Get tick */
441  tickstart = HAL_GetTick ();
442 
443  /* Wait till voltage level flag is set */
444  while (__HAL_PWR_GET_FLAG (PWR_FLAG_ACTVOSRDY) == 0U)
445  {
446  if ((HAL_GetTick () - tickstart) > PWR_FLAG_SETTING_DELAY)
447  {
448  return HAL_ERROR;
449  }
450  }
451 
452  /* Enable the PWR overdrive */
453  SET_BIT (SYSCFG->PWRCR, SYSCFG_PWRCR_ODEN);
454  }
455  else
456  {
457  /* The voltage scale 0 is only possible when LDO regulator is enabled */
458  return HAL_ERROR;
459  }
460  }
461  else
462  {
464  {
465  if ((SYSCFG->PWRCR & SYSCFG_PWRCR_ODEN) != 0U)
466  {
467  /* Disable the PWR overdrive */
469 
470  /* Get tick */
471  tickstart = HAL_GetTick ();
472 
473  /* Wait till voltage level flag is set */
474  while (__HAL_PWR_GET_FLAG (PWR_FLAG_ACTVOSRDY) == 0U)
475  {
476  if ((HAL_GetTick () - tickstart) > PWR_FLAG_SETTING_DELAY)
477  {
478  return HAL_ERROR;
479  }
480  }
481  }
482  }
483 
484  /* Set the voltage range */
485  MODIFY_REG (PWR->D3CR, PWR_D3CR_VOS, VoltageScaling);
486  }
487 #else /* STM32H72xxx and STM32H73xxx lines */
488  /* Set the voltage range */
489  MODIFY_REG(PWR->D3CR, PWR_D3CR_VOS, VoltageScaling);
490 #endif /* defined (SYSCFG_PWRCR_ODEN) */
491 #endif /* defined (PWR_SRDCR_VOS) */
492 
493  /* Get tick */
494  tickstart = HAL_GetTick ();
495 
496  /* Wait till voltage level flag is set */
497  while (__HAL_PWR_GET_FLAG (PWR_FLAG_ACTVOSRDY) == 0U)
498  {
499  if ((HAL_GetTick() - tickstart) > PWR_FLAG_SETTING_DELAY)
500  {
501  return HAL_ERROR;
502  }
503  }
504 
505  return HAL_OK;
506 }
507 
513 uint32_t HAL_PWREx_GetVoltageRange (void)
514 {
515  /* Get the active voltage scaling */
516  return (PWR->CSR1 & PWR_CSR1_ACTVOS);
517 }
518 
540 {
541  /* Check the parameters */
543 
544  /* Return the stop mode voltage range */
545  MODIFY_REG (PWR->CR1, PWR_CR1_SVOS, VoltageScaling);
546 
547  return HAL_OK;
548 }
549 
554 uint32_t HAL_PWREx_GetStopModeVoltageRange (void)
555 {
556  /* Return the stop voltage scaling */
557  return (PWR->CR1 & PWR_CR1_SVOS);
558 }
713 #if defined (PWR_CPUCR_RETDS_CD)
714 
740 void HAL_PWREx_EnterSTOP2Mode (uint32_t Regulator, uint8_t STOPEntry)
741 {
742  /* Check the parameters */
743  assert_param (IS_PWR_REGULATOR (Regulator));
744  assert_param (IS_PWR_STOP_ENTRY (STOPEntry));
745 
746  /* Select the regulator state in Stop mode */
747  MODIFY_REG (PWR->CR1, PWR_CR1_LPDS, Regulator);
748 
749  /* Go to DStop2 mode (deep retention) when CPU domain enters Deepsleep */
750  SET_BIT (PWR->CPUCR, PWR_CPUCR_RETDS_CD);
751 
752  /* Keep DSTOP mode when SmartRun domain enters Deepsleep */
753  CLEAR_BIT (PWR->CPUCR, PWR_CPUCR_PDDS_SRD);
754 
755  /* Set SLEEPDEEP bit of Cortex System Control Register */
757 
758  /* Ensure that all instructions are done before entering STOP mode */
759  __ISB ();
760  __DSB ();
761 
762  /* Select Stop mode entry */
763  if (STOPEntry == PWR_STOPENTRY_WFI)
764  {
765  /* Request Wait For Interrupt */
766  __WFI ();
767  }
768  else
769  {
770  /* Request Wait For Event */
771  __WFE ();
772  }
773 
774  /* Clear SLEEPDEEP bit of Cortex-Mx in the System Control Register */
776 }
777 #endif /* defined (PWR_CPUCR_RETDS_CD) */
778 
817 void HAL_PWREx_EnterSTOPMode (uint32_t Regulator, uint8_t STOPEntry, uint32_t Domain)
818 {
819  /* Check the parameters */
820  assert_param (IS_PWR_REGULATOR (Regulator));
821  assert_param (IS_PWR_STOP_ENTRY (STOPEntry));
822  assert_param (IS_PWR_DOMAIN (Domain));
823 
824  /* Select the regulator state in Stop mode */
825  MODIFY_REG (PWR->CR1, PWR_CR1_LPDS, Regulator);
826 
827  /* Select the domain Power Down DeepSleep */
828  if (Domain == PWR_D1_DOMAIN)
829  {
830 #if defined (DUAL_CORE)
831  /* Check current core */
832  if (HAL_GetCurrentCPUID () != CM7_CPUID)
833  {
834  /*
835  When the domain selected and the cortex-mx don't match, entering stop
836  mode will not be performed
837  */
838  return;
839  }
840 #endif /* defined (DUAL_CORE) */
841 
842  /* Keep DSTOP mode when D1/CD domain enters Deepsleep */
843  CLEAR_BIT (PWR->CPUCR, PWR_CPUCR_PDDS_D1);
844 
845  /* Set SLEEPDEEP bit of Cortex System Control Register */
847 
848  /* Ensure that all instructions are done before entering STOP mode */
849  __DSB ();
850  __ISB ();
851 
852  /* Select Stop mode entry */
853  if (STOPEntry == PWR_STOPENTRY_WFI)
854  {
855  /* Request Wait For Interrupt */
856  __WFI ();
857  }
858  else
859  {
860  /* Request Wait For Event */
861  __WFE ();
862  }
863 
864  /* Clear SLEEPDEEP bit of Cortex-Mx in the System Control Register */
866  }
867 #if defined (PWR_CPUCR_PDDS_D2)
868  else if (Domain == PWR_D2_DOMAIN)
869  {
870 #if defined (DUAL_CORE)
871  /* Check current core */
872  if (HAL_GetCurrentCPUID () != CM4_CPUID)
873  {
874  /*
875  When the domain selected and the cortex-mx don't match, entering stop
876  mode will not be performed
877  */
878  return;
879  }
880 
881  /* Keep DSTOP mode when D2 domain enters Deepsleep */
882  CLEAR_BIT (PWR->CPU2CR, PWR_CPU2CR_PDDS_D2);
883 
884  /* Set SLEEPDEEP bit of Cortex System Control Register */
886 
887  /* Ensure that all instructions are done before entering STOP mode */
888  __DSB ();
889  __ISB ();
890 
891  /* Select Stop mode entry */
892  if (STOPEntry == PWR_STOPENTRY_WFI)
893  {
894  /* Request Wait For Interrupt */
895  __WFI ();
896  }
897  else
898  {
899  /* Request Wait For Event */
900  __WFE ();
901  }
902 
903  /* Clear SLEEPDEEP bit of Cortex-Mx in the System Control Register */
905 #else
906  /* Keep DSTOP mode when D2 domain enters Deepsleep */
907  CLEAR_BIT (PWR->CPUCR, PWR_CPUCR_PDDS_D2);
908 #endif /* defined (DUAL_CORE) */
909  }
910 #endif /* defined (PWR_CPUCR_PDDS_D2) */
911  else
912  {
913 #if defined (DUAL_CORE)
914  /* Check current core */
915  if (HAL_GetCurrentCPUID () == CM7_CPUID)
916  {
917  /* Keep DSTOP mode when D3 domain enters Deepsleep */
918  CLEAR_BIT (PWR->CPUCR, PWR_CPUCR_PDDS_D3);
919  }
920  else
921  {
922  /* Keep DSTOP mode when D3 domain enters Deepsleep */
923  CLEAR_BIT (PWR->CPU2CR, PWR_CPU2CR_PDDS_D3);
924  }
925 #else
926  /* Keep DSTOP mode when D3/SRD domain enters Deepsleep */
927  CLEAR_BIT (PWR->CPUCR, PWR_CPUCR_PDDS_D3);
928 #endif /* defined (DUAL_CORE) */
929  }
930 }
931 
940 void HAL_PWREx_ClearPendingEvent (void)
941 {
942 #if defined (DUAL_CORE)
943  /* Check the current Core */
944  if (HAL_GetCurrentCPUID () == CM7_CPUID)
945  {
946  __WFE ();
947  }
948  else
949  {
950  __SEV ();
951  __WFE ();
952  }
953 #else
954  __WFE ();
955 #endif /* defined (DUAL_CORE) */
956 }
957 
987 void HAL_PWREx_EnterSTANDBYMode (uint32_t Domain)
988 {
989  /* Check the parameters */
990  assert_param (IS_PWR_DOMAIN (Domain));
991 
992  /* Select the domain Power Down DeepSleep */
993  if (Domain == PWR_D1_DOMAIN)
994  {
995 #if defined (DUAL_CORE)
996  /* Check current core */
997  if (HAL_GetCurrentCPUID () != CM7_CPUID)
998  {
999  /*
1000  When the domain selected and the cortex-mx don't match, entering
1001  standby mode will not be performed
1002  */
1003  return;
1004  }
1005 #endif /* defined (DUAL_CORE) */
1006 
1007  /* Allow DSTANDBY mode when D1/CD domain enters Deepsleep */
1008  SET_BIT (PWR-> CPUCR, PWR_CPUCR_PDDS_D1);
1009 
1010 #if defined (DUAL_CORE)
1011  /* Allow DSTANDBY mode when D1/CD domain enters Deepsleep */
1012  SET_BIT (PWR-> CPU2CR, PWR_CPU2CR_PDDS_D1);
1013 #endif /*DUAL_CORE*/
1014 
1015  /* Set SLEEPDEEP bit of Cortex System Control Register */
1017 
1018  /* This option is used to ensure that store operations are completed */
1019 #if defined (__CC_ARM)
1020  __force_stores ();
1021 #endif /* defined (__CC_ARM) */
1022 
1023  /* Request Wait For Interrupt */
1024  __WFI ();
1025  }
1026 #if defined (PWR_CPUCR_PDDS_D2)
1027  else if (Domain == PWR_D2_DOMAIN)
1028  {
1029  /* Allow DSTANDBY mode when D2 domain enters Deepsleep */
1030  SET_BIT (PWR-> CPUCR, PWR_CPUCR_PDDS_D2);
1031 
1032 #if defined (DUAL_CORE)
1033  /* Check current core */
1034  if (HAL_GetCurrentCPUID () != CM4_CPUID)
1035  {
1036  /*
1037  When the domain selected and the cortex-mx don't match, entering
1038  standby mode will not be performed
1039  */
1040  return;
1041  }
1042 
1043  /* Allow DSTANDBY mode when D2 domain enters Deepsleep */
1044  SET_BIT (PWR-> CPU2CR, PWR_CPU2CR_PDDS_D2);
1045 
1046  /* Set SLEEPDEEP bit of Cortex System Control Register */
1048 
1049  /* This option is used to ensure that store operations are completed */
1050 #if defined (__CC_ARM)
1051  __force_stores ();
1052 #endif /* defined (__CC_ARM) */
1053 
1054  /* Request Wait For Interrupt */
1055  __WFI ();
1056 #endif /* defined (DUAL_CORE) */
1057  }
1058 #endif /* defined (PWR_CPUCR_PDDS_D2) */
1059  else
1060  {
1061  /* Allow DSTANDBY mode when D3/SRD domain enters Deepsleep */
1062  SET_BIT (PWR->CPUCR, PWR_CPUCR_PDDS_D3);
1063 
1064 #if defined (DUAL_CORE)
1065  /* Allow DSTANDBY mode when D3/SRD domain enters Deepsleep */
1066  SET_BIT (PWR->CPU2CR, PWR_CPU2CR_PDDS_D3);
1067 #endif /* defined (DUAL_CORE) */
1068  }
1069 }
1070 
1082 void HAL_PWREx_ConfigD3Domain (uint32_t D3State)
1083 {
1084  /* Check the parameter */
1085  assert_param (IS_D3_STATE (D3State));
1086 
1087  /* Keep D3/SRD in run mode */
1088  MODIFY_REG (PWR->CPUCR, PWR_CPUCR_RUN_D3, D3State);
1089 }
1090 
1091 #if defined (DUAL_CORE)
1092 
1102 void HAL_PWREx_ClearDomainFlags (uint32_t DomainFlags)
1103 {
1104  /* Check the parameter */
1105  assert_param (IS_PWR_DOMAIN_FLAG (DomainFlags));
1106 
1107  /* D1 CPU flags */
1108  if (DomainFlags == PWR_D1_DOMAIN_FLAGS)
1109  {
1110  /* Clear D1 domain flags (HOLD2F, STOPF, SBF, SBF_D1, and SBF_D2) */
1111  SET_BIT (PWR->CPUCR, PWR_CPUCR_CSSF);
1112  }
1113  /* D2 CPU flags */
1114  else if (DomainFlags == PWR_D2_DOMAIN_FLAGS)
1115  {
1116  /* Clear D2 domain flags (HOLD1F, STOPF, SBF, SBF_D1, and SBF_D2) */
1117  SET_BIT (PWR->CPU2CR, PWR_CPU2CR_CSSF);
1118  }
1119  else
1120  {
1121  /* Clear D1 domain flags (HOLD2F, STOPF, SBF, SBF_D1, and SBF_D2) */
1122  SET_BIT (PWR->CPUCR, PWR_CPUCR_CSSF);
1123  /* Clear D2 domain flags (HOLD1F, STOPF, SBF, SBF_D1, and SBF_D2) */
1124  SET_BIT (PWR->CPU2CR, PWR_CPU2CR_CSSF);
1125  }
1126 }
1127 
1136 HAL_StatusTypeDef HAL_PWREx_HoldCore (uint32_t CPU)
1137 {
1138  HAL_StatusTypeDef status = HAL_OK;
1139 
1140  /* Check the parameters */
1141  assert_param (IS_PWR_CORE (CPU));
1142 
1143  /* Check CPU index */
1144  if (CPU == PWR_CORE_CPU2)
1145  {
1146  /* If CPU1 is not held */
1147  if ((PWR->CPU2CR & PWR_CPU2CR_HOLD1) != PWR_CPU2CR_HOLD1)
1148  {
1149  /* Set HOLD2 bit */
1150  SET_BIT (PWR->CPUCR, PWR_CPUCR_HOLD2);
1151  }
1152  else
1153  {
1154  status = HAL_ERROR;
1155  }
1156  }
1157  else
1158  {
1159  /* If CPU2 is not held */
1160  if ((PWR->CPUCR & PWR_CPUCR_HOLD2) != PWR_CPUCR_HOLD2)
1161  {
1162  /* Set HOLD1 bit */
1163  SET_BIT (PWR->CPU2CR, PWR_CPU2CR_HOLD1);
1164  }
1165  else
1166  {
1167  status = HAL_ERROR;
1168  }
1169  }
1170 
1171  return status;
1172 }
1173 
1185 void HAL_PWREx_ReleaseCore (uint32_t CPU)
1186 {
1187  /* Check the parameters */
1188  assert_param (IS_PWR_CORE (CPU));
1189 
1190  /* Check CPU index */
1191  if (CPU == PWR_CORE_CPU2)
1192  {
1193  /* Reset HOLD2 bit */
1194  CLEAR_BIT (PWR->CPUCR, PWR_CPUCR_HOLD2);
1195  }
1196  else
1197  {
1198  /* Reset HOLD1 bit */
1199  CLEAR_BIT (PWR->CPU2CR, PWR_CPU2CR_HOLD1);
1200  }
1201 }
1202 #endif /* defined (DUAL_CORE) */
1203 
1204 
1214 {
1215  /* Enable the Flash Power Down */
1216  SET_BIT (PWR->CR1, PWR_CR1_FLPS);
1217 }
1218 
1228 {
1229  /* Disable the Flash Power Down */
1230  CLEAR_BIT (PWR->CR1, PWR_CR1_FLPS);
1231 }
1232 
1233 #if defined (PWR_CR1_SRDRAMSO)
1234 
1256 void HAL_PWREx_EnableMemoryShutOff (uint32_t MemoryBlock)
1257 {
1258  /* Check the parameter */
1259  assert_param (IS_PWR_MEMORY_BLOCK (MemoryBlock));
1260 
1261  /* Enable memory block shut-off */
1262  SET_BIT (PWR->CR1, MemoryBlock);
1263 }
1264 
1282 void HAL_PWREx_DisableMemoryShutOff (uint32_t MemoryBlock)
1283 {
1284  /* Check the parameter */
1285  assert_param (IS_PWR_MEMORY_BLOCK (MemoryBlock));
1286 
1287  /* Disable memory block shut-off */
1288  CLEAR_BIT (PWR->CR1, MemoryBlock);
1289 }
1290 #endif /* defined (PWR_CR1_SRDRAMSO) */
1291 
1304 {
1305  uint32_t pinConfig;
1306  uint32_t regMask;
1307  const uint32_t pullMask = PWR_WKUPEPR_WKUPPUPD1;
1308 
1309  /* Check the parameters */
1310  assert_param (IS_PWR_WAKEUP_PIN (sPinParams->WakeUpPin));
1313 
1314  pinConfig = sPinParams->WakeUpPin | \
1315  (sPinParams->PinPolarity << ((POSITION_VAL(sPinParams->WakeUpPin) + PWR_WKUPEPR_WKUPP1_Pos) & 0x1FU)) | \
1316  (sPinParams->PinPull << (((POSITION_VAL(sPinParams->WakeUpPin) * PWR_WAKEUP_PINS_PULL_SHIFT_OFFSET) + PWR_WKUPEPR_WKUPPUPD1_Pos) & 0x1FU));
1317 
1318  regMask = sPinParams->WakeUpPin | \
1319  (PWR_WKUPEPR_WKUPP1 << (POSITION_VAL(sPinParams->WakeUpPin) & 0x1FU)) | \
1320  (pullMask << ((POSITION_VAL(sPinParams->WakeUpPin) * PWR_WAKEUP_PINS_PULL_SHIFT_OFFSET) & 0x1FU));
1321 
1322  /* Enable and Specify the Wake-Up pin polarity and the pull configuration
1323  for the event detection (rising or falling edge) */
1324  MODIFY_REG (PWR->WKUPEPR, regMask, pinConfig);
1325 #ifndef DUAL_CORE
1326  /* Configure the Wakeup Pin EXTI Line */
1327  MODIFY_REG (EXTI->IMR2, PWR_EXTI_WAKEUP_PINS_MASK, (sPinParams->WakeUpPin << EXTI_IMR2_IM55_Pos));
1328 #endif /* !DUAL_CORE */
1329 }
1330 
1345 void HAL_PWREx_DisableWakeUpPin (uint32_t WakeUpPin)
1346 {
1347  /* Check the parameter */
1348  assert_param (IS_PWR_WAKEUP_PIN (WakeUpPin));
1349 
1350  /* Disable the WakeUpPin */
1351  CLEAR_BIT (PWR->WKUPEPR, WakeUpPin);
1352 }
1353 
1370 uint32_t HAL_PWREx_GetWakeupFlag (uint32_t WakeUpFlag)
1371 {
1372  /* Check the parameters */
1373  assert_param (IS_PWR_WAKEUP_FLAG (WakeUpFlag));
1374 
1375  /* Return the wake up pin flag */
1376  return (PWR->WKUPFR & WakeUpFlag);
1377 }
1378 
1395 HAL_StatusTypeDef HAL_PWREx_ClearWakeupFlag (uint32_t WakeUpFlag)
1396 {
1397  /* Check the parameter */
1398  assert_param (IS_PWR_WAKEUP_FLAG (WakeUpFlag));
1399 
1400  /* Clear the wake up event received from wake up pin x */
1401  SET_BIT (PWR->WKUPCR, WakeUpFlag);
1402 
1403  /* Check if the wake up event is well cleared */
1404  if ((PWR->WKUPFR & WakeUpFlag) != 0U)
1405  {
1406  return HAL_ERROR;
1407  }
1408 
1409  return HAL_OK;
1410 }
1411 
1418 {
1419  /* Wakeup pin EXTI line interrupt detected */
1420  if (READ_BIT(PWR->WKUPFR, PWR_WKUPFR_WKUPF1) != 0U)
1421  {
1422  /* Clear PWR WKUPF1 flag */
1424 
1425  /* PWR WKUP1 interrupt user callback */
1427  }
1428  else if (READ_BIT (PWR->WKUPFR, PWR_WKUPFR_WKUPF2) != 0U)
1429  {
1430  /* Clear PWR WKUPF2 flag */
1432 
1433  /* PWR WKUP2 interrupt user callback */
1435  }
1436 #if defined (PWR_WKUPFR_WKUPF3)
1437  else if (READ_BIT (PWR->WKUPFR, PWR_WKUPFR_WKUPF3) != 0U)
1438  {
1439  /* Clear PWR WKUPF3 flag */
1441 
1442  /* PWR WKUP3 interrupt user callback */
1443  HAL_PWREx_WKUP3_Callback ();
1444  }
1445 #endif /* defined (PWR_WKUPFR_WKUPF3) */
1446  else if (READ_BIT (PWR->WKUPFR, PWR_WKUPFR_WKUPF4) != 0U)
1447  {
1448  /* Clear PWR WKUPF4 flag */
1450 
1451  /* PWR WKUP4 interrupt user callback */
1453  }
1454 #if defined (PWR_WKUPFR_WKUPF5)
1455  else if (READ_BIT (PWR->WKUPFR, PWR_WKUPFR_WKUPF5) != 0U)
1456  {
1457  /* Clear PWR WKUPF5 flag */
1459 
1460  /* PWR WKUP5 interrupt user callback */
1461  HAL_PWREx_WKUP5_Callback ();
1462  }
1463 #endif /* defined (PWR_WKUPFR_WKUPF5) */
1464  else
1465  {
1466  /* Clear PWR WKUPF6 flag */
1468 
1469  /* PWR WKUP6 interrupt user callback */
1471  }
1472 }
1473 
1478 __weak void HAL_PWREx_WKUP1_Callback (void)
1479 {
1480  /* NOTE : This function should not be modified, when the callback is needed,
1481  the HAL_PWREx_WKUP1Callback can be implemented in the user file
1482  */
1483 }
1484 
1489 __weak void HAL_PWREx_WKUP2_Callback (void)
1490 {
1491  /* NOTE : This function should not be modified, when the callback is needed,
1492  the HAL_PWREx_WKUP2Callback can be implemented in the user file
1493  */
1494 }
1495 
1496 #if defined (PWR_WKUPFR_WKUPF3)
1497 
1501 __weak void HAL_PWREx_WKUP3_Callback (void)
1502 {
1503  /* NOTE : This function should not be modified, when the callback is needed,
1504  the HAL_PWREx_WKUP3Callback can be implemented in the user file
1505  */
1506 }
1507 #endif /* defined (PWR_WKUPFR_WKUPF3) */
1508 
1513 __weak void HAL_PWREx_WKUP4_Callback (void)
1514 {
1515  /* NOTE : This function should not be modified, when the callback is needed,
1516  the HAL_PWREx_WKUP4Callback can be implemented in the user file
1517  */
1518 }
1519 
1520 #if defined (PWR_WKUPFR_WKUPF5)
1521 
1525 __weak void HAL_PWREx_WKUP5_Callback (void)
1526 {
1527  /* NOTE : This function should not be modified, when the callback is needed,
1528  the HAL_PWREx_WKUP5Callback can be implemented in the user file
1529  */
1530 }
1531 #endif /* defined (PWR_WKUPFR_WKUPF5) */
1532 
1537 __weak void HAL_PWREx_WKUP6_Callback (void)
1538 {
1539  /* NOTE : This function should not be modified, when the callback is needed,
1540  the HAL_PWREx_WKUP6Callback can be implemented in the user file
1541  */
1542 }
1627 {
1628  uint32_t tickstart;
1629 
1630  /* Enable the Backup regulator */
1631  SET_BIT (PWR->CR2, PWR_CR2_BREN);
1632 
1633  /* Get tick */
1634  tickstart = HAL_GetTick ();
1635 
1636  /* Wait till Backup regulator ready flag is set */
1637  while (__HAL_PWR_GET_FLAG (PWR_FLAG_BRR) == 0U)
1638  {
1639  if ((HAL_GetTick() - tickstart ) > PWR_FLAG_SETTING_DELAY)
1640  {
1641  return HAL_ERROR;
1642  }
1643  }
1644 
1645  return HAL_OK;
1646 }
1647 
1653 {
1654  uint32_t tickstart;
1655 
1656  /* Disable the Backup regulator */
1657  CLEAR_BIT (PWR->CR2, PWR_CR2_BREN);
1658 
1659  /* Get tick */
1660  tickstart = HAL_GetTick ();
1661 
1662  /* Wait till Backup regulator ready flag is reset */
1663  while (__HAL_PWR_GET_FLAG (PWR_FLAG_BRR) != 0U)
1664  {
1665  if ((HAL_GetTick() - tickstart ) > PWR_FLAG_SETTING_DELAY)
1666  {
1667  return HAL_ERROR;
1668  }
1669  }
1670 
1671  return HAL_OK;
1672 }
1673 
1679 {
1680  uint32_t tickstart;
1681 
1682  /* Enable the USB regulator */
1683  SET_BIT (PWR->CR3, PWR_CR3_USBREGEN);
1684 
1685  /* Get tick */
1686  tickstart = HAL_GetTick ();
1687 
1688  /* Wait till the USB regulator ready flag is set */
1689  while (__HAL_PWR_GET_FLAG (PWR_FLAG_USB33RDY) == 0U)
1690  {
1691  if ((HAL_GetTick() - tickstart ) > PWR_FLAG_SETTING_DELAY)
1692  {
1693  return HAL_ERROR;
1694  }
1695  }
1696 
1697  return HAL_OK;
1698 }
1699 
1705 {
1706  uint32_t tickstart;
1707 
1708  /* Disable the USB regulator */
1709  CLEAR_BIT (PWR->CR3, PWR_CR3_USBREGEN);
1710 
1711  /* Get tick */
1712  tickstart = HAL_GetTick ();
1713 
1714  /* Wait till the USB regulator ready flag is reset */
1715  while(__HAL_PWR_GET_FLAG (PWR_FLAG_USB33RDY) != 0U)
1716  {
1717  if ((HAL_GetTick() - tickstart ) > PWR_FLAG_SETTING_DELAY)
1718  {
1719  return HAL_ERROR;
1720  }
1721  }
1722 
1723  return HAL_OK;
1724 }
1725 
1731 {
1732  /* Enable the USB voltage detector */
1733  SET_BIT (PWR->CR3, PWR_CR3_USB33DEN);
1734 }
1735 
1741 {
1742  /* Disable the USB voltage detector */
1743  CLEAR_BIT (PWR->CR3, PWR_CR3_USB33DEN);
1744 }
1745 
1756 void HAL_PWREx_EnableBatteryCharging (uint32_t ResistorValue)
1757 {
1758  /* Check the parameter */
1759  assert_param (IS_PWR_BATTERY_RESISTOR_SELECT (ResistorValue));
1760 
1761  /* Specify the charging resistor */
1762  MODIFY_REG (PWR->CR3, PWR_CR3_VBRS, ResistorValue);
1763 
1764  /* Enable the Battery charging */
1765  SET_BIT (PWR->CR3, PWR_CR3_VBE);
1766 }
1767 
1773 {
1774  /* Disable the Battery charging */
1775  CLEAR_BIT (PWR->CR3, PWR_CR3_VBE);
1776 }
1777 
1778 #if defined (PWR_CR1_BOOSTE)
1779 
1786 void HAL_PWREx_EnableAnalogBooster (void)
1787 {
1788  /* Enable the Analog voltage */
1789  SET_BIT (PWR->CR1, PWR_CR1_AVD_READY);
1790 
1791  /* Enable VDDA booster */
1792  SET_BIT (PWR->CR1, PWR_CR1_BOOSTE);
1793 }
1794 
1799 void HAL_PWREx_DisableAnalogBooster (void)
1800 {
1801  /* Disable VDDA booster */
1802  CLEAR_BIT (PWR->CR1, PWR_CR1_BOOSTE);
1803 
1804  /* Disable the Analog voltage */
1805  CLEAR_BIT (PWR->CR1, PWR_CR1_AVD_READY);
1806 }
1807 #endif /* defined (PWR_CR1_BOOSTE) */
1808 
1862 void HAL_PWREx_EnableMonitoring (void)
1863 {
1864  /* Enable the VBAT and Temperature monitoring */
1865  SET_BIT (PWR->CR2, PWR_CR2_MONEN);
1866 }
1867 
1872 void HAL_PWREx_DisableMonitoring (void)
1873 {
1874  /* Disable the VBAT and Temperature monitoring */
1875  CLEAR_BIT (PWR->CR2, PWR_CR2_MONEN);
1876 }
1877 
1883 uint32_t HAL_PWREx_GetTemperatureLevel (void)
1884 {
1885  uint32_t tempLevel, regValue;
1886 
1887  /* Read the temperature flags */
1888  regValue = READ_BIT (PWR->CR2, (PWR_CR2_TEMPH | PWR_CR2_TEMPL));
1889 
1890  /* Check if the temperature is below the threshold */
1891  if (regValue == PWR_CR2_TEMPL)
1892  {
1893  tempLevel = PWR_TEMP_BELOW_LOW_THRESHOLD;
1894  }
1895  /* Check if the temperature is above the threshold */
1896  else if (regValue == PWR_CR2_TEMPH)
1897  {
1898  tempLevel = PWR_TEMP_ABOVE_HIGH_THRESHOLD;
1899  }
1900  /* The temperature is between the thresholds */
1901  else
1902  {
1904  }
1905 
1906  return tempLevel;
1907 }
1908 
1914 uint32_t HAL_PWREx_GetVBATLevel (void)
1915 {
1916  uint32_t VBATLevel, regValue;
1917 
1918  /* Read the VBAT flags */
1919  regValue = READ_BIT (PWR->CR2, (PWR_CR2_VBATH | PWR_CR2_VBATL));
1920 
1921  /* Check if the VBAT is below the threshold */
1922  if (regValue == PWR_CR2_VBATL)
1923  {
1924  VBATLevel = PWR_VBAT_BELOW_LOW_THRESHOLD;
1925  }
1926  /* Check if the VBAT is above the threshold */
1927  else if (regValue == PWR_CR2_VBATH)
1928  {
1929  VBATLevel = PWR_VBAT_ABOVE_HIGH_THRESHOLD;
1930  }
1931  /* The VBAT is between the thresholds */
1932  else
1933  {
1935  }
1936 
1937  return VBATLevel;
1938 }
1939 
1940 #if defined (PWR_CSR1_MMCVDO)
1941 
1945 PWREx_MMC_VoltageLevel HAL_PWREx_GetMMCVoltage (void)
1946 {
1947  PWREx_MMC_VoltageLevel mmc_voltage;
1948 
1949  /* Check voltage detector output on VDDMMC value */
1950  if ((PWR->CSR1 & PWR_CSR1_MMCVDO_Msk) == 0U)
1951  {
1952  mmc_voltage = PWR_MMC_VOLTAGE_BELOW_1V2;
1953  }
1954  else
1955  {
1956  mmc_voltage = PWR_MMC_VOLTAGE_EQUAL_ABOVE_1V2;
1957  }
1958 
1959  return mmc_voltage;
1960 }
1961 #endif /* defined (PWR_CSR1_MMCVDO) */
1962 
1977 void HAL_PWREx_ConfigAVD (PWREx_AVDTypeDef *sConfigAVD)
1978 {
1979  /* Check the parameters */
1980  assert_param (IS_PWR_AVD_LEVEL (sConfigAVD->AVDLevel));
1981  assert_param (IS_PWR_AVD_MODE (sConfigAVD->Mode));
1982 
1983  /* Set the ALS[18:17] bits according to AVDLevel value */
1984  MODIFY_REG (PWR->CR1, PWR_CR1_ALS, sConfigAVD->AVDLevel);
1985 
1986  /* Clear any previous config */
1987 #if !defined (DUAL_CORE)
1990 #endif /* !defined (DUAL_CORE) */
1991 
1994 
1995 #if !defined (DUAL_CORE)
1996  /* Configure the interrupt mode */
1997  if ((sConfigAVD->Mode & AVD_MODE_IT) == AVD_MODE_IT)
1998  {
2000  }
2001 
2002  /* Configure the event mode */
2003  if ((sConfigAVD->Mode & AVD_MODE_EVT) == AVD_MODE_EVT)
2004  {
2006  }
2007 #endif /* !defined (DUAL_CORE) */
2008 
2009  /* Rising edge configuration */
2010  if ((sConfigAVD->Mode & AVD_RISING_EDGE) == AVD_RISING_EDGE)
2011  {
2013  }
2014 
2015  /* Falling edge configuration */
2016  if ((sConfigAVD->Mode & AVD_FALLING_EDGE) == AVD_FALLING_EDGE)
2017  {
2019  }
2020 }
2021 
2026 void HAL_PWREx_EnableAVD (void)
2027 {
2028  /* Enable the Analog Voltage Detector */
2029  SET_BIT (PWR->CR1, PWR_CR1_AVDEN);
2030 }
2031 
2036 void HAL_PWREx_DisableAVD (void)
2037 {
2038  /* Disable the Analog Voltage Detector */
2039  CLEAR_BIT (PWR->CR1, PWR_CR1_AVDEN);
2040 }
2041 
2047 void HAL_PWREx_PVD_AVD_IRQHandler (void)
2048 {
2049  /* Check if the Programmable Voltage Detector is enabled (PVD) */
2050  if (READ_BIT (PWR->CR1, PWR_CR1_PVDEN) != 0U)
2051  {
2052 #if defined (DUAL_CORE)
2053  if (HAL_GetCurrentCPUID () == CM7_CPUID)
2054 #endif /* defined (DUAL_CORE) */
2055  {
2056  /* Check PWR D1/CD EXTI flag */
2057  if (__HAL_PWR_PVD_EXTI_GET_FLAG () != 0U)
2058  {
2059  /* PWR PVD interrupt user callback */
2061 
2062  /* Clear PWR EXTI D1/CD pending bit */
2064  }
2065  }
2066 #if defined (DUAL_CORE)
2067  else
2068  {
2069  /* Check PWR EXTI D2 flag */
2070  if (__HAL_PWR_PVD_EXTID2_GET_FLAG () != 0U)
2071  {
2072  /* PWR PVD interrupt user callback */
2074 
2075  /* Clear PWR EXTI D2 pending bit */
2076  __HAL_PWR_PVD_EXTID2_CLEAR_FLAG();
2077  }
2078  }
2079 #endif /* defined (DUAL_CORE) */
2080  }
2081 
2082  /* Check if the Analog Voltage Detector is enabled (AVD) */
2083  if (READ_BIT (PWR->CR1, PWR_CR1_AVDEN) != 0U)
2084  {
2085 #if defined (DUAL_CORE)
2086  if (HAL_GetCurrentCPUID () == CM7_CPUID)
2087 #endif /* defined (DUAL_CORE) */
2088  {
2089  /* Check PWR EXTI D1/CD flag */
2090  if (__HAL_PWR_AVD_EXTI_GET_FLAG () != 0U)
2091  {
2092  /* PWR AVD interrupt user callback */
2094 
2095  /* Clear PWR EXTI D1/CD pending bit */
2097  }
2098  }
2099 #if defined (DUAL_CORE)
2100  else
2101  {
2102  /* Check PWR EXTI D2 flag */
2103  if (__HAL_PWR_AVD_EXTID2_GET_FLAG () != 0U)
2104  {
2105  /* PWR AVD interrupt user callback */
2107 
2108  /* Clear PWR EXTI D2 pending bit */
2109  __HAL_PWR_AVD_EXTID2_CLEAR_FLAG ();
2110  }
2111  }
2112 #endif /* defined (DUAL_CORE) */
2113  }
2114 }
2115 
2120 __weak void HAL_PWREx_AVDCallback (void)
2121 {
2122  /* NOTE : This function should not be modified, when the callback is needed,
2123  the HAL_PWR_AVDCallback can be implemented in the user file
2124  */
2125 }
2134 #endif /* HAL_PWR_MODULE_ENABLED */
2135 
2144 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
__HAL_PWR_AVD_EXTI_GET_FLAG
#define __HAL_PWR_AVD_EXTI_GET_FLAG()
Check whether the specified AVD EXTI interrupt flag is set or not.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:468
PWR_FLAG_BRR
#define PWR_FLAG_BRR
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h:137
SCB
#define SCB
Definition: imxrt1050/imxrt1050-evkb/CMSIS/core_cm7.h:1778
assert_param
#define assert_param(expr)
Include module's header file.
Definition: stm32f407/stm32f407g-disc1/Inc/stm32f4xx_hal_conf.h:353
__HAL_PWR_PVD_EXTI_GET_FLAG
#define __HAL_PWR_PVD_EXTI_GET_FLAG()
checks whether the specified PVD Exti interrupt flag is set or not.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h:254
__HAL_PWR_GET_FLAG
#define __HAL_PWR_GET_FLAG(__FLAG__)
Check PWR flag is set or not.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h:173
IS_PWR_DOMAIN
#define IS_PWR_DOMAIN(DOMAIN)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:655
__HAL_PWR_AVD_EXTI_CLEAR_FLAG
#define __HAL_PWR_AVD_EXTI_CLEAR_FLAG()
Clear the AVD EXTI flag.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:482
HAL_PWREx_EnableUSBVoltageDetector
void HAL_PWREx_EnableUSBVoltageDetector(void)
HAL_StatusTypeDef
HAL_StatusTypeDef
HAL Status structures definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:40
PWR_WKUPFR_WKUPF2
#define PWR_WKUPFR_WKUPF2
Definition: stm32h735xx.h:14731
PWR_SUPPLY_CONFIG_MASK
#define PWR_SUPPLY_CONFIG_MASK
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:252
PWR_CR1_ALS
#define PWR_CR1_ALS
Definition: stm32h735xx.h:14526
HAL_PWREx_ConfigD3Domain
void HAL_PWREx_ConfigD3Domain(uint32_t D3State)
PWREx_AVDTypeDef::Mode
uint32_t Mode
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:53
PWR
#define PWR
Definition: stm32f407xx.h:1083
HAL_PWREx_ConfigAVD
void HAL_PWREx_ConfigAVD(PWREx_AVDTypeDef *sConfigAVD)
PWR_CR2_BREN
#define PWR_CR2_BREN
Definition: stm32h735xx.h:14629
PWREx_AVDTypeDef
PWREx AVD configuration structure definition.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:46
PWR_WKUPEPR_WKUPP1_Pos
#define PWR_WKUPEPR_WKUPP1_Pos
Definition: stm32h735xx.h:14766
PWR_VBAT_ABOVE_HIGH_THRESHOLD
#define PWR_VBAT_ABOVE_HIGH_THRESHOLD
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:312
IS_PWR_WAKEUP_PIN_PULL
#define IS_PWR_WAKEUP_PIN_PULL(PULL)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:703
EXTI_IMR2_IM55_Pos
#define EXTI_IMR2_IM55_Pos
Definition: stm32h735xx.h:10756
HAL_PWREx_WKUP6_Callback
void HAL_PWREx_WKUP6_Callback(void)
PWR_CR1_PVDEN
#define PWR_CR1_PVDEN
Definition: stm32h735xx.h:14551
__DSB
__STATIC_FORCEINLINE void __DSB(void)
Data Synchronization Barrier.
Definition: imxrt1050/imxrt1050-evkb/CMSIS/cmsis_gcc.h:944
HAL_PWREx_EnableBkUpReg
HAL_StatusTypeDef HAL_PWREx_EnableBkUpReg(void)
PWREx_WakeupPinTypeDef::WakeUpPin
uint32_t WakeUpPin
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:64
HAL_PWREx_WAKEUP_PIN_IRQHandler
void HAL_PWREx_WAKEUP_PIN_IRQHandler(void)
PWREx_AVDTypeDef::AVDLevel
uint32_t AVDLevel
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:48
PWR_FLAG_WKUP6
#define PWR_FLAG_WKUP6
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr.h:196
__HAL_PWR_AVD_EXTI_DISABLE_FALLING_EDGE
#define __HAL_PWR_AVD_EXTI_DISABLE_FALLING_EDGE()
Disable the AVD Extended Interrupt Falling Trigger.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:442
__ISB
__STATIC_FORCEINLINE void __ISB(void)
Instruction Synchronization Barrier.
Definition: imxrt1050/imxrt1050-evkb/CMSIS/cmsis_gcc.h:933
PWREx_WakeupPinTypeDef
PWREx Wakeup pin configuration structure definition.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:62
__HAL_PWR_AVD_EXTI_ENABLE_IT
#define __HAL_PWR_AVD_EXTI_ENABLE_IT()
Enable the AVD EXTI Line 16.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:368
PWR_CR1_LPDS
#define PWR_CR1_LPDS
Definition: stm32f769xx.h:10431
PWR_CR1_FLPS
#define PWR_CR1_FLPS
Definition: stm32h735xx.h:14539
PWR_VBAT_BELOW_LOW_THRESHOLD
#define PWR_VBAT_BELOW_LOW_THRESHOLD
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:311
PWR_D1_DOMAIN
#define PWR_D1_DOMAIN
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:200
PWR_CR3_USBREGEN
#define PWR_CR3_USBREGEN
Definition: stm32h735xx.h:14637
PWR_CSR1_ACTVOS
#define PWR_CSR1_ACTVOS
Definition: stm32h735xx.h:14598
PWR_CPUCR_PDDS_D1
#define PWR_CPUCR_PDDS_D1
Definition: stm32h735xx.h:14695
__HAL_PWR_AVD_EXTI_DISABLE_IT
#define __HAL_PWR_AVD_EXTI_DISABLE_IT()
Disable the AVD EXTI Line 16.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:382
PWR_D3CR_VOS
#define PWR_D3CR_VOS
Definition: stm32h735xx.h:14701
IS_PWR_BATTERY_RESISTOR_SELECT
#define IS_PWR_BATTERY_RESISTOR_SELECT(RESISTOR)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:740
HAL_ERROR
@ HAL_ERROR
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:43
IS_PWR_REGULATOR_VOLTAGE
#define IS_PWR_REGULATOR_VOLTAGE(VOLTAGE)
Definition: stm32f7xx_hal_pwr.h:377
CLEAR_BIT
#define CLEAR_BIT(REG, BIT)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:214
HAL_GetTick
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c:323
HAL_PWREx_EnterSTANDBYMode
void HAL_PWREx_EnterSTANDBYMode(uint32_t Domain)
IS_PWR_STOP_ENTRY
#define IS_PWR_STOP_ENTRY(ENTRY)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h:407
IS_PWR_SUPPLY
#define IS_PWR_SUPPLY(PWR_SOURCE)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:640
PWR_FLAG_WKUP5
#define PWR_FLAG_WKUP5
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr.h:195
POSITION_VAL
#define POSITION_VAL(VAL)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:226
HAL_PWREx_GetVBATLevel
uint32_t HAL_PWREx_GetVBATLevel(void)
IS_PWR_STOP_MODE_REGULATOR_VOLTAGE
#define IS_PWR_STOP_MODE_REGULATOR_VOLTAGE(VOLTAGE)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:645
IS_PWR_WAKEUP_PIN_POLARITY
#define IS_PWR_WAKEUP_PIN_POLARITY(POLARITY)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:699
HAL_PWREx_DisableUSBReg
HAL_StatusTypeDef HAL_PWREx_DisableUSBReg(void)
PWR_CR3_SMPSEN
#define PWR_CR3_SMPSEN
Definition: stm32h735xx.h:14660
PWR_VBAT_BETWEEN_HIGH_LOW_THRESHOLD
#define PWR_VBAT_BETWEEN_HIGH_LOW_THRESHOLD
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:310
HAL_PWREx_ConfigSupply
HAL_StatusTypeDef HAL_PWREx_ConfigSupply(uint32_t SupplySource)
HAL_PWREx_EnterSTOPMode
void HAL_PWREx_EnterSTOPMode(uint32_t Regulator, uint8_t STOPEntry, uint32_t Domain)
PWR_CR1_SVOS
#define PWR_CR1_SVOS
Definition: stm32h735xx.h:14534
HAL_PWREx_GetTemperatureLevel
uint32_t HAL_PWREx_GetTemperatureLevel(void)
PWR_CR2_MONEN
#define PWR_CR2_MONEN
Definition: stm32h735xx.h:14626
PWR_CPU2CR_PDDS_D2
#define PWR_CPU2CR_PDDS_D2
Definition: stm32h747xx.h:17791
HAL_PWREx_DisableBkUpReg
HAL_StatusTypeDef HAL_PWREx_DisableBkUpReg(void)
HAL_OK
@ HAL_OK
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:42
PWR_CPUCR_CSSF
#define PWR_CPUCR_CSSF
Definition: stm32h735xx.h:14674
PWR_CPUCR_RUN_D3
#define PWR_CPUCR_RUN_D3
Definition: stm32h735xx.h:14671
__HAL_PWR_AVD_EXTI_ENABLE_FALLING_EDGE
#define __HAL_PWR_AVD_EXTI_ENABLE_FALLING_EDGE()
Enable the AVD Extended Interrupt Falling Trigger.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:436
PWR_FLAG_SCUEN
#define PWR_FLAG_SCUEN
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr.h:179
PWR_WKUPFR_WKUPF1
#define PWR_WKUPFR_WKUPF1
Definition: stm32h735xx.h:14734
PWR_CR3_VBRS
#define PWR_CR3_VBRS
Definition: stm32h735xx.h:14646
HAL_PWR_PVDCallback
void HAL_PWR_PVDCallback(void)
PWR_WKUPEPR_WKUPP1
#define PWR_WKUPEPR_WKUPP1
Definition: stm32h735xx.h:14768
HAL_PWREx_ControlStopModeVoltageScaling
HAL_StatusTypeDef HAL_PWREx_ControlStopModeVoltageScaling(uint32_t VoltageScaling)
PWR_TEMP_BETWEEN_HIGH_LOW_THRESHOLD
#define PWR_TEMP_BETWEEN_HIGH_LOW_THRESHOLD
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:320
HAL_GetCurrentCPUID
uint32_t HAL_GetCurrentCPUID(void)
PWR_STOPENTRY_WFI
#define PWR_STOPENTRY_WFI
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h:125
HAL_PWREx_WKUP4_Callback
void HAL_PWREx_WKUP4_Callback(void)
PWR_WKUPEPR_WKUPPUPD1_Pos
#define PWR_WKUPEPR_WKUPPUPD1_Pos
Definition: stm32h735xx.h:14752
__HAL_PWR_AVD_EXTI_ENABLE_EVENT
#define __HAL_PWR_AVD_EXTI_ENABLE_EVENT()
Enable event on AVD EXTI Line 16.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:396
HAL_PWREx_ClearPendingEvent
void HAL_PWREx_ClearPendingEvent(void)
MODIFY_REG
#define MODIFY_REG(REG, CLEARMASK, SETMASK)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:224
PWR_CR3_LDOEN
#define PWR_CR3_LDOEN
Definition: stm32h735xx.h:14663
HAL_PWREx_EnableAVD
void HAL_PWREx_EnableAVD(void)
IS_PWR_AVD_MODE
#define IS_PWR_AVD_MODE(MODE)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:731
HAL_PWREx_GetStopModeVoltageRange
uint32_t HAL_PWREx_GetStopModeVoltageRange(void)
SYSCFG_PWRCR_ODEN
#define SYSCFG_PWRCR_ODEN
Definition: stm32h747xx.h:22833
PWR_WKUPEPR_WKUPPUPD1
#define PWR_WKUPEPR_WKUPPUPD1
Definition: stm32h735xx.h:14754
IS_D3_STATE
#define IS_D3_STATE(STATE)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:660
IS_PWR_AVD_LEVEL
#define IS_PWR_AVD_LEVEL(LEVEL)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:725
PWR_CPU2CR_PDDS_D1
#define PWR_CPU2CR_PDDS_D1
Definition: stm32h747xx.h:17794
PWR_CPU2CR_HOLD1
#define PWR_CPU2CR_HOLD1
Definition: stm32h747xx.h:17767
HAL_PWREx_EnableFlashPowerDown
void HAL_PWREx_EnableFlashPowerDown(void)
SYSCFG
#define SYSCFG
Definition: stm32f407xx.h:1098
PWR_WKUPFR_WKUPF4
#define PWR_WKUPFR_WKUPF4
Definition: stm32h735xx.h:14728
PWR_CR2_VBATL
#define PWR_CR2_VBATL
Definition: stm32h735xx.h:14620
READ_BIT
#define READ_BIT(REG, BIT)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:216
PWR_CPUCR_PDDS_D2
#define PWR_CPUCR_PDDS_D2
Definition: stm32h735xx.h:14692
PWR_TEMP_ABOVE_HIGH_THRESHOLD
#define PWR_TEMP_ABOVE_HIGH_THRESHOLD
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:322
PWR_FLAG_WKUP4
#define PWR_FLAG_WKUP4
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr.h:194
PWR_CR2_TEMPL
#define PWR_CR2_TEMPL
Definition: stm32h735xx.h:14614
HAL_PWREx_DisableUSBVoltageDetector
void HAL_PWREx_DisableUSBVoltageDetector(void)
PWR_REGULATOR_VOLTAGE_SCALE1
#define PWR_REGULATOR_VOLTAGE_SCALE1
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h:74
PWR_CPU2CR_CSSF
#define PWR_CPU2CR_CSSF
Definition: stm32h747xx.h:17770
PWR_CPUCR_HOLD2
#define PWR_CPUCR_HOLD2
Definition: stm32h747xx.h:17732
PWR_FLAG_ACTVOSRDY
#define PWR_FLAG_ACTVOSRDY
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr.h:172
IS_PWR_WAKEUP_PIN
#define IS_PWR_WAKEUP_PIN(PIN)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr_ex.h:317
PWR_CR3_VBE
#define PWR_CR3_VBE
Definition: stm32h735xx.h:14649
IS_PWR_WAKEUP_FLAG
#define IS_PWR_WAKEUP_FLAG(FLAG)
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:717
IS_PWR_REGULATOR
#define IS_PWR_REGULATOR(REGULATOR)
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h:404
HAL_PWREx_GetWakeupFlag
uint32_t HAL_PWREx_GetWakeupFlag(uint32_t WakeUpFlag)
HAL_PWREx_EnableUSBReg
HAL_StatusTypeDef HAL_PWREx_EnableUSBReg(void)
HAL_PWREx_DisableBatteryCharging
void HAL_PWREx_DisableBatteryCharging(void)
HAL_PWREx_DisableFlashPowerDown
void HAL_PWREx_DisableFlashPowerDown(void)
PWR_WKUPFR_WKUPF3
#define PWR_WKUPFR_WKUPF3
Definition: stm32h747xx.h:17839
PWR_WKUPFR_WKUPF5
#define PWR_WKUPFR_WKUPF5
Definition: stm32h747xx.h:17833
CM7_CPUID
#define CM7_CPUID
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_cortex.h:275
PWREx_WakeupPinTypeDef::PinPolarity
uint32_t PinPolarity
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:69
HAL_PWREx_EnableMonitoring
void HAL_PWREx_EnableMonitoring(void)
PWR_CR2_TEMPH
#define PWR_CR2_TEMPH
Definition: stm32h735xx.h:14611
PWR_CR3_USB33DEN
#define PWR_CR3_USB33DEN
Definition: stm32h735xx.h:14640
PWR_CPUCR_PDDS_D3
#define PWR_CPUCR_PDDS_D3
Definition: stm32h735xx.h:14689
PWR_FLAG_WKUP3
#define PWR_FLAG_WKUP3
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr.h:193
__HAL_PWR_AVD_EXTI_DISABLE_EVENT
#define __HAL_PWR_AVD_EXTI_DISABLE_EVENT()
Disable event on AVD EXTI Line 16.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:410
__SEV
#define __SEV
Send Event.
Definition: imxrt1050/imxrt1050-evkb/CMSIS/cmsis_armcc.h:438
PWR_REGULATOR_VOLTAGE_SCALE0
#define PWR_REGULATOR_VOLTAGE_SCALE0
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr.h:143
HAL_PWREx_GetVoltageRange
uint32_t HAL_PWREx_GetVoltageRange(void)
__HAL_PWR_AVD_EXTI_DISABLE_RISING_EDGE
#define __HAL_PWR_AVD_EXTI_DISABLE_RISING_EDGE()
Disable the AVD Extended Interrupt Rising Trigger.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:430
PWR_CR2_VBATH
#define PWR_CR2_VBATH
Definition: stm32h735xx.h:14617
PWR_TEMP_BELOW_LOW_THRESHOLD
#define PWR_TEMP_BELOW_LOW_THRESHOLD
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:321
HAL_PWREx_WKUP2_Callback
void HAL_PWREx_WKUP2_Callback(void)
__HAL_PWR_PVD_EXTI_CLEAR_FLAG
#define __HAL_PWR_PVD_EXTI_CLEAR_FLAG()
Clear the PVD Exti flag.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_pwr.h:260
HAL_PWREx_EnableWakeUpPin
void HAL_PWREx_EnableWakeUpPin(PWREx_WakeupPinTypeDef *sPinParams)
HAL_PWREx_DisableMonitoring
void HAL_PWREx_DisableMonitoring(void)
EXTI
#define EXTI
Definition: stm32f407xx.h:1099
HAL_PWREx_GetSupplyConfig
uint32_t HAL_PWREx_GetSupplyConfig(void)
SET_BIT
#define SET_BIT(REG, BIT)
Definition: stm32f407/stm32f407g-disc1/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:212
PWR_FLAG_USB33RDY
#define PWR_FLAG_USB33RDY
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr.h:184
HAL_PWREx_ControlVoltageScaling
HAL_StatusTypeDef HAL_PWREx_ControlVoltageScaling(uint32_t VoltageScaling)
PWR_FLAG_WKUP2
#define PWR_FLAG_WKUP2
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr.h:192
__HAL_PWR_AVD_EXTI_ENABLE_RISING_EDGE
#define __HAL_PWR_AVD_EXTI_ENABLE_RISING_EDGE()
Enable the AVD Extended Interrupt Rising Trigger.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:424
__WFE
#define __WFE
Wait For Event.
Definition: imxrt1050/imxrt1050-evkb/CMSIS/cmsis_armcc.h:431
PWR_CR1_AVDEN
#define PWR_CR1_AVDEN
Definition: stm32h735xx.h:14531
__WFI
#define __WFI
Wait For Interrupt.
Definition: imxrt1050/imxrt1050-evkb/CMSIS/cmsis_armcc.h:423
PWREx_WakeupPinTypeDef::PinPull
uint32_t PinPull
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr_ex.h:74
PWR_CR3_BYPASS
#define PWR_CR3_BYPASS
Definition: stm32h735xx.h:14666
HAL_PWREx_DisableAVD
void HAL_PWREx_DisableAVD(void)
HAL_PWREx_AVDCallback
void HAL_PWREx_AVDCallback(void)
PWR_FLAG_WKUP1
#define PWR_FLAG_WKUP1
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr.h:191
PWR_CPU2CR_PDDS_D3
#define PWR_CPU2CR_PDDS_D3
Definition: stm32h747xx.h:17788
SCB_SCR_SLEEPDEEP_Msk
#define SCB_SCR_SLEEPDEEP_Msk
Definition: imxrt1050/imxrt1050-evkb/CMSIS/core_cm7.h:587
HAL_PWREx_ClearWakeupFlag
HAL_StatusTypeDef HAL_PWREx_ClearWakeupFlag(uint32_t WakeUpFlag)
HAL_PWREx_EnableBatteryCharging
void HAL_PWREx_EnableBatteryCharging(uint32_t ResistorValue)
HAL_PWREx_DisableWakeUpPin
void HAL_PWREx_DisableWakeUpPin(uint32_t WakeUpPin)
HAL_PWREx_WKUP1_Callback
void HAL_PWREx_WKUP1_Callback(void)
HAL_PWREx_PVD_AVD_IRQHandler
void HAL_PWREx_PVD_AVD_IRQHandler(void)
__HAL_PWR_CLEAR_WAKEUPFLAG
#define __HAL_PWR_CLEAR_WAKEUPFLAG(__FLAG__)
Clear PWR wake up flags.
Definition: stm32h735/stm32h735g-dk/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_pwr.h:533


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:54