1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! On-chip voltage regulator (VREG)
//!
//! See [Chapter 2, Section 10](https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf) of the datasheet for more details
//!
//! ## Usage
//! ```no_run
//! use rp2040_hal::pac::vreg_and_chip_reset::vreg::VSEL_A;
//! use rp2040_hal::{vreg::set_voltage, pac};
//! let mut pac = pac::Peripherals::take().unwrap();
//! // Set voltage to 1.20V
//! set_voltage(&mut pac.VREG_AND_CHIP_RESET, VSEL_A::VOLTAGE1_20);
//! ```
use crateVSEL_A;
use crateVREG_AND_CHIP_RESET;
/// Set voltage to the on-chip voltage regulator.
///
/// There is no guarantee that the device will operate at all of the available voltages.
/// Appropriate values should be selected in consideration of the system clock frequency and other factors to be set.
///
/// # Arguments
///
/// * `vreg_dev` - VREG peripheral
/// * `voltage` - Voltage to set
/// Get voltage from the on-chip voltage regulator
///
/// # Arguments
///
/// * `vreg_dev` - VREG peripheral