1#![cfg_attr(not(test), no_std)]
2
3extern crate alloc;
4
5#[macro_use]
6mod _macro;
7
8pub mod io;
9
10pub type DriverResult<T = ()> = core::result::Result<T, alloc::boxed::Box<dyn core::error::Error>>;
11
12pub trait DriverGeneric: Send {
13 fn open(&mut self) -> DriverResult;
14 fn close(&mut self) -> DriverResult;
15}
16
17custom_type!(IrqId, usize, "{:#x}");
18
19#[derive(Copy, Clone, Debug, Eq, PartialEq)]
21pub enum Trigger {
22 EdgeBoth,
23 EdgeRising,
24 EdgeFailling,
25 LevelHigh,
26 LevelLow,
27}
28
29#[derive(Debug, Clone)]
30pub struct IrqConfig {
31 pub irq: IrqId,
32 pub trigger: Trigger,
33}