From c7c384bb854d79b5eaa4e7ba4e2b7ac25728402a Mon Sep 17 00:00:00 2001 From: bunnie Date: Fri, 26 Jan 2024 22:51:13 +0800 Subject: [PATCH] intermediate work checkin before swapping to sigchat branch --- services/graphics-server/src/backend/cramium.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/services/graphics-server/src/backend/cramium.rs b/services/graphics-server/src/backend/cramium.rs index 0fb3a5169..c24427e9f 100644 --- a/services/graphics-server/src/backend/cramium.rs +++ b/services/graphics-server/src/backend/cramium.rs @@ -1,5 +1,6 @@ use cram_hal_service::IframRange; use cramium_hal::iox; +use cramium_hal::udma::PeriphId; use utralib::generated::*; use utralib::utra; use xous::MemoryRange; @@ -88,7 +89,7 @@ pub fn claim_main_thread(f: impl FnOnce(MainThreadToken) -> Never + Send + 'stat pub struct XousDisplay { fb: MemoryRange, - hwfb: IframRange, + hwfb: cramium_hal::udma::Spim, next_free_line: usize, srfb: [u32; FB_SIZE], csr: utralib::CSR, @@ -111,8 +112,15 @@ impl XousDisplay { } } + // TODO: + // - then convert the line below to create a Spim, instead of an IframRange... + let udma_global = cram_hal_service::UdmaGlobal::new(); + // using bank SPIM_B[1] + udma_global.udma_clock_config(PeriphId::Spim1, true); + // safety: this is safe because we bind hwfb to XousDisplay which lives for the entire // duration of the OS. + /////////////// LEFT OFF HERE let hwfb = unsafe { cram_hal_service::IframRange::request(4096 * 3, None) .expect("Couldn't allocate a DMA target for graphics!")