mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
add udmaglobal implementation for xous environment
This commit is contained in:
parent
68828cf9ce
commit
84c79a313b
2 changed files with 15 additions and 2 deletions
|
|
@ -4,7 +4,7 @@ pub mod keyboard;
|
||||||
pub mod trng;
|
pub mod trng;
|
||||||
|
|
||||||
use api::Opcode;
|
use api::Opcode;
|
||||||
use cramium_hal::udma::{EventChannel, PeriphEventType, PeriphId};
|
use cramium_hal::udma::{EventChannel, PeriphEventType, PeriphId, UdmaGlobalConfig};
|
||||||
pub use iox_lib::*;
|
pub use iox_lib::*;
|
||||||
use num_traits::*;
|
use num_traits::*;
|
||||||
|
|
||||||
|
|
@ -64,3 +64,16 @@ impl UdmaGlobal {
|
||||||
.expect("Couldn't setup UDMA event mapping");
|
.expect("Couldn't setup UDMA event mapping");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl UdmaGlobalConfig for UdmaGlobal {
|
||||||
|
fn clock(&self, peripheral: PeriphId, enable: bool) { self.udma_clock_config(peripheral, enable); }
|
||||||
|
|
||||||
|
unsafe fn udma_event_map(
|
||||||
|
&self,
|
||||||
|
peripheral: PeriphId,
|
||||||
|
event_type: PeriphEventType,
|
||||||
|
to_channel: EventChannel,
|
||||||
|
) {
|
||||||
|
self.udma_event_map(peripheral, event_type, to_channel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ fn main() {
|
||||||
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
xous::MemoryFlags::R | xous::MemoryFlags::W,
|
||||||
)
|
)
|
||||||
.expect("couldn't map UDMA global control");
|
.expect("couldn't map UDMA global control");
|
||||||
let mut udma_global = GlobalConfig::new(udma_global_csr.as_mut_ptr() as *mut u32);
|
let udma_global = GlobalConfig::new(udma_global_csr.as_mut_ptr() as *mut u32);
|
||||||
|
|
||||||
let mut pio_ss = xous_pio::PioSharedState::new();
|
let mut pio_ss = xous_pio::PioSharedState::new();
|
||||||
// map and enable the interrupt for the PIO system timer
|
// map and enable the interrupt for the PIO system timer
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue