aboutsummaryrefslogtreecommitdiffstats
path: root/sw/deps/hd44780-driver/src/bus/mod.rs
blob: b141f7e4780f308dfe85c640a28236a799d35089 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use embedded_hal::blocking::delay::{DelayMs, DelayUs};

mod eightbit;
mod fourbit;
mod i2c;
mod i2c_mcp23008;

pub use self::eightbit::EightBitBus;
pub use self::fourbit::FourBitBus;
pub use self::i2c::I2CBus;
pub use self::i2c_mcp23008::I2CMCP23008Bus;

use crate::error::Result;

pub trait DataBus {
    fn write<D: DelayUs<u16> + DelayMs<u8>>(
        &mut self,
        byte: u8,
        data: bool,
        delay: &mut D,
    ) -> Result<()>;

    // TODO
    // fn read(...)
}