libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
pwr.c
Go to the documentation of this file.
1
/** @defgroup pwr_file PWR peripheral API
2
*
3
* @ingroup peripheral_apis
4
*
5
* @brief <b>libopencm3 STM32F4xx Power Control</b>
6
*
7
* @version 1.0.0
8
*
9
* @author @htmlonly © @endhtmlonly 2011 Stephen Caudle <scaudle@doceme.com>
10
*
11
* @date 4 March 2013
12
*
13
* This library supports the power control system for the
14
* STM32F4 series of ARM Cortex Microcontrollers by ST Microelectronics.
15
*
16
* LGPL License Terms @ref lgpl_license
17
*/
18
/*
19
* This file is part of the libopencm3 project.
20
*
21
* Copyright (C) 2011 Stephen Caudle <scaudle@doceme.com>
22
*
23
* This library is free software: you can redistribute it and/or modify
24
* it under the terms of the GNU Lesser General Public License as published by
25
* the Free Software Foundation, either version 3 of the License, or
26
* (at your option) any later version.
27
*
28
* This library is distributed in the hope that it will be useful,
29
* but WITHOUT ANY WARRANTY; without even the implied warranty of
30
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31
* GNU Lesser General Public License for more details.
32
*
33
* You should have received a copy of the GNU Lesser General Public License
34
* along with this library. If not, see <http://www.gnu.org/licenses/>.
35
*/
36
37
#include <
libopencm3/stm32/pwr.h
>
38
39
/**@{*/
40
41
void
pwr_set_vos_scale
(
enum
pwr_vos_scale
scale)
42
{
43
uint32_t reg32;
44
reg32 =
PWR_CR
& ~(
PWR_CR_VOS_MASK
<<
PWR_CR_VOS_SHIFT
);
45
reg32 |= (scale &
PWR_CR_VOS_MASK
) <<
PWR_CR_VOS_SHIFT
;
46
PWR_CR
= reg32;
47
}
48
49
/**@}*/
PWR_CR_VOS_MASK
#define PWR_CR_VOS_MASK
Definition:
f4/pwr.h:50
PWR_CR
#define PWR_CR
Power control register (PWR_CR)
Definition:
pwr_common_v1.h:41
pwr_vos_scale
pwr_vos_scale
Definition:
f4/pwr.h:79
PWR_CR_VOS_SHIFT
#define PWR_CR_VOS_SHIFT
VOS: Regulator voltage scaling output selection.
Definition:
f4/pwr.h:49
pwr_set_vos_scale
void pwr_set_vos_scale(enum pwr_vos_scale scale)
Definition:
pwr.c:41
pwr.h
lib
stm32
f4
pwr.c
Generated on Tue Mar 7 2023 16:11:41 for libopencm3 by
1.9.4