OpenMPTL - STM32F4
C++ Microprocessor Template Library
pwr.hpp
Go to the documentation of this file.
1 /*
2  * OpenMPTL - C++ Microprocessor Template Library
3  *
4  * Copyright (C) 2012-2017 Axel Burri <axel@tty0.ch>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 /*
22  * This program contains derivative representations of CMSIS System
23  * View Description (SVD) files, and is subject to the "End User
24  * License Agreement for STMicroelectronics" (see "STM_License.html"
25  * in the containing directory).
26  */
27 
28 #ifndef ARCH_REG_PWR_HPP_INCLUDED
29 #define ARCH_REG_PWR_HPP_INCLUDED
30 
31 #include <register.hpp>
32 
33 namespace mptl {
34 /**
35  * Power control
36  */
37 struct PWR
38 {
39  static constexpr reg_addr_t base_addr = 0x40007000;
40 
41  /**
42  * Power control register
43  */
44  struct CR
45  : public reg< uint32_t, base_addr + 0x0, rw, 0x00004000 >
46  {
47  using VOS = regbits< type, 14, 1 >; /**< Regulator voltage scaling output selection */
48  using FPDS = regbits< type, 9, 1 >; /**< Flash power down in Stop mode */
49  using DBP = regbits< type, 8, 1 >; /**< Disable backup domain write protection */
50  using PLS = regbits< type, 5, 3 >; /**< PVD level selection */
51  using PVDE = regbits< type, 4, 1 >; /**< Power voltage detector enable */
52  using CSBF = regbits< type, 3, 1 >; /**< Clear standby flag */
53  using CWUF = regbits< type, 2, 1 >; /**< Clear wakeup flag */
54  using PDDS = regbits< type, 1, 1 >; /**< Power down deepsleep */
55  using LPDS = regbits< type, 0, 1 >; /**< Low-power deep sleep */
56  };
57 
58  /**
59  * Power control/status register
60  */
61  struct CSR
62  : public reg< uint32_t, base_addr + 0x4, rw, 0x00000000 >
63  {
64  using VOSRDY = regbits< type, 14, 1 >; /**< Regulator voltage scaling output selection ready bit */
65  using BRE = regbits< type, 9, 1 >; /**< Backup regulator enable */
66  using EWUP = regbits< type, 8, 1 >; /**< Enable WKUP pin */
67  using BRR = regbits< type, 3, 1 >; /**< Backup regulator ready */
68  using PVDO = regbits< type, 2, 1 >; /**< PVD output */
69  using SBF = regbits< type, 1, 1 >; /**< Standby flag */
70  using WUF = regbits< type, 0, 1 >; /**< Wakeup flag */
71  };
72 };
73 
74 } // namespace mptl
75 
76 #endif // ARCH_REG_PWR_HPP_INCLUDED
Power control register.
Definition: pwr.hpp:44
uintptr_t reg_addr_t
Power control/status register.
Definition: pwr.hpp:61
Power control.
Definition: pwr.hpp:37
static constexpr reg_addr_t base_addr
Definition: pwr.hpp:39