graham sanderson | 26653ea | 2021-01-20 10:44:27 -0600 | [diff] [blame] | 1 | /* |
| 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 | |
| 10 | void vreg_set_voltage(enum vreg_voltage voltage) { |
graham sanderson | 503bc8b | 2021-02-19 12:05:13 -0600 | [diff] [blame] | 11 | 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 sanderson | 26653ea | 2021-01-20 10:44:27 -0600 | [diff] [blame] | 12 | } |