aboutsummaryrefslogtreecommitdiff
path: root/examples/rp/src
diff options
context:
space:
mode:
author1-rafael-1 <[email protected]>2025-05-11 17:26:36 +0200
committer1-rafael-1 <[email protected]>2025-05-11 17:26:36 +0200
commit4567beda7b7773c8cb11f19f0f4f146c1243508d (patch)
treea01a9fe7649508c846dd772a47650bb271430acb /examples/rp/src
parent4621c8aa7a1ee1b55f2f0bf80fc48eddf76af320 (diff)
rp235x overclocking
Diffstat (limited to 'examples/rp/src')
-rw-r--r--examples/rp/src/bin/overclock.rs8
-rw-r--r--examples/rp/src/bin/overclock_manual.rs10
2 files changed, 10 insertions, 8 deletions
diff --git a/examples/rp/src/bin/overclock.rs b/examples/rp/src/bin/overclock.rs
index 9c78e0c9d..89147ba42 100644
--- a/examples/rp/src/bin/overclock.rs
+++ b/examples/rp/src/bin/overclock.rs
@@ -7,7 +7,7 @@
7 7
8use defmt::*; 8use defmt::*;
9use embassy_executor::Spawner; 9use embassy_executor::Spawner;
10use embassy_rp::clocks::{clk_sys_freq, ClockConfig}; 10use embassy_rp::clocks::{clk_sys_freq, core_voltage, ClockConfig};
11use embassy_rp::config::Config; 11use embassy_rp::config::Config;
12use embassy_rp::gpio::{Level, Output}; 12use embassy_rp::gpio::{Level, Output};
13use embassy_time::{Duration, Instant, Timer}; 13use embassy_time::{Duration, Instant, Timer};
@@ -20,15 +20,15 @@ async fn main(_spawner: Spawner) -> ! {
20 // Set up for clock frequency of 200 MHz, setting all necessary defaults. 20 // Set up for clock frequency of 200 MHz, setting all necessary defaults.
21 let config = Config::new(ClockConfig::system_freq(200_000_000)); 21 let config = Config::new(ClockConfig::system_freq(200_000_000));
22 22
23 // Show the voltage scale for verification
24 info!("System core voltage: {}", Debug2Format(&config.clocks.core_voltage));
25
26 // Initialize the peripherals 23 // Initialize the peripherals
27 let p = embassy_rp::init(config); 24 let p = embassy_rp::init(config);
28 25
29 // Show CPU frequency for verification 26 // Show CPU frequency for verification
30 let sys_freq = clk_sys_freq(); 27 let sys_freq = clk_sys_freq();
31 info!("System clock frequency: {} MHz", sys_freq / 1_000_000); 28 info!("System clock frequency: {} MHz", sys_freq / 1_000_000);
29 // Show core voltage for verification
30 let core_voltage = core_voltage().unwrap();
31 info!("Core voltage: {}", Debug2Format(&core_voltage));
32 32
33 // LED to indicate the system is running 33 // LED to indicate the system is running
34 let mut led = Output::new(p.PIN_25, Level::Low); 34 let mut led = Output::new(p.PIN_25, Level::Low);
diff --git a/examples/rp/src/bin/overclock_manual.rs b/examples/rp/src/bin/overclock_manual.rs
index 35160b250..88ef26a7a 100644
--- a/examples/rp/src/bin/overclock_manual.rs
+++ b/examples/rp/src/bin/overclock_manual.rs
@@ -7,8 +7,7 @@
7 7
8use defmt::*; 8use defmt::*;
9use embassy_executor::Spawner; 9use embassy_executor::Spawner;
10use embassy_rp::clocks; 10use embassy_rp::clocks::{clk_sys_freq, core_voltage, ClockConfig, CoreVoltage, PllConfig};
11use embassy_rp::clocks::{ClockConfig, CoreVoltage, PllConfig};
12use embassy_rp::config::Config; 11use embassy_rp::config::Config;
13use embassy_rp::gpio::{Level, Output}; 12use embassy_rp::gpio::{Level, Output};
14use embassy_time::{Duration, Instant, Timer}; 13use embassy_time::{Duration, Instant, Timer};
@@ -41,9 +40,12 @@ async fn main(_spawner: Spawner) -> ! {
41 // Initialize with our manual overclock configuration 40 // Initialize with our manual overclock configuration
42 let p = embassy_rp::init(configure_manual_overclock()); 41 let p = embassy_rp::init(configure_manual_overclock());
43 42
44 // Verify the actual system clock frequency 43 // Show CPU frequency for verification
45 let sys_freq = clocks::clk_sys_freq(); 44 let sys_freq = clk_sys_freq();
46 info!("System clock frequency: {} MHz", sys_freq / 1_000_000); 45 info!("System clock frequency: {} MHz", sys_freq / 1_000_000);
46 // Show core voltage for verification
47 let core_voltage = core_voltage().unwrap();
48 info!("Core voltage: {}", Debug2Format(&core_voltage));
47 49
48 // LED to indicate the system is running 50 // LED to indicate the system is running
49 let mut led = Output::new(p.PIN_25, Level::Low); 51 let mut led = Output::new(p.PIN_25, Level::Low);