44#ifndef LIBOPENCM3_PWR_H
45#define LIBOPENCM3_PWR_H
51#define PWR_CR1 MMIO32(POWER_CONTROL_BASE + 0x00)
52#define PWR_CR2 MMIO32(POWER_CONTROL_BASE + 0x04)
53#define PWR_CR3 MMIO32(POWER_CONTROL_BASE + 0x08)
54#define PWR_CR4 MMIO32(POWER_CONTROL_BASE + 0x0C)
55#define PWR_CR5 MMIO32(POWER_CONTROL_BASE + 0x80)
56#define PWR_SR1 MMIO32(POWER_CONTROL_BASE + 0x10)
57#define PWR_SR2 MMIO32(POWER_CONTROL_BASE + 0x14)
58#define PWR_SCR MMIO32(POWER_CONTROL_BASE + 0x18)
60#define PWR_PORT_A MMIO32(POWER_CONTROL_BASE + 0x20)
61#define PWR_PORT_B MMIO32(POWER_CONTROL_BASE + 0x28)
62#define PWR_PORT_C MMIO32(POWER_CONTROL_BASE + 0x30)
63#define PWR_PORT_D MMIO32(POWER_CONTROL_BASE + 0x38)
64#define PWR_PORT_E MMIO32(POWER_CONTROL_BASE + 0x40)
65#define PWR_PORT_F MMIO32(POWER_CONTROL_BASE + 0x48)
66#define PWR_PORT_G MMIO32(POWER_CONTROL_BASE + 0x50)
68#define PWR_PUCR(pwr_port) MMIO32((pwr_port) + 0x00)
69#define PWR_PDCR(pwr_port) MMIO32((pwr_port) + 0x04)
73#define PWR_CR1_LPR (1 << 14)
75#define PWR_CR1_VOS_SHIFT 9
76#define PWR_CR1_VOS_MASK 0x3
77#define PWR_CR1_VOS_RANGE_1 1
78#define PWR_CR1_VOS_RANGE_2 2
80#define PWR_CR1_DBP (1 << 8)
82#define PWR_CR1_LPMS_SHIFT 0
83#define PWR_CR1_LPMS_MASK 0x07
84#define PWR_CR1_LPMS_STOP_0 0
85#define PWR_CR1_LPMS_STOP_1 1
86#define PWR_CR1_LPMS_STOP_2 2
87#define PWR_CR1_LPMS_STANDBY 3
88#define PWR_CR1_LPMS_SHUTDOWN 4
92#define PWR_CR2_PVMEN2 (1 << 7)
93#define PWR_CR2_PVMEN1 (1 << 6)
95#define PWR_CR2_PLS_SHIFT 1
96#define PWR_CR2_PLS_MASK 0x07
100#define PWR_CR2_PLS_2V0 0x00
101#define PWR_CR2_PLS_2V2 0x01
102#define PWR_CR2_PLS_2V4 0x02
103#define PWR_CR2_PLS_2V5 0x03
104#define PWR_CR2_PLS_2V6 0x04
105#define PWR_CR2_PLS_2V8 0x05
106#define PWR_CR2_PLS_2V9 0x06
107#define PWR_CR2_PLS_PVD_IN 0x07
110#define PWR_CR2_PVDE (1 << 0)
114#define PWR_CR3_EIWUL (1 << 15)
115#define PWR_CR3_UCPD1_DBDIS (1 << 14)
116#define PWR_CR3_UCPD1_STDBY (1 << 13)
117#define PWR_CR3_APC (1 << 10)
118#define PWR_CR3_RRS (1 << 8)
119#define PWR_CR3_EWUP5 (1 << 4)
120#define PWR_CR3_EWUP4 (1 << 3)
121#define PWR_CR3_EWUP3 (1 << 2)
122#define PWR_CR3_EWUP2 (1 << 1)
123#define PWR_CR3_EWUP1 (1 << 0)
127#define PWR_CR4_VBRS (1 << 9)
128#define PWR_CR4_VBE (1 << 8)
129#define PWR_CR4_WP5 (1 << 4)
130#define PWR_CR4_WP4 (1 << 3)
131#define PWR_CR4_WP3 (1 << 2)
132#define PWR_CR4_WP2 (1 << 1)
133#define PWR_CR4_WP1 (1 << 0)
137#define PWR_CR5_R1MODE_SHIFT 8
138#define PWR_CR5_R1MODE_MASK 0x1
139#define PWR_CR5_R1MODE_BOOST 0
140#define PWR_CR5_R1MODE_NORMAL 1
141#define PWR_CR5_R1MODE (PWR_CR5_R1MODE_MASK << PWR_CR5_R1MODE_SHIFT)
145#define PWR_SR1_WUFI (1 << 15)
146#define PWR_SR1_SBF (1 << 8)
147#define PWR_SR1_WUF5 (1 << 4)
148#define PWR_SR1_WUF4 (1 << 3)
149#define PWR_SR1_WUF3 (1 << 2)
150#define PWR_SR1_WUF2 (1 << 1)
151#define PWR_SR1_WUF1 (1 << 0)
155#define PWR_SR2_PVMO2 (1 << 15)
156#define PWR_SR2_PVMO1 (1 << 14)
157#define PWR_SR2_PVDO (1 << 11)
158#define PWR_SR2_VOSF (1 << 10)
159#define PWR_SR2_REGLPF (1 << 9)
160#define PWR_SR2_REGLPS (1 << 8)
164#define PWR_SCR_CSBF (1 << 8)
165#define PWR_SCR_CWUF5 (1 << 4)
166#define PWR_SCR_CWUF4 (1 << 3)
167#define PWR_SCR_CWUF3 (1 << 2)
168#define PWR_SCR_CWUF2 (1 << 1)
169#define PWR_SCR_CWUF1 (1 << 0)
void pwr_set_low_power_mode_selection(uint32_t lpms)
Select the low power mode used in deep sleep.
void pwr_enable_backup_domain_write_protect(void)
Re-enable Backup Domain Write Protection.
void pwr_disable_power_voltage_detect(void)
Disable Power Voltage Detector.
void pwr_disable_backup_domain_write_protect(void)
Disable Backup Domain Write Protection.
void pwr_enable_boost(void)
Enable Boost Mode.
void pwr_set_vos_scale(enum pwr_vos_scale scale)
#define PWR_CR1_VOS_RANGE_2
void pwr_disable_boost(void)
Disable Boost Mode.
void pwr_enable_power_voltage_detect(uint32_t pvd_level)
Enable Power Voltage Detector.
#define PWR_CR1_VOS_RANGE_1