aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Nordlander <[email protected]>2025-08-05 09:34:09 +0200
committerMagnus Nordlander <[email protected]>2025-08-05 09:34:09 +0200
commit6d38e8b3060e4408ce493aee259048e5cf55dbb0 (patch)
treef8481ab5db4c2ed817b0af38a40e5caca002450a
parentaf6b74ad5a423b3d9a0ad7776723b5ec7e0116af (diff)
Remove regs since it doesn’t really make sense to return the QMI peripheral from QMI CS1.
-rw-r--r--embassy-rp/src/psram.rs9
-rw-r--r--embassy-rp/src/qmi_cs1.rs13
2 files changed, 7 insertions, 15 deletions
diff --git a/embassy-rp/src/psram.rs b/embassy-rp/src/psram.rs
index 190a7eb09..6da852b26 100644
--- a/embassy-rp/src/psram.rs
+++ b/embassy-rp/src/psram.rs
@@ -10,11 +10,12 @@
10 10
11#![cfg(feature = "_rp235x")] 11#![cfg(feature = "_rp235x")]
12 12
13use crate::qmi_cs1::QmiCs1;
14use crate::{pac, peripherals};
15use critical_section::{acquire, release, CriticalSection, RestoreState}; 13use critical_section::{acquire, release, CriticalSection, RestoreState};
16use embassy_hal_internal::Peri; 14use embassy_hal_internal::Peri;
17 15
16use crate::qmi_cs1::QmiCs1;
17use crate::{pac, peripherals};
18
18/// PSRAM errors. 19/// PSRAM errors.
19#[derive(Debug, Clone, Copy, PartialEq, Eq)] 20#[derive(Debug, Clone, Copy, PartialEq, Eq)]
20#[cfg_attr(feature = "defmt", derive(defmt::Format))] 21#[cfg_attr(feature = "defmt", derive(defmt::Format))]
@@ -204,6 +205,7 @@ impl Config {
204 205
205/// PSRAM driver. 206/// PSRAM driver.
206pub struct Psram<'d> { 207pub struct Psram<'d> {
208 #[allow(dead_code)]
207 qmi_cs1: QmiCs1<'d>, 209 qmi_cs1: QmiCs1<'d>,
208 size: usize, 210 size: usize,
209} 211}
@@ -218,8 +220,7 @@ impl<'d> Psram<'d> {
218 config: Config, 220 config: Config,
219 ) -> Result<Self, Error> { 221 ) -> Result<Self, Error> {
220 let qmi_cs1 = QmiCs1::new(qmi_cs1_peripheral, cs1); 222 let qmi_cs1 = QmiCs1::new(qmi_cs1_peripheral, cs1);
221 let qmi = qmi_cs1.regs(); 223 let qmi = pac::QMI;
222
223 let xip = pac::XIP_CTRL; 224 let xip = pac::XIP_CTRL;
224 225
225 // Verify PSRAM device if requested 226 // Verify PSRAM device if requested
diff --git a/embassy-rp/src/qmi_cs1.rs b/embassy-rp/src/qmi_cs1.rs
index 4e2dc0dbf..ada420432 100644
--- a/embassy-rp/src/qmi_cs1.rs
+++ b/embassy-rp/src/qmi_cs1.rs
@@ -34,17 +34,10 @@ impl<'d> QmiCs1<'d> {
34 34
35 Self { _inner: qmi_cs1 } 35 Self { _inner: qmi_cs1 }
36 } 36 }
37
38 /// Get access to the QMI peripheral registers.
39 ///
40 /// This allows low-level access to configure the QMI controller for specific memory devices.
41 pub fn regs(&self) -> pac::qmi::Qmi {
42 pac::QMI
43 }
44} 37}
45 38
46trait SealedInstance { 39trait SealedInstance {
47 fn regs(&self) -> pac::qmi::Qmi; 40
48} 41}
49 42
50/// QMI CS1 instance trait. 43/// QMI CS1 instance trait.
@@ -52,9 +45,7 @@ trait SealedInstance {
52pub trait Instance: SealedInstance + PeripheralType {} 45pub trait Instance: SealedInstance + PeripheralType {}
53 46
54impl SealedInstance for peripherals::QMI_CS1 { 47impl SealedInstance for peripherals::QMI_CS1 {
55 fn regs(&self) -> pac::qmi::Qmi { 48
56 pac::QMI
57 }
58} 49}
59 50
60impl Instance for peripherals::QMI_CS1 {} 51impl Instance for peripherals::QMI_CS1 {}