aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rwxr-xr-xsrc/main.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index d0dfe1a..ce5f346 100755
--- a/src/main.rs
+++ b/src/main.rs
@@ -3,9 +3,11 @@
//extern crate panic_semihosting;
+mod cirque;
mod led;
mod log;
+use cirque::Cirque;
use led::LED;
use cortex_m::{
@@ -82,7 +84,7 @@ fn main() -> ! {
phase: Phase::CaptureOnSecondTransition,
polarity: Polarity::IdleHigh,
};
- let spi = Spi::spi1(
+ let mut spi = Spi::spi1(
dp.SPI1,
(sck_pin, miso_pin, mosi_pin),
&mut afio.mapr,
@@ -90,6 +92,7 @@ fn main() -> ! {
1.MHz(),
clocks,
);
+ let mut cirque = Cirque::new(cs_pin, dr_pin, &mut spi, clocks).expect("couldn't init touch pad");
// BluePill board has a pull-up resistor on the D+ line.
// Pull the D+ pin down to send a RESET condition to the USB bus.
@@ -119,6 +122,12 @@ fn main() -> ! {
loop {
logln!(".");
+
+ if let Ok(mut td) = cirque.poll(&mut spi) {
+ td.scale_to(1920, 1080);
+ logln!("td: {:?}", td);
+ }
+
if !usb_dev.poll(&mut [&mut serial]) {
continue;
}