added drawing mod to the library, improved readme, fixed travis.yml, made rpi example working with a better pin config,
parent
3fa5a12d24
commit
2feff5b9fa
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -4,14 +4,20 @@ version = "0.1.0"
|
|||
authors = ["Christoph Groß <christoph.gross@student.uni-tuebingen.de>"]
|
||||
|
||||
[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"
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue