mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-20 09:03:28 +00:00
add trait for setting IRQ on GPIO
This commit is contained in:
parent
7f8f64e1be
commit
fa3550a30f
1 changed files with 8 additions and 0 deletions
|
|
@ -101,6 +101,14 @@ pub trait IoGpio {
|
||||||
fn set_gpio_pin_dir(&self, port: IoxPort, pin: u8, dir: IoxDir);
|
fn set_gpio_pin_dir(&self, port: IoxPort, pin: u8, dir: IoxDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub trait IoIrq {
|
||||||
|
/// This hooks a given port/pin to generate a message to the server specified
|
||||||
|
/// with `server` and the opcode number `usize` when an IRQ is detected on the port/pin.
|
||||||
|
/// The active state of the IRQ is defined by `active`; the transition edge from inactive
|
||||||
|
/// to active is when the event is generated.
|
||||||
|
fn set_irq_pin(&self, port: IoxPort, pin: u8, active: IoxValue, server: &str, opcode: usize);
|
||||||
|
}
|
||||||
|
|
||||||
pub struct Iox {
|
pub struct Iox {
|
||||||
pub csr: SharedCsr<u32>,
|
pub csr: SharedCsr<u32>,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue