Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ readme = "README.md"
[dependencies]
cortex-m = "0.6"
cortex-m-rt = "0.6"
ssd1306 = "0.3"
ssd1306 = { version = "0.3", path = "../ssd1306" }
panic-halt = "0.2"
ina260 = "0.3"
embedded-graphics = "0.6"
Expand All @@ -40,6 +40,12 @@ features = ["cortexm"]
optional = false
version = "0.1"

[dependencies.display-interface]
version = "0.2"

[dependencies.display-interface-i2c]
version = "0.2"

[profile.dev]
debug = true
opt-level = "s"
Expand Down
5 changes: 3 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use embedded_graphics::{
};
use ina260::INA260;
use ssd1306::mode::GraphicsMode;
use ssd1306::Builder;
use ssd1306::{Builder, I2CDIBuilder};

use crate::hal::delay::Delay;
use crate::hal::i2c::*;
Expand Down Expand Up @@ -76,7 +76,8 @@ fn main() -> ! {
.text_color(BinaryColor::On)
.build();

let mut disp: GraphicsMode<_> = Builder::new().connect_i2c(i2c_bus.acquire()).into();
let interface = I2CDIBuilder::new().init(i2c_bus.acquire());
let mut disp: GraphicsMode<_> = Builder::new().connect(interface).into();

disp.init().map_err(drop).unwrap();
disp.flush().map_err(drop).unwrap();
Expand Down