added drawing mod to the library, improved readme, fixed travis.yml, made rpi example working with a better pin config,

This commit is contained in:
Christoph Groß
2018-05-24 14:43:46 +02:00
parent 3fa5a12d24
commit 2feff5b9fa
6 changed files with 26 additions and 15 deletions
+11 -5
View File
@@ -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"
+6 -3
View File
@@ -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);