From 6c356bf4782b60619216eaf6309787a0ddf49d2c Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Tue, 25 Oct 2022 15:15:59 -0400 Subject: pull in cirque driver seems broken rn, but it's a start. --- src/main.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/main.rs') 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; } -- cgit v1.2.3