diff --git a/.travis.yml b/.travis.yml index 9c2a7c8..6ba858c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -100,7 +100,8 @@ script: - cargo test - cargo test --release - cargo doc --release - - cd examples/embedded_linux && cargo build && cd ../f3_stm32f30x && cargo build + - cd examples/embedded_linux && cargo build + #- cd ../f3_stm32f30x && cargo build after_success: - cargo doc-upload diff --git a/README.md b/README.md index 855e7b2..d141ecf 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ IN WORK! Drivers for various EPDs from Waveshare. Currently only support for the Be careful with the partial updates! It was only tested in a mBED implementation, this one wasn't tested yet!!! +Due to a broken + ## TODO's - [ ] add some basic buffer drawing abilities @@ -29,8 +31,7 @@ Maybe add support for Non-Buffer drawing from the https://crates.io/crates/embed There are some examples in the examples folder. -But be careful, I haven't found the time to actually test the examples yet and the pins are just choosen randomly atm. -So thats something that needs to be done first. +The f3 example is broken/working on a old version ## Documenation diff --git a/examples/embedded_linux/src/main.rs b/examples/embedded_linux/src/main.rs index c05a0a7..5286b15 100644 --- a/examples/embedded_linux/src/main.rs +++ b/examples/embedded_linux/src/main.rs @@ -64,26 +64,26 @@ fn main() { spi.configure(&options).unwrap(); // Configure Digital I/O Pin to be used as Chip Select for SPI - let cs = Pin::new(23); + let cs = Pin::new(7);//BCM7 CE0 cs.export().unwrap(); while !cs.is_exported() {} cs.set_direction(Direction::Out).unwrap(); cs.set_value(1).unwrap(); - let busy = Pin::new(26); + let busy = Pin::new(5);//pin 29 busy.export().unwrap(); while !busy.is_exported() {} busy.set_direction(Direction::In).unwrap(); busy.set_value(1).unwrap(); let busy_in = HackInputPin::new(&busy); - let dc = Pin::new(27); + let dc = Pin::new(6); //pin 31 //bcm6 dc.export().unwrap(); while !dc.is_exported() {} dc.set_direction(Direction::Out).unwrap(); dc.set_value(1).unwrap(); - let rst = Pin::new(28); + let rst = Pin::new(16); //pin 36 //bcm16 rst.export().unwrap(); while !rst.is_exported() {} rst.set_direction(Direction::Out).unwrap(); diff --git a/examples/f3_stm32f30x/Cargo.toml b/examples/f3_stm32f30x/Cargo.toml index f8696af..73697fe 100644 --- a/examples/f3_stm32f30x/Cargo.toml +++ b/examples/f3_stm32f30x/Cargo.toml @@ -4,14 +4,20 @@ version = "0.1.0" authors = ["Christoph Groß "] [dependencies] -f3 = "0.6.0" -cortex-m = {version = "0.5.2"} +#f3 = "0.6.0" +f3 = "0.5.3" +#cortex-m = {version = "0.5.2"} +cortex-m = {version = "0.4.3"} -#eink_waveshare_rs = { git = "https://github.com/Caemor/eink-waveshare-rs"} -eink_waveshare_rs = { path = "../../"} + + +eink_waveshare_rs = { git = "https://github.com/Caemor/eink-waveshare-rs", rev = "ba5d44a"} + +#eink_waveshare_rs = { path = "../../"} # only temporary until Digital::InputPin has arrived in f3 -embedded-hal = { version = "0.2.1", features = ["unproven"] } +#TODO: update to 0.2.1 +embedded-hal = { version = "0.1.2", features = ["unproven"] } # for #no_std panic-abort = "0.1.1" diff --git a/examples/f3_stm32f30x/src/main.rs b/examples/f3_stm32f30x/src/main.rs index 4a8cf87..bca5833 100644 --- a/examples/f3_stm32f30x/src/main.rs +++ b/examples/f3_stm32f30x/src/main.rs @@ -1,3 +1,4 @@ +#![feature(start)] #![deny(unsafe_code)] #![no_std] @@ -26,11 +27,11 @@ use hal::digital::{InputPin, OutputPin}; //from https://github.com/rudihorn/max31865/tree/extra_examples/examples struct HackInputPin<'a> { - pin: &'a Pin + pin: &'a OutputPin } impl<'a> HackInputPin<'a> { - fn new(p : &'a Pin) -> HackInputPin { + fn new(p : &'a OutputPin) -> HackInputPin { HackInputPin { pin: p } @@ -53,6 +54,7 @@ impl<'a> InputPin for HackInputPin<'a> { * */ +#[start] fn main() { let cp = cortex_m::Peripherals::take().unwrap(); let p = stm32f30x::Peripherals::take().unwrap(); @@ -75,7 +77,8 @@ fn main() { //TODO: Fix when f3::hal includes Digital::InputPin //using the hack from rudihorn that Digital::OutputPin basically //contains the needed functions for Digital::InputPin - let busy = gpioe.pe4.into_floating_input(&mut gpioe.moder, &mut gpioe.pupdr); + //let busy = gpioe.pe4.into_floating_input(&mut gpioe.moder, &mut gpioe.pupdr); + let busy = gpioe.pe4.into_push_pull_output(&mut gpioe.moder, &mut gpioe.otyper); let busy_in = HackInputPin::new(&busy); let dc = gpioe.pe5.into_push_pull_output(&mut gpioe.moder, &mut gpioe.otyper); diff --git a/src/drawing/mod.rs b/src/drawing/mod.rs new file mode 100644 index 0000000..e69de29