| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077 |
- /**
- ******************************************************************************
- * @file stm32h5xx_ll_pwr.h
- * @author MCD Application Team
- * @brief Header file of PWR LL module.
- ******************************************************************************
- * @attention
- *
- * Copyright (c) 2023 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 STM32H5xx_LL_PWR_H
- #define STM32H5xx_LL_PWR_H
- #ifdef __cplusplus
- extern "C" {
- #endif /* __cplusplus */
- /* Includes ------------------------------------------------------------------*/
- #include "stm32h5xx.h"
- /** @addtogroup STM32H5xx_LL_Driver
- * @{
- */
- #if defined (PWR)
- /** @defgroup PWR_LL PWR
- * @{
- */
- /* Private types -------------------------------------------------------------*/
- /* Private variables ---------------------------------------------------------*/
- /* Private constants ---------------------------------------------------------*/
- /** @defgroup PWR_LL_Private_Constants PWR Private Constants
- * @{
- */
- /** @defgroup PWR_LL_WAKEUP_PIN_OFFSET Wake-Up Pins register offsets Defines
- * @brief Flags defines which can be used with LL_PWR_WriteReg function
- * @{
- */
- /* Wake-Up Pins PWR register offsets */
- #define LL_PWR_WAKEUP_PINS_PULL_SHIFT_OFFSET 2UL
- #define LL_PWR_WAKEUP_PINS_MAX_SHIFT_MASK 0x7FU
- /**
- * @}
- */
- /**
- * @}
- */
- /* Private macros ------------------------------------------------------------*/
- /* Exported types ------------------------------------------------------------*/
- /* Exported constants --------------------------------------------------------*/
- /** @defgroup PWR_LL_Exported_Constants PWR Exported Constants
- * @{
- */
- /** @defgroup PWR_LL_EC_CLEAR_FLAG Clear Flags Defines
- * @brief Flags defines which can be used with LL_PWR_WriteReg function
- * @{
- */
- #define LL_PWR_PMCR_CSSF PWR_PMCR_CSSF /*!< Clear STOP and STANDBY flags */
- #define LL_PWR_WUSCR_CWUF1 PWR_WUSCR_CWUF1 /*!< Clear Wakeup flag 1 */
- #define LL_PWR_WUSCR_CWUF2 PWR_WUSCR_CWUF2 /*!< Clear Wakeup flag 2 */
- #define LL_PWR_WUSCR_CWUF3 PWR_WUSCR_CWUF3 /*!< Clear Wakeup flag 3 */
- #define LL_PWR_WUSCR_CWUF4 PWR_WUSCR_CWUF4 /*!< Clear Wakeup flag 4 */
- #define LL_PWR_WUSCR_CWUF5 PWR_WUSCR_CWUF5 /*!< Clear Wakeup flag 5 */
- #define LL_PWR_WUSCR_CWUF6 PWR_WUSCR_CWUF6 /*!< Clear Wakeup flag 6 */
- #define LL_PWR_WUSCR_CWUF7 PWR_WUSCR_CWUF7 /*!< Clear Wakeup flag 7 */
- #define LL_PWR_WUSCR_CWUF8 PWR_WUSCR_CWUF8 /*!< Clear Wakeup flag 8 */
- #define LL_PWR_WUSCR_CWUF_ALL PWR_WUSCR_CWUF /*!< Clear all Wakeup flags */
- /**
- * @}
- */
- /** @defgroup PWR_LL_EC_GET_FLAG Get Flags Defines
- * @brief Flags defines which can be used with LL_PWR_ReadReg function
- * @{
- */
- #define LL_PWR_FLAG_VOSRDY PWR_VOSR_VOSRDY /*!< Voltage scaling ready flag */
- #define LL_PWR_FLAG_ACTVOSRDY PWR_VOSR_ACTOVSRDY /*!< Currently applied VOS ready flag */
- #define LL_PWR_FLAG_STOPF PWR_PMSR_STOPF /*!< STOP flag */
- #define LL_PWR_FLAG_SBF PWR_PMSR_SBF /*!< STANDBY flag */
- #define LL_PWR_FLAG_AVDO PWR_VMSR_AVDO /*!< Analog voltage detector output on VDDA flag */
- #define LL_PWR_FLAG_VDDIO2RDY PWR_VMSR_VDDIO2RDY /*!< VDDIO2 ready flag */
- #define LL_PWR_FLAG_PVDO PWR_VMSR_PVDO /*!< Programmable voltage detect output flag */
- #define LL_PWR_FLAG_USB33RDY PWR_VMSR_USB33RDY /*!< VDDUSB ready flag */
- #define LL_PWR_FLAG_TEMPH PWR_BDSR_TEMPH /*!< Temperature level flag (versus high threshold) */
- #define LL_PWR_FLAG_TEMPL PWR_BDSR_TEMPL /*!< Temperature level flag (versus low threshold) */
- #define LL_PWR_FLAG_VBATH PWR_BDSR_VBATH /*!< VBAT level flag (versus high threshold) */
- #define LL_PWR_FLAG_VBATL PWR_BDSR_VBATL /*!< VBAT level flag (versus low threshold) */
- #define LL_PWR_WAKEUP_FLAG1 PWR_WUSR_WUF1 /*!< Wakeup flag 1 */
- #define LL_PWR_WAKEUP_FLAG2 PWR_WUSR_WUF2 /*!< Wakeup flag 2 */
- #define LL_PWR_WAKEUP_FLAG3 PWR_WUSR_WUF3 /*!< Wakeup flag 3 */
- #define LL_PWR_WAKEUP_FLAG4 PWR_WUSR_WUF4 /*!< Wakeup flag 4 */
- #define LL_PWR_WAKEUP_FLAG5 PWR_WUSR_WUF5 /*!< Wakeup flag 5 */
- #define LL_PWR_WAKEUP_FLAG6 PWR_WUSR_WUF6 /*!< Wakeup flag 6 */
- #define LL_PWR_WAKEUP_FLAG7 PWR_WUSR_WUF7 /*!< Wakeup flag 7 */
- #define LL_PWR_WAKEUP_FLAG8 PWR_WUSR_WUF8 /*!< Wakeup flag 8 */
- /**
- * @}
- */
- /** @defgroup PWR_LL_EC_LOW_POWER_MODE_SELCTION Low Power Mode Selection
- * @{
- */
- #define LL_PWR_STOP_MODE (0U) /*!< STOP 0 mode */
- #define LL_PWR_STANDBY_MODE PWR_PMCR_LPMS /*!< STANDBY mode */
- /**
- * @}
- */
- /** @defgroup PWR_LL_EC_VOLTAGE_SCALING_RANGE_SELECTION PWR Voltage scaling range selection
- * @{
- */
- #define LL_PWR_REGU_VOLTAGE_SCALE0 PWR_VOSCR_VOS /*!< Voltage scaling range 0 */
- #define LL_PWR_REGU_VOLTAGE_SCALE1 PWR_VOSCR_VOS_1 /*!< Voltage scaling range 1 */
- #define LL_PWR_REGU_VOLTAGE_SCALE2 PWR_VOSCR_VOS_0 /*!< Voltage scaling range 2 */
- #define LL_PWR_REGU_VOLTAGE_SCALE3 0x00000000U /*!< Voltage scaling range 3 */
- /**
- * @}
- */
- /** @defgroup PWR_LL_EC_STOP_MODE_REGU_VOLTAGE Stop mode Regulator Voltage Scaling
- * @{
- */
- #define LL_PWR_REGU_VOLTAGE_SVOS_SCALE5 PWR_PMCR_SVOS_0 /*!< Select voltage scale 5 when system enters STOP mode */
- #define LL_PWR_REGU_VOLTAGE_SVOS_SCALE4 PWR_PMCR_SVOS_1 /*!< Select voltage scale 4 when system enters STOP mode */
- #define LL_PWR_REGU_VOLTAGE_SVOS_SCALE3 (PWR_PMCR_SVOS_0 | PWR_PMCR_SVOS_1) /*!< Select voltage scale 3 when system enters STOP mode */
- /**
- * @}
- */
- /** @defgroup PWR_LL_EC_PVD_LEVEL_SELECTION PWR Power Voltage Detector Level Selection
- * @{
- */
- #define LL_PWR_PVDLEVEL_0 0U /*!< Voltage threshold detected by PVD 1.95 V */
- #define LL_PWR_PVDLEVEL_1 PWR_VMCR_PLS_0 /*!< Voltage threshold detected by PVD 2.10 V */
- #define LL_PWR_PVDLEVEL_2 PWR_VMCR_PLS_1 /*!< Voltage threshold detected by PVD 2.25 V */
- #define LL_PWR_PVDLEVEL_3 (PWR_VMCR_PLS_0 | PWR_VMCR_PLS_1) /*!< Voltage threshold detected by PVD 2.40 V */
- #define LL_PWR_PVDLEVEL_4 PWR_VMCR_PLS_2 /*!< Voltage threshold detected by PVD 2.55 V */
- #define LL_PWR_PVDLEVEL_5 (PWR_VMCR_PLS_0 | PWR_VMCR_PLS_2) /*!< Voltage threshold detected by PVD 2.70 V */
- #define LL_PWR_PVDLEVEL_6 (PWR_VMCR_PLS_1 | PWR_VMCR_PLS_2) /*!< Voltage threshold detected by PVD 2.85 V */
- #define LL_PWR_PVDLEVEL_7 PWR_VMCR_PLS /*!< External input analog voltage on PVD_IN
- pin, compared to internal VREFINT level */
- /**
- * @}
- */
- /** @defgroup PWR_LL_EC_AVDLEVEL Power Analog Voltage Level Detector
- * @{
- */
- #define LL_PWR_AVDLEVEL_0 0U /*!< Analog Voltage threshold detected by AVD 1.7 V */
- #define LL_PWR_AVDLEVEL_1 PWR_VMCR_ALS_0 /*!< Analog Voltage threshold detected by AVD 2.1 V */
- #define LL_PWR_AVDLEVEL_2 PWR_VMCR_ALS_1 /*!< Analog Voltage threshold detected by AVD 2.5 V */
- #define LL_PWR_AVDLEVEL_3 PWR_VMCR_ALS /*!< Analog Voltage threshold detected by AVD 2.8 V */
- /**
- * @}
- */
- /** @defgroup PWR_LL_EC_WAKEUP_PIN PWR Wake Up Pin
- * @{
- */
- #define LL_PWR_WAKEUP_PIN1 PWR_WUCR_WUPEN1 /*!< Wakeup pin 1 enable */
- #define LL_PWR_WAKEUP_PIN2 PWR_WUCR_WUPEN2 /*!< Wakeup pin 2 enable */
- #define LL_PWR_WAKEUP_PIN3 PWR_WUCR_WUPEN3 /*!< Wakeup pin 3 enable */
- #define LL_PWR_WAKEUP_PIN4 PWR_WUCR_WUPEN4 /*!< Wakeup pin 4 enable */
- #define LL_PWR_WAKEUP_PIN5 PWR_WUCR_WUPEN5 /*!< Wakeup pin 5 enable */
- #define LL_PWR_WAKEUP_PIN6 PWR_WUCR_WUPEN6 /*!< Wakeup pin 6 enable */
- #define LL_PWR_WAKEUP_PIN7 PWR_WUCR_WUPEN7 /*!< Wakeup pin 7 enable */
- #define LL_PWR_WAKEUP_PIN8 PWR_WUCR_WUPEN8 /*!< Wakeup pin 8 enable */
- /**
- * @}
- */
- /** @defgroup PWR_LL_EC_WAKEUP_PIN_PULL Wakeup Pins pull configuration
- * @{
- */
- #define LL_PWR_WAKEUP_PIN_NOPULL 0x00000000UL /*!< Configure Wake-Up pin in no pull */
- #define LL_PWR_WAKEUP_PIN_PULLUP 0x00000001UL /*!< Configure Wake-Up pin in pull Up */
- #define LL_PWR_WAKEUP_PIN_PULLDOWN 0x00000002UL /*!< Configure Wake-Up pin in pull Down */
- /**
- * @}
- */
- /** @defgroup PWR_LL_EC_SUPPLY_PWR Power supply source configuration
- * @{
- */
- #define LL_PWR_EXTERNAL_SOURCE_SUPPLY PWR_SCCR_BYPASS /*!< The SMPS and the LDO are Bypassed.
- The Core domains are supplied from an external source */
- /**
- * @}
- */
- /** @defgroup PWR_LL_EC_CHARGING_RESISTOR_SELECTION PWR VBAT Charging Resistor Selection
- * @{
- */
- #define LL_PWR_BATT_CHARG_RESISTOR_5K 0U /*!< Charge the battery through a 5 kO resistor */
- #define LL_PWR_BATT_CHARG_RESISTOR_1_5K PWR_BDCR_VBRS /*!< Charge the battery through a 1.5 kO resistor */
- /**
- * @}
- */
- /** @defgroup PWR_LL_EC_ITEMS_SECURE_ATTRIBUTE PWR Items Secure Attribute
- * @{
- */
- #define LL_PWR_WAKEUP_PIN1_NSEC 0U /* Wake up pin 1 nsecure mode */
- #define LL_PWR_WAKEUP_PIN1_SEC PWR_SECCFGR_WUP1SEC /* Wake up pin 1 secure mode */
- #define LL_PWR_WAKEUP_PIN2_NSEC 0U /* Wake up pin 2 nsecure mode */
- #define LL_PWR_WAKEUP_PIN2_SEC PWR_SECCFGR_WUP2SEC /* Wake up pin 2 secure mode */
- #define LL_PWR_WAKEUP_PIN3_NSEC 0U /* Wake up pin 3 nsecure mode */
- #define LL_PWR_WAKEUP_PIN3_SEC PWR_SECCFGR_WUP3SEC /* Wake up pin 3 secure mode */
- #define LL_PWR_WAKEUP_PIN4_NSEC 0U /* Wake up pin 4 nsecure mode */
- #define LL_PWR_WAKEUP_PIN4_SEC PWR_SECCFGR_WUP4SEC /* Wake up pin 4 secure mode */
- #define LL_PWR_WAKEUP_PIN5_NSEC 0U /* Wake up pin 5 nsecure mode */
- #define LL_PWR_WAKEUP_PIN5_SEC PWR_SECCFGR_WUP5SEC /* Wake up pin 5 secure mode */
- #define LL_PWR_WAKEUP_PIN6_NSEC 0U /* Wake up pin 6 nsecure mode */
- #define LL_PWR_WAKEUP_PIN6_SEC PWR_SECCFGR_WUP6SEC /* Wake up pin 6 secure mode */
- #define LL_PWR_WAKEUP_PIN7_NSEC 0U /* Wake up pin 7 nsecure mode */
- #define LL_PWR_WAKEUP_PIN7_SEC PWR_SECCFGR_WUP7SEC /* Wake up pin 7 secure mode */
- #define LL_PWR_WAKEUP_PIN8_NSEC 0U /* Wake up pin 8 nsecure mode */
- #define LL_PWR_WAKEUP_PIN8_SEC PWR_SECCFGR_WUP8SEC /* Wake up pin 8 secure mode */
- #define LL_PWR_RET_NSEC 0U /* Retention nsecure mode */
- #define LL_PWR_RET_SEC PWR_SECCFGR_RETSEC /* Retention secure mode */
- #define LL_PWR_LPM_NSEC 0U /* Low-power modes nsecure mode */
- #define LL_PWR_LPM_SEC PWR_SECCFGR_LPMSEC /* Low-power modes secure mode */
- #define LL_PWR_VDM_NSEC 0U /* Voltage detection and monitoring nsecure mode */
- #define LL_PWR_VDM_SEC PWR_SECCFGR_SCMSEC /* Voltage detection and monitoring secure mode */
- #define LL_PWR_VB_NSEC 0U /* Backup domain nsecure mode */
- #define LL_PWR_VB_SEC PWR_SECCFGR_VBSEC /* Backup domain secure mode */
- #define LL_PWR_APC_NSEC 0U /* Pull-up/pull-down nsecure mode */
- #define LL_PWR_APC_SEC PWR_SECCFGR_VUSBSEC /* Pull-up/pull-down secure mode */
- /**
- * @}
- */
- /**
- * @}
- */
- /* Exported macro ------------------------------------------------------------*/
- /** @defgroup PWR_LL_Exported_Macros PWR Exported Macros
- * @{
- */
- /** @defgroup PWR_LL_EM_WRITE_READ Common Write and Read Registers Macros
- * @{
- */
- /**
- * @brief Write a value in PWR register.
- * @param __REG__ Register to be written.
- * @param __VALUE__ Value to be written in the register.
- * @retval None.
- */
- #define LL_PWR_WriteReg(__REG__, __VALUE__) WRITE_REG(PWR->__REG__, (__VALUE__))
- /**
- * @brief Read a value in PWR register.
- * @param __REG__ Register to be read.
- * @retval Register value.
- */
- #define LL_PWR_ReadReg(__REG__) READ_REG(PWR->__REG__)
- /**
- * @}
- */
- /**
- * @}
- */
- /* Exported functions --------------------------------------------------------*/
- /** @defgroup PWR_LL_Exported_Functions PWR Exported Functions
- * @{
- */
- /** @defgroup PWR_LL_EF_CONFIGURATION PWR Configuration
- * @{
- */
- /**
- * @brief Set system power mode.
- * @rmtoll PMCR LPMS LL_PWR_SetPowerMode
- * @param Mode : This parameter can be one of the following values:
- * @arg @ref LL_PWR_STOP_MODE
- * @arg @ref LL_PWR_STANDBY_MODE
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_SetPowerMode(uint32_t Mode)
- {
- MODIFY_REG(PWR->PMCR, PWR_PMCR_LPMS, Mode);
- }
- /**
- * @brief Get system power mode.
- * @rmtoll PMCR LPMS LL_PWR_GetPowerMode
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_PWR_STOP_MODE
- * @arg @ref LL_PWR_STANDBY_MODE
- */
- __STATIC_INLINE uint32_t LL_PWR_GetPowerMode(void)
- {
- return (READ_BIT(PWR->PMCR, PWR_PMCR_LPMS));
- }
- /**
- * @brief Set the internal Regulator output voltage in STOP mode
- * @rmtoll PMCR SVOS LL_PWR_SetStopModeRegulVoltageScaling
- * @param VoltageScaling This parameter can be one of the following values:
- * @arg @ref LL_PWR_REGU_VOLTAGE_SVOS_SCALE3
- * @arg @ref LL_PWR_REGU_VOLTAGE_SVOS_SCALE4
- * @arg @ref LL_PWR_REGU_VOLTAGE_SVOS_SCALE5
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_SetStopModeRegulVoltageScaling(uint32_t VoltageScaling)
- {
- MODIFY_REG(PWR->PMCR, PWR_PMCR_SVOS, VoltageScaling);
- }
- /**
- * @brief Get the internal Regulator output voltage in STOP mode
- * @rmtoll PMCR SVOS LL_PWR_GetStopModeRegulVoltageScaling
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_PWR_REGU_VOLTAGE_SVOS_SCALE3
- * @arg @ref LL_PWR_REGU_VOLTAGE_SVOS_SCALE4
- * @arg @ref LL_PWR_REGU_VOLTAGE_SVOS_SCALE5
- */
- __STATIC_INLINE uint32_t LL_PWR_GetStopModeRegulVoltageScaling(void)
- {
- return (uint32_t)(READ_BIT(PWR->PMCR, PWR_PMCR_SVOS));
- }
- /**
- * @brief Enable the Flash Power Down in Stop Mode
- * @rmtoll PMCR FLPS LL_PWR_EnableFlashPowerDown
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableFlashPowerDown(void)
- {
- SET_BIT(PWR->PMCR, PWR_PMCR_FLPS);
- }
- /**
- * @brief Disable the Flash Power Down in Stop Mode
- * @rmtoll PMCR FLPS LL_PWR_DisableFlashPowerDown
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableFlashPowerDown(void)
- {
- CLEAR_BIT(PWR->PMCR, PWR_PMCR_FLPS);
- }
- /**
- * @brief Check if the Flash Power Down in Stop Mode is enabled
- * @rmtoll PMCR FLPS LL_PWR_IsEnabledFlashPowerDown
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledFlashPowerDown(void)
- {
- return ((READ_BIT(PWR->PMCR, PWR_PMCR_FLPS) == (PWR_PMCR_FLPS)) ? 1UL : 0UL);
- }
- /**
- * @brief Enable the Analog Voltage Booster (VDDA)
- * @rmtoll PMCR BOOSTE LL_PWR_EnableAnalogBooster
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableAnalogBooster(void)
- {
- SET_BIT(PWR->PMCR, PWR_PMCR_BOOSTE);
- }
- /**
- * @brief Disable the Analog Voltage Booster (VDDA)
- * @rmtoll PMCR BOOSTE LL_PWR_DisableAnalogBooster
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableAnalogBooster(void)
- {
- CLEAR_BIT(PWR->PMCR, PWR_PMCR_BOOSTE);
- }
- /**
- * @brief Check if the Analog Voltage Booster (VDDA) is enabled
- * @rmtoll PMCR BOOSTE LL_PWR_IsEnabledAnalogBooster
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledAnalogBooster(void)
- {
- return ((READ_BIT(PWR->PMCR, PWR_PMCR_BOOSTE) == (PWR_PMCR_BOOSTE)) ? 1UL : 0UL);
- }
- /**
- * @brief Enable the Analog Voltage Ready to isolate the BOOST IP until VDDA will be ready
- * @rmtoll PMCR AVD_READY LL_PWR_EnableAnalogVoltageReady
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableAnalogVoltageReady(void)
- {
- SET_BIT(PWR->PMCR, PWR_PMCR_AVD_READY);
- }
- /**
- * @brief Disable the Analog Voltage Ready (VDDA)
- * @rmtoll PMCR AVD_READY LL_PWR_DisableAnalogVoltageReady
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableAnalogVoltageReady(void)
- {
- CLEAR_BIT(PWR->PMCR, PWR_PMCR_AVD_READY);
- }
- /**
- * @brief Check if the Analog Voltage Booster (VDDA) is enabled
- * @rmtoll PMCR AVD_READY LL_PWR_IsEnabledAnalogVoltageReady
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledAnalogVoltageReady(void)
- {
- return ((READ_BIT(PWR->PMCR, PWR_PMCR_AVD_READY) == (PWR_PMCR_AVD_READY)) ? 1UL : 0UL);
- }
- /**
- * @brief Enable the AHB RAM1 shut-off in Stop mode
- * @rmtoll PMCR SRAM1SO LL_PWR_EnableAHBRAM1ShutOff
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableAHBRAM1ShutOff(void)
- {
- SET_BIT(PWR->PMCR, PWR_PMCR_SRAM1SO);
- }
- /**
- * @brief Disable the AHB RAM1 shut-off in Stop mode
- * @rmtoll PMCR SRAM1SO LL_PWR_DisableAHBRAM1ShutOff
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableAHBRAM1ShutOff(void)
- {
- CLEAR_BIT(PWR->PMCR, PWR_PMCR_SRAM1SO);
- }
- /**
- * @brief Check if the AHB RAM1 shut-off in Stop mode is enabled
- * @rmtoll CR1 SRAM1SO LL_PWR_IsEnabledAHBRAM1ShutOff
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledAHBRAM1ShutOff(void)
- {
- return ((READ_BIT(PWR->PMCR, PWR_PMCR_SRAM1SO) == (PWR_PMCR_SRAM1SO)) ? 1UL : 0UL);
- }
- #if defined (PWR_PMCR_SRAM2_48SO)
- /**
- * @brief Enable the AHB RAM2 48K Bytes shut-off in Stop mode
- * @rmtoll PMCR SRAM2_48SO LL_PWR_EnableAHBRAM2_48K_ShutOff
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableAHBRAM2_48K_ShutOff(void)
- {
- SET_BIT(PWR->PMCR, PWR_PMCR_SRAM2_48SO);
- }
- /**
- * @brief Disable the AHB RAM2 48K Bytes shut-off in Stop mode
- * @rmtoll PMCR SRAM2_48SO LL_PWR_DisableAHBRAM2_48K_ShutOff
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableAHBRAM2_48K_ShutOff(void)
- {
- CLEAR_BIT(PWR->PMCR, PWR_PMCR_SRAM2_48SO);
- }
- /**
- * @brief Check if the AHB RAM2 shut-off in Stop mode is enabled
- * @rmtoll PMCR SRAM2_48SO LL_PWR_IsEnabledAHBRAM2_48K_ShutOff
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledAHBRAM2_48K_ShutOff(void)
- {
- return ((READ_BIT(PWR->PMCR, PWR_PMCR_SRAM2_48SO) == (PWR_PMCR_SRAM2_48SO)) ? 1UL : 0UL);
- }
- #endif /* PWR_PMCR_SRAM2_48SO */
- #if defined (PWR_PMCR_SRAM2_16SO)
- /**
- * @brief Enable the AHB RAM2 16K Bytes shut-off in Stop mode
- * @rmtoll PMCR SRAM2_16SO LL_PWR_EnableAHBRAM2_16K_ShutOff
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableAHBRAM2_16K_ShutOff(void)
- {
- SET_BIT(PWR->PMCR, PWR_PMCR_SRAM2_16SO);
- }
- /**
- * @brief Disable the AHB RAM2 16K Bytes shut-off in Stop mode
- * @rmtoll PMCR SRAM2_16SO LL_PWR_DisableAHBRAM2_16K_ShutOff
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableAHBRAM2_16K_ShutOff(void)
- {
- CLEAR_BIT(PWR->PMCR, PWR_PMCR_SRAM2_16SO);
- }
- /**
- * @brief Check if the AHB RAM2 shut-off in Stop mode is enabled
- * @rmtoll PMCR SRAM2_16SO LL_PWR_IsEnabledAHBRAM2_16K_ShutOff
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledAHBRAM2_16K_ShutOff(void)
- {
- return ((READ_BIT(PWR->PMCR, PWR_PMCR_SRAM2_16SO) == (PWR_PMCR_SRAM2_16SO)) ? 1UL : 0UL);
- }
- #endif /* PWR_PMCR_SRAM2_16SO */
- #if defined(PWR_PMCR_SRAM2_16HSO)
- /**
- * @brief Enable the AHB RAM2 high 16K Bytes shut-off in Stop mode
- * @rmtoll PMCR SRAM2_16HSO LL_PWR_EnableAHBRAM2_High_16K_ShutOff
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableAHBRAM2_High_16K_ShutOff(void)
- {
- SET_BIT(PWR->PMCR, PWR_PMCR_SRAM2_16HSO);
- }
- /**
- * @brief Disable the AHB RAM2 high 16K Bytes shut-off in Stop mode
- * @rmtoll PMCR SRAM2_16HSO LL_PWR_DisableAHBRAM2_High_16K_ShutOff
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableAHBRAM2_High_16K_ShutOff(void)
- {
- CLEAR_BIT(PWR->PMCR, PWR_PMCR_SRAM2_16HSO);
- }
- /**
- * @brief Check if the high AHB RAM2 shut-off in Stop mode is enabled
- * @rmtoll PMCR SRAM2_16HSO LL_PWR_IsEnabledAHBRAM2_16K_ShutOff
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledAHBRAM2_High_16K_ShutOff(void)
- {
- return ((READ_BIT(PWR->PMCR, PWR_PMCR_SRAM2_16HSO) == (PWR_PMCR_SRAM2_16HSO)) ? 1UL : 0UL);
- }
- #endif /* PWR_PMCR_SRAM2_16HSO */
- #if defined(PWR_PMCR_SRAM2_16LSO)
- /**
- * @brief Enable the AHB RAM2 low 16K Bytes shut-off in Stop mode
- * @rmtoll PMCR SRAM2_16LSO LL_PWR_EnableAHBRAM2_Low_16K_ShutOff
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableAHBRAM2_Low_16K_ShutOff(void)
- {
- SET_BIT(PWR->PMCR, PWR_PMCR_SRAM2_16LSO);
- }
- /**
- * @brief Disable the AHB RAM2 low 16K Bytes shut-off in Stop mode
- * @rmtoll PMCR SRAM2_16LSO LL_PWR_DisableAHBRAM2_Low_16K_ShutOff
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableAHBRAM2_Low_16K_ShutOff(void)
- {
- CLEAR_BIT(PWR->PMCR, PWR_PMCR_SRAM2_16LSO);
- }
- /**
- * @brief Check if the low 16K AHB RAM2 shut-off in Stop mode is enabled
- * @rmtoll PMCR SRAM2_16LSO LL_PWR_IsEnabledAHBRAM2_Low_16K_ShutOff
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledAHBRAM2_Low_16K_ShutOff(void)
- {
- return ((READ_BIT(PWR->PMCR, PWR_PMCR_SRAM2_16LSO) == (PWR_PMCR_SRAM2_16LSO)) ? 1UL : 0UL);
- }
- #endif /* PWR_PMCR_SRAM2_16LSO */
- #if defined (PWR_PMCR_SRAM2SO)
- /**
- * @brief Enable the AHB RAM2 shut-off in Stop mode
- * @rmtoll PMCR SRAM2SO LL_PWR_EnableAHBRAM2ShutOff
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableAHBRAM2ShutOff(void)
- {
- SET_BIT(PWR->PMCR, PWR_PMCR_SRAM2SO);
- }
- /**
- * @brief Disable the AHB RAM2 shut-off in Stop mode
- * @rmtoll PMCR SRAM2SO LL_PWR_DisableAHBRAM2ShutOff
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableAHBRAM2ShutOff(void)
- {
- CLEAR_BIT(PWR->PMCR, PWR_PMCR_SRAM2SO);
- }
- /**
- * @brief Check if the AHB RAM2 shut-off in Stop mode is enabled
- * @rmtoll PMCR SRAM2SO LL_PWR_IsEnabledAHBRAM2ShutOff
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledAHBRAM2ShutOff(void)
- {
- return ((READ_BIT(PWR->PMCR, PWR_PMCR_SRAM2SO) == (PWR_PMCR_SRAM2SO)) ? 1UL : 0UL);
- }
- #endif /* PWR_PMCR_SRAM2SO */
- #if defined (PWR_PMCR_SRAM3SO)
- /**
- * @brief Enable the AHB RAM3 shut-off in Stop mode
- * @rmtoll PMCR SRAM3SO LL_PWR_EnableAHBRAM3ShutOff
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableAHBRAM3ShutOff(void)
- {
- SET_BIT(PWR->PMCR, PWR_PMCR_SRAM3SO);
- }
- /**
- * @brief Disable the AHB RAM3 shut-off in Stop mode
- * @rmtoll PMCR SRAM3SO LL_PWR_DisableAHBRAM3ShutOff
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableAHBRAM3ShutOff(void)
- {
- CLEAR_BIT(PWR->PMCR, PWR_PMCR_SRAM3SO);
- }
- /**
- * @brief Check if the AHB RAM3 shut-off in Stop mode is enabled
- * @rmtoll PMCR SRAM3SO LL_PWR_IsEnabledAHBRAM3ShutOff
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledAHBRAM3ShutOff(void)
- {
- return ((READ_BIT(PWR->PMCR, PWR_PMCR_SRAM3SO) == (PWR_PMCR_SRAM3SO)) ? 1UL : 0UL);
- }
- #endif /* PWR_PMCR_SRAM3SO */
- #if defined (PWR_PMCR_ETHERNETSO)
- /**
- * @brief Enable the ETHERNET RAM shut-off in Stop mode
- * @rmtoll PMCR ETHERNETSO LL_PWR_EnableETHERNETRAMShutOff
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableETHERNETRAMShutOff(void)
- {
- SET_BIT(PWR->PMCR, PWR_PMCR_ETHERNETSO);
- }
- /**
- * @brief Disable the ETHERNET RAM shut-off in Stop mode
- * @rmtoll PMCR ETHERNETSO LL_PWR_DisableETHERNETRAMShutOff
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableETHERNETRAMShutOff(void)
- {
- CLEAR_BIT(PWR->PMCR, PWR_PMCR_ETHERNETSO);
- }
- /**
- * @brief Check if the ETHERNET RAM shut-off in Stop mode is enabled
- * @rmtoll PMCR ETHERNETSO LL_PWR_IsEnabledETHERNETRAMShutOff
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledETHERNETRAMShutOff(void)
- {
- return ((READ_BIT(PWR->PMCR, PWR_PMCR_ETHERNETSO) == (PWR_PMCR_ETHERNETSO)) ? 1UL : 0UL);
- }
- #endif /* PWR_PMCR_ETHERNETSO */
- /**
- * @brief Set the regulator supply output voltage.
- * @rmtoll VOSCR VOS LL_PWR_SetRegulVoltageScaling
- * @param VoltageScaling This parameter can be one of the following values:
- * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE0
- * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE1
- * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE2
- * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE3
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_SetRegulVoltageScaling(uint32_t VoltageScaling)
- {
- MODIFY_REG(PWR->VOSCR, PWR_VOSCR_VOS, VoltageScaling);
- }
- /**
- * @brief Get the regulator supply output voltage.
- * @rmtoll VOSCR VOS LL_PWR_GetRegulVoltageScaling
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE0
- * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE1
- * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE2
- * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE3
- */
- __STATIC_INLINE uint32_t LL_PWR_GetRegulVoltageScaling(void)
- {
- return (uint32_t)(READ_BIT(PWR->VOSCR, PWR_VOSCR_VOS));
- }
- /**
- * @brief Get currently voltage scaling applied to VCORE.
- * @rmtoll VOSSR ACTVOS[1:0] LL_PWR_GetCurrentVOS
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE0
- * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE1
- * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE2
- * @arg @ref LL_PWR_REGU_VOLTAGE_SCALE3
- */
- __STATIC_INLINE uint32_t LL_PWR_GetCurrentVOS(void)
- {
- return (READ_BIT(PWR->VOSSR, PWR_VOSSR_ACTVOS));
- }
- /**
- * @brief Enable Backup Regulator
- * @rmtoll BDCR BREN LL_PWR_EnableBkUpRegulator
- * @note When set, the Backup Regulator (used to maintain backup SRAM content in Standby and
- * VBAT modes) is enabled. If BRE is reset, the backup Regulator is switched off. The backup
- * SRAM can still be used but its content will be lost in the Standby and VBAT modes. Once set,
- * the application must wait that the Backup Regulator Ready flag (BRR) is set to indicate that
- * the data written into the RAM will be maintained in the Standby and VBAT modes.
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableBkUpRegulator(void)
- {
- SET_BIT(PWR->BDCR, PWR_BDCR_BREN);
- }
- /**
- * @brief Disable Backup Regulator
- * @rmtoll BDCR BREN LL_PWR_DisableBkUpRegulator
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableBkUpRegulator(void)
- {
- CLEAR_BIT(PWR->BDCR, PWR_BDCR_BREN);
- }
- /**
- * @brief Check if the backup Regulator is enabled
- * @rmtoll BDCR BREN LL_PWR_IsEnabledBkUpRegulator
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledBkUpRegulator(void)
- {
- return ((READ_BIT(PWR->BDCR, PWR_BDCR_BREN) == (PWR_BDCR_BREN)) ? 1UL : 0UL);
- }
- /**
- * @brief Enable VBAT and Temperature monitoring
- * @rmtoll BDCR MONEN LL_PWR_EnableMonitoring
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableMonitoring(void)
- {
- SET_BIT(PWR->BDCR, PWR_BDCR_MONEN);
- }
- /**
- * @brief Disable VBAT and Temperature monitoring
- * @rmtoll BDCR MONEN LL_PWR_DisableMonitoring
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableMonitoring(void)
- {
- CLEAR_BIT(PWR->BDCR, PWR_BDCR_MONEN);
- }
- /**
- * @brief Check if the VBAT and Temperature monitoring is enabled
- * @rmtoll BDCR MONEN LL_PWR_IsEnabledMonitoring
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledMonitoring(void)
- {
- return ((READ_BIT(PWR->BDCR, PWR_BDCR_MONEN) == (PWR_BDCR_MONEN)) ? 1UL : 0UL);
- }
- /**
- * @brief Enable battery charging
- * @rmtoll BDCR VBE LL_PWR_EnableBatteryCharging
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableBatteryCharging(void)
- {
- SET_BIT(PWR->BDCR, PWR_BDCR_VBE);
- }
- /**
- * @brief Disable battery charging
- * @rmtoll BDCR VBE LL_PWR_DisableBatteryCharging
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableBatteryCharging(void)
- {
- CLEAR_BIT(PWR->BDCR, PWR_BDCR_VBE);
- }
- /**
- * @brief Check if battery charging is enabled
- * @rmtoll BDCR VBE LL_PWR_IsEnabledBatteryCharging
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledBatteryCharging(void)
- {
- return ((READ_BIT(PWR->BDCR, PWR_BDCR_VBE) == (PWR_BDCR_VBE)) ? 1UL : 0UL);
- }
- /**
- * @brief Set the Battery charge resistor impedance
- * @rmtoll BDCR VBRS LL_PWR_SetBattChargResistor
- * @param Resistor This parameter can be one of the following values:
- * @arg @ref LL_PWR_BATT_CHARG_RESISTOR_5K
- * @arg @ref LL_PWR_BATT_CHARG_RESISTOR_1_5K
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_SetBattChargResistor(uint32_t Resistor)
- {
- MODIFY_REG(PWR->BDCR, PWR_BDCR_VBRS, Resistor);
- }
- /**
- * @brief Get the Battery charge resistor impedance
- * @rmtoll BDCR VBRS LL_PWR_GetBattChargResistor
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_PWR_BATT_CHARG_RESISTOR_5K
- * @arg @ref LL_PWR_BATT_CHARG_RESISTOR_1_5K
- */
- __STATIC_INLINE uint32_t LL_PWR_GetBattChargResistor(void)
- {
- return (uint32_t)(READ_BIT(PWR->BDCR, PWR_BDCR_VBRS));
- }
- /**
- * @brief Enable access to the backup domain
- * @rmtoll DBPCR DBP LL_PWR_EnableBkUpAccess
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableBkUpAccess(void)
- {
- SET_BIT(PWR->DBPCR, PWR_DBPCR_DBP);
- }
- /**
- * @brief Disable access to the backup domain
- * @rmtoll DBPCR DBP LL_PWR_DisableBkUpAccess
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableBkUpAccess(void)
- {
- CLEAR_BIT(PWR->DBPCR, PWR_DBPCR_DBP);
- }
- /**
- * @brief Check if the backup domain is enabled
- * @rmtoll DBPCR DBP LL_PWR_IsEnabledBkUpAccess
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledBkUpAccess(void)
- {
- return ((READ_BIT(PWR->DBPCR, PWR_DBPCR_DBP) == (PWR_DBPCR_DBP)) ? 1UL : 0UL);
- }
- #if defined (PWR_UCPDR_UCPD_STBY)
- /**
- * @brief Enable the USB type-C and power delivery memorization in Standby
- * mode.
- * @note This function must be called just before entering Standby mode.
- * @rmtoll UCPDR UCPD_STDBY LL_PWR_EnableUCPDStandbyMode
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableUCPDStandbyMode(void)
- {
- SET_BIT(PWR->UCPDR, PWR_UCPDR_UCPD_STBY);
- }
- /**
- * @brief Disable the USB type-C and power delivery memorization in Standby
- * mode.
- * @note This function must be called after exiting Standby mode and before
- * any UCPD configuration update.
- * @rmtoll UCPDR UCPD_STDBY LL_PWR_DisableUCPDStandbyMode
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableUCPDStandbyMode(void)
- {
- CLEAR_BIT(PWR->UCPDR, PWR_UCPDR_UCPD_STBY);
- }
- /**
- * @brief Check if the USB Type-C and Power Delivery Standby mode memorization
- * is enabled.
- * @rmtoll UCPDR UCPD_STDBY LL_PWR_IsEnabledUCPDStandbyMode
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledUCPDStandbyMode(void)
- {
- return ((READ_BIT(PWR->UCPDR, PWR_UCPDR_UCPD_STBY) == (PWR_UCPDR_UCPD_STBY)) ? 1UL : 0UL);
- }
- #endif /* PWR_UCPDR_UCPD_STBY */
- #if defined (PWR_UCPDR_UCPD_DBDIS)
- /**
- * @brief Enable the USB Type-C and power delivery dead battery pull-down behavior
- * on UCPD CC1 and CC2 pins.
- * @note After exiting reset, the USB Type-C dead battery behavior is enabled,
- * which may have a pull-down effect on CC1 and CC2 pins. It is recommended
- * to disable it in all cases, either to stop this pull-down or to hand over
- * control to the UCPD (which should therefore be initialized before doing the disable).
- * @rmtoll UCPDR UCPD_DBDIS LL_PWR_EnableUCPDDeadBattery
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableUCPDDeadBattery(void)
- {
- CLEAR_BIT(PWR->UCPDR, PWR_UCPDR_UCPD_DBDIS);
- }
- /**
- * @brief Disable the USB Type-C and power delivery dead battery pull-down behavior
- * on UCPD CC1 and CC2 pins.
- * @note After exiting reset, the USB Type-C dead battery behavior is enabled,
- * which may have a pull-down effect on CC1 and CC2 pins. It is recommended
- * to disable it in all cases, either to stop this pull-down or to hand over
- * control to the UCPD (which should therefore be initialized before doing the disable).
- * @rmtoll UCPDR UCPD_DBDIS LL_PWR_DisableUCPDDeadBattery
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableUCPDDeadBattery(void)
- {
- SET_BIT(PWR->UCPDR, PWR_UCPDR_UCPD_DBDIS);
- }
- /**
- * @brief Check the USB Type-C and power delivery dead battery pull-down behavior
- * on UCPD CC1 and CC2 pins.
- * @note After exiting reset, the USB Type-C dead battery behavior is enabled,
- * which may have a pull-down effect on CC1 and CC2 pins. It is recommended
- * to disable it in all cases, either to stop this pull-down or to hand over
- * control to the UCPD (which should therefore be initialized before doing the disable).
- * @rmtoll UCPDR UCPD_DBDIS LL_PWR_IsEnabledUCPDDeadBattery
- * @retval State of feature (1 : enabled; 0 : disabled).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledUCPDDeadBattery(void)
- {
- return ((READ_BIT(PWR->UCPDR, PWR_UCPDR_UCPD_DBDIS) == (PWR_UCPDR_UCPD_DBDIS)) ? 0UL : 1UL);
- }
- #endif /* PWR_UCPDR_UCPD_DBDIS */
- /**
- * @brief Configure the PWR supply
- * @rmtoll SCCR BYPASS LL_PWR_ConfigSupply
- * @param SupplySource This parameter can be one of the following values:
- * @arg @ref LL_PWR_EXTERNAL_SOURCE_SUPPLY
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_ConfigSupply(uint32_t SupplySource)
- {
- /* Set the power supply configuration */
- MODIFY_REG(PWR->SCCR, (PWR_SCCR_BYPASS), SupplySource);
- }
- /**
- * @brief Get the PWR supply
- * @rmtoll SCCR BYPASS LL_PWR_GetSupply
- * @retval The supply configuration.
- */
- __STATIC_INLINE uint32_t LL_PWR_GetSupply(void)
- {
- #if defined (PWR_SCCR_SMPSEN)
- /* Get the power supply configuration */
- return (uint32_t)(READ_BIT(PWR->SCCR, (PWR_SCCR_SMPSEN | PWR_SCCR_LDOEN | PWR_SCCR_BYPASS)));
- #else
- /* Get the power supply configuration */
- return (uint32_t)(READ_BIT(PWR->SCCR, (PWR_SCCR_LDOEN | PWR_SCCR_BYPASS)));
- #endif /* PWR_SCCR_SMPSEN */
- }
- /**
- * @brief Enable Power Voltage Detector
- * @rmtoll VMCR PVDEN LL_PWR_EnablePVD
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnablePVD(void)
- {
- SET_BIT(PWR->VMCR, PWR_VMCR_PVDEN);
- }
- /**
- * @brief Disable Power Voltage Detector
- * @rmtoll VMCR PVDEN LL_PWR_DisablePVD
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisablePVD(void)
- {
- CLEAR_BIT(PWR->VMCR, PWR_VMCR_PVDEN);
- }
- /**
- * @brief Check if Power Voltage Detector is enabled
- * @rmtoll VMCR PVDEN LL_PWR_IsEnabledPVD
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledPVD(void)
- {
- return ((READ_BIT(PWR->VMCR, PWR_VMCR_PVDEN) == (PWR_VMCR_PVDEN)) ? 1UL : 0UL);
- }
- /**
- * @brief Configure the voltage threshold detected by the Power Voltage Detector
- * @rmtoll VMCR PLS LL_PWR_SetPVDLevel
- * @param PVDLevel This parameter can be one of the following values:
- * @arg @ref LL_PWR_PVDLEVEL_0
- * @arg @ref LL_PWR_PVDLEVEL_1
- * @arg @ref LL_PWR_PVDLEVEL_2
- * @arg @ref LL_PWR_PVDLEVEL_3
- * @arg @ref LL_PWR_PVDLEVEL_4
- * @arg @ref LL_PWR_PVDLEVEL_5
- * @arg @ref LL_PWR_PVDLEVEL_6
- * @arg @ref LL_PWR_PVDLEVEL_7
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_SetPVDLevel(uint32_t PVDLevel)
- {
- MODIFY_REG(PWR->VMCR, PWR_VMCR_PLS, PVDLevel);
- }
- /**
- * @brief Get the voltage threshold detection
- * @rmtoll VMCR PLS LL_PWR_GetPVDLevel
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_PWR_PVDLEVEL_0
- * @arg @ref LL_PWR_PVDLEVEL_1
- * @arg @ref LL_PWR_PVDLEVEL_2
- * @arg @ref LL_PWR_PVDLEVEL_3
- * @arg @ref LL_PWR_PVDLEVEL_4
- * @arg @ref LL_PWR_PVDLEVEL_5
- * @arg @ref LL_PWR_PVDLEVEL_6
- * @arg @ref LL_PWR_PVDLEVEL_7
- */
- __STATIC_INLINE uint32_t LL_PWR_GetPVDLevel(void)
- {
- return (uint32_t)(READ_BIT(PWR->VMCR, PWR_VMCR_PLS));
- }
- /**
- * @brief Enable Analog Power Voltage Detector
- * @rmtoll VMCR AVDEN LL_PWR_EnableAVD
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableAVD(void)
- {
- SET_BIT(PWR->VMCR, PWR_VMCR_AVDEN);
- }
- /**
- * @brief Disable Analog Power Voltage Detector
- * @rmtoll VMCR AVDEN LL_PWR_DisableAVD
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableAVD(void)
- {
- CLEAR_BIT(PWR->VMCR, PWR_VMCR_AVDEN);
- }
- /**
- * @brief Check if Analog Power Voltage Detector is enabled
- * @rmtoll VMCR AVDEN LL_PWR_IsEnabledAVD
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledAVD(void)
- {
- return ((READ_BIT(PWR->VMCR, PWR_VMCR_AVDEN) == (PWR_VMCR_AVDEN)) ? 1UL : 0UL);
- }
- /**
- * @brief Configure the voltage threshold to be detected by the Analog Power Voltage Detector
- * @rmtoll VMCR ALS LL_PWR_SetAVDLevel
- * @param AVDLevel This parameter can be one of the following values:
- * @arg @ref LL_PWR_AVDLEVEL_0
- * @arg @ref LL_PWR_AVDLEVEL_1
- * @arg @ref LL_PWR_AVDLEVEL_2
- * @arg @ref LL_PWR_AVDLEVEL_3
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_SetAVDLevel(uint32_t AVDLevel)
- {
- MODIFY_REG(PWR->VMCR, PWR_VMCR_ALS, AVDLevel);
- }
- /**
- * @brief Get the Analog Voltage threshold to be detected by the Analog Power Voltage Detector
- * @rmtoll CR1 ALS LL_PWR_GetAVDLevel
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_PWR_AVDLEVEL_0
- * @arg @ref LL_PWR_AVDLEVEL_1
- * @arg @ref LL_PWR_AVDLEVEL_2
- * @arg @ref LL_PWR_AVDLEVEL_3
- */
- __STATIC_INLINE uint32_t LL_PWR_GetAVDLevel(void)
- {
- return (uint32_t)(READ_BIT(PWR->VMCR, PWR_VMCR_ALS));
- }
- #if defined (PWR_USBSCR_USB33DEN)
- /**
- * @brief Enable the USB voltage detector
- * @rmtoll USBSCR USB33DEN LL_PWR_EnableUSBVoltageDetector
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableUSBVoltageDetector(void)
- {
- SET_BIT(PWR->USBSCR, PWR_USBSCR_USB33DEN);
- }
- /**
- * @brief Disable the USB voltage detector
- * @rmtoll USBSCR USB33DEN LL_PWR_DisableUSBVoltageDetector
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableUSBVoltageDetector(void)
- {
- CLEAR_BIT(PWR->USBSCR, PWR_USBSCR_USB33DEN);
- }
- /**
- * @brief Check if the USB voltage detector is enabled
- * @rmtoll USBSCR USB33DEN LL_PWR_IsEnabledUSBVoltageDetector
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledUSBVoltageDetector(void)
- {
- return ((READ_BIT(PWR->USBSCR, PWR_USBSCR_USB33DEN) == (PWR_USBSCR_USB33DEN)) ? 1UL : 0UL);
- }
- /**
- * @brief Enable the independent USB supply.
- * @rmtoll USBSCR USB33SV LL_PWR_EnableVddUSB
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableVddUSB(void)
- {
- SET_BIT(PWR->USBSCR, PWR_USBSCR_USB33SV);
- }
- #define LL_PWR_EnableVDDUSB LL_PWR_EnableVddUSB /* for API backward compatibility */
- /**
- * @brief Disable the independent USB supply.
- * @rmtoll USBSCR USB33SV LL_PWR_DisableVddUSB
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableVddUSB(void)
- {
- CLEAR_BIT(PWR->USBSCR, PWR_USBSCR_USB33SV);
- }
- #define LL_PWR_DisableVDDUSB LL_PWR_DisableVddUSB /* for API backward compatibility */
- /**
- * @brief Check if the independent USB supply is enabled.
- * @rmtoll USBSCR USB33SV LL_PWR_IsEnabledVddUSB
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledVddUSB(void)
- {
- return ((READ_BIT(PWR->USBSCR, PWR_USBSCR_USB33SV) == (PWR_USBSCR_USB33SV)) ? 1UL : 0UL);
- }
- #define LL_PWR_IsEnabledVDDUSB LL_PWR_IsEnabledVddUSB /* for API backward compatibility */
- #endif /* PWR_USBSCR_USB33DEN */
- /**
- * @brief Enable the wake up pin_x.
- * @rmtoll WUCR WUPENx LL_PWR_EnableWakeUpPin
- * @param WakeUpPin This parameter can be a combination of the following values:
- * @arg @ref LL_PWR_WAKEUP_PIN1
- * @arg @ref LL_PWR_WAKEUP_PIN2
- * @arg @ref LL_PWR_WAKEUP_PIN3
- * @arg @ref LL_PWR_WAKEUP_PIN4
- * @arg @ref LL_PWR_WAKEUP_PIN5
- * @arg @ref LL_PWR_WAKEUP_PIN6
- * @arg @ref LL_PWR_WAKEUP_PIN7
- * @arg @ref LL_PWR_WAKEUP_PIN8
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableWakeUpPin(uint32_t WakeUpPin)
- {
- SET_BIT(PWR->WUCR, WakeUpPin);
- }
- /**
- * @brief Disable the wake up pin_x.
- * @rmtoll WUCR WUPENx LL_PWR_DisableWakeUpPin
- * @param WakeUpPin This parameter can be a combination of the following values:
- * @arg @ref LL_PWR_WAKEUP_PIN1
- * @arg @ref LL_PWR_WAKEUP_PIN2
- * @arg @ref LL_PWR_WAKEUP_PIN3
- * @arg @ref LL_PWR_WAKEUP_PIN4
- * @arg @ref LL_PWR_WAKEUP_PIN5
- * @arg @ref LL_PWR_WAKEUP_PIN6
- * @arg @ref LL_PWR_WAKEUP_PIN7
- * @arg @ref LL_PWR_WAKEUP_PIN8
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableWakeUpPin(uint32_t WakeUpPin)
- {
- CLEAR_BIT(PWR->WUCR, WakeUpPin);
- }
- /**
- * @brief Check if the wake up pin_x is enabled.
- * @rmtoll WUCR WUPPx LL_PWR_IsEnabledWakeUpPin
- * @param WakeUpPin This parameter can be one of the following values:
- * @arg @ref LL_PWR_WAKEUP_PIN1
- * @arg @ref LL_PWR_WAKEUP_PIN2
- * @arg @ref LL_PWR_WAKEUP_PIN3
- * @arg @ref LL_PWR_WAKEUP_PIN4
- * @arg @ref LL_PWR_WAKEUP_PIN5
- * @arg @ref LL_PWR_WAKEUP_PIN6
- * @arg @ref LL_PWR_WAKEUP_PIN7
- * @arg @ref LL_PWR_WAKEUP_PIN8
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledWakeUpPin(uint32_t WakeUpPin)
- {
- return ((READ_BIT(PWR->WUCR, WakeUpPin) == (WakeUpPin)) ? 1UL : 0UL);
- }
- /**
- * @brief Set the Wake-Up pin polarity low for the event detection
- * @rmtoll WUCR WKUPP1 LL_PWR_SetWakeUpPinPolarityLow\n
- * WUCR WKUPP2 LL_PWR_SetWakeUpPinPolarityLow\n
- * WUCR WKUPP3 LL_PWR_SetWakeUpPinPolarityLow\n
- * WUCR WKUPP4 LL_PWR_SetWakeUpPinPolarityLow\n
- * WUCR WKUPP5 LL_PWR_SetWakeUpPinPolarityLow\n
- * WUCR WKUPP6 LL_PWR_SetWakeUpPinPolarityLow\n
- * WUCR WKUPP7 LL_PWR_SetWakeUpPinPolarityLow\n
- * WUCR WKUPP8 LL_PWR_SetWakeUpPinPolarityLow
- * @param WakeUpPin This parameter can be one of the following values:
- * @arg @ref LL_PWR_WAKEUP_PIN1
- * @arg @ref LL_PWR_WAKEUP_PIN2
- * @arg @ref LL_PWR_WAKEUP_PIN3
- * @arg @ref LL_PWR_WAKEUP_PIN4
- * @arg @ref LL_PWR_WAKEUP_PIN5
- * @arg @ref LL_PWR_WAKEUP_PIN6
- * @arg @ref LL_PWR_WAKEUP_PIN7
- * @arg @ref LL_PWR_WAKEUP_PIN8
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_SetWakeUpPinPolarityLow(uint32_t WakeUpPin)
- {
- SET_BIT(PWR->WUCR, (WakeUpPin << PWR_WUCR_WUPP1_Pos));
- }
- /**
- * @brief Set the Wake-Up pin polarity high for the event detection
- * @rmtoll WUCR WKUPP1 LL_PWR_SetWakeUpPinPolarityHigh\n
- * WUCR WKUPP2 LL_PWR_SetWakeUpPinPolarityHigh\n
- * WUCR WKUPP3 LL_PWR_SetWakeUpPinPolarityHigh\n
- * WUCR WKUPP4 LL_PWR_SetWakeUpPinPolarityHigh\n
- * WUCR WKUPP5 LL_PWR_SetWakeUpPinPolarityHigh\n
- * WUCR WKUPP6 LL_PWR_SetWakeUpPinPolarityHigh\n
- * WUCR WKUPP7 LL_PWR_SetWakeUpPinPolarityHigh\n
- * WUCR WKUPP8 LL_PWR_SetWakeUpPinPolarityHigh
- * @param WakeUpPin This parameter can be one of the following values:
- * @arg @ref LL_PWR_WAKEUP_PIN1
- * @arg @ref LL_PWR_WAKEUP_PIN2
- * @arg @ref LL_PWR_WAKEUP_PIN3
- * @arg @ref LL_PWR_WAKEUP_PIN4
- * @arg @ref LL_PWR_WAKEUP_PIN5
- * @arg @ref LL_PWR_WAKEUP_PIN6
- * @arg @ref LL_PWR_WAKEUP_PIN7
- * @arg @ref LL_PWR_WAKEUP_PIN8
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_SetWakeUpPinPolarityHigh(uint32_t WakeUpPin)
- {
- CLEAR_BIT(PWR->WUCR, (WakeUpPin << PWR_WUCR_WUPP1_Pos));
- }
- /**
- * @brief Get the Wake-Up pin polarity for the event detection
- * @rmtoll WUCR WUPP1 LL_PWR_SetWakeUpPinPolarityLow\n
- * WUCR WUPP2 LL_PWR_SetWakeUpPinPolarityLow\n
- * WUCR WUPP3 LL_PWR_SetWakeUpPinPolarityLow\n
- * WUCR WUPP4 LL_PWR_SetWakeUpPinPolarityLow\n
- * WUCR WUPP5 LL_PWR_SetWakeUpPinPolarityLow\n
- * WUCR WUPP6 LL_PWR_SetWakeUpPinPolarityLow\n
- * WUCR WUPP7 LL_PWR_SetWakeUpPinPolarityLow\n
- * WUCR WUPP8 LL_PWR_SetWakeUpPinPolarityLow
- * @param WakeUpPin This parameter can be one of the following values:
- * @arg @ref LL_PWR_WAKEUP_PIN1
- * @arg @ref LL_PWR_WAKEUP_PIN2
- * @arg @ref LL_PWR_WAKEUP_PIN3
- * @arg @ref LL_PWR_WAKEUP_PIN4
- * @arg @ref LL_PWR_WAKEUP_PIN5
- * @arg @ref LL_PWR_WAKEUP_PIN6
- * @arg @ref LL_PWR_WAKEUP_PIN7
- * @arg @ref LL_PWR_WAKEUP_PIN8
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsWakeUpPinPolarityLow(uint32_t WakeUpPin)
- {
- return ((READ_BIT(PWR->WUCR, (WakeUpPin << PWR_WUCR_WUPP1_Pos)) == (WakeUpPin << PWR_WUCR_WUPP1_Pos)) ? 1UL : 0UL);
- }
- /**
- * @brief Set the Wake-Up pin Pull None
- * @rmtoll WUCR WUPPUPD1 LL_PWR_SetWakeUpPinPullNone\n
- * WUCR WUPPUPD2 LL_PWR_SetWakeUpPinPullNone\n
- * WUCR WUPPUPD3 LL_PWR_SetWakeUpPinPullNone\n
- * WUCR WUPPUPD4 LL_PWR_SetWakeUpPinPullNone\n
- * WUCR WUPPUPD5 LL_PWR_SetWakeUpPinPullNone\n
- * WUCR WUPPUPD6 LL_PWR_SetWakeUpPinPullNone\n
- * WUCR WUPPUPD7 LL_PWR_SetWakeUpPinPullNone\n
- * WUCR WUPPUPD8 LL_PWR_SetWakeUpPinPullNone
- * @param WakeUpPin This parameter can be one of the following values:
- * @arg @ref LL_PWR_WAKEUP_PIN1
- * @arg @ref LL_PWR_WAKEUP_PIN2
- * @arg @ref LL_PWR_WAKEUP_PIN3
- * @arg @ref LL_PWR_WAKEUP_PIN4
- * @arg @ref LL_PWR_WAKEUP_PIN5
- * @arg @ref LL_PWR_WAKEUP_PIN6
- * @arg @ref LL_PWR_WAKEUP_PIN7
- * @arg @ref LL_PWR_WAKEUP_PIN8
- *
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_SetWakeUpPinPullNone(uint32_t WakeUpPin)
- {
- MODIFY_REG(PWR->WUCR,
- (PWR_WUCR_WUPPUPD1 << ((LL_PWR_WAKEUP_PINS_PULL_SHIFT_OFFSET * (POSITION_VAL(WakeUpPin) & 0xFU)) & \
- LL_PWR_WAKEUP_PINS_MAX_SHIFT_MASK)),
- (LL_PWR_WAKEUP_PIN_NOPULL << ((PWR_WUCR_WUPPUPD1_Pos + ((LL_PWR_WAKEUP_PINS_PULL_SHIFT_OFFSET * \
- POSITION_VAL(WakeUpPin)) & 0xFU)) & \
- LL_PWR_WAKEUP_PINS_MAX_SHIFT_MASK)));
- }
- /**
- * @brief Set the Wake-Up pin Pull Up
- * @rmtoll WUCR WUPPUPD1 LL_PWR_SetWakeUpPinPullUp\n
- * WUCR WUPPUPD2 LL_PWR_SetWakeUpPinPullUp\n
- * WUCR WUPPUPD3 LL_PWR_SetWakeUpPinPullUp\n
- * WUCR WUPPUPD4 LL_PWR_SetWakeUpPinPullUp\n
- * WUCR WUPPUPD5 LL_PWR_SetWakeUpPinPullUp\n
- * WUCR WUPPUPD6 LL_PWR_SetWakeUpPinPullUp\n
- * WUCR WUPPUPD7 LL_PWR_SetWakeUpPinPullUp\n
- * WUCR WUPPUPD8 LL_PWR_SetWakeUpPinPullUp
- * @param WakeUpPin This parameter can be one of the following values:
- * @arg @ref LL_PWR_WAKEUP_PIN1
- * @arg @ref LL_PWR_WAKEUP_PIN2
- * @arg @ref LL_PWR_WAKEUP_PIN3
- * @arg @ref LL_PWR_WAKEUP_PIN4
- * @arg @ref LL_PWR_WAKEUP_PIN5
- * @arg @ref LL_PWR_WAKEUP_PIN6
- * @arg @ref LL_PWR_WAKEUP_PIN7
- * @arg @ref LL_PWR_WAKEUP_PIN8
- *
- *
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_SetWakeUpPinPullUp(uint32_t WakeUpPin)
- {
- MODIFY_REG(PWR->WUCR,
- (PWR_WUCR_WUPPUPD1 << ((LL_PWR_WAKEUP_PINS_PULL_SHIFT_OFFSET * (POSITION_VAL(WakeUpPin) & 0xFU)) & \
- LL_PWR_WAKEUP_PINS_MAX_SHIFT_MASK)),
- (LL_PWR_WAKEUP_PIN_PULLUP << ((PWR_WUCR_WUPPUPD1_Pos + ((LL_PWR_WAKEUP_PINS_PULL_SHIFT_OFFSET * \
- POSITION_VAL(WakeUpPin)) & 0xFU)) & \
- LL_PWR_WAKEUP_PINS_MAX_SHIFT_MASK)));
- }
- /**
- * @brief Set the Wake-Up pin Pull Down
- * @rmtoll WUCR WUPPUPD1 LL_PWR_SetWakeUpPinPullDown\n
- * WUCR WUPPUPD2 LL_PWR_SetWakeUpPinPullDown\n
- * WUCR WUPPUPD3 LL_PWR_SetWakeUpPinPullDown\n
- * WUCR WUPPUPD4 LL_PWR_SetWakeUpPinPullDown\n
- * WUCR WUPPUPD5 LL_PWR_SetWakeUpPinPullDown\n
- * WUCR WUPPUPD6 LL_PWR_SetWakeUpPinPullDown\n
- * WUCR WUPPUPD7 LL_PWR_SetWakeUpPinPullDown\n
- * WUCR WUPPUPD8 LL_PWR_SetWakeUpPinPullDown
- * @param WakeUpPin This parameter can be one of the following values:
- * @arg @ref LL_PWR_WAKEUP_PIN1
- * @arg @ref LL_PWR_WAKEUP_PIN2
- * @arg @ref LL_PWR_WAKEUP_PIN3
- * @arg @ref LL_PWR_WAKEUP_PIN4
- * @arg @ref LL_PWR_WAKEUP_PIN5
- * @arg @ref LL_PWR_WAKEUP_PIN6
- * @arg @ref LL_PWR_WAKEUP_PIN7
- * @arg @ref LL_PWR_WAKEUP_PIN8
- *
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_SetWakeUpPinPullDown(uint32_t WakeUpPin)
- {
- MODIFY_REG(PWR->WUCR,
- (PWR_WUCR_WUPPUPD1 << ((LL_PWR_WAKEUP_PINS_PULL_SHIFT_OFFSET * (POSITION_VAL(WakeUpPin) & 0xFU)) & \
- LL_PWR_WAKEUP_PINS_MAX_SHIFT_MASK)),
- (LL_PWR_WAKEUP_PIN_PULLDOWN << ((PWR_WUCR_WUPPUPD1_Pos + ((LL_PWR_WAKEUP_PINS_PULL_SHIFT_OFFSET * \
- POSITION_VAL(WakeUpPin)) & 0xFU)) & \
- LL_PWR_WAKEUP_PINS_MAX_SHIFT_MASK)));
- }
- /**
- * @brief Get the Wake-Up pin pull
- * @rmtoll WUCR WUPPUPD1 LL_PWR_GetWakeUpPinPull\n
- * WUCR WUPPUPD2 LL_PWR_GetWakeUpPinPull\n
- * WUCR WUPPUPD3 LL_PWR_GetWakeUpPinPull\n
- * WUCR WUPPUPD4 LL_PWR_GetWakeUpPinPull\n
- * WUCR WUPPUPD5 LL_PWR_GetWakeUpPinPull\n
- * WUCR WUPPUPD7 LL_PWR_GetWakeUpPinPull\n
- * WUCR WUPPUPD7 LL_PWR_GetWakeUpPinPull\n
- * WUCR WUPPUPD8 LL_PWR_GetWakeUpPinPull
- * @param WakeUpPin This parameter can be one of the following values:
- * @arg @ref LL_PWR_WAKEUP_PIN1
- * @arg @ref LL_PWR_WAKEUP_PIN2
- * @arg @ref LL_PWR_WAKEUP_PIN3
- * @arg @ref LL_PWR_WAKEUP_PIN4
- * @arg @ref LL_PWR_WAKEUP_PIN5
- * @arg @ref LL_PWR_WAKEUP_PIN6
- * @arg @ref LL_PWR_WAKEUP_PIN7
- * @arg @ref LL_PWR_WAKEUP_PIN8
- *
- * @retval Returned value can be one of the following values:
- * @arg @ref LL_PWR_WAKEUP_PIN_NOPULL
- * @arg @ref LL_PWR_WAKEUP_PIN_PULLUP
- * @arg @ref LL_PWR_WAKEUP_PIN_PULLDOWN
- */
- __STATIC_INLINE uint32_t LL_PWR_GetWakeUpPinPull(uint32_t WakeUpPin)
- {
- uint32_t regValue = READ_BIT(PWR->WUCR, (PWR_WUCR_WUPPUPD1 << ((LL_PWR_WAKEUP_PINS_PULL_SHIFT_OFFSET * \
- (POSITION_VAL(WakeUpPin) & 0xFU)) & \
- LL_PWR_WAKEUP_PINS_MAX_SHIFT_MASK)));
- return (uint32_t)(regValue >> ((PWR_WUCR_WUPPUPD1_Pos + ((LL_PWR_WAKEUP_PINS_PULL_SHIFT_OFFSET * \
- POSITION_VAL(WakeUpPin)) & 0xFU)) & \
- LL_PWR_WAKEUP_PINS_MAX_SHIFT_MASK));
- }
- /**
- * @brief Enable IO Retention
- * @rmtoll IORETR IORETEN LL_PWR_EnableIORetention
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableIORetention(void)
- {
- SET_BIT(PWR->IORETR, PWR_IORETR_IORETEN);
- }
- /**
- * @brief Disable IO Retention
- * @rmtoll IORETR IORETEN LL_PWR_DisableIORetention
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableIORetention(void)
- {
- CLEAR_BIT(PWR->IORETR, PWR_IORETR_IORETEN);
- }
- /**
- * @brief Check if IO Retention is enabled
- * @rmtoll IORETR IORETEN LL_PWR_IsEnabledIORetention
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledIORetention(void)
- {
- return ((READ_BIT(PWR->IORETR, PWR_IORETR_IORETEN) == (PWR_IORETR_IORETEN)) ? 1UL : 0UL);
- }
- /**
- * @brief Enable JTAGIO Retention
- * @rmtoll JTAGIORETR JTAGIORETEN LL_PWR_EnableJTAGIORetention
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableJTAGIORetention(void)
- {
- SET_BIT(PWR->IORETR, PWR_IORETR_JTAGIORETEN);
- }
- /**
- * @brief Disable JTAGIO Retention
- * @rmtoll JTAGIORETR JTAGIORETEN LL_PWR_DisableJTAGIORetention
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableJTAGIORetention(void)
- {
- CLEAR_BIT(PWR->IORETR, PWR_IORETR_JTAGIORETEN);
- }
- /**
- * @brief Check if JTAGIO Retention is enabled
- * @rmtoll IORETR JTAGIORETEN LL_PWR_IsEnabledJTAGIORetention
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledJTAGIORetention(void)
- {
- return ((READ_BIT(PWR->IORETR, PWR_IORETR_JTAGIORETEN) == (PWR_IORETR_JTAGIORETEN)) ? 1UL : 0UL);
- }
- /**
- * @}
- */
- /** @defgroup PWR_LL_EF_FLAG_MANAGEMENT PWR FLAG Management
- * @{
- */
- /**
- * @brief Indicate whether the regulator voltage output is above voltage
- * scaling range or not.
- * @rmtoll VOSSR VOSRDY LL_PWR_IsActiveFlag_VOS
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_VOS(void)
- {
- return ((READ_BIT(PWR->VOSSR, PWR_VOSSR_VOSRDY) == (PWR_VOSSR_VOSRDY)) ? 1UL : 0UL);
- }
- /**
- * @brief Indicate whether the system was in standby mode or not.
- * @rmtoll PMSR SBF LL_PWR_IsActiveFlag_SB
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_SB(void)
- {
- return ((READ_BIT(PWR->PMSR, PWR_PMSR_SBF) == (PWR_PMSR_SBF)) ? 1UL : 0UL);
- }
- /**
- * @brief Indicate whether the system was in stop mode or not.
- * @rmtoll PMSR STOPF LL_PWR_IsActiveFlag_STOP
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_STOP(void)
- {
- return ((READ_BIT(PWR->PMSR, PWR_PMSR_STOPF) == (PWR_PMSR_STOPF)) ? 1UL : 0UL);
- }
- /**
- * @brief Indicate whether the VDD voltage is below the threshold or not.
- * @rmtoll VMSR PVDO LL_PWR_IsActiveFlag_PVDO
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_PVDO(void)
- {
- return ((READ_BIT(PWR->VMSR, PWR_VMSR_PVDO) == (PWR_VMSR_PVDO)) ? 1UL : 0UL);
- }
- /**
- * @brief Indicate whether the VDDA voltage is below the threshold or not.
- * @rmtoll VMSR AVDO LL_PWR_IsActiveFlag_AVDO
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_AVDO(void)
- {
- return ((READ_BIT(PWR->VMSR, PWR_VMSR_AVDO) == (PWR_VMSR_AVDO)) ? 1UL : 0UL);
- }
- /**
- * @brief Indicate whether the regulator voltage output is equal to current
- * used voltage scaling range or not.
- * @rmtoll VOSSR ACTVOSRDY LL_PWR_IsActiveFlag_ACTVOS
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_ACTVOS(void)
- {
- return ((READ_BIT(PWR->VOSSR, PWR_VOSSR_ACTVOSRDY) == (PWR_VOSSR_ACTVOSRDY)) ? 1UL : 0UL);
- }
- #if defined (PWR_VMSR_USB33RDY)
- /**
- * @brief Indicate whether the VDDUSB is below the threshold of monitor or not.
- * @rmtoll VMSR USB33RDY LL_PWR_IsActiveFlag_VDDUSB
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_VDDUSB(void)
- {
- return ((READ_BIT(PWR->VMSR, PWR_VMSR_USB33RDY) == (PWR_VMSR_USB33RDY)) ? 1UL : 0UL);
- }
- #endif /* PWR_VMSR_USB33RDY */
- /**
- * @brief Indicate whether VDDMMC voltage is below 1V2
- * @rmtoll VMSR VDDIO2RDY LL_PWR_IsActiveFlag_VDDIO2
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_VDDIO2(void)
- {
- return ((READ_BIT(PWR->VMCR, PWR_VMSR_VDDIO2RDY) == (PWR_VMSR_VDDIO2RDY)) ? 1UL : 0UL);
- }
- /**
- * @brief Get Backup Regulator ready Flag
- * @rmtoll BDSR BRRDY LL_PWR_IsActiveFlag_BRR
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_BRR(void)
- {
- return ((READ_BIT(PWR->BDSR, PWR_BDSR_BRRDY) == (PWR_BDSR_BRRDY)) ? 1UL : 0UL);
- }
- /**
- * @brief Indicate whether the VBAT level is below high threshold or not.
- * @rmtoll BDSR VBATL LL_PWR_IsActiveFlag_VBATL
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_VBATL(void)
- {
- return ((READ_BIT(PWR->BDSR, PWR_BDSR_VBATL) == (PWR_BDSR_VBATL)) ? 1UL : 0UL);
- }
- /**
- * @brief Indicate whether the VBAT level is below high threshold or not.
- * @rmtoll BDSR VBATH LL_PWR_IsActiveFlag_VBATH
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_VBATH(void)
- {
- return ((READ_BIT(PWR->BDSR, PWR_BDSR_VBATH) == (PWR_BDSR_VBATH)) ? 1UL : 0UL);
- }
- /**
- * @brief Indicate whether the CPU temperature level is above low threshold or
- * not.
- * @rmtoll BDSR TEMPL LL_PWR_IsActiveFlag_TEMPL
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_TEMPL(void)
- {
- return ((READ_BIT(PWR->BDSR, PWR_BDSR_TEMPL) == (PWR_BDSR_TEMPL)) ? 1UL : 0UL);
- }
- /**
- * @brief Indicate whether the CPU temperature level is below high threshold
- * or not.
- * @rmtoll BDSR TEMPH LL_PWR_IsActiveFlag_TEMPH
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_TEMPH(void)
- {
- return ((READ_BIT(PWR->BDSR, PWR_BDSR_TEMPH) == (PWR_BDSR_TEMPH)) ? 1UL : 0UL);
- }
- /**
- * @brief Indicate whether a wakeup event is detected on wake up pin 1.
- * @rmtoll WUSR WUF1 LL_PWR_IsActiveFlag_WU1
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU1(void)
- {
- return ((READ_BIT(PWR->WUSR, PWR_WUSR_WUF1) == (PWR_WUSR_WUF1)) ? 1UL : 0UL);
- }
- /**
- * @brief Indicate whether a wakeup event is detected on wake up pin 2.
- * @rmtoll WUSR WUF2 LL_PWR_IsActiveFlag_WU2
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU2(void)
- {
- return ((READ_BIT(PWR->WUSR, PWR_WUSR_WUF2) == (PWR_WUSR_WUF2)) ? 1UL : 0UL);
- }
- /**
- * @brief Indicate whether a wakeup event is detected on wake up pin 3.
- * @rmtoll WUSR WUF3 LL_PWR_IsActiveFlag_WU3
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU3(void)
- {
- return ((READ_BIT(PWR->WUSR, PWR_WUSR_WUF3) == (PWR_WUSR_WUF3)) ? 1UL : 0UL);
- }
- /**
- * @brief Indicate whether a wakeup event is detected on wake up pin 4.
- * @rmtoll WUSR WUF4 LL_PWR_IsActiveFlag_WU4
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU4(void)
- {
- return ((READ_BIT(PWR->WUSR, PWR_WUSR_WUF4) == (PWR_WUSR_WUF4)) ? 1UL : 0UL);
- }
- /**
- * @brief Indicate whether a wakeup event is detected on wake up pin 5.
- * @rmtoll WUSR WUF5 LL_PWR_IsActiveFlag_WU5
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU5(void)
- {
- return ((READ_BIT(PWR->WUSR, PWR_WUSR_WUF5) == (PWR_WUSR_WUF5)) ? 1UL : 0UL);
- }
- #if defined (PWR_WUSR_WUF6)
- /**
- * @brief Indicate whether a wakeup event is detected on wake up pin 6.
- * @rmtoll WUSR WUF6 LL_PWR_IsActiveFlag_WU6
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU6(void)
- {
- return ((READ_BIT(PWR->WUSR, PWR_WUSR_WUF6) == (PWR_WUSR_WUF6)) ? 1UL : 0UL);
- }
- #endif /* PWR_WUSR_WUF6 */
- #if defined (PWR_WUSR_WUF7)
- /**
- * @brief Indicate whether a wakeup event is detected on wake up pin 7.
- * @rmtoll WUSR WUF7 LL_PWR_IsActiveFlag_WU7
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU7(void)
- {
- return ((READ_BIT(PWR->WUSR, PWR_WUSR_WUF7) == (PWR_WUSR_WUF7)) ? 1UL : 0UL);
- }
- #endif /* PWR_WUSR_WUF7 */
- #if defined (PWR_WUSR_WUF8)
- /**
- * @brief Indicate whether a wakeup event is detected on wake up pin 8.
- * @rmtoll WUSR WUF8 LL_PWR_IsActiveFlag_WU8
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU8(void)
- {
- return ((READ_BIT(PWR->WUSR, PWR_WUSR_WUF8) == (PWR_WUSR_WUF8)) ? 1UL : 0UL);
- }
- #endif /* PWR_WUSR_WUF8 */
- /**
- * @brief Clear stop flag.
- * @rmtoll PMCR CSSF LL_PWR_ClearFlag_STOP
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_ClearFlag_STOP(void)
- {
- WRITE_REG(PWR->PMCR, PWR_PMCR_CSSF);
- }
- /**
- * @brief Clear standby flag.
- * @rmtoll PMCR CSSF LL_PWR_ClearFlag_SB
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_ClearFlag_SB(void)
- {
- WRITE_REG(PWR->PMCR, PWR_PMCR_CSSF);
- }
- /**
- * @brief Clear wake up flag 1.
- * @rmtoll WUSCR CWUF1 LL_PWR_ClearFlag_WU1
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_ClearFlag_WU1(void)
- {
- WRITE_REG(PWR->WUSCR, PWR_WUSCR_CWUF1);
- }
- /**
- * @brief Clear wake up flag 2.
- * @rmtoll WUSCR CWUF2 LL_PWR_ClearFlag_WU2
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_ClearFlag_WU2(void)
- {
- WRITE_REG(PWR->WUSCR, PWR_WUSCR_CWUF2);
- }
- /**
- * @brief Clear wake up flag 3.
- * @rmtoll WUSCR CWUF3 LL_PWR_ClearFlag_WU3
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_ClearFlag_WU3(void)
- {
- WRITE_REG(PWR->WUSCR, PWR_WUSCR_CWUF3);
- }
- /**
- * @brief Clear wake up flag 4.
- * @rmtoll WUSCR CWUF4 LL_PWR_ClearFlag_WU4
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_ClearFlag_WU4(void)
- {
- WRITE_REG(PWR->WUSCR, PWR_WUSCR_CWUF4);
- }
- /**
- * @brief Clear wake up flag 5.
- * @rmtoll WUSCR CWUF5 LL_PWR_ClearFlag_WU5
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_ClearFlag_WU5(void)
- {
- WRITE_REG(PWR->WUSCR, PWR_WUSCR_CWUF5);
- }
- #if defined (PWR_WUSCR_CWUF6)
- /**
- * @brief Clear wake up flag 6.
- * @rmtoll WUSCR CWUF6 LL_PWR_ClearFlag_WU6
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_ClearFlag_WU6(void)
- {
- WRITE_REG(PWR->WUSCR, PWR_WUSCR_CWUF6);
- }
- #endif /* PWR_WUSCR_CWUF6 */
- #if defined (PWR_WUSCR_CWUF7)
- /**
- * @brief Clear wake up flag 7.
- * @rmtoll WUSCR CWUF7 LL_PWR_ClearFlag_WU7
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_ClearFlag_WU7(void)
- {
- WRITE_REG(PWR->WUSCR, PWR_WUSCR_CWUF7);
- }
- #endif /* PWR_WUSCR_CWUF7 */
- #if defined (PWR_WUSCR_CWUF8)
- /**
- * @brief Clear wake up flag 8.
- * @rmtoll WUSCR CWUF8 LL_PWR_ClearFlag_WU8
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_ClearFlag_WU8(void)
- {
- WRITE_REG(PWR->WUSCR, PWR_WUSCR_CWUF8);
- }
- #endif /* PWR_WUSCR_CWUF8 */
- /**
- * @brief Clear all wake up flags.
- * @rmtoll WUSCR CWUF LL_PWR_ClearFlag_WU
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_ClearFlag_WU(void)
- {
- WRITE_REG(PWR->WUSCR, PWR_WUSCR_CWUF);
- }
- /**
- * @}
- */
- /** @defgroup PWR_LL_EF_ATTRIBUTE_MANAGEMENT PWR Attribute Management
- * @{
- */
- #if defined(PWR_PRIVCFGR_NSPRIV)
- /**
- * @brief Enable privileged mode for nsecure items.
- * @rmtoll PRIVCFGR NSPRIV LL_PWR_EnableNSecurePrivilege
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableNSecurePrivilege(void)
- {
- SET_BIT(PWR->PRIVCFGR, PWR_PRIVCFGR_NSPRIV);
- }
- /**
- * @brief Disable privileged mode for nsecure items.
- * @rmtoll PRIVCFGR NSPRIV LL_PWR_DisableNSecurePrivilege
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableNSecurePrivilege(void)
- {
- CLEAR_BIT(PWR->PRIVCFGR, PWR_PRIVCFGR_NSPRIV);
- }
- /**
- * @brief Check if privileged mode for nsecure items is enabled.
- * @rmtoll PRIVCFGR NSPRIV LL_PWR_IsEnabledNSecurePrivilege
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledNSecurePrivilege(void)
- {
- return ((READ_BIT(PWR->PRIVCFGR, PWR_PRIVCFGR_NSPRIV) == PWR_PRIVCFGR_NSPRIV) ? 1UL : 0UL);
- }
- #else
- /**
- * @brief Enable privileged mode for nsecure items.
- * @rmtoll PRIVCFGR NSPRIV LL_PWR_EnableNSecurePrivilege
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableNSecurePrivilege(void)
- {
- SET_BIT(PWR->PRIVCFGR, PWR_PRIVCFGR_PRIV);
- }
- /**
- * @brief Disable privileged mode for nsecure items.
- * @rmtoll PRIVCFGR NSPRIV LL_PWR_DisableNSecurePrivilege
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableNSecurePrivilege(void)
- {
- CLEAR_BIT(PWR->PRIVCFGR, PWR_PRIVCFGR_PRIV);
- }
- /**
- * @brief Check if privileged mode for nsecure items is enabled.
- * @rmtoll PRIVCFGR NSPRIV LL_PWR_IsEnabledNSecurePrivilege
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledNSecurePrivilege(void)
- {
- return ((READ_BIT(PWR->PRIVCFGR, PWR_PRIVCFGR_PRIV) == PWR_PRIVCFGR_PRIV) ? 1UL : 0UL);
- }
- #endif /* RCC_PRIVCFGR_NSPRIV */
- #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
- /**
- * @brief Enable privileged mode for secure items.
- * @rmtoll PRIVCFGR SPRIV LL_PWR_EnableSecurePrivilege
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_EnableSecurePrivilege(void)
- {
- SET_BIT(PWR->PRIVCFGR, PWR_PRIVCFGR_SPRIV);
- }
- /**
- * @brief Disable privileged mode for secure items.
- * @rmtoll PRIVCFGR SPRIV LL_PWR_DisableSecurePrivilege
- * @retval None
- */
- __STATIC_INLINE void LL_PWR_DisableSecurePrivilege(void)
- {
- CLEAR_BIT(PWR->PRIVCFGR, PWR_PRIVCFGR_SPRIV);
- }
- #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
- #if defined (PWR_PRIVCFGR_SPRIV)
- /**
- * @brief Check if privileged mode for secure items is enabled.
- * @rmtoll PRIVCFGR SPRIV LL_PWR_IsEnabledSecurePrivilege
- * @retval State of bit (1 or 0).
- */
- __STATIC_INLINE uint32_t LL_PWR_IsEnabledSecurePrivilege(void)
- {
- return ((READ_BIT(PWR->PRIVCFGR, PWR_PRIVCFGR_SPRIV) == PWR_PRIVCFGR_SPRIV) ? 1UL : 0UL);
- }
- #endif /* PWR_PRIVCFGR_SPRIV */
- #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
- /**
- * @brief Configure secure attribute mode.
- * @note This API can be executed only by CPU in secure mode.
- * @rmtoll SECCFGR WUP1SEC LL_PWR_ConfigSecure\n
- * SECCFGR WUP2SEC LL_PWR_ConfigSecure\n
- * SECCFGR WUP3SEC LL_PWR_ConfigSecure\n
- * SECCFGR WUP4SEC LL_PWR_ConfigSecure\n
- * SECCFGR WUP5SEC LL_PWR_ConfigSecure\n
- * SECCFGR WUP6SEC LL_PWR_ConfigSecure\n
- * SECCFGR WUP7SEC LL_PWR_ConfigSecure\n
- * SECCFGR WUP8SEC LL_PWR_ConfigSecure\n
- * SECCFGR RETSEC LL_PWR_ConfigSecure\n
- * SECCFGR LPMSEC LL_PWR_ConfigSecure\n
- * SECCFGR VDMSEC LL_PWR_ConfigSecure\n
- * SECCFGR VBSEC LL_PWR_ConfigSecure\n
- * SECCFGR APCSEC LL_PWR_ConfigSecure
- * @param SecureConfig This parameter can be the full combination
- * of the following values:
- * @arg @ref LL_PWR_WAKEUP_PIN1_NSEC or LL_PWR_WAKEUP_PIN1_SEC
- * @arg @ref LL_PWR_WAKEUP_PIN2_NSEC or LL_PWR_WAKEUP_PIN2_SEC
- * @arg @ref LL_PWR_WAKEUP_PIN3_NSEC or LL_PWR_WAKEUP_PIN3_SEC
- * @arg @ref LL_PWR_WAKEUP_PIN4_NSEC or LL_PWR_WAKEUP_PIN4_SEC
- * @arg @ref LL_PWR_WAKEUP_PIN5_NSEC or LL_PWR_WAKEUP_PIN5_SEC
- * @arg @ref LL_PWR_WAKEUP_PIN6_NSEC or LL_PWR_WAKEUP_PIN6_SEC
- * @arg @ref LL_PWR_WAKEUP_PIN7_NSEC or LL_PWR_WAKEUP_PIN7_SEC
- * @arg @ref LL_PWR_WAKEUP_PIN8_NSEC or LL_PWR_WAKEUP_PIN8_SEC
- * @arg @ref LL_PWR_RET_NSEC or LL_PWR_RET_SEC
- * @arg @ref LL_PWR_LPM_NSEC or LL_PWR_LPM_SEC
- * @arg @ref LL_PWR_VDM_NSEC or LL_PWR_VDM_SEC
- * @arg @ref LL_PWR_VB_NSEC or LL_PWR_VB_SEC
- * @arg @ref LL_PWR_APC_NSEC or LL_PWR_APC_SEC
- * @retval None.
- */
- __STATIC_INLINE void LL_PWR_ConfigSecure(uint32_t SecureConfig)
- {
- WRITE_REG(PWR->SECCFGR, SecureConfig);
- }
- /**
- * @brief Get secure attribute configuration.
- * @note This API can be executed only by CPU in secure mode.
- * @rmtoll SECCFGR WUP1SEC LL_PWR_GetConfigSecure\n
- * SECCFGR WUP2SEC LL_PWR_GetConfigSecure\n
- * SECCFGR WUP3SEC LL_PWR_GetConfigSecure\n
- * SECCFGR WUP4SEC LL_PWR_GetConfigSecure\n
- * SECCFGR WUP5SEC LL_PWR_GetConfigSecure\n
- * SECCFGR WUP6SEC LL_PWR_GetConfigSecure\n
- * SECCFGR WUP7SEC LL_PWR_GetConfigSecure\n
- * SECCFGR WUP8SEC LL_PWR_GetConfigSecure\n
- * SECCFGR RETSEC LL_PWR_ConfigSecure\n
- * SECCFGR LPMSEC LL_PWR_GetConfigSecure\n
- * SECCFGR VDMSEC LL_PWR_GetConfigSecure\n
- * SECCFGR VBSEC LL_PWR_GetConfigSecure\n
- * SECCFGR APCSEC LL_PWR_GetConfigSecure
- * @retval Returned value is the combination of the following values:
- * @arg @ref LL_PWR_WAKEUP_PIN1_NSEC or LL_PWR_WAKEUP_PIN1_SEC
- * @arg @ref LL_PWR_WAKEUP_PIN2_NSEC or LL_PWR_WAKEUP_PIN2_SEC
- * @arg @ref LL_PWR_WAKEUP_PIN3_NSEC or LL_PWR_WAKEUP_PIN3_SEC
- * @arg @ref LL_PWR_WAKEUP_PIN4_NSEC or LL_PWR_WAKEUP_PIN4_SEC
- * @arg @ref LL_PWR_WAKEUP_PIN5_NSEC or LL_PWR_WAKEUP_PIN5_SEC
- * @arg @ref LL_PWR_WAKEUP_PIN6_NSEC or LL_PWR_WAKEUP_PIN6_SEC
- * @arg @ref LL_PWR_WAKEUP_PIN7_NSEC or LL_PWR_WAKEUP_PIN7_SEC
- * @arg @ref LL_PWR_WAKEUP_PIN8_NSEC or LL_PWR_WAKEUP_PIN8_SEC
- * @arg @ref LL_PWR_RET_NSEC or LL_PWR_RET_SEC
- * @arg @ref LL_PWR_LPM_NSEC or LL_PWR_LPM_SEC
- * @arg @ref LL_PWR_VDM_NSEC or LL_PWR_VDM_SEC
- * @arg @ref LL_PWR_VB_NSEC or LL_PWR_VB_SEC
- * @arg @ref LL_PWR_APC_NSEC or LL_PWR_APC_SEC
- */
- __STATIC_INLINE uint32_t LL_PWR_GetConfigSecure(void)
- {
- return (READ_REG(PWR->SECCFGR));
- }
- #endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */
- /**
- * @}
- */
- #if defined (USE_FULL_LL_DRIVER)
- /** @defgroup PWR_LL_EF_Init De-initialization function
- * @{
- */
- ErrorStatus LL_PWR_DeInit(void);
- /**
- * @}
- */
- #endif /* defined (USE_FULL_LL_DRIVER) */
- /**
- * @}
- */
- /**
- * @}
- */
- #endif /* defined (PWR) */
- /**
- * @}
- */
- #ifdef __cplusplus
- }
- #endif /* __cplusplus */
- #endif /* STM32H5xx_LL_PWR_H */
|