mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
add irq_status_bits() trait and enum for selecting Irq bank
multiple IRQs related to the UDMA will eventually get mapped into the global IRQ handler for UDMA. Create an enum type that will help us differentiate this and add a trait that returns the raw bits for a given IRQ type. Probably a fancier wrapper should be made to interptet the IRQ bits but unfortunately there isn't a uniform pattern to the IRQ mappings, it's pretty much whatever fit into the IRQ space based on the underlying function. At the moment not even sure if this is the right register to be chasing, so we'll use this for probing that aspect and then get fancy later, maybe.
This commit is contained in:
parent
cfe9b3c845
commit
c24bb3a450
1 changed files with 6 additions and 0 deletions
|
|
@ -233,6 +233,11 @@ pub enum EventChannel {
|
|||
Channel3 = 24,
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, num_derive::FromPrimitive)]
|
||||
pub enum IrqBank {
|
||||
I2c,
|
||||
}
|
||||
|
||||
/// Use a trait that will allow us to share code between both `std` and `no-std` implementations
|
||||
pub trait UdmaGlobalConfig {
|
||||
fn clock(&self, peripheral: PeriphId, enable: bool);
|
||||
|
|
@ -243,4 +248,5 @@ pub trait UdmaGlobalConfig {
|
|||
to_channel: EventChannel,
|
||||
);
|
||||
fn reset(&self, peripheral: PeriphId);
|
||||
fn irq_status_bits(&self, bank: IrqBank) -> u32;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue