v2.0.0
vreg.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef _HARDWARE_VREG_H
8#define _HARDWARE_VREG_H
9
10#include "pico.h"
11
12#if PICO_RP2040
13#include "hardware/structs/vreg_and_chip_reset.h"
14#else
15#include "hardware/structs/powman.h"
16#endif
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
31 enum vreg_voltage {
32#if !PICO_RP2040
33 VREG_VOLTAGE_0_55 = 0b00000,
34 VREG_VOLTAGE_0_60 = 0b00001,
35 VREG_VOLTAGE_0_65 = 0b00010,
36 VREG_VOLTAGE_0_70 = 0b00011,
37 VREG_VOLTAGE_0_75 = 0b00100,
38 VREG_VOLTAGE_0_80 = 0b00101,
39#endif
40 VREG_VOLTAGE_0_85 = 0b00110,
41 VREG_VOLTAGE_0_90 = 0b00111,
42 VREG_VOLTAGE_0_95 = 0b01000,
43 VREG_VOLTAGE_1_00 = 0b01001,
44 VREG_VOLTAGE_1_05 = 0b01010,
45 VREG_VOLTAGE_1_10 = 0b01011,
46 VREG_VOLTAGE_1_15 = 0b01100,
47 VREG_VOLTAGE_1_20 = 0b01101,
48 VREG_VOLTAGE_1_25 = 0b01110,
49 VREG_VOLTAGE_1_30 = 0b01111,
50#if !PICO_RP2040
51 // Above this point you will need to set POWMAN_VREG_CTRL_DISABLE_VOLTAGE_LIMIT
52 VREG_VOLTAGE_1_35 = 0b10000,
53 VREG_VOLTAGE_1_40 = 0b10001,
54 VREG_VOLTAGE_1_50 = 0b10010,
55 VREG_VOLTAGE_1_60 = 0b10011,
56 VREG_VOLTAGE_1_65 = 0b10100,
57 VREG_VOLTAGE_1_70 = 0b10101,
58 VREG_VOLTAGE_1_80 = 0b10110,
59 VREG_VOLTAGE_1_90 = 0b10111,
60 VREG_VOLTAGE_2_00 = 0b11000,
61 VREG_VOLTAGE_2_35 = 0b11001,
62 VREG_VOLTAGE_2_50 = 0b11010,
63 VREG_VOLTAGE_2_65 = 0b11011,
64 VREG_VOLTAGE_2_80 = 0b11100,
65 VREG_VOLTAGE_3_00 = 0b11101,
66 VREG_VOLTAGE_3_15 = 0b11110,
67 VREG_VOLTAGE_3_30 = 0b11111,
68#endif
69
70 // Note the "max" here assumes that VREG_CTRL_DISABLE_VOLTAGE_LIMIT is not set
71 VREG_VOLTAGE_MIN = VREG_VOLTAGE_0_85,
72 VREG_VOLTAGE_DEFAULT = VREG_VOLTAGE_1_10,
73 VREG_VOLTAGE_MAX = VREG_VOLTAGE_1_30,
74};
75
76
82void vreg_set_voltage(enum vreg_voltage voltage);
83
84
93void vreg_disable_voltage_limit(void);
94
95#ifdef __cplusplus
96}
97#endif
98
99#endif
vreg_set_voltage
void vreg_set_voltage(enum vreg_voltage voltage)
Set voltage.
Definition: vreg.c:10
vreg_disable_voltage_limit
void vreg_disable_voltage_limit(void)
Enable use of voltages beyond the safe range of operation.
Definition: vreg.c:40
pico.h
vreg_voltage
vreg_voltage
Definition: vreg.h:31
VREG_VOLTAGE_1_00
@ VREG_VOLTAGE_1_00
1.00 V
Definition: vreg.h:43
VREG_VOLTAGE_1_15
@ VREG_VOLTAGE_1_15
1.15 V
Definition: vreg.h:46
VREG_VOLTAGE_1_30
@ VREG_VOLTAGE_1_30
1.30 V
Definition: vreg.h:49
VREG_VOLTAGE_DEFAULT
@ VREG_VOLTAGE_DEFAULT
Default voltage on power up.
Definition: vreg.h:72
VREG_VOLTAGE_1_25
@ VREG_VOLTAGE_1_25
1.25 V
Definition: vreg.h:48
VREG_VOLTAGE_1_20
@ VREG_VOLTAGE_1_20
1.20 V
Definition: vreg.h:47
VREG_VOLTAGE_MIN
@ VREG_VOLTAGE_MIN
Always the minimum possible voltage.
Definition: vreg.h:71
VREG_VOLTAGE_0_85
@ VREG_VOLTAGE_0_85
0.85 V
Definition: vreg.h:40
VREG_VOLTAGE_0_95
@ VREG_VOLTAGE_0_95
0.95 V
Definition: vreg.h:42
VREG_VOLTAGE_MAX
@ VREG_VOLTAGE_MAX
Always the maximum possible voltage.
Definition: vreg.h:73
VREG_VOLTAGE_1_05
@ VREG_VOLTAGE_1_05
1.05 V
Definition: vreg.h:44
VREG_VOLTAGE_0_90
@ VREG_VOLTAGE_0_90
0.90 V
Definition: vreg.h:41
VREG_VOLTAGE_1_10
@ VREG_VOLTAGE_1_10
1.10 V
Definition: vreg.h:45