libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
PWR peripheral API

libopencm3 STM32G4xx Power Control More...

Collaboration diagram for PWR peripheral API:

Functions

void pwr_set_vos_scale (enum pwr_vos_scale scale)
 
void pwr_disable_backup_domain_write_protect (void)
 Disable Backup Domain Write Protection. More...
 
void pwr_enable_backup_domain_write_protect (void)
 Re-enable Backup Domain Write Protection. More...
 
void pwr_set_low_power_mode_selection (uint32_t lpms)
 Select the low power mode used in deep sleep. More...
 
void pwr_enable_power_voltage_detect (uint32_t pvd_level)
 Enable Power Voltage Detector. More...
 
void pwr_disable_power_voltage_detect (void)
 Disable Power Voltage Detector. More...
 
void pwr_enable_boost (void)
 Enable Boost Mode. More...
 
void pwr_disable_boost (void)
 Disable Boost Mode. More...
 

Detailed Description

libopencm3 STM32G4xx Power Control

Version
1.0.0
Author
© 2016 Benjamin Levine benja.nosp@m.min@.nosp@m.jesco.nosp@m..kar.nosp@m.oo.co.nosp@m..uk
© 2019 Guillaume Revaillot g.rev.nosp@m.aill.nosp@m.ot@gm.nosp@m.ail..nosp@m.com
© 2020 Ben Brewer ben.b.nosp@m.rewe.nosp@m.r@cod.nosp@m.ethi.nosp@m.nk.co.nosp@m..uk
Date
29 July 2020

This library supports the power control system for the STM32G4 series of ARM Cortex Microcontrollers by ST Microelectronics.

LGPL License Terms libopencm3 License

Function Documentation

◆ pwr_disable_backup_domain_write_protect()

void pwr_disable_backup_domain_write_protect ( void  )

Disable Backup Domain Write Protection.

This allows backup domain registers to be changed. These registers are write protected after a reset.

Definition at line 57 of file pwr.c.

References PWR_CR1, and PWR_CR1_DBP.

◆ pwr_disable_boost()

void pwr_disable_boost ( void  )

Disable Boost Mode.

Definition at line 116 of file pwr.c.

References PWR_CR5, and PWR_CR5_R1MODE.

Referenced by rcc_clock_setup_pll().

Here is the caller graph for this function:

◆ pwr_disable_power_voltage_detect()

void pwr_disable_power_voltage_detect ( void  )

Disable Power Voltage Detector.

Definition at line 100 of file pwr.c.

References PWR_CR2.

◆ pwr_enable_backup_domain_write_protect()

void pwr_enable_backup_domain_write_protect ( void  )

Re-enable Backup Domain Write Protection.

This protects backup domain registers from inadvertent change.

Definition at line 66 of file pwr.c.

References PWR_CR1.

◆ pwr_enable_boost()

void pwr_enable_boost ( void  )

Enable Boost Mode.

Definition at line 108 of file pwr.c.

References PWR_CR5.

Referenced by rcc_clock_setup_pll().

Here is the caller graph for this function:

◆ pwr_enable_power_voltage_detect()

void pwr_enable_power_voltage_detect ( uint32_t  pvd_level)

Enable Power Voltage Detector.

Parameters
[in]pvd_levelPower Voltage Detector Falling Threshold voltage PVD level selection.

Definition at line 88 of file pwr.c.

References PWR_CR2, PWR_CR2_PLS_MASK, PWR_CR2_PLS_SHIFT, and PWR_CR2_PVDE.

◆ pwr_set_low_power_mode_selection()

void pwr_set_low_power_mode_selection ( uint32_t  lpms)

Select the low power mode used in deep sleep.

Parameters
lpmslow power mode pwr_cr1_lpms

Definition at line 75 of file pwr.c.

References PWR_CR1, PWR_CR1_LPMS_MASK, and PWR_CR1_LPMS_SHIFT.

◆ pwr_set_vos_scale()

void pwr_set_vos_scale ( enum pwr_vos_scale  scale)

Definition at line 43 of file pwr.c.

References PWR_CR1, PWR_CR1_VOS_MASK, and PWR_CR1_VOS_SHIFT.

Referenced by rcc_clock_setup_pll().

Here is the caller graph for this function: