aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-rp/src/psram.rs7
-rw-r--r--embassy-rp/src/qmi_cs1.rs8
-rw-r--r--examples/rp235x/src/bin/psram.rs7
3 files changed, 7 insertions, 15 deletions
diff --git a/embassy-rp/src/psram.rs b/embassy-rp/src/psram.rs
index a4d619565..0823b4be6 100644
--- a/embassy-rp/src/psram.rs
+++ b/embassy-rp/src/psram.rs
@@ -12,8 +12,8 @@
12 12
13use critical_section::{acquire, release, CriticalSection, RestoreState}; 13use critical_section::{acquire, release, CriticalSection, RestoreState};
14 14
15use crate::qmi_cs1::QmiCs1;
16use crate::pac; 15use crate::pac;
16use crate::qmi_cs1::QmiCs1;
17 17
18/// PSRAM errors. 18/// PSRAM errors.
19#[derive(Debug, Clone, Copy, PartialEq, Eq)] 19#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -213,10 +213,7 @@ impl<'d> Psram<'d> {
213 /// Create a new PSRAM driver instance. 213 /// Create a new PSRAM driver instance.
214 /// 214 ///
215 /// This will detect the PSRAM device and configure it for memory-mapped access. 215 /// This will detect the PSRAM device and configure it for memory-mapped access.
216 pub fn new( 216 pub fn new(qmi_cs1: QmiCs1<'d>, config: Config) -> Result<Self, Error> {
217 qmi_cs1: QmiCs1<'d>,
218 config: Config,
219 ) -> Result<Self, Error> {
220 let qmi = pac::QMI; 217 let qmi = pac::QMI;
221 let xip = pac::XIP_CTRL; 218 let xip = pac::XIP_CTRL;
222 219
diff --git a/embassy-rp/src/qmi_cs1.rs b/embassy-rp/src/qmi_cs1.rs
index ada420432..b8ae41e35 100644
--- a/embassy-rp/src/qmi_cs1.rs
+++ b/embassy-rp/src/qmi_cs1.rs
@@ -36,17 +36,13 @@ impl<'d> QmiCs1<'d> {
36 } 36 }
37} 37}
38 38
39trait SealedInstance { 39trait SealedInstance {}
40
41}
42 40
43/// QMI CS1 instance trait. 41/// QMI CS1 instance trait.
44#[allow(private_bounds)] 42#[allow(private_bounds)]
45pub trait Instance: SealedInstance + PeripheralType {} 43pub trait Instance: SealedInstance + PeripheralType {}
46 44
47impl SealedInstance for peripherals::QMI_CS1 { 45impl SealedInstance for peripherals::QMI_CS1 {}
48
49}
50 46
51impl Instance for peripherals::QMI_CS1 {} 47impl Instance for peripherals::QMI_CS1 {}
52 48
diff --git a/examples/rp235x/src/bin/psram.rs b/examples/rp235x/src/bin/psram.rs
index c0e41dd9e..b2ddf91c9 100644
--- a/examples/rp235x/src/bin/psram.rs
+++ b/examples/rp235x/src/bin/psram.rs
@@ -6,11 +6,11 @@
6#![no_std] 6#![no_std]
7#![no_main] 7#![no_main]
8 8
9use core::slice;
9use defmt::*; 10use defmt::*;
10use embassy_executor::Spawner; 11use embassy_executor::Spawner;
11use embassy_time::Timer; 12use embassy_time::Timer;
12use {defmt_rtt as _, panic_probe as _}; 13use {defmt_rtt as _, panic_probe as _};
13use core::slice;
14 14
15#[embassy_executor::main] 15#[embassy_executor::main]
16async fn main(_spawner: Spawner) { 16async fn main(_spawner: Spawner) {
@@ -23,13 +23,12 @@ async fn main(_spawner: Spawner) {
23 error!("PSRAM not found"); 23 error!("PSRAM not found");
24 loop { 24 loop {
25 Timer::after_secs(1).await; 25 Timer::after_secs(1).await;
26 }; 26 }
27 }; 27 };
28 28
29 let psram_slice = unsafe { 29 let psram_slice = unsafe {
30 let psram_ptr = psram.base_address(); 30 let psram_ptr = psram.base_address();
31 let slice: &'static mut [u8] = 31 let slice: &'static mut [u8] = slice::from_raw_parts_mut(psram_ptr, psram.size() as usize);
32 slice::from_raw_parts_mut(psram_ptr, psram.size() as usize);
33 slice 32 slice
34 }; 33 };
35 34