aboutsummaryrefslogtreecommitdiff
path: root/examples/rp/src/bin/overclock.rs
diff options
context:
space:
mode:
author1-rafael-1 <[email protected]>2025-05-01 00:11:56 +0200
committer1-rafael-1 <[email protected]>2025-05-01 00:11:56 +0200
commit22b5f73811a7cc0dbca920e02b5d001d252d344c (patch)
treed3fd2d801ffddc74a43f04c7892c953356647904 /examples/rp/src/bin/overclock.rs
parentd44b94523576d3f8c1f586811f600eb3ba223606 (diff)
add manual overclock example, finalize API, cleanup
Diffstat (limited to 'examples/rp/src/bin/overclock.rs')
-rw-r--r--examples/rp/src/bin/overclock.rs24
1 files changed, 6 insertions, 18 deletions
diff --git a/examples/rp/src/bin/overclock.rs b/examples/rp/src/bin/overclock.rs
index 9027f1516..e3ac77340 100644
--- a/examples/rp/src/bin/overclock.rs
+++ b/examples/rp/src/bin/overclock.rs
@@ -1,9 +1,13 @@
1//! # Overclocking the RP2040 to 200 MHz
2//!
3//! This example demonstrates how to configure the RP2040 to run at 200 MHz using a higher level API.
4
1#![no_std] 5#![no_std]
2#![no_main] 6#![no_main]
3 7
4use defmt::*; 8use defmt::*;
5use embassy_executor::Spawner; 9use embassy_executor::Spawner;
6use embassy_rp::clocks::{clk_sys_freq, ClockConfig, VoltageScale}; 10use embassy_rp::clocks::{clk_sys_freq, ClockConfig};
7use embassy_rp::config::Config; 11use embassy_rp::config::Config;
8use embassy_rp::gpio::{Level, Output}; 12use embassy_rp::gpio::{Level, Output};
9use embassy_time::{Duration, Instant, Timer}; 13use embassy_time::{Duration, Instant, Timer};
@@ -15,15 +19,10 @@ const COUNT_TO: i64 = 10_000_000;
15async fn main(_spawner: Spawner) -> ! { 19async fn main(_spawner: Spawner) -> ! {
16 // Set up for clock frequency of 200 MHz 20 // Set up for clock frequency of 200 MHz
17 // This will set all the necessary defaults including slightly raised voltage 21 // This will set all the necessary defaults including slightly raised voltage
18 // See embassy_rp::clocks::ClockConfig for more options, including full manual control
19 let config = Config::new(ClockConfig::at_sys_frequency_mhz(200)); 22 let config = Config::new(ClockConfig::at_sys_frequency_mhz(200));
20 23
21 // Show the voltage scale and brownout-detection for verification 24 // Show the voltage scale for verification
22 info!("System core voltage: {}", Debug2Format(&config.clocks.voltage_scale)); 25 info!("System core voltage: {}", Debug2Format(&config.clocks.voltage_scale));
23 // info!(
24 // "Brownout detection: {}",
25 // Debug2Format(&config.clocks.brownout_detection)
26 // );
27 26
28 // Initialize the peripherals 27 // Initialize the peripherals
29 let p = embassy_rp::init(config); 28 let p = embassy_rp::init(config);
@@ -64,14 +63,3 @@ async fn main(_spawner: Spawner) -> ! {
64 Timer::after(Duration::from_secs(2)).await; 63 Timer::after(Duration::from_secs(2)).await;
65 } 64 }
66} 65}
67
68// let config = Config::new(ClockConfig::with_speed_mhz_test_voltage(125, Some(VoltageScale::V1_10)));
69// let config = Config::default();
70// let config = Config::new(ClockConfig::with_speed_mhz_test_voltage_extended_delay(
71// 200, // Standard 125MHz clock
72// Some(VoltageScale::V1_15), // 1.15V voltage
73// Some(1000), // 1000μs (1ms) stabilization delay - significantly longer than default
74// ));
75// Initialize the peripherals
76
77// let p = embassy_rp::init(Default::default()); //testing the bog standard