blob: 501b0d4e096287054c14a1f3196f4f47f8a79c2f [file] [log] [blame]
graham sanderson26653ea2021-01-20 10:44:27 -06001/*
2 * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include "pico.h"
8#include "hardware/vreg.h"
9
10void vreg_set_voltage(enum vreg_voltage voltage) {
graham sanderson503bc8b2021-02-19 12:05:13 -060011 hw_write_masked(&vreg_and_chip_reset_hw->vreg, ((uint)voltage) << VREG_AND_CHIP_RESET_VREG_VSEL_LSB, VREG_AND_CHIP_RESET_VREG_VSEL_BITS);
graham sanderson26653ea2021-01-20 10:44:27 -060012}