mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
intermediate work checkin before swapping to sigchat branch
This commit is contained in:
parent
e14a7ced8f
commit
c7c384bb85
1 changed files with 9 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
use cram_hal_service::IframRange;
|
use cram_hal_service::IframRange;
|
||||||
use cramium_hal::iox;
|
use cramium_hal::iox;
|
||||||
|
use cramium_hal::udma::PeriphId;
|
||||||
use utralib::generated::*;
|
use utralib::generated::*;
|
||||||
use utralib::utra;
|
use utralib::utra;
|
||||||
use xous::MemoryRange;
|
use xous::MemoryRange;
|
||||||
|
|
@ -88,7 +89,7 @@ pub fn claim_main_thread(f: impl FnOnce(MainThreadToken) -> Never + Send + 'stat
|
||||||
|
|
||||||
pub struct XousDisplay {
|
pub struct XousDisplay {
|
||||||
fb: MemoryRange,
|
fb: MemoryRange,
|
||||||
hwfb: IframRange,
|
hwfb: cramium_hal::udma::Spim,
|
||||||
next_free_line: usize,
|
next_free_line: usize,
|
||||||
srfb: [u32; FB_SIZE],
|
srfb: [u32; FB_SIZE],
|
||||||
csr: utralib::CSR<u32>,
|
csr: utralib::CSR<u32>,
|
||||||
|
|
@ -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
|
// safety: this is safe because we bind hwfb to XousDisplay which lives for the entire
|
||||||
// duration of the OS.
|
// duration of the OS.
|
||||||
|
/////////////// LEFT OFF HERE
|
||||||
let hwfb = unsafe {
|
let hwfb = unsafe {
|
||||||
cram_hal_service::IframRange::request(4096 * 3, None)
|
cram_hal_service::IframRange::request(4096 * 3, None)
|
||||||
.expect("Couldn't allocate a DMA target for graphics!")
|
.expect("Couldn't allocate a DMA target for graphics!")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue